From 6328625bc33033f9faf0d0d357a7abd2073fec9e Mon Sep 17 00:00:00 2001 From: David Gamero Date: Thu, 9 Jan 2025 13:25:05 -0500 Subject: [PATCH 01/10] add call-time middleware --- .../resources/typescript/api/api.mustache | 10 +- .../services/ObservableAPI.mustache | 5 +- .../typescript/types/ObjectParamAPI.mustache | 5 +- .../typescript/types/ObservableAPI.mustache | 16 +- .../typescript/types/PromiseAPI.mustache | 5 +- .../builds/array-of-lists/apis/DefaultApi.ts | 10 +- .../array-of-lists/types/ObjectParamAPI.ts | 5 +- .../array-of-lists/types/ObservableAPI.ts | 16 +- .../builds/array-of-lists/types/PromiseAPI.ts | 5 +- .../enum-single-value/types/ObjectParamAPI.ts | 1 + .../enum-single-value/types/ObservableAPI.ts | 1 + .../enum-single-value/types/PromiseAPI.ts | 1 + .../null-types-simple/types/ObjectParamAPI.ts | 1 + .../null-types-simple/types/ObservableAPI.ts | 1 + .../null-types-simple/types/PromiseAPI.ts | 1 + .../with-unique-items/apis/DefaultApi.ts | 10 +- .../with-unique-items/types/ObjectParamAPI.ts | 5 +- .../with-unique-items/types/ObservableAPI.ts | 16 +- .../with-unique-items/types/PromiseAPI.ts | 5 +- .../encode-decode/build/apis/DefaultApi.ts | 289 +++++--- .../build/types/ObjectParamAPI.ts | 129 ++-- .../build/types/ObservableAPI.ts | 481 ++++++++++--- .../encode-decode/build/types/PromiseAPI.ts | 129 ++-- .../typescript/builds/browser/apis/PetApi.ts | 73 +- .../builds/browser/apis/StoreApi.ts | 37 +- .../typescript/builds/browser/apis/UserApi.ts | 73 +- .../builds/browser/types/ObjectParamAPI.ts | 81 +-- .../builds/browser/types/ObservableAPI.ts | 301 +++++++-- .../builds/browser/types/PromiseAPI.ts | 81 +-- .../composed-schemas/apis/DefaultApi.ts | 28 +- .../composed-schemas/types/ObjectParamAPI.ts | 13 +- .../composed-schemas/types/ObservableAPI.ts | 46 +- .../composed-schemas/types/PromiseAPI.ts | 13 +- .../typescript/builds/default/apis/PetApi.ts | 73 +- .../builds/default/apis/StoreApi.ts | 37 +- .../typescript/builds/default/apis/UserApi.ts | 73 +- .../builds/default/package-lock.json | 54 +- .../builds/default/types/ObjectParamAPI.ts | 81 +-- .../builds/default/types/ObservableAPI.ts | 301 +++++++-- .../builds/default/types/PromiseAPI.ts | 81 +-- .../typescript/builds/deno/apis/PetApi.ts | 73 +- .../typescript/builds/deno/apis/StoreApi.ts | 37 +- .../typescript/builds/deno/apis/UserApi.ts | 73 +- .../builds/deno/types/ObjectParamAPI.ts | 81 +-- .../builds/deno/types/ObservableAPI.ts | 301 +++++++-- .../builds/deno/types/PromiseAPI.ts | 81 +-- .../builds/deno_object_params/apis/PetApi.ts | 73 +- .../deno_object_params/apis/StoreApi.ts | 37 +- .../builds/deno_object_params/apis/UserApi.ts | 73 +- .../types/ObjectParamAPI.ts | 81 +-- .../deno_object_params/types/ObservableAPI.ts | 301 +++++++-- .../deno_object_params/types/PromiseAPI.ts | 81 +-- .../explode-query/apis/AnotherFakeApi.ts | 10 +- .../builds/explode-query/apis/DefaultApi.ts | 10 +- .../builds/explode-query/apis/FakeApi.ts | 163 +++-- .../apis/FakeClassnameTags123Api.ts | 10 +- .../builds/explode-query/apis/PetApi.ts | 82 ++- .../builds/explode-query/apis/StoreApi.ts | 37 +- .../builds/explode-query/apis/UserApi.ts | 73 +- .../explode-query/types/ObjectParamAPI.ts | 169 ++--- .../explode-query/types/ObservableAPI.ts | 631 ++++++++++++++---- .../builds/explode-query/types/PromiseAPI.ts | 169 ++--- .../builds/inversify/apis/PetApi.ts | 57 +- .../builds/inversify/apis/StoreApi.ts | 29 +- .../builds/inversify/apis/UserApi.ts | 57 +- .../inversify/services/ObservableAPI.ts | 41 +- .../builds/inversify/types/ObjectParamAPI.ts | 81 +-- .../builds/inversify/types/ObservableAPI.ts | 301 +++++++-- .../builds/inversify/types/PromiseAPI.ts | 81 +-- .../typescript/builds/jquery/apis/PetApi.ts | 73 +- .../typescript/builds/jquery/apis/StoreApi.ts | 37 +- .../typescript/builds/jquery/apis/UserApi.ts | 73 +- .../builds/jquery/types/ObjectParamAPI.ts | 81 +-- .../builds/jquery/types/ObservableAPI.ts | 301 +++++++-- .../builds/jquery/types/PromiseAPI.ts | 81 +-- .../builds/nullable-enum/apis/DefaultApi.ts | 10 +- .../nullable-enum/types/ObjectParamAPI.ts | 5 +- .../nullable-enum/types/ObservableAPI.ts | 16 +- .../builds/nullable-enum/types/PromiseAPI.ts | 5 +- .../builds/object_params/apis/PetApi.ts | 73 +- .../builds/object_params/apis/StoreApi.ts | 37 +- .../builds/object_params/apis/UserApi.ts | 73 +- .../object_params/types/ObjectParamAPI.ts | 81 +-- .../object_params/types/ObservableAPI.ts | 301 +++++++-- .../builds/object_params/types/PromiseAPI.ts | 81 +-- .../tests/default/package-lock.json | 289 ++++---- .../typescript/tests/default/package.json | 2 +- 87 files changed, 5105 insertions(+), 2400 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript/api/api.mustache b/modules/openapi-generator/src/main/resources/typescript/api/api.mustache index 0ad7fa1ca686..10be5db6889e 100644 --- a/modules/openapi-generator/src/main/resources/typescript/api/api.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/api/api.mustache @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi{{importFileExtension}}'; import {Configuration} from '../configuration{{importFileExtension}}'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http{{importFileExtension}}'; {{#platforms}} {{#node}} @@ -42,8 +43,11 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory { * @param {{paramName}} {{description}} {{/allParams}} */ - public async {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } {{#allParams}} {{#required}} @@ -183,7 +187,7 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory { {{/authMethods}} {{^useInversify}} - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/modules/openapi-generator/src/main/resources/typescript/services/ObservableAPI.mustache b/modules/openapi-generator/src/main/resources/typescript/services/ObservableAPI.mustache index 336ec7aa2eb8..5eb5c172101a 100644 --- a/modules/openapi-generator/src/main/resources/typescript/services/ObservableAPI.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/services/ObservableAPI.mustache @@ -1,6 +1,7 @@ import type { HttpFile } from "../http/http"; import type { Observable } from {{#useRxJS}}"rxjs"{{/useRxJS}}{{^useRxJS}}"../rxjsStub"{{/useRxJS}}; import type { Configuration } from "../configuration"; +import type { Middleware } from "../middleware"; {{#models}} {{#model}} @@ -14,10 +15,10 @@ import { {{{ classname }}} } from "{{{ importPath }}}"; export abstract class AbstractObservable{{classname}} { {{#operation}} - public abstract {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: Configuration): Observable<{{{returnType}}}{{^returnType}}void{{/returnType}}>; + public abstract {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: Configuration | Middleware[]): Observable<{{{returnType}}}{{^returnType}}void{{/returnType}}>; {{/operation}} } {{/operations}} {{/apis}} -{{/apiInfo}} \ No newline at end of file +{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/typescript/types/ObjectParamAPI.mustache b/modules/openapi-generator/src/main/resources/typescript/types/ObjectParamAPI.mustache index 28cd9d4d6cab..6e2e33389fb9 100644 --- a/modules/openapi-generator/src/main/resources/typescript/types/ObjectParamAPI.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/types/ObjectParamAPI.mustache @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http{{importFileExtension}}'; import { Configuration} from '../configuration{{importFileExtension}}' +import type { Middleware } from "../middleware"; {{#useRxJS}} import { Observable } from 'rxjs'; {{/useRxJS}} @@ -55,7 +56,7 @@ export class Object{{classname}} { {{/summary}} * @param param the request object */ - public {{nickname}}WithHttpInfo(param: {{classname}}{{operationIdCamelCase}}Request{{^hasRequiredParams}} = {}{{/hasRequiredParams}}, options?: Configuration): {{#useRxJS}}Observable{{/useRxJS}}{{^useRxJS}}Promise{{/useRxJS}}> { + public {{nickname}}WithHttpInfo(param: {{classname}}{{operationIdCamelCase}}Request{{^hasRequiredParams}} = {}{{/hasRequiredParams}}, options?: Configuration | Middleware[]): {{#useRxJS}}Observable{{/useRxJS}}{{^useRxJS}}Promise{{/useRxJS}}> { return this.api.{{nickname}}WithHttpInfo({{#allParams}}param.{{paramName}}, {{/allParams}} options){{^useRxJS}}.toPromise(){{/useRxJS}}; } @@ -68,7 +69,7 @@ export class Object{{classname}} { {{/summary}} * @param param the request object */ - public {{nickname}}(param: {{classname}}{{operationIdCamelCase}}Request{{^hasRequiredParams}} = {}{{/hasRequiredParams}}, options?: Configuration): {{#useRxJS}}Observable{{/useRxJS}}{{^useRxJS}}Promise{{/useRxJS}}<{{{returnType}}}{{^returnType}}void{{/returnType}}> { + public {{nickname}}(param: {{classname}}{{operationIdCamelCase}}Request{{^hasRequiredParams}} = {}{{/hasRequiredParams}}, options?: Configuration | Middleware[]): {{#useRxJS}}Observable{{/useRxJS}}{{^useRxJS}}Promise{{/useRxJS}}<{{{returnType}}}{{^returnType}}void{{/returnType}}> { return this.api.{{nickname}}({{#allParams}}param.{{paramName}}, {{/allParams}} options){{^useRxJS}}.toPromise(){{/useRxJS}}; } diff --git a/modules/openapi-generator/src/main/resources/typescript/types/ObservableAPI.mustache b/modules/openapi-generator/src/main/resources/typescript/types/ObservableAPI.mustache index 4de2c5faa5c8..ea1191f36c34 100644 --- a/modules/openapi-generator/src/main/resources/typescript/types/ObservableAPI.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/types/ObservableAPI.mustache @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http{{importFileExtension}}'; import { Configuration} from '../configuration{{importFileExtension}}' +import type { Middleware } from "../middleware"; import { Observable, of, from } from {{#useRxJS}}'rxjs'{{/useRxJS}}{{^useRxJS}}'../rxjsStub{{importFileExtension}}'{{/useRxJS}}; import {mergeMap, map} from {{#useRxJS}}'rxjs/operators'{{/useRxJS}}{{^useRxJS}}'../rxjsStub{{importFileExtension}}'{{/useRxJS}}; {{#useInversify}} @@ -61,12 +62,21 @@ export class Observable{{classname}} { * @param {{#required}}{{paramName}}{{/required}}{{^required}}[{{paramName}}]{{/required}}{{#description}} {{description}}{{/description}} {{/allParams}} */ - public {{nickname}}WithHttpInfo({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration): Observable> { + public {{nickname}}WithHttpInfo({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -91,7 +101,7 @@ export class Observable{{classname}} { * @param {{#required}}{{paramName}}{{/required}}{{^required}}[{{paramName}}]{{/required}}{{#description}} {{description}}{{/description}} {{/allParams}} */ - public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration): Observable<{{{returnType}}}{{^returnType}}void{{/returnType}}> { + public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration | Middleware[]): Observable<{{{returnType}}}{{^returnType}}void{{/returnType}}> { return this.{{nickname}}WithHttpInfo({{#allParams}}{{paramName}}, {{/allParams}}_options).pipe(map((apiResponse: HttpInfo<{{{returnType}}}{{^returnType}}void{{/returnType}}>) => apiResponse.data)); } diff --git a/modules/openapi-generator/src/main/resources/typescript/types/PromiseAPI.mustache b/modules/openapi-generator/src/main/resources/typescript/types/PromiseAPI.mustache index 0a5d71e03f32..6cd98efaff3f 100644 --- a/modules/openapi-generator/src/main/resources/typescript/types/PromiseAPI.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/types/PromiseAPI.mustache @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http{{importFileExtension}}'; import { Configuration} from '../configuration{{importFileExtension}}' +import type { Middleware } from "../middleware"; {{#useInversify}} import { injectable, inject, optional } from "inversify"; import { AbstractConfiguration } from "../services/configuration"; @@ -51,7 +52,7 @@ export class Promise{{classname}} { * @param {{#required}}{{paramName}}{{/required}}{{^required}}[{{paramName}}]{{/required}}{{#description}} {{description}}{{/description}} {{/allParams}} */ - public {{nickname}}WithHttpInfo({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration): Promise> { + public {{nickname}}WithHttpInfo({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration | Middleware[]): Promise> { const result = this.api.{{nickname}}WithHttpInfo({{#allParams}}{{paramName}}, {{/allParams}}_options); return result.toPromise(); } @@ -67,7 +68,7 @@ export class Promise{{classname}} { * @param {{#required}}{{paramName}}{{/required}}{{^required}}[{{paramName}}]{{/required}}{{#description}} {{description}}{{/description}} {{/allParams}} */ - public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration): Promise<{{{returnType}}}{{^returnType}}void{{/returnType}}> { + public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration | Middleware[]): Promise<{{{returnType}}}{{^returnType}}void{{/returnType}}> { const result = this.api.{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}_options); return result.toPromise(); } diff --git a/samples/client/others/typescript/builds/array-of-lists/apis/DefaultApi.ts b/samples/client/others/typescript/builds/array-of-lists/apis/DefaultApi.ts index 447001f9d1fe..c790aeba5f1e 100644 --- a/samples/client/others/typescript/builds/array-of-lists/apis/DefaultApi.ts +++ b/samples/client/others/typescript/builds/array-of-lists/apis/DefaultApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; @@ -17,8 +18,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** */ - public async list(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async list(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/list'; @@ -29,7 +33,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/client/others/typescript/builds/array-of-lists/types/ObjectParamAPI.ts b/samples/client/others/typescript/builds/array-of-lists/types/ObjectParamAPI.ts index b785bad29b70..d1c0d70099ad 100644 --- a/samples/client/others/typescript/builds/array-of-lists/types/ObjectParamAPI.ts +++ b/samples/client/others/typescript/builds/array-of-lists/types/ObjectParamAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { List } from '../models/List'; import { ListPaged } from '../models/ListPaged'; @@ -20,14 +21,14 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public listWithHttpInfo(param: DefaultApiListRequest = {}, options?: Configuration): Promise> { + public listWithHttpInfo(param: DefaultApiListRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.listWithHttpInfo( options).toPromise(); } /** * @param param the request object */ - public list(param: DefaultApiListRequest = {}, options?: Configuration): Promise { + public list(param: DefaultApiListRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.list( options).toPromise(); } diff --git a/samples/client/others/typescript/builds/array-of-lists/types/ObservableAPI.ts b/samples/client/others/typescript/builds/array-of-lists/types/ObservableAPI.ts index 1c37be96152a..77220bb8c5da 100644 --- a/samples/client/others/typescript/builds/array-of-lists/types/ObservableAPI.ts +++ b/samples/client/others/typescript/builds/array-of-lists/types/ObservableAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { Observable, of, from } from '../rxjsStub'; import {mergeMap, map} from '../rxjsStub'; import { List } from '../models/List'; @@ -23,12 +24,21 @@ export class ObservableDefaultApi { /** */ - public listWithHttpInfo(_options?: Configuration): Observable> { + public listWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.list(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -44,7 +54,7 @@ export class ObservableDefaultApi { /** */ - public list(_options?: Configuration): Observable { + public list(_options?: Configuration | Middleware[]): Observable { return this.listWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/client/others/typescript/builds/array-of-lists/types/PromiseAPI.ts b/samples/client/others/typescript/builds/array-of-lists/types/PromiseAPI.ts index e7bad1d6c467..76747740abdc 100644 --- a/samples/client/others/typescript/builds/array-of-lists/types/PromiseAPI.ts +++ b/samples/client/others/typescript/builds/array-of-lists/types/PromiseAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { List } from '../models/List'; import { ListPaged } from '../models/ListPaged'; @@ -19,14 +20,14 @@ export class PromiseDefaultApi { /** */ - public listWithHttpInfo(_options?: Configuration): Promise> { + public listWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.listWithHttpInfo(_options); return result.toPromise(); } /** */ - public list(_options?: Configuration): Promise { + public list(_options?: Configuration | Middleware[]): Promise { const result = this.api.list(_options); return result.toPromise(); } diff --git a/samples/client/others/typescript/builds/enum-single-value/types/ObjectParamAPI.ts b/samples/client/others/typescript/builds/enum-single-value/types/ObjectParamAPI.ts index 936110df8d4f..6c1d433efb38 100644 --- a/samples/client/others/typescript/builds/enum-single-value/types/ObjectParamAPI.ts +++ b/samples/client/others/typescript/builds/enum-single-value/types/ObjectParamAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { SingleValueEnum30 } from '../models/SingleValueEnum30'; import { SingleValueEnum31 } from '../models/SingleValueEnum31'; diff --git a/samples/client/others/typescript/builds/enum-single-value/types/ObservableAPI.ts b/samples/client/others/typescript/builds/enum-single-value/types/ObservableAPI.ts index 1f0a9ad2f10f..4d3a4f331439 100644 --- a/samples/client/others/typescript/builds/enum-single-value/types/ObservableAPI.ts +++ b/samples/client/others/typescript/builds/enum-single-value/types/ObservableAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { Observable, of, from } from '../rxjsStub'; import {mergeMap, map} from '../rxjsStub'; import { SingleValueEnum30 } from '../models/SingleValueEnum30'; diff --git a/samples/client/others/typescript/builds/enum-single-value/types/PromiseAPI.ts b/samples/client/others/typescript/builds/enum-single-value/types/PromiseAPI.ts index 936110df8d4f..6c1d433efb38 100644 --- a/samples/client/others/typescript/builds/enum-single-value/types/PromiseAPI.ts +++ b/samples/client/others/typescript/builds/enum-single-value/types/PromiseAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { SingleValueEnum30 } from '../models/SingleValueEnum30'; import { SingleValueEnum31 } from '../models/SingleValueEnum31'; diff --git a/samples/client/others/typescript/builds/null-types-simple/types/ObjectParamAPI.ts b/samples/client/others/typescript/builds/null-types-simple/types/ObjectParamAPI.ts index e7cd7dce2a6a..f6e490661b04 100644 --- a/samples/client/others/typescript/builds/null-types-simple/types/ObjectParamAPI.ts +++ b/samples/client/others/typescript/builds/null-types-simple/types/ObjectParamAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { SomeObject } from '../models/SomeObject'; import { WithNullableType } from '../models/WithNullableType'; diff --git a/samples/client/others/typescript/builds/null-types-simple/types/ObservableAPI.ts b/samples/client/others/typescript/builds/null-types-simple/types/ObservableAPI.ts index 33a8b0a84943..8dd43da8d163 100644 --- a/samples/client/others/typescript/builds/null-types-simple/types/ObservableAPI.ts +++ b/samples/client/others/typescript/builds/null-types-simple/types/ObservableAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { Observable, of, from } from '../rxjsStub'; import {mergeMap, map} from '../rxjsStub'; import { SomeObject } from '../models/SomeObject'; diff --git a/samples/client/others/typescript/builds/null-types-simple/types/PromiseAPI.ts b/samples/client/others/typescript/builds/null-types-simple/types/PromiseAPI.ts index e7cd7dce2a6a..f6e490661b04 100644 --- a/samples/client/others/typescript/builds/null-types-simple/types/PromiseAPI.ts +++ b/samples/client/others/typescript/builds/null-types-simple/types/PromiseAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { SomeObject } from '../models/SomeObject'; import { WithNullableType } from '../models/WithNullableType'; diff --git a/samples/client/others/typescript/builds/with-unique-items/apis/DefaultApi.ts b/samples/client/others/typescript/builds/with-unique-items/apis/DefaultApi.ts index db62475226d0..7d064dd8772a 100644 --- a/samples/client/others/typescript/builds/with-unique-items/apis/DefaultApi.ts +++ b/samples/client/others/typescript/builds/with-unique-items/apis/DefaultApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; @@ -17,8 +18,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** */ - public async uniqueItems(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async uniqueItems(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/unique-items'; @@ -29,7 +33,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/client/others/typescript/builds/with-unique-items/types/ObjectParamAPI.ts b/samples/client/others/typescript/builds/with-unique-items/types/ObjectParamAPI.ts index 2c5db71a9382..09b5873c11ef 100644 --- a/samples/client/others/typescript/builds/with-unique-items/types/ObjectParamAPI.ts +++ b/samples/client/others/typescript/builds/with-unique-items/types/ObjectParamAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { Response } from '../models/Response'; @@ -19,14 +20,14 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public uniqueItemsWithHttpInfo(param: DefaultApiUniqueItemsRequest = {}, options?: Configuration): Promise> { + public uniqueItemsWithHttpInfo(param: DefaultApiUniqueItemsRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.uniqueItemsWithHttpInfo( options).toPromise(); } /** * @param param the request object */ - public uniqueItems(param: DefaultApiUniqueItemsRequest = {}, options?: Configuration): Promise { + public uniqueItems(param: DefaultApiUniqueItemsRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.uniqueItems( options).toPromise(); } diff --git a/samples/client/others/typescript/builds/with-unique-items/types/ObservableAPI.ts b/samples/client/others/typescript/builds/with-unique-items/types/ObservableAPI.ts index 02bae11fe29c..905d507a360d 100644 --- a/samples/client/others/typescript/builds/with-unique-items/types/ObservableAPI.ts +++ b/samples/client/others/typescript/builds/with-unique-items/types/ObservableAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { Observable, of, from } from '../rxjsStub'; import {mergeMap, map} from '../rxjsStub'; import { Response } from '../models/Response'; @@ -22,12 +23,21 @@ export class ObservableDefaultApi { /** */ - public uniqueItemsWithHttpInfo(_options?: Configuration): Observable> { + public uniqueItemsWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.uniqueItems(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -43,7 +53,7 @@ export class ObservableDefaultApi { /** */ - public uniqueItems(_options?: Configuration): Observable { + public uniqueItems(_options?: Configuration | Middleware[]): Observable { return this.uniqueItemsWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/client/others/typescript/builds/with-unique-items/types/PromiseAPI.ts b/samples/client/others/typescript/builds/with-unique-items/types/PromiseAPI.ts index a133e29a6f4d..418fd986e291 100644 --- a/samples/client/others/typescript/builds/with-unique-items/types/PromiseAPI.ts +++ b/samples/client/others/typescript/builds/with-unique-items/types/PromiseAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { Response } from '../models/Response'; import { ObservableDefaultApi } from './ObservableAPI'; @@ -18,14 +19,14 @@ export class PromiseDefaultApi { /** */ - public uniqueItemsWithHttpInfo(_options?: Configuration): Promise> { + public uniqueItemsWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.uniqueItemsWithHttpInfo(_options); return result.toPromise(); } /** */ - public uniqueItems(_options?: Configuration): Promise { + public uniqueItems(_options?: Configuration | Middleware[]): Promise { const result = this.api.uniqueItems(_options); return result.toPromise(); } diff --git a/samples/client/others/typescript/encode-decode/build/apis/DefaultApi.ts b/samples/client/others/typescript/encode-decode/build/apis/DefaultApi.ts index 923ff4994486..2a23f0bef397 100644 --- a/samples/client/others/typescript/encode-decode/build/apis/DefaultApi.ts +++ b/samples/client/others/typescript/encode-decode/build/apis/DefaultApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; @@ -20,8 +21,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** */ - public async testDecodeArrayOfArraysGet(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testDecodeArrayOfArraysGet(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/test/decode/array-of-arrays'; @@ -32,7 +36,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -42,8 +46,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** */ - public async testDecodeArrayOfGet(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testDecodeArrayOfGet(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/test/decode/array-of'; @@ -54,7 +61,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -64,8 +71,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** */ - public async testDecodeArrayOfMapsOfObjectsGet(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testDecodeArrayOfMapsOfObjectsGet(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/test/decode/array-of/maps-of/objects'; @@ -76,7 +86,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -86,8 +96,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** */ - public async testDecodeArrayOfNullableGet(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testDecodeArrayOfNullableGet(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/test/decode/array-of/nullable'; @@ -98,7 +111,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -108,8 +121,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** */ - public async testDecodeArrayOfNullableObjectsGet(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testDecodeArrayOfNullableObjectsGet(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/test/decode/array-of/nullable-objects'; @@ -120,7 +136,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -130,8 +146,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** */ - public async testDecodeCompositeObjectsGet(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testDecodeCompositeObjectsGet(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/test/decode/composite-objects'; @@ -142,7 +161,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -152,8 +171,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** */ - public async testDecodeMapOfMapsOfObjectsGet(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testDecodeMapOfMapsOfObjectsGet(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/test/decode/map-of/maps-of/objects'; @@ -164,7 +186,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -174,8 +196,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** */ - public async testDecodeMapOfObjectsGet(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testDecodeMapOfObjectsGet(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/test/decode/map-of/objects'; @@ -186,7 +211,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -196,8 +221,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** */ - public async testDecodeMapOfPrimitiveGet(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testDecodeMapOfPrimitiveGet(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/test/decode/map-of/primitive'; @@ -208,7 +236,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -218,8 +246,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** */ - public async testDecodeNullableArrayGet(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testDecodeNullableArrayGet(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/test/decode/nullable-array'; @@ -230,7 +261,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -240,8 +271,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** */ - public async testDecodeNullableGet(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testDecodeNullableGet(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/test/decode/nullable'; @@ -252,7 +286,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -262,8 +296,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** */ - public async testDecodeObjectGet(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testDecodeObjectGet(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/test/decode/object'; @@ -274,7 +311,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -284,8 +321,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** */ - public async testDecodePrimitiveBooleanGet(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testDecodePrimitiveBooleanGet(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/test/decode/primitive/boolean'; @@ -296,7 +336,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -306,8 +346,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** */ - public async testDecodePrimitiveIntegerGet(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testDecodePrimitiveIntegerGet(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/test/decode/primitive/integer'; @@ -318,7 +361,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -328,8 +371,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** */ - public async testDecodePrimitiveNumberGet(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testDecodePrimitiveNumberGet(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/test/decode/primitive/number'; @@ -340,7 +386,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -350,8 +396,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** */ - public async testDecodePrimitiveStringGet(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testDecodePrimitiveStringGet(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/test/decode/primitive/string'; @@ -362,7 +411,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -373,8 +422,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** * @param requestBody */ - public async testEncodeArrayOfArraysPost(requestBody: Array>, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testEncodeArrayOfArraysPost(requestBody: Array>, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'requestBody' is not null or undefined if (requestBody === null || requestBody === undefined) { @@ -402,7 +454,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -413,8 +465,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** * @param complexObject */ - public async testEncodeArrayOfMapsOfObjectsPost(complexObject: Array<{ [key: string]: ComplexObject; }>, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testEncodeArrayOfMapsOfObjectsPost(complexObject: Array<{ [key: string]: ComplexObject; }>, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'complexObject' is not null or undefined if (complexObject === null || complexObject === undefined) { @@ -442,7 +497,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -453,8 +508,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** * @param complexObject */ - public async testEncodeArrayOfNullableObjectsPost(complexObject: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testEncodeArrayOfNullableObjectsPost(complexObject: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'complexObject' is not null or undefined if (complexObject === null || complexObject === undefined) { @@ -482,7 +540,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -493,8 +551,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** * @param requestBody */ - public async testEncodeArrayOfNullablePost(requestBody: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testEncodeArrayOfNullablePost(requestBody: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'requestBody' is not null or undefined if (requestBody === null || requestBody === undefined) { @@ -522,7 +583,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -533,8 +594,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** * @param requestBody */ - public async testEncodeArrayOfPost(requestBody: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testEncodeArrayOfPost(requestBody: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'requestBody' is not null or undefined if (requestBody === null || requestBody === undefined) { @@ -562,7 +626,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -573,8 +637,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** * @param compositeObject */ - public async testEncodeCompositeObjectsPost(compositeObject: CompositeObject, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testEncodeCompositeObjectsPost(compositeObject: CompositeObject, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'compositeObject' is not null or undefined if (compositeObject === null || compositeObject === undefined) { @@ -602,7 +669,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -613,8 +680,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** * @param requestBody */ - public async testEncodeMapOfMapsOfObjectsPost(requestBody: { [key: string]: { [key: string]: ComplexObject; }; }, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testEncodeMapOfMapsOfObjectsPost(requestBody: { [key: string]: { [key: string]: ComplexObject; }; }, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'requestBody' is not null or undefined if (requestBody === null || requestBody === undefined) { @@ -642,7 +712,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -653,8 +723,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** * @param requestBody */ - public async testEncodeMapOfObjectsPost(requestBody: { [key: string]: ComplexObject | null; }, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testEncodeMapOfObjectsPost(requestBody: { [key: string]: ComplexObject | null; }, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'requestBody' is not null or undefined if (requestBody === null || requestBody === undefined) { @@ -682,7 +755,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -693,8 +766,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** * @param requestBody */ - public async testEncodeMapOfPrimitivePost(requestBody: { [key: string]: string; }, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testEncodeMapOfPrimitivePost(requestBody: { [key: string]: string; }, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'requestBody' is not null or undefined if (requestBody === null || requestBody === undefined) { @@ -722,7 +798,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -733,8 +809,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** * @param requestBody */ - public async testEncodeNullableArrayPost(requestBody?: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testEncodeNullableArrayPost(requestBody?: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params @@ -757,7 +836,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -768,8 +847,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** * @param body */ - public async testEncodeNullablePost(body?: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testEncodeNullablePost(body?: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params @@ -792,7 +874,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -803,8 +885,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** * @param complexObject */ - public async testEncodeObjectPost(complexObject: ComplexObject, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testEncodeObjectPost(complexObject: ComplexObject, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'complexObject' is not null or undefined if (complexObject === null || complexObject === undefined) { @@ -832,7 +917,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -843,8 +928,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** * @param body */ - public async testEncodePrimitiveBooleanPost(body: boolean, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testEncodePrimitiveBooleanPost(body: boolean, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { @@ -872,7 +960,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -883,8 +971,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** * @param body */ - public async testEncodePrimitiveIntegerPost(body: number, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testEncodePrimitiveIntegerPost(body: number, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { @@ -912,7 +1003,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -923,8 +1014,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** * @param body */ - public async testEncodePrimitiveNumberPost(body: number, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testEncodePrimitiveNumberPost(body: number, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { @@ -952,7 +1046,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -963,8 +1057,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** * @param body */ - public async testEncodePrimitiveStringPost(body: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testEncodePrimitiveStringPost(body: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { @@ -992,7 +1089,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/client/others/typescript/encode-decode/build/types/ObjectParamAPI.ts b/samples/client/others/typescript/encode-decode/build/types/ObjectParamAPI.ts index c307698325b1..61de76de568d 100644 --- a/samples/client/others/typescript/encode-decode/build/types/ObjectParamAPI.ts +++ b/samples/client/others/typescript/encode-decode/build/types/ObjectParamAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { ComplexObject } from '../models/ComplexObject'; import { CompositeObject } from '../models/CompositeObject'; @@ -209,448 +210,448 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testDecodeArrayOfArraysGetWithHttpInfo(param: DefaultApiTestDecodeArrayOfArraysGetRequest = {}, options?: Configuration): Promise>>> { + public testDecodeArrayOfArraysGetWithHttpInfo(param: DefaultApiTestDecodeArrayOfArraysGetRequest = {}, options?: Configuration | Middleware[]): Promise>>> { return this.api.testDecodeArrayOfArraysGetWithHttpInfo( options).toPromise(); } /** * @param param the request object */ - public testDecodeArrayOfArraysGet(param: DefaultApiTestDecodeArrayOfArraysGetRequest = {}, options?: Configuration): Promise>> { + public testDecodeArrayOfArraysGet(param: DefaultApiTestDecodeArrayOfArraysGetRequest = {}, options?: Configuration | Middleware[]): Promise>> { return this.api.testDecodeArrayOfArraysGet( options).toPromise(); } /** * @param param the request object */ - public testDecodeArrayOfGetWithHttpInfo(param: DefaultApiTestDecodeArrayOfGetRequest = {}, options?: Configuration): Promise>> { + public testDecodeArrayOfGetWithHttpInfo(param: DefaultApiTestDecodeArrayOfGetRequest = {}, options?: Configuration | Middleware[]): Promise>> { return this.api.testDecodeArrayOfGetWithHttpInfo( options).toPromise(); } /** * @param param the request object */ - public testDecodeArrayOfGet(param: DefaultApiTestDecodeArrayOfGetRequest = {}, options?: Configuration): Promise> { + public testDecodeArrayOfGet(param: DefaultApiTestDecodeArrayOfGetRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.testDecodeArrayOfGet( options).toPromise(); } /** * @param param the request object */ - public testDecodeArrayOfMapsOfObjectsGetWithHttpInfo(param: DefaultApiTestDecodeArrayOfMapsOfObjectsGetRequest = {}, options?: Configuration): Promise>> { + public testDecodeArrayOfMapsOfObjectsGetWithHttpInfo(param: DefaultApiTestDecodeArrayOfMapsOfObjectsGetRequest = {}, options?: Configuration | Middleware[]): Promise>> { return this.api.testDecodeArrayOfMapsOfObjectsGetWithHttpInfo( options).toPromise(); } /** * @param param the request object */ - public testDecodeArrayOfMapsOfObjectsGet(param: DefaultApiTestDecodeArrayOfMapsOfObjectsGetRequest = {}, options?: Configuration): Promise> { + public testDecodeArrayOfMapsOfObjectsGet(param: DefaultApiTestDecodeArrayOfMapsOfObjectsGetRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.testDecodeArrayOfMapsOfObjectsGet( options).toPromise(); } /** * @param param the request object */ - public testDecodeArrayOfNullableGetWithHttpInfo(param: DefaultApiTestDecodeArrayOfNullableGetRequest = {}, options?: Configuration): Promise>> { + public testDecodeArrayOfNullableGetWithHttpInfo(param: DefaultApiTestDecodeArrayOfNullableGetRequest = {}, options?: Configuration | Middleware[]): Promise>> { return this.api.testDecodeArrayOfNullableGetWithHttpInfo( options).toPromise(); } /** * @param param the request object */ - public testDecodeArrayOfNullableGet(param: DefaultApiTestDecodeArrayOfNullableGetRequest = {}, options?: Configuration): Promise> { + public testDecodeArrayOfNullableGet(param: DefaultApiTestDecodeArrayOfNullableGetRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.testDecodeArrayOfNullableGet( options).toPromise(); } /** * @param param the request object */ - public testDecodeArrayOfNullableObjectsGetWithHttpInfo(param: DefaultApiTestDecodeArrayOfNullableObjectsGetRequest = {}, options?: Configuration): Promise>> { + public testDecodeArrayOfNullableObjectsGetWithHttpInfo(param: DefaultApiTestDecodeArrayOfNullableObjectsGetRequest = {}, options?: Configuration | Middleware[]): Promise>> { return this.api.testDecodeArrayOfNullableObjectsGetWithHttpInfo( options).toPromise(); } /** * @param param the request object */ - public testDecodeArrayOfNullableObjectsGet(param: DefaultApiTestDecodeArrayOfNullableObjectsGetRequest = {}, options?: Configuration): Promise> { + public testDecodeArrayOfNullableObjectsGet(param: DefaultApiTestDecodeArrayOfNullableObjectsGetRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.testDecodeArrayOfNullableObjectsGet( options).toPromise(); } /** * @param param the request object */ - public testDecodeCompositeObjectsGetWithHttpInfo(param: DefaultApiTestDecodeCompositeObjectsGetRequest = {}, options?: Configuration): Promise> { + public testDecodeCompositeObjectsGetWithHttpInfo(param: DefaultApiTestDecodeCompositeObjectsGetRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.testDecodeCompositeObjectsGetWithHttpInfo( options).toPromise(); } /** * @param param the request object */ - public testDecodeCompositeObjectsGet(param: DefaultApiTestDecodeCompositeObjectsGetRequest = {}, options?: Configuration): Promise { + public testDecodeCompositeObjectsGet(param: DefaultApiTestDecodeCompositeObjectsGetRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.testDecodeCompositeObjectsGet( options).toPromise(); } /** * @param param the request object */ - public testDecodeMapOfMapsOfObjectsGetWithHttpInfo(param: DefaultApiTestDecodeMapOfMapsOfObjectsGetRequest = {}, options?: Configuration): Promise> { + public testDecodeMapOfMapsOfObjectsGetWithHttpInfo(param: DefaultApiTestDecodeMapOfMapsOfObjectsGetRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.testDecodeMapOfMapsOfObjectsGetWithHttpInfo( options).toPromise(); } /** * @param param the request object */ - public testDecodeMapOfMapsOfObjectsGet(param: DefaultApiTestDecodeMapOfMapsOfObjectsGetRequest = {}, options?: Configuration): Promise<{ [key: string]: { [key: string]: ComplexObject; }; }> { + public testDecodeMapOfMapsOfObjectsGet(param: DefaultApiTestDecodeMapOfMapsOfObjectsGetRequest = {}, options?: Configuration | Middleware[]): Promise<{ [key: string]: { [key: string]: ComplexObject; }; }> { return this.api.testDecodeMapOfMapsOfObjectsGet( options).toPromise(); } /** * @param param the request object */ - public testDecodeMapOfObjectsGetWithHttpInfo(param: DefaultApiTestDecodeMapOfObjectsGetRequest = {}, options?: Configuration): Promise> { + public testDecodeMapOfObjectsGetWithHttpInfo(param: DefaultApiTestDecodeMapOfObjectsGetRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.testDecodeMapOfObjectsGetWithHttpInfo( options).toPromise(); } /** * @param param the request object */ - public testDecodeMapOfObjectsGet(param: DefaultApiTestDecodeMapOfObjectsGetRequest = {}, options?: Configuration): Promise<{ [key: string]: ComplexObject | null; }> { + public testDecodeMapOfObjectsGet(param: DefaultApiTestDecodeMapOfObjectsGetRequest = {}, options?: Configuration | Middleware[]): Promise<{ [key: string]: ComplexObject | null; }> { return this.api.testDecodeMapOfObjectsGet( options).toPromise(); } /** * @param param the request object */ - public testDecodeMapOfPrimitiveGetWithHttpInfo(param: DefaultApiTestDecodeMapOfPrimitiveGetRequest = {}, options?: Configuration): Promise> { + public testDecodeMapOfPrimitiveGetWithHttpInfo(param: DefaultApiTestDecodeMapOfPrimitiveGetRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.testDecodeMapOfPrimitiveGetWithHttpInfo( options).toPromise(); } /** * @param param the request object */ - public testDecodeMapOfPrimitiveGet(param: DefaultApiTestDecodeMapOfPrimitiveGetRequest = {}, options?: Configuration): Promise<{ [key: string]: string; }> { + public testDecodeMapOfPrimitiveGet(param: DefaultApiTestDecodeMapOfPrimitiveGetRequest = {}, options?: Configuration | Middleware[]): Promise<{ [key: string]: string; }> { return this.api.testDecodeMapOfPrimitiveGet( options).toPromise(); } /** * @param param the request object */ - public testDecodeNullableArrayGetWithHttpInfo(param: DefaultApiTestDecodeNullableArrayGetRequest = {}, options?: Configuration): Promise>> { + public testDecodeNullableArrayGetWithHttpInfo(param: DefaultApiTestDecodeNullableArrayGetRequest = {}, options?: Configuration | Middleware[]): Promise>> { return this.api.testDecodeNullableArrayGetWithHttpInfo( options).toPromise(); } /** * @param param the request object */ - public testDecodeNullableArrayGet(param: DefaultApiTestDecodeNullableArrayGetRequest = {}, options?: Configuration): Promise> { + public testDecodeNullableArrayGet(param: DefaultApiTestDecodeNullableArrayGetRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.testDecodeNullableArrayGet( options).toPromise(); } /** * @param param the request object */ - public testDecodeNullableGetWithHttpInfo(param: DefaultApiTestDecodeNullableGetRequest = {}, options?: Configuration): Promise> { + public testDecodeNullableGetWithHttpInfo(param: DefaultApiTestDecodeNullableGetRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.testDecodeNullableGetWithHttpInfo( options).toPromise(); } /** * @param param the request object */ - public testDecodeNullableGet(param: DefaultApiTestDecodeNullableGetRequest = {}, options?: Configuration): Promise { + public testDecodeNullableGet(param: DefaultApiTestDecodeNullableGetRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.testDecodeNullableGet( options).toPromise(); } /** * @param param the request object */ - public testDecodeObjectGetWithHttpInfo(param: DefaultApiTestDecodeObjectGetRequest = {}, options?: Configuration): Promise> { + public testDecodeObjectGetWithHttpInfo(param: DefaultApiTestDecodeObjectGetRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.testDecodeObjectGetWithHttpInfo( options).toPromise(); } /** * @param param the request object */ - public testDecodeObjectGet(param: DefaultApiTestDecodeObjectGetRequest = {}, options?: Configuration): Promise { + public testDecodeObjectGet(param: DefaultApiTestDecodeObjectGetRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.testDecodeObjectGet( options).toPromise(); } /** * @param param the request object */ - public testDecodePrimitiveBooleanGetWithHttpInfo(param: DefaultApiTestDecodePrimitiveBooleanGetRequest = {}, options?: Configuration): Promise> { + public testDecodePrimitiveBooleanGetWithHttpInfo(param: DefaultApiTestDecodePrimitiveBooleanGetRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.testDecodePrimitiveBooleanGetWithHttpInfo( options).toPromise(); } /** * @param param the request object */ - public testDecodePrimitiveBooleanGet(param: DefaultApiTestDecodePrimitiveBooleanGetRequest = {}, options?: Configuration): Promise { + public testDecodePrimitiveBooleanGet(param: DefaultApiTestDecodePrimitiveBooleanGetRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.testDecodePrimitiveBooleanGet( options).toPromise(); } /** * @param param the request object */ - public testDecodePrimitiveIntegerGetWithHttpInfo(param: DefaultApiTestDecodePrimitiveIntegerGetRequest = {}, options?: Configuration): Promise> { + public testDecodePrimitiveIntegerGetWithHttpInfo(param: DefaultApiTestDecodePrimitiveIntegerGetRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.testDecodePrimitiveIntegerGetWithHttpInfo( options).toPromise(); } /** * @param param the request object */ - public testDecodePrimitiveIntegerGet(param: DefaultApiTestDecodePrimitiveIntegerGetRequest = {}, options?: Configuration): Promise { + public testDecodePrimitiveIntegerGet(param: DefaultApiTestDecodePrimitiveIntegerGetRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.testDecodePrimitiveIntegerGet( options).toPromise(); } /** * @param param the request object */ - public testDecodePrimitiveNumberGetWithHttpInfo(param: DefaultApiTestDecodePrimitiveNumberGetRequest = {}, options?: Configuration): Promise> { + public testDecodePrimitiveNumberGetWithHttpInfo(param: DefaultApiTestDecodePrimitiveNumberGetRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.testDecodePrimitiveNumberGetWithHttpInfo( options).toPromise(); } /** * @param param the request object */ - public testDecodePrimitiveNumberGet(param: DefaultApiTestDecodePrimitiveNumberGetRequest = {}, options?: Configuration): Promise { + public testDecodePrimitiveNumberGet(param: DefaultApiTestDecodePrimitiveNumberGetRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.testDecodePrimitiveNumberGet( options).toPromise(); } /** * @param param the request object */ - public testDecodePrimitiveStringGetWithHttpInfo(param: DefaultApiTestDecodePrimitiveStringGetRequest = {}, options?: Configuration): Promise> { + public testDecodePrimitiveStringGetWithHttpInfo(param: DefaultApiTestDecodePrimitiveStringGetRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.testDecodePrimitiveStringGetWithHttpInfo( options).toPromise(); } /** * @param param the request object */ - public testDecodePrimitiveStringGet(param: DefaultApiTestDecodePrimitiveStringGetRequest = {}, options?: Configuration): Promise { + public testDecodePrimitiveStringGet(param: DefaultApiTestDecodePrimitiveStringGetRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.testDecodePrimitiveStringGet( options).toPromise(); } /** * @param param the request object */ - public testEncodeArrayOfArraysPostWithHttpInfo(param: DefaultApiTestEncodeArrayOfArraysPostRequest, options?: Configuration): Promise> { + public testEncodeArrayOfArraysPostWithHttpInfo(param: DefaultApiTestEncodeArrayOfArraysPostRequest, options?: Configuration | Middleware[]): Promise> { return this.api.testEncodeArrayOfArraysPostWithHttpInfo(param.requestBody, options).toPromise(); } /** * @param param the request object */ - public testEncodeArrayOfArraysPost(param: DefaultApiTestEncodeArrayOfArraysPostRequest, options?: Configuration): Promise { + public testEncodeArrayOfArraysPost(param: DefaultApiTestEncodeArrayOfArraysPostRequest, options?: Configuration | Middleware[]): Promise { return this.api.testEncodeArrayOfArraysPost(param.requestBody, options).toPromise(); } /** * @param param the request object */ - public testEncodeArrayOfMapsOfObjectsPostWithHttpInfo(param: DefaultApiTestEncodeArrayOfMapsOfObjectsPostRequest, options?: Configuration): Promise> { + public testEncodeArrayOfMapsOfObjectsPostWithHttpInfo(param: DefaultApiTestEncodeArrayOfMapsOfObjectsPostRequest, options?: Configuration | Middleware[]): Promise> { return this.api.testEncodeArrayOfMapsOfObjectsPostWithHttpInfo(param.complexObject, options).toPromise(); } /** * @param param the request object */ - public testEncodeArrayOfMapsOfObjectsPost(param: DefaultApiTestEncodeArrayOfMapsOfObjectsPostRequest, options?: Configuration): Promise { + public testEncodeArrayOfMapsOfObjectsPost(param: DefaultApiTestEncodeArrayOfMapsOfObjectsPostRequest, options?: Configuration | Middleware[]): Promise { return this.api.testEncodeArrayOfMapsOfObjectsPost(param.complexObject, options).toPromise(); } /** * @param param the request object */ - public testEncodeArrayOfNullableObjectsPostWithHttpInfo(param: DefaultApiTestEncodeArrayOfNullableObjectsPostRequest, options?: Configuration): Promise> { + public testEncodeArrayOfNullableObjectsPostWithHttpInfo(param: DefaultApiTestEncodeArrayOfNullableObjectsPostRequest, options?: Configuration | Middleware[]): Promise> { return this.api.testEncodeArrayOfNullableObjectsPostWithHttpInfo(param.complexObject, options).toPromise(); } /** * @param param the request object */ - public testEncodeArrayOfNullableObjectsPost(param: DefaultApiTestEncodeArrayOfNullableObjectsPostRequest, options?: Configuration): Promise { + public testEncodeArrayOfNullableObjectsPost(param: DefaultApiTestEncodeArrayOfNullableObjectsPostRequest, options?: Configuration | Middleware[]): Promise { return this.api.testEncodeArrayOfNullableObjectsPost(param.complexObject, options).toPromise(); } /** * @param param the request object */ - public testEncodeArrayOfNullablePostWithHttpInfo(param: DefaultApiTestEncodeArrayOfNullablePostRequest, options?: Configuration): Promise> { + public testEncodeArrayOfNullablePostWithHttpInfo(param: DefaultApiTestEncodeArrayOfNullablePostRequest, options?: Configuration | Middleware[]): Promise> { return this.api.testEncodeArrayOfNullablePostWithHttpInfo(param.requestBody, options).toPromise(); } /** * @param param the request object */ - public testEncodeArrayOfNullablePost(param: DefaultApiTestEncodeArrayOfNullablePostRequest, options?: Configuration): Promise { + public testEncodeArrayOfNullablePost(param: DefaultApiTestEncodeArrayOfNullablePostRequest, options?: Configuration | Middleware[]): Promise { return this.api.testEncodeArrayOfNullablePost(param.requestBody, options).toPromise(); } /** * @param param the request object */ - public testEncodeArrayOfPostWithHttpInfo(param: DefaultApiTestEncodeArrayOfPostRequest, options?: Configuration): Promise> { + public testEncodeArrayOfPostWithHttpInfo(param: DefaultApiTestEncodeArrayOfPostRequest, options?: Configuration | Middleware[]): Promise> { return this.api.testEncodeArrayOfPostWithHttpInfo(param.requestBody, options).toPromise(); } /** * @param param the request object */ - public testEncodeArrayOfPost(param: DefaultApiTestEncodeArrayOfPostRequest, options?: Configuration): Promise { + public testEncodeArrayOfPost(param: DefaultApiTestEncodeArrayOfPostRequest, options?: Configuration | Middleware[]): Promise { return this.api.testEncodeArrayOfPost(param.requestBody, options).toPromise(); } /** * @param param the request object */ - public testEncodeCompositeObjectsPostWithHttpInfo(param: DefaultApiTestEncodeCompositeObjectsPostRequest, options?: Configuration): Promise> { + public testEncodeCompositeObjectsPostWithHttpInfo(param: DefaultApiTestEncodeCompositeObjectsPostRequest, options?: Configuration | Middleware[]): Promise> { return this.api.testEncodeCompositeObjectsPostWithHttpInfo(param.compositeObject, options).toPromise(); } /** * @param param the request object */ - public testEncodeCompositeObjectsPost(param: DefaultApiTestEncodeCompositeObjectsPostRequest, options?: Configuration): Promise { + public testEncodeCompositeObjectsPost(param: DefaultApiTestEncodeCompositeObjectsPostRequest, options?: Configuration | Middleware[]): Promise { return this.api.testEncodeCompositeObjectsPost(param.compositeObject, options).toPromise(); } /** * @param param the request object */ - public testEncodeMapOfMapsOfObjectsPostWithHttpInfo(param: DefaultApiTestEncodeMapOfMapsOfObjectsPostRequest, options?: Configuration): Promise> { + public testEncodeMapOfMapsOfObjectsPostWithHttpInfo(param: DefaultApiTestEncodeMapOfMapsOfObjectsPostRequest, options?: Configuration | Middleware[]): Promise> { return this.api.testEncodeMapOfMapsOfObjectsPostWithHttpInfo(param.requestBody, options).toPromise(); } /** * @param param the request object */ - public testEncodeMapOfMapsOfObjectsPost(param: DefaultApiTestEncodeMapOfMapsOfObjectsPostRequest, options?: Configuration): Promise { + public testEncodeMapOfMapsOfObjectsPost(param: DefaultApiTestEncodeMapOfMapsOfObjectsPostRequest, options?: Configuration | Middleware[]): Promise { return this.api.testEncodeMapOfMapsOfObjectsPost(param.requestBody, options).toPromise(); } /** * @param param the request object */ - public testEncodeMapOfObjectsPostWithHttpInfo(param: DefaultApiTestEncodeMapOfObjectsPostRequest, options?: Configuration): Promise> { + public testEncodeMapOfObjectsPostWithHttpInfo(param: DefaultApiTestEncodeMapOfObjectsPostRequest, options?: Configuration | Middleware[]): Promise> { return this.api.testEncodeMapOfObjectsPostWithHttpInfo(param.requestBody, options).toPromise(); } /** * @param param the request object */ - public testEncodeMapOfObjectsPost(param: DefaultApiTestEncodeMapOfObjectsPostRequest, options?: Configuration): Promise { + public testEncodeMapOfObjectsPost(param: DefaultApiTestEncodeMapOfObjectsPostRequest, options?: Configuration | Middleware[]): Promise { return this.api.testEncodeMapOfObjectsPost(param.requestBody, options).toPromise(); } /** * @param param the request object */ - public testEncodeMapOfPrimitivePostWithHttpInfo(param: DefaultApiTestEncodeMapOfPrimitivePostRequest, options?: Configuration): Promise> { + public testEncodeMapOfPrimitivePostWithHttpInfo(param: DefaultApiTestEncodeMapOfPrimitivePostRequest, options?: Configuration | Middleware[]): Promise> { return this.api.testEncodeMapOfPrimitivePostWithHttpInfo(param.requestBody, options).toPromise(); } /** * @param param the request object */ - public testEncodeMapOfPrimitivePost(param: DefaultApiTestEncodeMapOfPrimitivePostRequest, options?: Configuration): Promise { + public testEncodeMapOfPrimitivePost(param: DefaultApiTestEncodeMapOfPrimitivePostRequest, options?: Configuration | Middleware[]): Promise { return this.api.testEncodeMapOfPrimitivePost(param.requestBody, options).toPromise(); } /** * @param param the request object */ - public testEncodeNullableArrayPostWithHttpInfo(param: DefaultApiTestEncodeNullableArrayPostRequest = {}, options?: Configuration): Promise> { + public testEncodeNullableArrayPostWithHttpInfo(param: DefaultApiTestEncodeNullableArrayPostRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.testEncodeNullableArrayPostWithHttpInfo(param.requestBody, options).toPromise(); } /** * @param param the request object */ - public testEncodeNullableArrayPost(param: DefaultApiTestEncodeNullableArrayPostRequest = {}, options?: Configuration): Promise { + public testEncodeNullableArrayPost(param: DefaultApiTestEncodeNullableArrayPostRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.testEncodeNullableArrayPost(param.requestBody, options).toPromise(); } /** * @param param the request object */ - public testEncodeNullablePostWithHttpInfo(param: DefaultApiTestEncodeNullablePostRequest = {}, options?: Configuration): Promise> { + public testEncodeNullablePostWithHttpInfo(param: DefaultApiTestEncodeNullablePostRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.testEncodeNullablePostWithHttpInfo(param.body, options).toPromise(); } /** * @param param the request object */ - public testEncodeNullablePost(param: DefaultApiTestEncodeNullablePostRequest = {}, options?: Configuration): Promise { + public testEncodeNullablePost(param: DefaultApiTestEncodeNullablePostRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.testEncodeNullablePost(param.body, options).toPromise(); } /** * @param param the request object */ - public testEncodeObjectPostWithHttpInfo(param: DefaultApiTestEncodeObjectPostRequest, options?: Configuration): Promise> { + public testEncodeObjectPostWithHttpInfo(param: DefaultApiTestEncodeObjectPostRequest, options?: Configuration | Middleware[]): Promise> { return this.api.testEncodeObjectPostWithHttpInfo(param.complexObject, options).toPromise(); } /** * @param param the request object */ - public testEncodeObjectPost(param: DefaultApiTestEncodeObjectPostRequest, options?: Configuration): Promise { + public testEncodeObjectPost(param: DefaultApiTestEncodeObjectPostRequest, options?: Configuration | Middleware[]): Promise { return this.api.testEncodeObjectPost(param.complexObject, options).toPromise(); } /** * @param param the request object */ - public testEncodePrimitiveBooleanPostWithHttpInfo(param: DefaultApiTestEncodePrimitiveBooleanPostRequest, options?: Configuration): Promise> { + public testEncodePrimitiveBooleanPostWithHttpInfo(param: DefaultApiTestEncodePrimitiveBooleanPostRequest, options?: Configuration | Middleware[]): Promise> { return this.api.testEncodePrimitiveBooleanPostWithHttpInfo(param.body, options).toPromise(); } /** * @param param the request object */ - public testEncodePrimitiveBooleanPost(param: DefaultApiTestEncodePrimitiveBooleanPostRequest, options?: Configuration): Promise { + public testEncodePrimitiveBooleanPost(param: DefaultApiTestEncodePrimitiveBooleanPostRequest, options?: Configuration | Middleware[]): Promise { return this.api.testEncodePrimitiveBooleanPost(param.body, options).toPromise(); } /** * @param param the request object */ - public testEncodePrimitiveIntegerPostWithHttpInfo(param: DefaultApiTestEncodePrimitiveIntegerPostRequest, options?: Configuration): Promise> { + public testEncodePrimitiveIntegerPostWithHttpInfo(param: DefaultApiTestEncodePrimitiveIntegerPostRequest, options?: Configuration | Middleware[]): Promise> { return this.api.testEncodePrimitiveIntegerPostWithHttpInfo(param.body, options).toPromise(); } /** * @param param the request object */ - public testEncodePrimitiveIntegerPost(param: DefaultApiTestEncodePrimitiveIntegerPostRequest, options?: Configuration): Promise { + public testEncodePrimitiveIntegerPost(param: DefaultApiTestEncodePrimitiveIntegerPostRequest, options?: Configuration | Middleware[]): Promise { return this.api.testEncodePrimitiveIntegerPost(param.body, options).toPromise(); } /** * @param param the request object */ - public testEncodePrimitiveNumberPostWithHttpInfo(param: DefaultApiTestEncodePrimitiveNumberPostRequest, options?: Configuration): Promise> { + public testEncodePrimitiveNumberPostWithHttpInfo(param: DefaultApiTestEncodePrimitiveNumberPostRequest, options?: Configuration | Middleware[]): Promise> { return this.api.testEncodePrimitiveNumberPostWithHttpInfo(param.body, options).toPromise(); } /** * @param param the request object */ - public testEncodePrimitiveNumberPost(param: DefaultApiTestEncodePrimitiveNumberPostRequest, options?: Configuration): Promise { + public testEncodePrimitiveNumberPost(param: DefaultApiTestEncodePrimitiveNumberPostRequest, options?: Configuration | Middleware[]): Promise { return this.api.testEncodePrimitiveNumberPost(param.body, options).toPromise(); } /** * @param param the request object */ - public testEncodePrimitiveStringPostWithHttpInfo(param: DefaultApiTestEncodePrimitiveStringPostRequest, options?: Configuration): Promise> { + public testEncodePrimitiveStringPostWithHttpInfo(param: DefaultApiTestEncodePrimitiveStringPostRequest, options?: Configuration | Middleware[]): Promise> { return this.api.testEncodePrimitiveStringPostWithHttpInfo(param.body, options).toPromise(); } /** * @param param the request object */ - public testEncodePrimitiveStringPost(param: DefaultApiTestEncodePrimitiveStringPostRequest, options?: Configuration): Promise { + public testEncodePrimitiveStringPost(param: DefaultApiTestEncodePrimitiveStringPostRequest, options?: Configuration | Middleware[]): Promise { return this.api.testEncodePrimitiveStringPost(param.body, options).toPromise(); } diff --git a/samples/client/others/typescript/encode-decode/build/types/ObservableAPI.ts b/samples/client/others/typescript/encode-decode/build/types/ObservableAPI.ts index 36d0b69c684e..20725d388d56 100644 --- a/samples/client/others/typescript/encode-decode/build/types/ObservableAPI.ts +++ b/samples/client/others/typescript/encode-decode/build/types/ObservableAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { Observable, of, from } from '../rxjsStub'; import {mergeMap, map} from '../rxjsStub'; import { ComplexObject } from '../models/ComplexObject'; @@ -23,12 +24,21 @@ export class ObservableDefaultApi { /** */ - public testDecodeArrayOfArraysGetWithHttpInfo(_options?: Configuration): Observable>>> { + public testDecodeArrayOfArraysGetWithHttpInfo(_options?: Configuration | Middleware[]): Observable>>> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testDecodeArrayOfArraysGet(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -44,18 +54,27 @@ export class ObservableDefaultApi { /** */ - public testDecodeArrayOfArraysGet(_options?: Configuration): Observable>> { + public testDecodeArrayOfArraysGet(_options?: Configuration | Middleware[]): Observable>> { return this.testDecodeArrayOfArraysGetWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo>>) => apiResponse.data)); } /** */ - public testDecodeArrayOfGetWithHttpInfo(_options?: Configuration): Observable>> { + public testDecodeArrayOfGetWithHttpInfo(_options?: Configuration | Middleware[]): Observable>> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testDecodeArrayOfGet(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -71,18 +90,27 @@ export class ObservableDefaultApi { /** */ - public testDecodeArrayOfGet(_options?: Configuration): Observable> { + public testDecodeArrayOfGet(_options?: Configuration | Middleware[]): Observable> { return this.testDecodeArrayOfGetWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } /** */ - public testDecodeArrayOfMapsOfObjectsGetWithHttpInfo(_options?: Configuration): Observable>> { + public testDecodeArrayOfMapsOfObjectsGetWithHttpInfo(_options?: Configuration | Middleware[]): Observable>> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testDecodeArrayOfMapsOfObjectsGet(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -98,18 +126,27 @@ export class ObservableDefaultApi { /** */ - public testDecodeArrayOfMapsOfObjectsGet(_options?: Configuration): Observable> { + public testDecodeArrayOfMapsOfObjectsGet(_options?: Configuration | Middleware[]): Observable> { return this.testDecodeArrayOfMapsOfObjectsGetWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } /** */ - public testDecodeArrayOfNullableGetWithHttpInfo(_options?: Configuration): Observable>> { + public testDecodeArrayOfNullableGetWithHttpInfo(_options?: Configuration | Middleware[]): Observable>> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testDecodeArrayOfNullableGet(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -125,18 +162,27 @@ export class ObservableDefaultApi { /** */ - public testDecodeArrayOfNullableGet(_options?: Configuration): Observable> { + public testDecodeArrayOfNullableGet(_options?: Configuration | Middleware[]): Observable> { return this.testDecodeArrayOfNullableGetWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } /** */ - public testDecodeArrayOfNullableObjectsGetWithHttpInfo(_options?: Configuration): Observable>> { + public testDecodeArrayOfNullableObjectsGetWithHttpInfo(_options?: Configuration | Middleware[]): Observable>> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testDecodeArrayOfNullableObjectsGet(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -152,18 +198,27 @@ export class ObservableDefaultApi { /** */ - public testDecodeArrayOfNullableObjectsGet(_options?: Configuration): Observable> { + public testDecodeArrayOfNullableObjectsGet(_options?: Configuration | Middleware[]): Observable> { return this.testDecodeArrayOfNullableObjectsGetWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } /** */ - public testDecodeCompositeObjectsGetWithHttpInfo(_options?: Configuration): Observable> { + public testDecodeCompositeObjectsGetWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testDecodeCompositeObjectsGet(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -179,18 +234,27 @@ export class ObservableDefaultApi { /** */ - public testDecodeCompositeObjectsGet(_options?: Configuration): Observable { + public testDecodeCompositeObjectsGet(_options?: Configuration | Middleware[]): Observable { return this.testDecodeCompositeObjectsGetWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** */ - public testDecodeMapOfMapsOfObjectsGetWithHttpInfo(_options?: Configuration): Observable> { + public testDecodeMapOfMapsOfObjectsGetWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testDecodeMapOfMapsOfObjectsGet(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -206,18 +270,27 @@ export class ObservableDefaultApi { /** */ - public testDecodeMapOfMapsOfObjectsGet(_options?: Configuration): Observable<{ [key: string]: { [key: string]: ComplexObject; }; }> { + public testDecodeMapOfMapsOfObjectsGet(_options?: Configuration | Middleware[]): Observable<{ [key: string]: { [key: string]: ComplexObject; }; }> { return this.testDecodeMapOfMapsOfObjectsGetWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo<{ [key: string]: { [key: string]: ComplexObject; }; }>) => apiResponse.data)); } /** */ - public testDecodeMapOfObjectsGetWithHttpInfo(_options?: Configuration): Observable> { + public testDecodeMapOfObjectsGetWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testDecodeMapOfObjectsGet(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -233,18 +306,27 @@ export class ObservableDefaultApi { /** */ - public testDecodeMapOfObjectsGet(_options?: Configuration): Observable<{ [key: string]: ComplexObject | null; }> { + public testDecodeMapOfObjectsGet(_options?: Configuration | Middleware[]): Observable<{ [key: string]: ComplexObject | null; }> { return this.testDecodeMapOfObjectsGetWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo<{ [key: string]: ComplexObject | null; }>) => apiResponse.data)); } /** */ - public testDecodeMapOfPrimitiveGetWithHttpInfo(_options?: Configuration): Observable> { + public testDecodeMapOfPrimitiveGetWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testDecodeMapOfPrimitiveGet(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -260,18 +342,27 @@ export class ObservableDefaultApi { /** */ - public testDecodeMapOfPrimitiveGet(_options?: Configuration): Observable<{ [key: string]: string; }> { + public testDecodeMapOfPrimitiveGet(_options?: Configuration | Middleware[]): Observable<{ [key: string]: string; }> { return this.testDecodeMapOfPrimitiveGetWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo<{ [key: string]: string; }>) => apiResponse.data)); } /** */ - public testDecodeNullableArrayGetWithHttpInfo(_options?: Configuration): Observable>> { + public testDecodeNullableArrayGetWithHttpInfo(_options?: Configuration | Middleware[]): Observable>> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testDecodeNullableArrayGet(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -287,18 +378,27 @@ export class ObservableDefaultApi { /** */ - public testDecodeNullableArrayGet(_options?: Configuration): Observable> { + public testDecodeNullableArrayGet(_options?: Configuration | Middleware[]): Observable> { return this.testDecodeNullableArrayGetWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } /** */ - public testDecodeNullableGetWithHttpInfo(_options?: Configuration): Observable> { + public testDecodeNullableGetWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testDecodeNullableGet(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -314,18 +414,27 @@ export class ObservableDefaultApi { /** */ - public testDecodeNullableGet(_options?: Configuration): Observable { + public testDecodeNullableGet(_options?: Configuration | Middleware[]): Observable { return this.testDecodeNullableGetWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** */ - public testDecodeObjectGetWithHttpInfo(_options?: Configuration): Observable> { + public testDecodeObjectGetWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testDecodeObjectGet(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -341,18 +450,27 @@ export class ObservableDefaultApi { /** */ - public testDecodeObjectGet(_options?: Configuration): Observable { + public testDecodeObjectGet(_options?: Configuration | Middleware[]): Observable { return this.testDecodeObjectGetWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** */ - public testDecodePrimitiveBooleanGetWithHttpInfo(_options?: Configuration): Observable> { + public testDecodePrimitiveBooleanGetWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testDecodePrimitiveBooleanGet(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -368,18 +486,27 @@ export class ObservableDefaultApi { /** */ - public testDecodePrimitiveBooleanGet(_options?: Configuration): Observable { + public testDecodePrimitiveBooleanGet(_options?: Configuration | Middleware[]): Observable { return this.testDecodePrimitiveBooleanGetWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** */ - public testDecodePrimitiveIntegerGetWithHttpInfo(_options?: Configuration): Observable> { + public testDecodePrimitiveIntegerGetWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testDecodePrimitiveIntegerGet(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -395,18 +522,27 @@ export class ObservableDefaultApi { /** */ - public testDecodePrimitiveIntegerGet(_options?: Configuration): Observable { + public testDecodePrimitiveIntegerGet(_options?: Configuration | Middleware[]): Observable { return this.testDecodePrimitiveIntegerGetWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** */ - public testDecodePrimitiveNumberGetWithHttpInfo(_options?: Configuration): Observable> { + public testDecodePrimitiveNumberGetWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testDecodePrimitiveNumberGet(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -422,18 +558,27 @@ export class ObservableDefaultApi { /** */ - public testDecodePrimitiveNumberGet(_options?: Configuration): Observable { + public testDecodePrimitiveNumberGet(_options?: Configuration | Middleware[]): Observable { return this.testDecodePrimitiveNumberGetWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** */ - public testDecodePrimitiveStringGetWithHttpInfo(_options?: Configuration): Observable> { + public testDecodePrimitiveStringGetWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testDecodePrimitiveStringGet(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -449,19 +594,28 @@ export class ObservableDefaultApi { /** */ - public testDecodePrimitiveStringGet(_options?: Configuration): Observable { + public testDecodePrimitiveStringGet(_options?: Configuration | Middleware[]): Observable { return this.testDecodePrimitiveStringGetWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** * @param requestBody */ - public testEncodeArrayOfArraysPostWithHttpInfo(requestBody: Array>, _options?: Configuration): Observable> { + public testEncodeArrayOfArraysPostWithHttpInfo(requestBody: Array>, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testEncodeArrayOfArraysPost(requestBody, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -478,19 +632,28 @@ export class ObservableDefaultApi { /** * @param requestBody */ - public testEncodeArrayOfArraysPost(requestBody: Array>, _options?: Configuration): Observable { + public testEncodeArrayOfArraysPost(requestBody: Array>, _options?: Configuration | Middleware[]): Observable { return this.testEncodeArrayOfArraysPostWithHttpInfo(requestBody, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** * @param complexObject */ - public testEncodeArrayOfMapsOfObjectsPostWithHttpInfo(complexObject: Array<{ [key: string]: ComplexObject; }>, _options?: Configuration): Observable> { + public testEncodeArrayOfMapsOfObjectsPostWithHttpInfo(complexObject: Array<{ [key: string]: ComplexObject; }>, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testEncodeArrayOfMapsOfObjectsPost(complexObject, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -507,19 +670,28 @@ export class ObservableDefaultApi { /** * @param complexObject */ - public testEncodeArrayOfMapsOfObjectsPost(complexObject: Array<{ [key: string]: ComplexObject; }>, _options?: Configuration): Observable { + public testEncodeArrayOfMapsOfObjectsPost(complexObject: Array<{ [key: string]: ComplexObject; }>, _options?: Configuration | Middleware[]): Observable { return this.testEncodeArrayOfMapsOfObjectsPostWithHttpInfo(complexObject, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** * @param complexObject */ - public testEncodeArrayOfNullableObjectsPostWithHttpInfo(complexObject: Array, _options?: Configuration): Observable> { + public testEncodeArrayOfNullableObjectsPostWithHttpInfo(complexObject: Array, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testEncodeArrayOfNullableObjectsPost(complexObject, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -536,19 +708,28 @@ export class ObservableDefaultApi { /** * @param complexObject */ - public testEncodeArrayOfNullableObjectsPost(complexObject: Array, _options?: Configuration): Observable { + public testEncodeArrayOfNullableObjectsPost(complexObject: Array, _options?: Configuration | Middleware[]): Observable { return this.testEncodeArrayOfNullableObjectsPostWithHttpInfo(complexObject, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** * @param requestBody */ - public testEncodeArrayOfNullablePostWithHttpInfo(requestBody: Array, _options?: Configuration): Observable> { + public testEncodeArrayOfNullablePostWithHttpInfo(requestBody: Array, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testEncodeArrayOfNullablePost(requestBody, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -565,19 +746,28 @@ export class ObservableDefaultApi { /** * @param requestBody */ - public testEncodeArrayOfNullablePost(requestBody: Array, _options?: Configuration): Observable { + public testEncodeArrayOfNullablePost(requestBody: Array, _options?: Configuration | Middleware[]): Observable { return this.testEncodeArrayOfNullablePostWithHttpInfo(requestBody, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** * @param requestBody */ - public testEncodeArrayOfPostWithHttpInfo(requestBody: Array, _options?: Configuration): Observable> { + public testEncodeArrayOfPostWithHttpInfo(requestBody: Array, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testEncodeArrayOfPost(requestBody, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -594,19 +784,28 @@ export class ObservableDefaultApi { /** * @param requestBody */ - public testEncodeArrayOfPost(requestBody: Array, _options?: Configuration): Observable { + public testEncodeArrayOfPost(requestBody: Array, _options?: Configuration | Middleware[]): Observable { return this.testEncodeArrayOfPostWithHttpInfo(requestBody, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** * @param compositeObject */ - public testEncodeCompositeObjectsPostWithHttpInfo(compositeObject: CompositeObject, _options?: Configuration): Observable> { + public testEncodeCompositeObjectsPostWithHttpInfo(compositeObject: CompositeObject, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testEncodeCompositeObjectsPost(compositeObject, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -623,19 +822,28 @@ export class ObservableDefaultApi { /** * @param compositeObject */ - public testEncodeCompositeObjectsPost(compositeObject: CompositeObject, _options?: Configuration): Observable { + public testEncodeCompositeObjectsPost(compositeObject: CompositeObject, _options?: Configuration | Middleware[]): Observable { return this.testEncodeCompositeObjectsPostWithHttpInfo(compositeObject, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** * @param requestBody */ - public testEncodeMapOfMapsOfObjectsPostWithHttpInfo(requestBody: { [key: string]: { [key: string]: ComplexObject; }; }, _options?: Configuration): Observable> { + public testEncodeMapOfMapsOfObjectsPostWithHttpInfo(requestBody: { [key: string]: { [key: string]: ComplexObject; }; }, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testEncodeMapOfMapsOfObjectsPost(requestBody, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -652,19 +860,28 @@ export class ObservableDefaultApi { /** * @param requestBody */ - public testEncodeMapOfMapsOfObjectsPost(requestBody: { [key: string]: { [key: string]: ComplexObject; }; }, _options?: Configuration): Observable { + public testEncodeMapOfMapsOfObjectsPost(requestBody: { [key: string]: { [key: string]: ComplexObject; }; }, _options?: Configuration | Middleware[]): Observable { return this.testEncodeMapOfMapsOfObjectsPostWithHttpInfo(requestBody, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** * @param requestBody */ - public testEncodeMapOfObjectsPostWithHttpInfo(requestBody: { [key: string]: ComplexObject | null; }, _options?: Configuration): Observable> { + public testEncodeMapOfObjectsPostWithHttpInfo(requestBody: { [key: string]: ComplexObject | null; }, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testEncodeMapOfObjectsPost(requestBody, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -681,19 +898,28 @@ export class ObservableDefaultApi { /** * @param requestBody */ - public testEncodeMapOfObjectsPost(requestBody: { [key: string]: ComplexObject | null; }, _options?: Configuration): Observable { + public testEncodeMapOfObjectsPost(requestBody: { [key: string]: ComplexObject | null; }, _options?: Configuration | Middleware[]): Observable { return this.testEncodeMapOfObjectsPostWithHttpInfo(requestBody, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** * @param requestBody */ - public testEncodeMapOfPrimitivePostWithHttpInfo(requestBody: { [key: string]: string; }, _options?: Configuration): Observable> { + public testEncodeMapOfPrimitivePostWithHttpInfo(requestBody: { [key: string]: string; }, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testEncodeMapOfPrimitivePost(requestBody, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -710,19 +936,28 @@ export class ObservableDefaultApi { /** * @param requestBody */ - public testEncodeMapOfPrimitivePost(requestBody: { [key: string]: string; }, _options?: Configuration): Observable { + public testEncodeMapOfPrimitivePost(requestBody: { [key: string]: string; }, _options?: Configuration | Middleware[]): Observable { return this.testEncodeMapOfPrimitivePostWithHttpInfo(requestBody, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** * @param [requestBody] */ - public testEncodeNullableArrayPostWithHttpInfo(requestBody?: Array, _options?: Configuration): Observable> { + public testEncodeNullableArrayPostWithHttpInfo(requestBody?: Array, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testEncodeNullableArrayPost(requestBody, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -739,19 +974,28 @@ export class ObservableDefaultApi { /** * @param [requestBody] */ - public testEncodeNullableArrayPost(requestBody?: Array, _options?: Configuration): Observable { + public testEncodeNullableArrayPost(requestBody?: Array, _options?: Configuration | Middleware[]): Observable { return this.testEncodeNullableArrayPostWithHttpInfo(requestBody, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** * @param [body] */ - public testEncodeNullablePostWithHttpInfo(body?: string, _options?: Configuration): Observable> { + public testEncodeNullablePostWithHttpInfo(body?: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testEncodeNullablePost(body, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -768,19 +1012,28 @@ export class ObservableDefaultApi { /** * @param [body] */ - public testEncodeNullablePost(body?: string, _options?: Configuration): Observable { + public testEncodeNullablePost(body?: string, _options?: Configuration | Middleware[]): Observable { return this.testEncodeNullablePostWithHttpInfo(body, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** * @param complexObject */ - public testEncodeObjectPostWithHttpInfo(complexObject: ComplexObject, _options?: Configuration): Observable> { + public testEncodeObjectPostWithHttpInfo(complexObject: ComplexObject, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testEncodeObjectPost(complexObject, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -797,19 +1050,28 @@ export class ObservableDefaultApi { /** * @param complexObject */ - public testEncodeObjectPost(complexObject: ComplexObject, _options?: Configuration): Observable { + public testEncodeObjectPost(complexObject: ComplexObject, _options?: Configuration | Middleware[]): Observable { return this.testEncodeObjectPostWithHttpInfo(complexObject, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** * @param body */ - public testEncodePrimitiveBooleanPostWithHttpInfo(body: boolean, _options?: Configuration): Observable> { + public testEncodePrimitiveBooleanPostWithHttpInfo(body: boolean, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testEncodePrimitiveBooleanPost(body, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -826,19 +1088,28 @@ export class ObservableDefaultApi { /** * @param body */ - public testEncodePrimitiveBooleanPost(body: boolean, _options?: Configuration): Observable { + public testEncodePrimitiveBooleanPost(body: boolean, _options?: Configuration | Middleware[]): Observable { return this.testEncodePrimitiveBooleanPostWithHttpInfo(body, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** * @param body */ - public testEncodePrimitiveIntegerPostWithHttpInfo(body: number, _options?: Configuration): Observable> { + public testEncodePrimitiveIntegerPostWithHttpInfo(body: number, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testEncodePrimitiveIntegerPost(body, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -855,19 +1126,28 @@ export class ObservableDefaultApi { /** * @param body */ - public testEncodePrimitiveIntegerPost(body: number, _options?: Configuration): Observable { + public testEncodePrimitiveIntegerPost(body: number, _options?: Configuration | Middleware[]): Observable { return this.testEncodePrimitiveIntegerPostWithHttpInfo(body, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** * @param body */ - public testEncodePrimitiveNumberPostWithHttpInfo(body: number, _options?: Configuration): Observable> { + public testEncodePrimitiveNumberPostWithHttpInfo(body: number, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testEncodePrimitiveNumberPost(body, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -884,19 +1164,28 @@ export class ObservableDefaultApi { /** * @param body */ - public testEncodePrimitiveNumberPost(body: number, _options?: Configuration): Observable { + public testEncodePrimitiveNumberPost(body: number, _options?: Configuration | Middleware[]): Observable { return this.testEncodePrimitiveNumberPostWithHttpInfo(body, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** * @param body */ - public testEncodePrimitiveStringPostWithHttpInfo(body: string, _options?: Configuration): Observable> { + public testEncodePrimitiveStringPostWithHttpInfo(body: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testEncodePrimitiveStringPost(body, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -913,7 +1202,7 @@ export class ObservableDefaultApi { /** * @param body */ - public testEncodePrimitiveStringPost(body: string, _options?: Configuration): Observable { + public testEncodePrimitiveStringPost(body: string, _options?: Configuration | Middleware[]): Observable { return this.testEncodePrimitiveStringPostWithHttpInfo(body, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/client/others/typescript/encode-decode/build/types/PromiseAPI.ts b/samples/client/others/typescript/encode-decode/build/types/PromiseAPI.ts index 4e0e05472ee8..2ccf864c8913 100644 --- a/samples/client/others/typescript/encode-decode/build/types/PromiseAPI.ts +++ b/samples/client/others/typescript/encode-decode/build/types/PromiseAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { ComplexObject } from '../models/ComplexObject'; import { CompositeObject } from '../models/CompositeObject'; @@ -19,224 +20,224 @@ export class PromiseDefaultApi { /** */ - public testDecodeArrayOfArraysGetWithHttpInfo(_options?: Configuration): Promise>>> { + public testDecodeArrayOfArraysGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise>>> { const result = this.api.testDecodeArrayOfArraysGetWithHttpInfo(_options); return result.toPromise(); } /** */ - public testDecodeArrayOfArraysGet(_options?: Configuration): Promise>> { + public testDecodeArrayOfArraysGet(_options?: Configuration | Middleware[]): Promise>> { const result = this.api.testDecodeArrayOfArraysGet(_options); return result.toPromise(); } /** */ - public testDecodeArrayOfGetWithHttpInfo(_options?: Configuration): Promise>> { + public testDecodeArrayOfGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise>> { const result = this.api.testDecodeArrayOfGetWithHttpInfo(_options); return result.toPromise(); } /** */ - public testDecodeArrayOfGet(_options?: Configuration): Promise> { + public testDecodeArrayOfGet(_options?: Configuration | Middleware[]): Promise> { const result = this.api.testDecodeArrayOfGet(_options); return result.toPromise(); } /** */ - public testDecodeArrayOfMapsOfObjectsGetWithHttpInfo(_options?: Configuration): Promise>> { + public testDecodeArrayOfMapsOfObjectsGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise>> { const result = this.api.testDecodeArrayOfMapsOfObjectsGetWithHttpInfo(_options); return result.toPromise(); } /** */ - public testDecodeArrayOfMapsOfObjectsGet(_options?: Configuration): Promise> { + public testDecodeArrayOfMapsOfObjectsGet(_options?: Configuration | Middleware[]): Promise> { const result = this.api.testDecodeArrayOfMapsOfObjectsGet(_options); return result.toPromise(); } /** */ - public testDecodeArrayOfNullableGetWithHttpInfo(_options?: Configuration): Promise>> { + public testDecodeArrayOfNullableGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise>> { const result = this.api.testDecodeArrayOfNullableGetWithHttpInfo(_options); return result.toPromise(); } /** */ - public testDecodeArrayOfNullableGet(_options?: Configuration): Promise> { + public testDecodeArrayOfNullableGet(_options?: Configuration | Middleware[]): Promise> { const result = this.api.testDecodeArrayOfNullableGet(_options); return result.toPromise(); } /** */ - public testDecodeArrayOfNullableObjectsGetWithHttpInfo(_options?: Configuration): Promise>> { + public testDecodeArrayOfNullableObjectsGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise>> { const result = this.api.testDecodeArrayOfNullableObjectsGetWithHttpInfo(_options); return result.toPromise(); } /** */ - public testDecodeArrayOfNullableObjectsGet(_options?: Configuration): Promise> { + public testDecodeArrayOfNullableObjectsGet(_options?: Configuration | Middleware[]): Promise> { const result = this.api.testDecodeArrayOfNullableObjectsGet(_options); return result.toPromise(); } /** */ - public testDecodeCompositeObjectsGetWithHttpInfo(_options?: Configuration): Promise> { + public testDecodeCompositeObjectsGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.testDecodeCompositeObjectsGetWithHttpInfo(_options); return result.toPromise(); } /** */ - public testDecodeCompositeObjectsGet(_options?: Configuration): Promise { + public testDecodeCompositeObjectsGet(_options?: Configuration | Middleware[]): Promise { const result = this.api.testDecodeCompositeObjectsGet(_options); return result.toPromise(); } /** */ - public testDecodeMapOfMapsOfObjectsGetWithHttpInfo(_options?: Configuration): Promise> { + public testDecodeMapOfMapsOfObjectsGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.testDecodeMapOfMapsOfObjectsGetWithHttpInfo(_options); return result.toPromise(); } /** */ - public testDecodeMapOfMapsOfObjectsGet(_options?: Configuration): Promise<{ [key: string]: { [key: string]: ComplexObject; }; }> { + public testDecodeMapOfMapsOfObjectsGet(_options?: Configuration | Middleware[]): Promise<{ [key: string]: { [key: string]: ComplexObject; }; }> { const result = this.api.testDecodeMapOfMapsOfObjectsGet(_options); return result.toPromise(); } /** */ - public testDecodeMapOfObjectsGetWithHttpInfo(_options?: Configuration): Promise> { + public testDecodeMapOfObjectsGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.testDecodeMapOfObjectsGetWithHttpInfo(_options); return result.toPromise(); } /** */ - public testDecodeMapOfObjectsGet(_options?: Configuration): Promise<{ [key: string]: ComplexObject | null; }> { + public testDecodeMapOfObjectsGet(_options?: Configuration | Middleware[]): Promise<{ [key: string]: ComplexObject | null; }> { const result = this.api.testDecodeMapOfObjectsGet(_options); return result.toPromise(); } /** */ - public testDecodeMapOfPrimitiveGetWithHttpInfo(_options?: Configuration): Promise> { + public testDecodeMapOfPrimitiveGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.testDecodeMapOfPrimitiveGetWithHttpInfo(_options); return result.toPromise(); } /** */ - public testDecodeMapOfPrimitiveGet(_options?: Configuration): Promise<{ [key: string]: string; }> { + public testDecodeMapOfPrimitiveGet(_options?: Configuration | Middleware[]): Promise<{ [key: string]: string; }> { const result = this.api.testDecodeMapOfPrimitiveGet(_options); return result.toPromise(); } /** */ - public testDecodeNullableArrayGetWithHttpInfo(_options?: Configuration): Promise>> { + public testDecodeNullableArrayGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise>> { const result = this.api.testDecodeNullableArrayGetWithHttpInfo(_options); return result.toPromise(); } /** */ - public testDecodeNullableArrayGet(_options?: Configuration): Promise> { + public testDecodeNullableArrayGet(_options?: Configuration | Middleware[]): Promise> { const result = this.api.testDecodeNullableArrayGet(_options); return result.toPromise(); } /** */ - public testDecodeNullableGetWithHttpInfo(_options?: Configuration): Promise> { + public testDecodeNullableGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.testDecodeNullableGetWithHttpInfo(_options); return result.toPromise(); } /** */ - public testDecodeNullableGet(_options?: Configuration): Promise { + public testDecodeNullableGet(_options?: Configuration | Middleware[]): Promise { const result = this.api.testDecodeNullableGet(_options); return result.toPromise(); } /** */ - public testDecodeObjectGetWithHttpInfo(_options?: Configuration): Promise> { + public testDecodeObjectGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.testDecodeObjectGetWithHttpInfo(_options); return result.toPromise(); } /** */ - public testDecodeObjectGet(_options?: Configuration): Promise { + public testDecodeObjectGet(_options?: Configuration | Middleware[]): Promise { const result = this.api.testDecodeObjectGet(_options); return result.toPromise(); } /** */ - public testDecodePrimitiveBooleanGetWithHttpInfo(_options?: Configuration): Promise> { + public testDecodePrimitiveBooleanGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.testDecodePrimitiveBooleanGetWithHttpInfo(_options); return result.toPromise(); } /** */ - public testDecodePrimitiveBooleanGet(_options?: Configuration): Promise { + public testDecodePrimitiveBooleanGet(_options?: Configuration | Middleware[]): Promise { const result = this.api.testDecodePrimitiveBooleanGet(_options); return result.toPromise(); } /** */ - public testDecodePrimitiveIntegerGetWithHttpInfo(_options?: Configuration): Promise> { + public testDecodePrimitiveIntegerGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.testDecodePrimitiveIntegerGetWithHttpInfo(_options); return result.toPromise(); } /** */ - public testDecodePrimitiveIntegerGet(_options?: Configuration): Promise { + public testDecodePrimitiveIntegerGet(_options?: Configuration | Middleware[]): Promise { const result = this.api.testDecodePrimitiveIntegerGet(_options); return result.toPromise(); } /** */ - public testDecodePrimitiveNumberGetWithHttpInfo(_options?: Configuration): Promise> { + public testDecodePrimitiveNumberGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.testDecodePrimitiveNumberGetWithHttpInfo(_options); return result.toPromise(); } /** */ - public testDecodePrimitiveNumberGet(_options?: Configuration): Promise { + public testDecodePrimitiveNumberGet(_options?: Configuration | Middleware[]): Promise { const result = this.api.testDecodePrimitiveNumberGet(_options); return result.toPromise(); } /** */ - public testDecodePrimitiveStringGetWithHttpInfo(_options?: Configuration): Promise> { + public testDecodePrimitiveStringGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.testDecodePrimitiveStringGetWithHttpInfo(_options); return result.toPromise(); } /** */ - public testDecodePrimitiveStringGet(_options?: Configuration): Promise { + public testDecodePrimitiveStringGet(_options?: Configuration | Middleware[]): Promise { const result = this.api.testDecodePrimitiveStringGet(_options); return result.toPromise(); } @@ -244,7 +245,7 @@ export class PromiseDefaultApi { /** * @param requestBody */ - public testEncodeArrayOfArraysPostWithHttpInfo(requestBody: Array>, _options?: Configuration): Promise> { + public testEncodeArrayOfArraysPostWithHttpInfo(requestBody: Array>, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testEncodeArrayOfArraysPostWithHttpInfo(requestBody, _options); return result.toPromise(); } @@ -252,7 +253,7 @@ export class PromiseDefaultApi { /** * @param requestBody */ - public testEncodeArrayOfArraysPost(requestBody: Array>, _options?: Configuration): Promise { + public testEncodeArrayOfArraysPost(requestBody: Array>, _options?: Configuration | Middleware[]): Promise { const result = this.api.testEncodeArrayOfArraysPost(requestBody, _options); return result.toPromise(); } @@ -260,7 +261,7 @@ export class PromiseDefaultApi { /** * @param complexObject */ - public testEncodeArrayOfMapsOfObjectsPostWithHttpInfo(complexObject: Array<{ [key: string]: ComplexObject; }>, _options?: Configuration): Promise> { + public testEncodeArrayOfMapsOfObjectsPostWithHttpInfo(complexObject: Array<{ [key: string]: ComplexObject; }>, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testEncodeArrayOfMapsOfObjectsPostWithHttpInfo(complexObject, _options); return result.toPromise(); } @@ -268,7 +269,7 @@ export class PromiseDefaultApi { /** * @param complexObject */ - public testEncodeArrayOfMapsOfObjectsPost(complexObject: Array<{ [key: string]: ComplexObject; }>, _options?: Configuration): Promise { + public testEncodeArrayOfMapsOfObjectsPost(complexObject: Array<{ [key: string]: ComplexObject; }>, _options?: Configuration | Middleware[]): Promise { const result = this.api.testEncodeArrayOfMapsOfObjectsPost(complexObject, _options); return result.toPromise(); } @@ -276,7 +277,7 @@ export class PromiseDefaultApi { /** * @param complexObject */ - public testEncodeArrayOfNullableObjectsPostWithHttpInfo(complexObject: Array, _options?: Configuration): Promise> { + public testEncodeArrayOfNullableObjectsPostWithHttpInfo(complexObject: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testEncodeArrayOfNullableObjectsPostWithHttpInfo(complexObject, _options); return result.toPromise(); } @@ -284,7 +285,7 @@ export class PromiseDefaultApi { /** * @param complexObject */ - public testEncodeArrayOfNullableObjectsPost(complexObject: Array, _options?: Configuration): Promise { + public testEncodeArrayOfNullableObjectsPost(complexObject: Array, _options?: Configuration | Middleware[]): Promise { const result = this.api.testEncodeArrayOfNullableObjectsPost(complexObject, _options); return result.toPromise(); } @@ -292,7 +293,7 @@ export class PromiseDefaultApi { /** * @param requestBody */ - public testEncodeArrayOfNullablePostWithHttpInfo(requestBody: Array, _options?: Configuration): Promise> { + public testEncodeArrayOfNullablePostWithHttpInfo(requestBody: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testEncodeArrayOfNullablePostWithHttpInfo(requestBody, _options); return result.toPromise(); } @@ -300,7 +301,7 @@ export class PromiseDefaultApi { /** * @param requestBody */ - public testEncodeArrayOfNullablePost(requestBody: Array, _options?: Configuration): Promise { + public testEncodeArrayOfNullablePost(requestBody: Array, _options?: Configuration | Middleware[]): Promise { const result = this.api.testEncodeArrayOfNullablePost(requestBody, _options); return result.toPromise(); } @@ -308,7 +309,7 @@ export class PromiseDefaultApi { /** * @param requestBody */ - public testEncodeArrayOfPostWithHttpInfo(requestBody: Array, _options?: Configuration): Promise> { + public testEncodeArrayOfPostWithHttpInfo(requestBody: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testEncodeArrayOfPostWithHttpInfo(requestBody, _options); return result.toPromise(); } @@ -316,7 +317,7 @@ export class PromiseDefaultApi { /** * @param requestBody */ - public testEncodeArrayOfPost(requestBody: Array, _options?: Configuration): Promise { + public testEncodeArrayOfPost(requestBody: Array, _options?: Configuration | Middleware[]): Promise { const result = this.api.testEncodeArrayOfPost(requestBody, _options); return result.toPromise(); } @@ -324,7 +325,7 @@ export class PromiseDefaultApi { /** * @param compositeObject */ - public testEncodeCompositeObjectsPostWithHttpInfo(compositeObject: CompositeObject, _options?: Configuration): Promise> { + public testEncodeCompositeObjectsPostWithHttpInfo(compositeObject: CompositeObject, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testEncodeCompositeObjectsPostWithHttpInfo(compositeObject, _options); return result.toPromise(); } @@ -332,7 +333,7 @@ export class PromiseDefaultApi { /** * @param compositeObject */ - public testEncodeCompositeObjectsPost(compositeObject: CompositeObject, _options?: Configuration): Promise { + public testEncodeCompositeObjectsPost(compositeObject: CompositeObject, _options?: Configuration | Middleware[]): Promise { const result = this.api.testEncodeCompositeObjectsPost(compositeObject, _options); return result.toPromise(); } @@ -340,7 +341,7 @@ export class PromiseDefaultApi { /** * @param requestBody */ - public testEncodeMapOfMapsOfObjectsPostWithHttpInfo(requestBody: { [key: string]: { [key: string]: ComplexObject; }; }, _options?: Configuration): Promise> { + public testEncodeMapOfMapsOfObjectsPostWithHttpInfo(requestBody: { [key: string]: { [key: string]: ComplexObject; }; }, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testEncodeMapOfMapsOfObjectsPostWithHttpInfo(requestBody, _options); return result.toPromise(); } @@ -348,7 +349,7 @@ export class PromiseDefaultApi { /** * @param requestBody */ - public testEncodeMapOfMapsOfObjectsPost(requestBody: { [key: string]: { [key: string]: ComplexObject; }; }, _options?: Configuration): Promise { + public testEncodeMapOfMapsOfObjectsPost(requestBody: { [key: string]: { [key: string]: ComplexObject; }; }, _options?: Configuration | Middleware[]): Promise { const result = this.api.testEncodeMapOfMapsOfObjectsPost(requestBody, _options); return result.toPromise(); } @@ -356,7 +357,7 @@ export class PromiseDefaultApi { /** * @param requestBody */ - public testEncodeMapOfObjectsPostWithHttpInfo(requestBody: { [key: string]: ComplexObject | null; }, _options?: Configuration): Promise> { + public testEncodeMapOfObjectsPostWithHttpInfo(requestBody: { [key: string]: ComplexObject | null; }, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testEncodeMapOfObjectsPostWithHttpInfo(requestBody, _options); return result.toPromise(); } @@ -364,7 +365,7 @@ export class PromiseDefaultApi { /** * @param requestBody */ - public testEncodeMapOfObjectsPost(requestBody: { [key: string]: ComplexObject | null; }, _options?: Configuration): Promise { + public testEncodeMapOfObjectsPost(requestBody: { [key: string]: ComplexObject | null; }, _options?: Configuration | Middleware[]): Promise { const result = this.api.testEncodeMapOfObjectsPost(requestBody, _options); return result.toPromise(); } @@ -372,7 +373,7 @@ export class PromiseDefaultApi { /** * @param requestBody */ - public testEncodeMapOfPrimitivePostWithHttpInfo(requestBody: { [key: string]: string; }, _options?: Configuration): Promise> { + public testEncodeMapOfPrimitivePostWithHttpInfo(requestBody: { [key: string]: string; }, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testEncodeMapOfPrimitivePostWithHttpInfo(requestBody, _options); return result.toPromise(); } @@ -380,7 +381,7 @@ export class PromiseDefaultApi { /** * @param requestBody */ - public testEncodeMapOfPrimitivePost(requestBody: { [key: string]: string; }, _options?: Configuration): Promise { + public testEncodeMapOfPrimitivePost(requestBody: { [key: string]: string; }, _options?: Configuration | Middleware[]): Promise { const result = this.api.testEncodeMapOfPrimitivePost(requestBody, _options); return result.toPromise(); } @@ -388,7 +389,7 @@ export class PromiseDefaultApi { /** * @param [requestBody] */ - public testEncodeNullableArrayPostWithHttpInfo(requestBody?: Array, _options?: Configuration): Promise> { + public testEncodeNullableArrayPostWithHttpInfo(requestBody?: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testEncodeNullableArrayPostWithHttpInfo(requestBody, _options); return result.toPromise(); } @@ -396,7 +397,7 @@ export class PromiseDefaultApi { /** * @param [requestBody] */ - public testEncodeNullableArrayPost(requestBody?: Array, _options?: Configuration): Promise { + public testEncodeNullableArrayPost(requestBody?: Array, _options?: Configuration | Middleware[]): Promise { const result = this.api.testEncodeNullableArrayPost(requestBody, _options); return result.toPromise(); } @@ -404,7 +405,7 @@ export class PromiseDefaultApi { /** * @param [body] */ - public testEncodeNullablePostWithHttpInfo(body?: string, _options?: Configuration): Promise> { + public testEncodeNullablePostWithHttpInfo(body?: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testEncodeNullablePostWithHttpInfo(body, _options); return result.toPromise(); } @@ -412,7 +413,7 @@ export class PromiseDefaultApi { /** * @param [body] */ - public testEncodeNullablePost(body?: string, _options?: Configuration): Promise { + public testEncodeNullablePost(body?: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.testEncodeNullablePost(body, _options); return result.toPromise(); } @@ -420,7 +421,7 @@ export class PromiseDefaultApi { /** * @param complexObject */ - public testEncodeObjectPostWithHttpInfo(complexObject: ComplexObject, _options?: Configuration): Promise> { + public testEncodeObjectPostWithHttpInfo(complexObject: ComplexObject, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testEncodeObjectPostWithHttpInfo(complexObject, _options); return result.toPromise(); } @@ -428,7 +429,7 @@ export class PromiseDefaultApi { /** * @param complexObject */ - public testEncodeObjectPost(complexObject: ComplexObject, _options?: Configuration): Promise { + public testEncodeObjectPost(complexObject: ComplexObject, _options?: Configuration | Middleware[]): Promise { const result = this.api.testEncodeObjectPost(complexObject, _options); return result.toPromise(); } @@ -436,7 +437,7 @@ export class PromiseDefaultApi { /** * @param body */ - public testEncodePrimitiveBooleanPostWithHttpInfo(body: boolean, _options?: Configuration): Promise> { + public testEncodePrimitiveBooleanPostWithHttpInfo(body: boolean, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testEncodePrimitiveBooleanPostWithHttpInfo(body, _options); return result.toPromise(); } @@ -444,7 +445,7 @@ export class PromiseDefaultApi { /** * @param body */ - public testEncodePrimitiveBooleanPost(body: boolean, _options?: Configuration): Promise { + public testEncodePrimitiveBooleanPost(body: boolean, _options?: Configuration | Middleware[]): Promise { const result = this.api.testEncodePrimitiveBooleanPost(body, _options); return result.toPromise(); } @@ -452,7 +453,7 @@ export class PromiseDefaultApi { /** * @param body */ - public testEncodePrimitiveIntegerPostWithHttpInfo(body: number, _options?: Configuration): Promise> { + public testEncodePrimitiveIntegerPostWithHttpInfo(body: number, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testEncodePrimitiveIntegerPostWithHttpInfo(body, _options); return result.toPromise(); } @@ -460,7 +461,7 @@ export class PromiseDefaultApi { /** * @param body */ - public testEncodePrimitiveIntegerPost(body: number, _options?: Configuration): Promise { + public testEncodePrimitiveIntegerPost(body: number, _options?: Configuration | Middleware[]): Promise { const result = this.api.testEncodePrimitiveIntegerPost(body, _options); return result.toPromise(); } @@ -468,7 +469,7 @@ export class PromiseDefaultApi { /** * @param body */ - public testEncodePrimitiveNumberPostWithHttpInfo(body: number, _options?: Configuration): Promise> { + public testEncodePrimitiveNumberPostWithHttpInfo(body: number, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testEncodePrimitiveNumberPostWithHttpInfo(body, _options); return result.toPromise(); } @@ -476,7 +477,7 @@ export class PromiseDefaultApi { /** * @param body */ - public testEncodePrimitiveNumberPost(body: number, _options?: Configuration): Promise { + public testEncodePrimitiveNumberPost(body: number, _options?: Configuration | Middleware[]): Promise { const result = this.api.testEncodePrimitiveNumberPost(body, _options); return result.toPromise(); } @@ -484,7 +485,7 @@ export class PromiseDefaultApi { /** * @param body */ - public testEncodePrimitiveStringPostWithHttpInfo(body: string, _options?: Configuration): Promise> { + public testEncodePrimitiveStringPostWithHttpInfo(body: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testEncodePrimitiveStringPostWithHttpInfo(body, _options); return result.toPromise(); } @@ -492,7 +493,7 @@ export class PromiseDefaultApi { /** * @param body */ - public testEncodePrimitiveStringPost(body: string, _options?: Configuration): Promise { + public testEncodePrimitiveStringPost(body: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.testEncodePrimitiveStringPost(body, _options); return result.toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/browser/apis/PetApi.ts b/samples/openapi3/client/petstore/typescript/builds/browser/apis/PetApi.ts index b8a08514c5c6..c83eeae27060 100644 --- a/samples/openapi3/client/petstore/typescript/builds/browser/apis/PetApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/browser/apis/PetApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; @@ -21,8 +22,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public async addPet(pet: Pet, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async addPet(pet: Pet, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'pet' is not null or undefined if (pet === null || pet === undefined) { @@ -58,7 +62,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -72,8 +76,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param petId Pet id to delete * @param apiKey */ - public async deletePet(petId: number, apiKey?: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -101,7 +108,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -114,8 +121,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'status' is not null or undefined if (status === null || status === undefined) { @@ -143,7 +153,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -156,8 +166,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Finds Pets by tags * @param tags Tags to filter by */ - public async findPetsByTags(tags: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'tags' is not null or undefined if (tags === null || tags === undefined) { @@ -185,7 +198,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -198,8 +211,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Find pet by ID * @param petId ID of pet to return */ - public async getPetById(petId: number, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getPetById(petId: number, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -223,7 +239,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -236,8 +252,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public async updatePet(pet: Pet, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async updatePet(pet: Pet, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'pet' is not null or undefined if (pet === null || pet === undefined) { @@ -273,7 +292,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -288,8 +307,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param name Updated name of the pet * @param status Updated status of the pet */ - public async updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -344,7 +366,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -359,8 +381,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - public async uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -417,7 +442,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/browser/apis/StoreApi.ts b/samples/openapi3/client/petstore/typescript/builds/browser/apis/StoreApi.ts index 6474ad8a3044..8c55e2d1b6b6 100644 --- a/samples/openapi3/client/petstore/typescript/builds/browser/apis/StoreApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/browser/apis/StoreApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; @@ -20,8 +21,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public async deleteOrder(orderId: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'orderId' is not null or undefined if (orderId === null || orderId === undefined) { @@ -39,7 +43,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -51,8 +55,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public async getInventory(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getInventory(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/store/inventory'; @@ -69,7 +76,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -82,8 +89,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public async getOrderById(orderId: number, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getOrderById(orderId: number, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'orderId' is not null or undefined if (orderId === null || orderId === undefined) { @@ -101,7 +111,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -114,8 +124,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Place an order for a pet * @param order order placed for purchasing the pet */ - public async placeOrder(order: Order, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async placeOrder(order: Order, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'order' is not null or undefined if (order === null || order === undefined) { @@ -143,7 +156,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/browser/apis/UserApi.ts b/samples/openapi3/client/petstore/typescript/builds/browser/apis/UserApi.ts index 70aee8ce5e2f..42f8058cac54 100644 --- a/samples/openapi3/client/petstore/typescript/builds/browser/apis/UserApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/browser/apis/UserApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; @@ -20,8 +21,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Create user * @param user Created user object */ - public async createUser(user: User, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async createUser(user: User, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'user' is not null or undefined if (user === null || user === undefined) { @@ -55,7 +59,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -68,8 +72,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Creates list of users with given input array * @param user List of user object */ - public async createUsersWithArrayInput(user: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'user' is not null or undefined if (user === null || user === undefined) { @@ -103,7 +110,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -116,8 +123,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Creates list of users with given input array * @param user List of user object */ - public async createUsersWithListInput(user: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'user' is not null or undefined if (user === null || user === undefined) { @@ -151,7 +161,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -164,8 +174,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Delete user * @param username The name that needs to be deleted */ - public async deleteUser(username: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async deleteUser(username: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -189,7 +202,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -202,8 +215,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public async getUserByName(username: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getUserByName(username: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -221,7 +237,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -235,8 +251,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * @param username The user name for login * @param password The password for login in clear text */ - public async loginUser(username: string, password: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -269,7 +288,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -281,8 +300,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * * Logs out current logged in user session */ - public async logoutUser(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async logoutUser(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/user/logout'; @@ -299,7 +321,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -313,8 +335,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * @param username name that need to be deleted * @param user Updated user object */ - public async updateUser(username: string, user: User, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -355,7 +380,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/browser/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/browser/types/ObjectParamAPI.ts index 568cc5c507b1..b1512d688646 100644 --- a/samples/openapi3/client/petstore/typescript/builds/browser/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/browser/types/ObjectParamAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { ApiResponse } from '../models/ApiResponse'; import { Category } from '../models/Category'; @@ -136,7 +137,7 @@ export class ObjectPetApi { * Add a new pet to the store * @param param the request object */ - public addPetWithHttpInfo(param: PetApiAddPetRequest, options?: Configuration): Promise> { + public addPetWithHttpInfo(param: PetApiAddPetRequest, options?: Configuration | Middleware[]): Promise> { return this.api.addPetWithHttpInfo(param.pet, options).toPromise(); } @@ -145,7 +146,7 @@ export class ObjectPetApi { * Add a new pet to the store * @param param the request object */ - public addPet(param: PetApiAddPetRequest, options?: Configuration): Promise { + public addPet(param: PetApiAddPetRequest, options?: Configuration | Middleware[]): Promise { return this.api.addPet(param.pet, options).toPromise(); } @@ -154,7 +155,7 @@ export class ObjectPetApi { * Deletes a pet * @param param the request object */ - public deletePetWithHttpInfo(param: PetApiDeletePetRequest, options?: Configuration): Promise> { + public deletePetWithHttpInfo(param: PetApiDeletePetRequest, options?: Configuration | Middleware[]): Promise> { return this.api.deletePetWithHttpInfo(param.petId, param.apiKey, options).toPromise(); } @@ -163,7 +164,7 @@ export class ObjectPetApi { * Deletes a pet * @param param the request object */ - public deletePet(param: PetApiDeletePetRequest, options?: Configuration): Promise { + public deletePet(param: PetApiDeletePetRequest, options?: Configuration | Middleware[]): Promise { return this.api.deletePet(param.petId, param.apiKey, options).toPromise(); } @@ -172,7 +173,7 @@ export class ObjectPetApi { * Finds Pets by status * @param param the request object */ - public findPetsByStatusWithHttpInfo(param: PetApiFindPetsByStatusRequest, options?: Configuration): Promise>> { + public findPetsByStatusWithHttpInfo(param: PetApiFindPetsByStatusRequest, options?: Configuration | Middleware[]): Promise>> { return this.api.findPetsByStatusWithHttpInfo(param.status, options).toPromise(); } @@ -181,7 +182,7 @@ export class ObjectPetApi { * Finds Pets by status * @param param the request object */ - public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration): Promise> { + public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration | Middleware[]): Promise> { return this.api.findPetsByStatus(param.status, options).toPromise(); } @@ -190,7 +191,7 @@ export class ObjectPetApi { * Finds Pets by tags * @param param the request object */ - public findPetsByTagsWithHttpInfo(param: PetApiFindPetsByTagsRequest, options?: Configuration): Promise>> { + public findPetsByTagsWithHttpInfo(param: PetApiFindPetsByTagsRequest, options?: Configuration | Middleware[]): Promise>> { return this.api.findPetsByTagsWithHttpInfo(param.tags, options).toPromise(); } @@ -199,7 +200,7 @@ export class ObjectPetApi { * Finds Pets by tags * @param param the request object */ - public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration): Promise> { + public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration | Middleware[]): Promise> { return this.api.findPetsByTags(param.tags, options).toPromise(); } @@ -208,7 +209,7 @@ export class ObjectPetApi { * Find pet by ID * @param param the request object */ - public getPetByIdWithHttpInfo(param: PetApiGetPetByIdRequest, options?: Configuration): Promise> { + public getPetByIdWithHttpInfo(param: PetApiGetPetByIdRequest, options?: Configuration | Middleware[]): Promise> { return this.api.getPetByIdWithHttpInfo(param.petId, options).toPromise(); } @@ -217,7 +218,7 @@ export class ObjectPetApi { * Find pet by ID * @param param the request object */ - public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration): Promise { + public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration | Middleware[]): Promise { return this.api.getPetById(param.petId, options).toPromise(); } @@ -226,7 +227,7 @@ export class ObjectPetApi { * Update an existing pet * @param param the request object */ - public updatePetWithHttpInfo(param: PetApiUpdatePetRequest, options?: Configuration): Promise> { + public updatePetWithHttpInfo(param: PetApiUpdatePetRequest, options?: Configuration | Middleware[]): Promise> { return this.api.updatePetWithHttpInfo(param.pet, options).toPromise(); } @@ -235,7 +236,7 @@ export class ObjectPetApi { * Update an existing pet * @param param the request object */ - public updatePet(param: PetApiUpdatePetRequest, options?: Configuration): Promise { + public updatePet(param: PetApiUpdatePetRequest, options?: Configuration | Middleware[]): Promise { return this.api.updatePet(param.pet, options).toPromise(); } @@ -244,7 +245,7 @@ export class ObjectPetApi { * Updates a pet in the store with form data * @param param the request object */ - public updatePetWithFormWithHttpInfo(param: PetApiUpdatePetWithFormRequest, options?: Configuration): Promise> { + public updatePetWithFormWithHttpInfo(param: PetApiUpdatePetWithFormRequest, options?: Configuration | Middleware[]): Promise> { return this.api.updatePetWithFormWithHttpInfo(param.petId, param.name, param.status, options).toPromise(); } @@ -253,7 +254,7 @@ export class ObjectPetApi { * Updates a pet in the store with form data * @param param the request object */ - public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration): Promise { + public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration | Middleware[]): Promise { return this.api.updatePetWithForm(param.petId, param.name, param.status, options).toPromise(); } @@ -262,7 +263,7 @@ export class ObjectPetApi { * uploads an image * @param param the request object */ - public uploadFileWithHttpInfo(param: PetApiUploadFileRequest, options?: Configuration): Promise> { + public uploadFileWithHttpInfo(param: PetApiUploadFileRequest, options?: Configuration | Middleware[]): Promise> { return this.api.uploadFileWithHttpInfo(param.petId, param.additionalMetadata, param.file, options).toPromise(); } @@ -271,7 +272,7 @@ export class ObjectPetApi { * uploads an image * @param param the request object */ - public uploadFile(param: PetApiUploadFileRequest, options?: Configuration): Promise { + public uploadFile(param: PetApiUploadFileRequest, options?: Configuration | Middleware[]): Promise { return this.api.uploadFile(param.petId, param.additionalMetadata, param.file, options).toPromise(); } @@ -326,7 +327,7 @@ export class ObjectStoreApi { * Delete purchase order by ID * @param param the request object */ - public deleteOrderWithHttpInfo(param: StoreApiDeleteOrderRequest, options?: Configuration): Promise> { + public deleteOrderWithHttpInfo(param: StoreApiDeleteOrderRequest, options?: Configuration | Middleware[]): Promise> { return this.api.deleteOrderWithHttpInfo(param.orderId, options).toPromise(); } @@ -335,7 +336,7 @@ export class ObjectStoreApi { * Delete purchase order by ID * @param param the request object */ - public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration): Promise { + public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration | Middleware[]): Promise { return this.api.deleteOrder(param.orderId, options).toPromise(); } @@ -344,7 +345,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventoryWithHttpInfo(param: StoreApiGetInventoryRequest = {}, options?: Configuration): Promise> { + public getInventoryWithHttpInfo(param: StoreApiGetInventoryRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.getInventoryWithHttpInfo( options).toPromise(); } @@ -353,7 +354,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration): Promise<{ [key: string]: number; }> { + public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { return this.api.getInventory( options).toPromise(); } @@ -362,7 +363,7 @@ export class ObjectStoreApi { * Find purchase order by ID * @param param the request object */ - public getOrderByIdWithHttpInfo(param: StoreApiGetOrderByIdRequest, options?: Configuration): Promise> { + public getOrderByIdWithHttpInfo(param: StoreApiGetOrderByIdRequest, options?: Configuration | Middleware[]): Promise> { return this.api.getOrderByIdWithHttpInfo(param.orderId, options).toPromise(); } @@ -371,7 +372,7 @@ export class ObjectStoreApi { * Find purchase order by ID * @param param the request object */ - public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration): Promise { + public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration | Middleware[]): Promise { return this.api.getOrderById(param.orderId, options).toPromise(); } @@ -380,7 +381,7 @@ export class ObjectStoreApi { * Place an order for a pet * @param param the request object */ - public placeOrderWithHttpInfo(param: StoreApiPlaceOrderRequest, options?: Configuration): Promise> { + public placeOrderWithHttpInfo(param: StoreApiPlaceOrderRequest, options?: Configuration | Middleware[]): Promise> { return this.api.placeOrderWithHttpInfo(param.order, options).toPromise(); } @@ -389,7 +390,7 @@ export class ObjectStoreApi { * Place an order for a pet * @param param the request object */ - public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration): Promise { + public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration | Middleware[]): Promise { return this.api.placeOrder(param.order, options).toPromise(); } @@ -493,7 +494,7 @@ export class ObjectUserApi { * Create user * @param param the request object */ - public createUserWithHttpInfo(param: UserApiCreateUserRequest, options?: Configuration): Promise> { + public createUserWithHttpInfo(param: UserApiCreateUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.createUserWithHttpInfo(param.user, options).toPromise(); } @@ -502,7 +503,7 @@ export class ObjectUserApi { * Create user * @param param the request object */ - public createUser(param: UserApiCreateUserRequest, options?: Configuration): Promise { + public createUser(param: UserApiCreateUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.createUser(param.user, options).toPromise(); } @@ -511,7 +512,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithArrayInputWithHttpInfo(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration): Promise> { + public createUsersWithArrayInputWithHttpInfo(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration | Middleware[]): Promise> { return this.api.createUsersWithArrayInputWithHttpInfo(param.user, options).toPromise(); } @@ -520,7 +521,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration): Promise { + public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration | Middleware[]): Promise { return this.api.createUsersWithArrayInput(param.user, options).toPromise(); } @@ -529,7 +530,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithListInputWithHttpInfo(param: UserApiCreateUsersWithListInputRequest, options?: Configuration): Promise> { + public createUsersWithListInputWithHttpInfo(param: UserApiCreateUsersWithListInputRequest, options?: Configuration | Middleware[]): Promise> { return this.api.createUsersWithListInputWithHttpInfo(param.user, options).toPromise(); } @@ -538,7 +539,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration): Promise { + public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration | Middleware[]): Promise { return this.api.createUsersWithListInput(param.user, options).toPromise(); } @@ -547,7 +548,7 @@ export class ObjectUserApi { * Delete user * @param param the request object */ - public deleteUserWithHttpInfo(param: UserApiDeleteUserRequest, options?: Configuration): Promise> { + public deleteUserWithHttpInfo(param: UserApiDeleteUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.deleteUserWithHttpInfo(param.username, options).toPromise(); } @@ -556,7 +557,7 @@ export class ObjectUserApi { * Delete user * @param param the request object */ - public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration): Promise { + public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.deleteUser(param.username, options).toPromise(); } @@ -565,7 +566,7 @@ export class ObjectUserApi { * Get user by user name * @param param the request object */ - public getUserByNameWithHttpInfo(param: UserApiGetUserByNameRequest, options?: Configuration): Promise> { + public getUserByNameWithHttpInfo(param: UserApiGetUserByNameRequest, options?: Configuration | Middleware[]): Promise> { return this.api.getUserByNameWithHttpInfo(param.username, options).toPromise(); } @@ -574,7 +575,7 @@ export class ObjectUserApi { * Get user by user name * @param param the request object */ - public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration): Promise { + public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration | Middleware[]): Promise { return this.api.getUserByName(param.username, options).toPromise(); } @@ -583,7 +584,7 @@ export class ObjectUserApi { * Logs user into the system * @param param the request object */ - public loginUserWithHttpInfo(param: UserApiLoginUserRequest, options?: Configuration): Promise> { + public loginUserWithHttpInfo(param: UserApiLoginUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.loginUserWithHttpInfo(param.username, param.password, options).toPromise(); } @@ -592,7 +593,7 @@ export class ObjectUserApi { * Logs user into the system * @param param the request object */ - public loginUser(param: UserApiLoginUserRequest, options?: Configuration): Promise { + public loginUser(param: UserApiLoginUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.loginUser(param.username, param.password, options).toPromise(); } @@ -601,7 +602,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUserWithHttpInfo(param: UserApiLogoutUserRequest = {}, options?: Configuration): Promise> { + public logoutUserWithHttpInfo(param: UserApiLogoutUserRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.logoutUserWithHttpInfo( options).toPromise(); } @@ -610,7 +611,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration): Promise { + public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.logoutUser( options).toPromise(); } @@ -619,7 +620,7 @@ export class ObjectUserApi { * Updated user * @param param the request object */ - public updateUserWithHttpInfo(param: UserApiUpdateUserRequest, options?: Configuration): Promise> { + public updateUserWithHttpInfo(param: UserApiUpdateUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.updateUserWithHttpInfo(param.username, param.user, options).toPromise(); } @@ -628,7 +629,7 @@ export class ObjectUserApi { * Updated user * @param param the request object */ - public updateUser(param: UserApiUpdateUserRequest, options?: Configuration): Promise { + public updateUser(param: UserApiUpdateUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.updateUser(param.username, param.user, options).toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/browser/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/browser/types/ObservableAPI.ts index f344144c8b37..585735aa7842 100644 --- a/samples/openapi3/client/petstore/typescript/builds/browser/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/browser/types/ObservableAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { Observable, of, from } from '../rxjsStub'; import {mergeMap, map} from '../rxjsStub'; import { ApiResponse } from '../models/ApiResponse'; @@ -30,12 +31,21 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(pet: Pet, _options?: Configuration): Observable> { + public addPetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.addPet(pet, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -54,7 +64,7 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration): Observable { + public addPet(pet: Pet, _options?: Configuration | Middleware[]): Observable { return this.addPetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -64,12 +74,21 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration): Observable> { + public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.deletePet(petId, apiKey, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -89,7 +108,7 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration): Observable { + public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable { return this.deletePetWithHttpInfo(petId, apiKey, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -98,12 +117,21 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Observable>> { + public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable>> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.findPetsByStatus(status, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -122,7 +150,7 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Observable> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable> { return this.findPetsByStatusWithHttpInfo(status, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -131,12 +159,21 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration): Observable>> { + public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | Middleware[]): Observable>> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.findPetsByTags(tags, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -155,7 +192,7 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration): Observable> { + public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Observable> { return this.findPetsByTagsWithHttpInfo(tags, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -164,12 +201,21 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, _options?: Configuration): Observable> { + public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getPetById(petId, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -188,7 +234,7 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration): Observable { + public getPetById(petId: number, _options?: Configuration | Middleware[]): Observable { return this.getPetByIdWithHttpInfo(petId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -197,12 +243,21 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(pet: Pet, _options?: Configuration): Observable> { + public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.updatePet(pet, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -221,7 +276,7 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration): Observable { + public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Observable { return this.updatePetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -232,12 +287,21 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration): Observable> { + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.updatePetWithForm(petId, name, status, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -258,7 +322,7 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable { return this.updatePetWithFormWithHttpInfo(petId, name, status, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -269,12 +333,21 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Observable> { + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.uploadFile(petId, additionalMetadata, file, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -295,7 +368,7 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable { return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -322,12 +395,21 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration): Observable> { + public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.deleteOrder(orderId, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -346,7 +428,7 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration): Observable { + public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Observable { return this.deleteOrderWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -354,12 +436,21 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventoryWithHttpInfo(_options?: Configuration): Observable> { + public getInventoryWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getInventory(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -377,7 +468,7 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration): Observable<{ [key: string]: number; }> { + public getInventory(_options?: Configuration | Middleware[]): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo<{ [key: string]: number; }>) => apiResponse.data)); } @@ -386,12 +477,21 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration): Observable> { + public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getOrderById(orderId, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -410,7 +510,7 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration): Observable { + public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Observable { return this.getOrderByIdWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -419,12 +519,21 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(order: Order, _options?: Configuration): Observable> { + public placeOrderWithHttpInfo(order: Order, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.placeOrder(order, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -443,7 +552,7 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration): Observable { + public placeOrder(order: Order, _options?: Configuration | Middleware[]): Observable { return this.placeOrderWithHttpInfo(order, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -470,12 +579,21 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUserWithHttpInfo(user: User, _options?: Configuration): Observable> { + public createUserWithHttpInfo(user: User, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.createUser(user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -494,7 +612,7 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration): Observable { + public createUser(user: User, _options?: Configuration | Middleware[]): Observable { return this.createUserWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -503,12 +621,21 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration): Observable> { + public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.createUsersWithArrayInput(user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -527,7 +654,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration): Observable { + public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Observable { return this.createUsersWithArrayInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -536,12 +663,21 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration): Observable> { + public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.createUsersWithListInput(user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -560,7 +696,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration): Observable { + public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Observable { return this.createUsersWithListInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -569,12 +705,21 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, _options?: Configuration): Observable> { + public deleteUserWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.deleteUser(username, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -593,7 +738,7 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration): Observable { + public deleteUser(username: string, _options?: Configuration | Middleware[]): Observable { return this.deleteUserWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -602,12 +747,21 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, _options?: Configuration): Observable> { + public getUserByNameWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getUserByName(username, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -626,7 +780,7 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration): Observable { + public getUserByName(username: string, _options?: Configuration | Middleware[]): Observable { return this.getUserByNameWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -636,12 +790,21 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration): Observable> { + public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.loginUser(username, password, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -661,7 +824,7 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration): Observable { + public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Observable { return this.loginUserWithHttpInfo(username, password, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -669,12 +832,21 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUserWithHttpInfo(_options?: Configuration): Observable> { + public logoutUserWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.logoutUser(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -692,7 +864,7 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration): Observable { + public logoutUser(_options?: Configuration | Middleware[]): Observable { return this.logoutUserWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -702,12 +874,21 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration): Observable> { + public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.updateUser(username, user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -727,7 +908,7 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration): Observable { + public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Observable { return this.updateUserWithHttpInfo(username, user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/openapi3/client/petstore/typescript/builds/browser/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/browser/types/PromiseAPI.ts index 55af604f4659..d74bd8f9e572 100644 --- a/samples/openapi3/client/petstore/typescript/builds/browser/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/browser/types/PromiseAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { ApiResponse } from '../models/ApiResponse'; import { Category } from '../models/Category'; @@ -26,7 +27,7 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(pet: Pet, _options?: Configuration): Promise> { + public addPetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { const result = this.api.addPetWithHttpInfo(pet, _options); return result.toPromise(); } @@ -36,7 +37,7 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration): Promise { + public addPet(pet: Pet, _options?: Configuration | Middleware[]): Promise { const result = this.api.addPet(pet, _options); return result.toPromise(); } @@ -47,7 +48,7 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration): Promise> { + public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.deletePetWithHttpInfo(petId, apiKey, _options); return result.toPromise(); } @@ -58,7 +59,7 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration): Promise { + public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.deletePet(petId, apiKey, _options); return result.toPromise(); } @@ -68,7 +69,7 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise>> { + public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise>> { const result = this.api.findPetsByStatusWithHttpInfo(status, _options); return result.toPromise(); } @@ -78,7 +79,7 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise> { const result = this.api.findPetsByStatus(status, _options); return result.toPromise(); } @@ -88,7 +89,7 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration): Promise>> { + public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | Middleware[]): Promise>> { const result = this.api.findPetsByTagsWithHttpInfo(tags, _options); return result.toPromise(); } @@ -98,7 +99,7 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration): Promise> { + public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.findPetsByTags(tags, _options); return result.toPromise(); } @@ -108,7 +109,7 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, _options?: Configuration): Promise> { + public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | Middleware[]): Promise> { const result = this.api.getPetByIdWithHttpInfo(petId, _options); return result.toPromise(); } @@ -118,7 +119,7 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration): Promise { + public getPetById(petId: number, _options?: Configuration | Middleware[]): Promise { const result = this.api.getPetById(petId, _options); return result.toPromise(); } @@ -128,7 +129,7 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(pet: Pet, _options?: Configuration): Promise> { + public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { const result = this.api.updatePetWithHttpInfo(pet, _options); return result.toPromise(); } @@ -138,7 +139,7 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration): Promise { + public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Promise { const result = this.api.updatePet(pet, _options); return result.toPromise(); } @@ -150,7 +151,7 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration): Promise> { + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.updatePetWithFormWithHttpInfo(petId, name, status, _options); return result.toPromise(); } @@ -162,7 +163,7 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Promise { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.updatePetWithForm(petId, name, status, _options); return result.toPromise(); } @@ -174,7 +175,7 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise> { + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise> { const result = this.api.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options); return result.toPromise(); } @@ -186,7 +187,7 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise { const result = this.api.uploadFile(petId, additionalMetadata, file, _options); return result.toPromise(); } @@ -215,7 +216,7 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration): Promise> { + public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.deleteOrderWithHttpInfo(orderId, _options); return result.toPromise(); } @@ -225,7 +226,7 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration): Promise { + public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.deleteOrder(orderId, _options); return result.toPromise(); } @@ -234,7 +235,7 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventoryWithHttpInfo(_options?: Configuration): Promise> { + public getInventoryWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.getInventoryWithHttpInfo(_options); return result.toPromise(); } @@ -243,7 +244,7 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration): Promise<{ [key: string]: number; }> { + public getInventory(_options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { const result = this.api.getInventory(_options); return result.toPromise(); } @@ -253,7 +254,7 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration): Promise> { + public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | Middleware[]): Promise> { const result = this.api.getOrderByIdWithHttpInfo(orderId, _options); return result.toPromise(); } @@ -263,7 +264,7 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration): Promise { + public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Promise { const result = this.api.getOrderById(orderId, _options); return result.toPromise(); } @@ -273,7 +274,7 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(order: Order, _options?: Configuration): Promise> { + public placeOrderWithHttpInfo(order: Order, _options?: Configuration | Middleware[]): Promise> { const result = this.api.placeOrderWithHttpInfo(order, _options); return result.toPromise(); } @@ -283,7 +284,7 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration): Promise { + public placeOrder(order: Order, _options?: Configuration | Middleware[]): Promise { const result = this.api.placeOrder(order, _options); return result.toPromise(); } @@ -312,7 +313,7 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUserWithHttpInfo(user: User, _options?: Configuration): Promise> { + public createUserWithHttpInfo(user: User, _options?: Configuration | Middleware[]): Promise> { const result = this.api.createUserWithHttpInfo(user, _options); return result.toPromise(); } @@ -322,7 +323,7 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration): Promise { + public createUser(user: User, _options?: Configuration | Middleware[]): Promise { const result = this.api.createUser(user, _options); return result.toPromise(); } @@ -332,7 +333,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration): Promise> { + public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.createUsersWithArrayInputWithHttpInfo(user, _options); return result.toPromise(); } @@ -342,7 +343,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration): Promise { + public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Promise { const result = this.api.createUsersWithArrayInput(user, _options); return result.toPromise(); } @@ -352,7 +353,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration): Promise> { + public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.createUsersWithListInputWithHttpInfo(user, _options); return result.toPromise(); } @@ -362,7 +363,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration): Promise { + public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Promise { const result = this.api.createUsersWithListInput(user, _options); return result.toPromise(); } @@ -372,7 +373,7 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, _options?: Configuration): Promise> { + public deleteUserWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.deleteUserWithHttpInfo(username, _options); return result.toPromise(); } @@ -382,7 +383,7 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration): Promise { + public deleteUser(username: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.deleteUser(username, _options); return result.toPromise(); } @@ -392,7 +393,7 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, _options?: Configuration): Promise> { + public getUserByNameWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.getUserByNameWithHttpInfo(username, _options); return result.toPromise(); } @@ -402,7 +403,7 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration): Promise { + public getUserByName(username: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.getUserByName(username, _options); return result.toPromise(); } @@ -413,7 +414,7 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration): Promise> { + public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.loginUserWithHttpInfo(username, password, _options); return result.toPromise(); } @@ -424,7 +425,7 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration): Promise { + public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.loginUser(username, password, _options); return result.toPromise(); } @@ -433,7 +434,7 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUserWithHttpInfo(_options?: Configuration): Promise> { + public logoutUserWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.logoutUserWithHttpInfo(_options); return result.toPromise(); } @@ -442,7 +443,7 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration): Promise { + public logoutUser(_options?: Configuration | Middleware[]): Promise { const result = this.api.logoutUser(_options); return result.toPromise(); } @@ -453,7 +454,7 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration): Promise> { + public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | Middleware[]): Promise> { const result = this.api.updateUserWithHttpInfo(username, user, _options); return result.toPromise(); } @@ -464,7 +465,7 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration): Promise { + public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Promise { const result = this.api.updateUser(username, user, _options); return result.toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/apis/DefaultApi.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/apis/DefaultApi.ts index 6cb63372a676..d9b98d86bb38 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/apis/DefaultApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/apis/DefaultApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; @@ -20,8 +21,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** * @param filePostRequest */ - public async filePost(filePostRequest?: FilePostRequest, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async filePost(filePostRequest?: FilePostRequest, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params @@ -44,7 +48,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -55,8 +59,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** * @param petsFilteredPatchRequest */ - public async petsFilteredPatch(petsFilteredPatchRequest?: PetsFilteredPatchRequest, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async petsFilteredPatch(petsFilteredPatchRequest?: PetsFilteredPatchRequest, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params @@ -79,7 +86,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -90,8 +97,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** * @param petsPatchRequest */ - public async petsPatch(petsPatchRequest?: PetsPatchRequest, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async petsPatch(petsPatchRequest?: PetsPatchRequest, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params @@ -114,7 +124,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObjectParamAPI.ts index 0ec652e36598..7f87fa41cd73 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObjectParamAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { Cat } from '../models/Cat'; import { Dog } from '../models/Dog'; @@ -49,42 +50,42 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public filePostWithHttpInfo(param: DefaultApiFilePostRequest = {}, options?: Configuration): Promise> { + public filePostWithHttpInfo(param: DefaultApiFilePostRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.filePostWithHttpInfo(param.filePostRequest, options).toPromise(); } /** * @param param the request object */ - public filePost(param: DefaultApiFilePostRequest = {}, options?: Configuration): Promise { + public filePost(param: DefaultApiFilePostRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.filePost(param.filePostRequest, options).toPromise(); } /** * @param param the request object */ - public petsFilteredPatchWithHttpInfo(param: DefaultApiPetsFilteredPatchRequest = {}, options?: Configuration): Promise> { + public petsFilteredPatchWithHttpInfo(param: DefaultApiPetsFilteredPatchRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.petsFilteredPatchWithHttpInfo(param.petsFilteredPatchRequest, options).toPromise(); } /** * @param param the request object */ - public petsFilteredPatch(param: DefaultApiPetsFilteredPatchRequest = {}, options?: Configuration): Promise { + public petsFilteredPatch(param: DefaultApiPetsFilteredPatchRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.petsFilteredPatch(param.petsFilteredPatchRequest, options).toPromise(); } /** * @param param the request object */ - public petsPatchWithHttpInfo(param: DefaultApiPetsPatchRequest = {}, options?: Configuration): Promise> { + public petsPatchWithHttpInfo(param: DefaultApiPetsPatchRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.petsPatchWithHttpInfo(param.petsPatchRequest, options).toPromise(); } /** * @param param the request object */ - public petsPatch(param: DefaultApiPetsPatchRequest = {}, options?: Configuration): Promise { + public petsPatch(param: DefaultApiPetsPatchRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.petsPatch(param.petsPatchRequest, options).toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObservableAPI.ts index a8436e102d79..4213bfc97be8 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObservableAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { Observable, of, from } from '../rxjsStub'; import {mergeMap, map} from '../rxjsStub'; import { Cat } from '../models/Cat'; @@ -29,12 +30,21 @@ export class ObservableDefaultApi { /** * @param [filePostRequest] */ - public filePostWithHttpInfo(filePostRequest?: FilePostRequest, _options?: Configuration): Observable> { + public filePostWithHttpInfo(filePostRequest?: FilePostRequest, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.filePost(filePostRequest, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -51,19 +61,28 @@ export class ObservableDefaultApi { /** * @param [filePostRequest] */ - public filePost(filePostRequest?: FilePostRequest, _options?: Configuration): Observable { + public filePost(filePostRequest?: FilePostRequest, _options?: Configuration | Middleware[]): Observable { return this.filePostWithHttpInfo(filePostRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** * @param [petsFilteredPatchRequest] */ - public petsFilteredPatchWithHttpInfo(petsFilteredPatchRequest?: PetsFilteredPatchRequest, _options?: Configuration): Observable> { + public petsFilteredPatchWithHttpInfo(petsFilteredPatchRequest?: PetsFilteredPatchRequest, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.petsFilteredPatch(petsFilteredPatchRequest, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -80,19 +99,28 @@ export class ObservableDefaultApi { /** * @param [petsFilteredPatchRequest] */ - public petsFilteredPatch(petsFilteredPatchRequest?: PetsFilteredPatchRequest, _options?: Configuration): Observable { + public petsFilteredPatch(petsFilteredPatchRequest?: PetsFilteredPatchRequest, _options?: Configuration | Middleware[]): Observable { return this.petsFilteredPatchWithHttpInfo(petsFilteredPatchRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** * @param [petsPatchRequest] */ - public petsPatchWithHttpInfo(petsPatchRequest?: PetsPatchRequest, _options?: Configuration): Observable> { + public petsPatchWithHttpInfo(petsPatchRequest?: PetsPatchRequest, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.petsPatch(petsPatchRequest, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -109,7 +137,7 @@ export class ObservableDefaultApi { /** * @param [petsPatchRequest] */ - public petsPatch(petsPatchRequest?: PetsPatchRequest, _options?: Configuration): Observable { + public petsPatch(petsPatchRequest?: PetsPatchRequest, _options?: Configuration | Middleware[]): Observable { return this.petsPatchWithHttpInfo(petsPatchRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/PromiseAPI.ts index 44bd0126291b..ce68b9a7d35b 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/PromiseAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { Cat } from '../models/Cat'; import { Dog } from '../models/Dog'; @@ -25,7 +26,7 @@ export class PromiseDefaultApi { /** * @param [filePostRequest] */ - public filePostWithHttpInfo(filePostRequest?: FilePostRequest, _options?: Configuration): Promise> { + public filePostWithHttpInfo(filePostRequest?: FilePostRequest, _options?: Configuration | Middleware[]): Promise> { const result = this.api.filePostWithHttpInfo(filePostRequest, _options); return result.toPromise(); } @@ -33,7 +34,7 @@ export class PromiseDefaultApi { /** * @param [filePostRequest] */ - public filePost(filePostRequest?: FilePostRequest, _options?: Configuration): Promise { + public filePost(filePostRequest?: FilePostRequest, _options?: Configuration | Middleware[]): Promise { const result = this.api.filePost(filePostRequest, _options); return result.toPromise(); } @@ -41,7 +42,7 @@ export class PromiseDefaultApi { /** * @param [petsFilteredPatchRequest] */ - public petsFilteredPatchWithHttpInfo(petsFilteredPatchRequest?: PetsFilteredPatchRequest, _options?: Configuration): Promise> { + public petsFilteredPatchWithHttpInfo(petsFilteredPatchRequest?: PetsFilteredPatchRequest, _options?: Configuration | Middleware[]): Promise> { const result = this.api.petsFilteredPatchWithHttpInfo(petsFilteredPatchRequest, _options); return result.toPromise(); } @@ -49,7 +50,7 @@ export class PromiseDefaultApi { /** * @param [petsFilteredPatchRequest] */ - public petsFilteredPatch(petsFilteredPatchRequest?: PetsFilteredPatchRequest, _options?: Configuration): Promise { + public petsFilteredPatch(petsFilteredPatchRequest?: PetsFilteredPatchRequest, _options?: Configuration | Middleware[]): Promise { const result = this.api.petsFilteredPatch(petsFilteredPatchRequest, _options); return result.toPromise(); } @@ -57,7 +58,7 @@ export class PromiseDefaultApi { /** * @param [petsPatchRequest] */ - public petsPatchWithHttpInfo(petsPatchRequest?: PetsPatchRequest, _options?: Configuration): Promise> { + public petsPatchWithHttpInfo(petsPatchRequest?: PetsPatchRequest, _options?: Configuration | Middleware[]): Promise> { const result = this.api.petsPatchWithHttpInfo(petsPatchRequest, _options); return result.toPromise(); } @@ -65,7 +66,7 @@ export class PromiseDefaultApi { /** * @param [petsPatchRequest] */ - public petsPatch(petsPatchRequest?: PetsPatchRequest, _options?: Configuration): Promise { + public petsPatch(petsPatchRequest?: PetsPatchRequest, _options?: Configuration | Middleware[]): Promise { const result = this.api.petsPatch(petsPatchRequest, _options); return result.toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/apis/PetApi.ts b/samples/openapi3/client/petstore/typescript/builds/default/apis/PetApi.ts index 02f9d230affe..0799a319b3ca 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/apis/PetApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/apis/PetApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; @@ -23,8 +24,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public async addPet(pet: Pet, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async addPet(pet: Pet, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'pet' is not null or undefined if (pet === null || pet === undefined) { @@ -60,7 +64,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -74,8 +78,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param petId Pet id to delete * @param apiKey */ - public async deletePet(petId: number, apiKey?: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -103,7 +110,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -116,8 +123,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'status' is not null or undefined if (status === null || status === undefined) { @@ -145,7 +155,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -158,8 +168,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Finds Pets by tags * @param tags Tags to filter by */ - public async findPetsByTags(tags: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'tags' is not null or undefined if (tags === null || tags === undefined) { @@ -187,7 +200,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -200,8 +213,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Find pet by ID * @param petId ID of pet to return */ - public async getPetById(petId: number, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getPetById(petId: number, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -225,7 +241,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -238,8 +254,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public async updatePet(pet: Pet, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async updatePet(pet: Pet, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'pet' is not null or undefined if (pet === null || pet === undefined) { @@ -275,7 +294,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -290,8 +309,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param name Updated name of the pet * @param status Updated status of the pet */ - public async updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -346,7 +368,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -361,8 +383,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - public async uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -419,7 +444,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/apis/StoreApi.ts b/samples/openapi3/client/petstore/typescript/builds/default/apis/StoreApi.ts index f4861af0df0c..77b19f3c02d8 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/apis/StoreApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/apis/StoreApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; @@ -22,8 +23,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public async deleteOrder(orderId: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'orderId' is not null or undefined if (orderId === null || orderId === undefined) { @@ -41,7 +45,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -53,8 +57,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public async getInventory(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getInventory(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/store/inventory'; @@ -71,7 +78,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -84,8 +91,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public async getOrderById(orderId: number, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getOrderById(orderId: number, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'orderId' is not null or undefined if (orderId === null || orderId === undefined) { @@ -103,7 +113,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -116,8 +126,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Place an order for a pet * @param order order placed for purchasing the pet */ - public async placeOrder(order: Order, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async placeOrder(order: Order, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'order' is not null or undefined if (order === null || order === undefined) { @@ -145,7 +158,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/apis/UserApi.ts b/samples/openapi3/client/petstore/typescript/builds/default/apis/UserApi.ts index b8f2c3313e26..abf735a140ff 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/apis/UserApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/apis/UserApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; @@ -22,8 +23,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Create user * @param user Created user object */ - public async createUser(user: User, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async createUser(user: User, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'user' is not null or undefined if (user === null || user === undefined) { @@ -57,7 +61,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -70,8 +74,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Creates list of users with given input array * @param user List of user object */ - public async createUsersWithArrayInput(user: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'user' is not null or undefined if (user === null || user === undefined) { @@ -105,7 +112,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -118,8 +125,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Creates list of users with given input array * @param user List of user object */ - public async createUsersWithListInput(user: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'user' is not null or undefined if (user === null || user === undefined) { @@ -153,7 +163,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -166,8 +176,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Delete user * @param username The name that needs to be deleted */ - public async deleteUser(username: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async deleteUser(username: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -191,7 +204,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -204,8 +217,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public async getUserByName(username: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getUserByName(username: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -223,7 +239,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -237,8 +253,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * @param username The user name for login * @param password The password for login in clear text */ - public async loginUser(username: string, password: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -271,7 +290,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -283,8 +302,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * * Logs out current logged in user session */ - public async logoutUser(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async logoutUser(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/user/logout'; @@ -301,7 +323,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -315,8 +337,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * @param username name that need to be deleted * @param user Updated user object */ - public async updateUser(username: string, user: User, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -357,7 +382,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/package-lock.json b/samples/openapi3/client/petstore/typescript/builds/default/package-lock.json index 284af0de81ad..3ef8c4edfcd5 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/package-lock.json +++ b/samples/openapi3/client/petstore/typescript/builds/default/package-lock.json @@ -13,11 +13,9 @@ "@types/node-fetch": "^2.5.7", "es6-promise": "^4.2.4", "form-data": "^2.5.0", - "node-fetch": "^2.6.0", - "url-parse": "^1.4.3" + "node-fetch": "^2.6.0" }, "devDependencies": { - "@types/url-parse": "1.4.4", "typescript": "^4.0" } }, @@ -48,12 +46,6 @@ "node": ">= 6" } }, - "node_modules/@types/url-parse": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/@types/url-parse/-/url-parse-1.4.4.tgz", - "integrity": "sha512-KtQLad12+4T/NfSxpoDhmr22+fig3T7/08QCgmutYA6QSznSRmEtuL95GrhVV40/0otTEdFc+etRcCTqhh1q5Q==", - "dev": true - }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -123,16 +115,6 @@ "node": "4.x || >=6.0.0" } }, - "node_modules/querystringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.0.tgz", - "integrity": "sha512-sluvZZ1YiTLD5jsqZcDmFyV2EwToyXZBfpoVOmktMmW+VEnhgakFHnasVph65fOjGPTWN0Nw3+XQaSeMayr0kg==" - }, - "node_modules/requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" - }, "node_modules/typescript": { "version": "4.7.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", @@ -145,15 +127,6 @@ "engines": { "node": ">=4.2.0" } - }, - "node_modules/url-parse": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.3.tgz", - "integrity": "sha512-rh+KuAW36YKo0vClhQzLLveoj8FwPJNu65xLb7Mrt+eZht0IPT0IXgSv8gcMegZ6NvjJUALf6Mf25POlMwD1Fw==", - "dependencies": { - "querystringify": "^2.0.0", - "requires-port": "^1.0.0" - } } }, "dependencies": { @@ -183,12 +156,6 @@ } } }, - "@types/url-parse": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/@types/url-parse/-/url-parse-1.4.4.tgz", - "integrity": "sha512-KtQLad12+4T/NfSxpoDhmr22+fig3T7/08QCgmutYA6QSznSRmEtuL95GrhVV40/0otTEdFc+etRcCTqhh1q5Q==", - "dev": true - }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -240,30 +207,11 @@ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" }, - "querystringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.0.tgz", - "integrity": "sha512-sluvZZ1YiTLD5jsqZcDmFyV2EwToyXZBfpoVOmktMmW+VEnhgakFHnasVph65fOjGPTWN0Nw3+XQaSeMayr0kg==" - }, - "requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" - }, "typescript": { "version": "4.7.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", "dev": true - }, - "url-parse": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.3.tgz", - "integrity": "sha512-rh+KuAW36YKo0vClhQzLLveoj8FwPJNu65xLb7Mrt+eZht0IPT0IXgSv8gcMegZ6NvjJUALf6Mf25POlMwD1Fw==", - "requires": { - "querystringify": "^2.0.0", - "requires-port": "^1.0.0" - } } } } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/default/types/ObjectParamAPI.ts index 568cc5c507b1..b1512d688646 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/types/ObjectParamAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { ApiResponse } from '../models/ApiResponse'; import { Category } from '../models/Category'; @@ -136,7 +137,7 @@ export class ObjectPetApi { * Add a new pet to the store * @param param the request object */ - public addPetWithHttpInfo(param: PetApiAddPetRequest, options?: Configuration): Promise> { + public addPetWithHttpInfo(param: PetApiAddPetRequest, options?: Configuration | Middleware[]): Promise> { return this.api.addPetWithHttpInfo(param.pet, options).toPromise(); } @@ -145,7 +146,7 @@ export class ObjectPetApi { * Add a new pet to the store * @param param the request object */ - public addPet(param: PetApiAddPetRequest, options?: Configuration): Promise { + public addPet(param: PetApiAddPetRequest, options?: Configuration | Middleware[]): Promise { return this.api.addPet(param.pet, options).toPromise(); } @@ -154,7 +155,7 @@ export class ObjectPetApi { * Deletes a pet * @param param the request object */ - public deletePetWithHttpInfo(param: PetApiDeletePetRequest, options?: Configuration): Promise> { + public deletePetWithHttpInfo(param: PetApiDeletePetRequest, options?: Configuration | Middleware[]): Promise> { return this.api.deletePetWithHttpInfo(param.petId, param.apiKey, options).toPromise(); } @@ -163,7 +164,7 @@ export class ObjectPetApi { * Deletes a pet * @param param the request object */ - public deletePet(param: PetApiDeletePetRequest, options?: Configuration): Promise { + public deletePet(param: PetApiDeletePetRequest, options?: Configuration | Middleware[]): Promise { return this.api.deletePet(param.petId, param.apiKey, options).toPromise(); } @@ -172,7 +173,7 @@ export class ObjectPetApi { * Finds Pets by status * @param param the request object */ - public findPetsByStatusWithHttpInfo(param: PetApiFindPetsByStatusRequest, options?: Configuration): Promise>> { + public findPetsByStatusWithHttpInfo(param: PetApiFindPetsByStatusRequest, options?: Configuration | Middleware[]): Promise>> { return this.api.findPetsByStatusWithHttpInfo(param.status, options).toPromise(); } @@ -181,7 +182,7 @@ export class ObjectPetApi { * Finds Pets by status * @param param the request object */ - public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration): Promise> { + public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration | Middleware[]): Promise> { return this.api.findPetsByStatus(param.status, options).toPromise(); } @@ -190,7 +191,7 @@ export class ObjectPetApi { * Finds Pets by tags * @param param the request object */ - public findPetsByTagsWithHttpInfo(param: PetApiFindPetsByTagsRequest, options?: Configuration): Promise>> { + public findPetsByTagsWithHttpInfo(param: PetApiFindPetsByTagsRequest, options?: Configuration | Middleware[]): Promise>> { return this.api.findPetsByTagsWithHttpInfo(param.tags, options).toPromise(); } @@ -199,7 +200,7 @@ export class ObjectPetApi { * Finds Pets by tags * @param param the request object */ - public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration): Promise> { + public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration | Middleware[]): Promise> { return this.api.findPetsByTags(param.tags, options).toPromise(); } @@ -208,7 +209,7 @@ export class ObjectPetApi { * Find pet by ID * @param param the request object */ - public getPetByIdWithHttpInfo(param: PetApiGetPetByIdRequest, options?: Configuration): Promise> { + public getPetByIdWithHttpInfo(param: PetApiGetPetByIdRequest, options?: Configuration | Middleware[]): Promise> { return this.api.getPetByIdWithHttpInfo(param.petId, options).toPromise(); } @@ -217,7 +218,7 @@ export class ObjectPetApi { * Find pet by ID * @param param the request object */ - public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration): Promise { + public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration | Middleware[]): Promise { return this.api.getPetById(param.petId, options).toPromise(); } @@ -226,7 +227,7 @@ export class ObjectPetApi { * Update an existing pet * @param param the request object */ - public updatePetWithHttpInfo(param: PetApiUpdatePetRequest, options?: Configuration): Promise> { + public updatePetWithHttpInfo(param: PetApiUpdatePetRequest, options?: Configuration | Middleware[]): Promise> { return this.api.updatePetWithHttpInfo(param.pet, options).toPromise(); } @@ -235,7 +236,7 @@ export class ObjectPetApi { * Update an existing pet * @param param the request object */ - public updatePet(param: PetApiUpdatePetRequest, options?: Configuration): Promise { + public updatePet(param: PetApiUpdatePetRequest, options?: Configuration | Middleware[]): Promise { return this.api.updatePet(param.pet, options).toPromise(); } @@ -244,7 +245,7 @@ export class ObjectPetApi { * Updates a pet in the store with form data * @param param the request object */ - public updatePetWithFormWithHttpInfo(param: PetApiUpdatePetWithFormRequest, options?: Configuration): Promise> { + public updatePetWithFormWithHttpInfo(param: PetApiUpdatePetWithFormRequest, options?: Configuration | Middleware[]): Promise> { return this.api.updatePetWithFormWithHttpInfo(param.petId, param.name, param.status, options).toPromise(); } @@ -253,7 +254,7 @@ export class ObjectPetApi { * Updates a pet in the store with form data * @param param the request object */ - public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration): Promise { + public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration | Middleware[]): Promise { return this.api.updatePetWithForm(param.petId, param.name, param.status, options).toPromise(); } @@ -262,7 +263,7 @@ export class ObjectPetApi { * uploads an image * @param param the request object */ - public uploadFileWithHttpInfo(param: PetApiUploadFileRequest, options?: Configuration): Promise> { + public uploadFileWithHttpInfo(param: PetApiUploadFileRequest, options?: Configuration | Middleware[]): Promise> { return this.api.uploadFileWithHttpInfo(param.petId, param.additionalMetadata, param.file, options).toPromise(); } @@ -271,7 +272,7 @@ export class ObjectPetApi { * uploads an image * @param param the request object */ - public uploadFile(param: PetApiUploadFileRequest, options?: Configuration): Promise { + public uploadFile(param: PetApiUploadFileRequest, options?: Configuration | Middleware[]): Promise { return this.api.uploadFile(param.petId, param.additionalMetadata, param.file, options).toPromise(); } @@ -326,7 +327,7 @@ export class ObjectStoreApi { * Delete purchase order by ID * @param param the request object */ - public deleteOrderWithHttpInfo(param: StoreApiDeleteOrderRequest, options?: Configuration): Promise> { + public deleteOrderWithHttpInfo(param: StoreApiDeleteOrderRequest, options?: Configuration | Middleware[]): Promise> { return this.api.deleteOrderWithHttpInfo(param.orderId, options).toPromise(); } @@ -335,7 +336,7 @@ export class ObjectStoreApi { * Delete purchase order by ID * @param param the request object */ - public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration): Promise { + public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration | Middleware[]): Promise { return this.api.deleteOrder(param.orderId, options).toPromise(); } @@ -344,7 +345,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventoryWithHttpInfo(param: StoreApiGetInventoryRequest = {}, options?: Configuration): Promise> { + public getInventoryWithHttpInfo(param: StoreApiGetInventoryRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.getInventoryWithHttpInfo( options).toPromise(); } @@ -353,7 +354,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration): Promise<{ [key: string]: number; }> { + public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { return this.api.getInventory( options).toPromise(); } @@ -362,7 +363,7 @@ export class ObjectStoreApi { * Find purchase order by ID * @param param the request object */ - public getOrderByIdWithHttpInfo(param: StoreApiGetOrderByIdRequest, options?: Configuration): Promise> { + public getOrderByIdWithHttpInfo(param: StoreApiGetOrderByIdRequest, options?: Configuration | Middleware[]): Promise> { return this.api.getOrderByIdWithHttpInfo(param.orderId, options).toPromise(); } @@ -371,7 +372,7 @@ export class ObjectStoreApi { * Find purchase order by ID * @param param the request object */ - public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration): Promise { + public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration | Middleware[]): Promise { return this.api.getOrderById(param.orderId, options).toPromise(); } @@ -380,7 +381,7 @@ export class ObjectStoreApi { * Place an order for a pet * @param param the request object */ - public placeOrderWithHttpInfo(param: StoreApiPlaceOrderRequest, options?: Configuration): Promise> { + public placeOrderWithHttpInfo(param: StoreApiPlaceOrderRequest, options?: Configuration | Middleware[]): Promise> { return this.api.placeOrderWithHttpInfo(param.order, options).toPromise(); } @@ -389,7 +390,7 @@ export class ObjectStoreApi { * Place an order for a pet * @param param the request object */ - public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration): Promise { + public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration | Middleware[]): Promise { return this.api.placeOrder(param.order, options).toPromise(); } @@ -493,7 +494,7 @@ export class ObjectUserApi { * Create user * @param param the request object */ - public createUserWithHttpInfo(param: UserApiCreateUserRequest, options?: Configuration): Promise> { + public createUserWithHttpInfo(param: UserApiCreateUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.createUserWithHttpInfo(param.user, options).toPromise(); } @@ -502,7 +503,7 @@ export class ObjectUserApi { * Create user * @param param the request object */ - public createUser(param: UserApiCreateUserRequest, options?: Configuration): Promise { + public createUser(param: UserApiCreateUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.createUser(param.user, options).toPromise(); } @@ -511,7 +512,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithArrayInputWithHttpInfo(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration): Promise> { + public createUsersWithArrayInputWithHttpInfo(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration | Middleware[]): Promise> { return this.api.createUsersWithArrayInputWithHttpInfo(param.user, options).toPromise(); } @@ -520,7 +521,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration): Promise { + public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration | Middleware[]): Promise { return this.api.createUsersWithArrayInput(param.user, options).toPromise(); } @@ -529,7 +530,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithListInputWithHttpInfo(param: UserApiCreateUsersWithListInputRequest, options?: Configuration): Promise> { + public createUsersWithListInputWithHttpInfo(param: UserApiCreateUsersWithListInputRequest, options?: Configuration | Middleware[]): Promise> { return this.api.createUsersWithListInputWithHttpInfo(param.user, options).toPromise(); } @@ -538,7 +539,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration): Promise { + public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration | Middleware[]): Promise { return this.api.createUsersWithListInput(param.user, options).toPromise(); } @@ -547,7 +548,7 @@ export class ObjectUserApi { * Delete user * @param param the request object */ - public deleteUserWithHttpInfo(param: UserApiDeleteUserRequest, options?: Configuration): Promise> { + public deleteUserWithHttpInfo(param: UserApiDeleteUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.deleteUserWithHttpInfo(param.username, options).toPromise(); } @@ -556,7 +557,7 @@ export class ObjectUserApi { * Delete user * @param param the request object */ - public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration): Promise { + public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.deleteUser(param.username, options).toPromise(); } @@ -565,7 +566,7 @@ export class ObjectUserApi { * Get user by user name * @param param the request object */ - public getUserByNameWithHttpInfo(param: UserApiGetUserByNameRequest, options?: Configuration): Promise> { + public getUserByNameWithHttpInfo(param: UserApiGetUserByNameRequest, options?: Configuration | Middleware[]): Promise> { return this.api.getUserByNameWithHttpInfo(param.username, options).toPromise(); } @@ -574,7 +575,7 @@ export class ObjectUserApi { * Get user by user name * @param param the request object */ - public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration): Promise { + public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration | Middleware[]): Promise { return this.api.getUserByName(param.username, options).toPromise(); } @@ -583,7 +584,7 @@ export class ObjectUserApi { * Logs user into the system * @param param the request object */ - public loginUserWithHttpInfo(param: UserApiLoginUserRequest, options?: Configuration): Promise> { + public loginUserWithHttpInfo(param: UserApiLoginUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.loginUserWithHttpInfo(param.username, param.password, options).toPromise(); } @@ -592,7 +593,7 @@ export class ObjectUserApi { * Logs user into the system * @param param the request object */ - public loginUser(param: UserApiLoginUserRequest, options?: Configuration): Promise { + public loginUser(param: UserApiLoginUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.loginUser(param.username, param.password, options).toPromise(); } @@ -601,7 +602,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUserWithHttpInfo(param: UserApiLogoutUserRequest = {}, options?: Configuration): Promise> { + public logoutUserWithHttpInfo(param: UserApiLogoutUserRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.logoutUserWithHttpInfo( options).toPromise(); } @@ -610,7 +611,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration): Promise { + public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.logoutUser( options).toPromise(); } @@ -619,7 +620,7 @@ export class ObjectUserApi { * Updated user * @param param the request object */ - public updateUserWithHttpInfo(param: UserApiUpdateUserRequest, options?: Configuration): Promise> { + public updateUserWithHttpInfo(param: UserApiUpdateUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.updateUserWithHttpInfo(param.username, param.user, options).toPromise(); } @@ -628,7 +629,7 @@ export class ObjectUserApi { * Updated user * @param param the request object */ - public updateUser(param: UserApiUpdateUserRequest, options?: Configuration): Promise { + public updateUser(param: UserApiUpdateUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.updateUser(param.username, param.user, options).toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/default/types/ObservableAPI.ts index f344144c8b37..585735aa7842 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/types/ObservableAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { Observable, of, from } from '../rxjsStub'; import {mergeMap, map} from '../rxjsStub'; import { ApiResponse } from '../models/ApiResponse'; @@ -30,12 +31,21 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(pet: Pet, _options?: Configuration): Observable> { + public addPetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.addPet(pet, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -54,7 +64,7 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration): Observable { + public addPet(pet: Pet, _options?: Configuration | Middleware[]): Observable { return this.addPetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -64,12 +74,21 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration): Observable> { + public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.deletePet(petId, apiKey, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -89,7 +108,7 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration): Observable { + public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable { return this.deletePetWithHttpInfo(petId, apiKey, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -98,12 +117,21 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Observable>> { + public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable>> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.findPetsByStatus(status, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -122,7 +150,7 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Observable> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable> { return this.findPetsByStatusWithHttpInfo(status, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -131,12 +159,21 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration): Observable>> { + public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | Middleware[]): Observable>> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.findPetsByTags(tags, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -155,7 +192,7 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration): Observable> { + public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Observable> { return this.findPetsByTagsWithHttpInfo(tags, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -164,12 +201,21 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, _options?: Configuration): Observable> { + public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getPetById(petId, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -188,7 +234,7 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration): Observable { + public getPetById(petId: number, _options?: Configuration | Middleware[]): Observable { return this.getPetByIdWithHttpInfo(petId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -197,12 +243,21 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(pet: Pet, _options?: Configuration): Observable> { + public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.updatePet(pet, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -221,7 +276,7 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration): Observable { + public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Observable { return this.updatePetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -232,12 +287,21 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration): Observable> { + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.updatePetWithForm(petId, name, status, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -258,7 +322,7 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable { return this.updatePetWithFormWithHttpInfo(petId, name, status, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -269,12 +333,21 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Observable> { + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.uploadFile(petId, additionalMetadata, file, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -295,7 +368,7 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable { return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -322,12 +395,21 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration): Observable> { + public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.deleteOrder(orderId, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -346,7 +428,7 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration): Observable { + public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Observable { return this.deleteOrderWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -354,12 +436,21 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventoryWithHttpInfo(_options?: Configuration): Observable> { + public getInventoryWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getInventory(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -377,7 +468,7 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration): Observable<{ [key: string]: number; }> { + public getInventory(_options?: Configuration | Middleware[]): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo<{ [key: string]: number; }>) => apiResponse.data)); } @@ -386,12 +477,21 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration): Observable> { + public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getOrderById(orderId, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -410,7 +510,7 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration): Observable { + public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Observable { return this.getOrderByIdWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -419,12 +519,21 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(order: Order, _options?: Configuration): Observable> { + public placeOrderWithHttpInfo(order: Order, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.placeOrder(order, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -443,7 +552,7 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration): Observable { + public placeOrder(order: Order, _options?: Configuration | Middleware[]): Observable { return this.placeOrderWithHttpInfo(order, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -470,12 +579,21 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUserWithHttpInfo(user: User, _options?: Configuration): Observable> { + public createUserWithHttpInfo(user: User, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.createUser(user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -494,7 +612,7 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration): Observable { + public createUser(user: User, _options?: Configuration | Middleware[]): Observable { return this.createUserWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -503,12 +621,21 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration): Observable> { + public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.createUsersWithArrayInput(user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -527,7 +654,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration): Observable { + public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Observable { return this.createUsersWithArrayInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -536,12 +663,21 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration): Observable> { + public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.createUsersWithListInput(user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -560,7 +696,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration): Observable { + public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Observable { return this.createUsersWithListInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -569,12 +705,21 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, _options?: Configuration): Observable> { + public deleteUserWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.deleteUser(username, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -593,7 +738,7 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration): Observable { + public deleteUser(username: string, _options?: Configuration | Middleware[]): Observable { return this.deleteUserWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -602,12 +747,21 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, _options?: Configuration): Observable> { + public getUserByNameWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getUserByName(username, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -626,7 +780,7 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration): Observable { + public getUserByName(username: string, _options?: Configuration | Middleware[]): Observable { return this.getUserByNameWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -636,12 +790,21 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration): Observable> { + public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.loginUser(username, password, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -661,7 +824,7 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration): Observable { + public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Observable { return this.loginUserWithHttpInfo(username, password, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -669,12 +832,21 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUserWithHttpInfo(_options?: Configuration): Observable> { + public logoutUserWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.logoutUser(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -692,7 +864,7 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration): Observable { + public logoutUser(_options?: Configuration | Middleware[]): Observable { return this.logoutUserWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -702,12 +874,21 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration): Observable> { + public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.updateUser(username, user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -727,7 +908,7 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration): Observable { + public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Observable { return this.updateUserWithHttpInfo(username, user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/default/types/PromiseAPI.ts index 55af604f4659..d74bd8f9e572 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/types/PromiseAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { ApiResponse } from '../models/ApiResponse'; import { Category } from '../models/Category'; @@ -26,7 +27,7 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(pet: Pet, _options?: Configuration): Promise> { + public addPetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { const result = this.api.addPetWithHttpInfo(pet, _options); return result.toPromise(); } @@ -36,7 +37,7 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration): Promise { + public addPet(pet: Pet, _options?: Configuration | Middleware[]): Promise { const result = this.api.addPet(pet, _options); return result.toPromise(); } @@ -47,7 +48,7 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration): Promise> { + public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.deletePetWithHttpInfo(petId, apiKey, _options); return result.toPromise(); } @@ -58,7 +59,7 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration): Promise { + public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.deletePet(petId, apiKey, _options); return result.toPromise(); } @@ -68,7 +69,7 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise>> { + public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise>> { const result = this.api.findPetsByStatusWithHttpInfo(status, _options); return result.toPromise(); } @@ -78,7 +79,7 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise> { const result = this.api.findPetsByStatus(status, _options); return result.toPromise(); } @@ -88,7 +89,7 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration): Promise>> { + public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | Middleware[]): Promise>> { const result = this.api.findPetsByTagsWithHttpInfo(tags, _options); return result.toPromise(); } @@ -98,7 +99,7 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration): Promise> { + public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.findPetsByTags(tags, _options); return result.toPromise(); } @@ -108,7 +109,7 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, _options?: Configuration): Promise> { + public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | Middleware[]): Promise> { const result = this.api.getPetByIdWithHttpInfo(petId, _options); return result.toPromise(); } @@ -118,7 +119,7 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration): Promise { + public getPetById(petId: number, _options?: Configuration | Middleware[]): Promise { const result = this.api.getPetById(petId, _options); return result.toPromise(); } @@ -128,7 +129,7 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(pet: Pet, _options?: Configuration): Promise> { + public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { const result = this.api.updatePetWithHttpInfo(pet, _options); return result.toPromise(); } @@ -138,7 +139,7 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration): Promise { + public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Promise { const result = this.api.updatePet(pet, _options); return result.toPromise(); } @@ -150,7 +151,7 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration): Promise> { + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.updatePetWithFormWithHttpInfo(petId, name, status, _options); return result.toPromise(); } @@ -162,7 +163,7 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Promise { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.updatePetWithForm(petId, name, status, _options); return result.toPromise(); } @@ -174,7 +175,7 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise> { + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise> { const result = this.api.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options); return result.toPromise(); } @@ -186,7 +187,7 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise { const result = this.api.uploadFile(petId, additionalMetadata, file, _options); return result.toPromise(); } @@ -215,7 +216,7 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration): Promise> { + public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.deleteOrderWithHttpInfo(orderId, _options); return result.toPromise(); } @@ -225,7 +226,7 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration): Promise { + public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.deleteOrder(orderId, _options); return result.toPromise(); } @@ -234,7 +235,7 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventoryWithHttpInfo(_options?: Configuration): Promise> { + public getInventoryWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.getInventoryWithHttpInfo(_options); return result.toPromise(); } @@ -243,7 +244,7 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration): Promise<{ [key: string]: number; }> { + public getInventory(_options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { const result = this.api.getInventory(_options); return result.toPromise(); } @@ -253,7 +254,7 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration): Promise> { + public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | Middleware[]): Promise> { const result = this.api.getOrderByIdWithHttpInfo(orderId, _options); return result.toPromise(); } @@ -263,7 +264,7 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration): Promise { + public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Promise { const result = this.api.getOrderById(orderId, _options); return result.toPromise(); } @@ -273,7 +274,7 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(order: Order, _options?: Configuration): Promise> { + public placeOrderWithHttpInfo(order: Order, _options?: Configuration | Middleware[]): Promise> { const result = this.api.placeOrderWithHttpInfo(order, _options); return result.toPromise(); } @@ -283,7 +284,7 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration): Promise { + public placeOrder(order: Order, _options?: Configuration | Middleware[]): Promise { const result = this.api.placeOrder(order, _options); return result.toPromise(); } @@ -312,7 +313,7 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUserWithHttpInfo(user: User, _options?: Configuration): Promise> { + public createUserWithHttpInfo(user: User, _options?: Configuration | Middleware[]): Promise> { const result = this.api.createUserWithHttpInfo(user, _options); return result.toPromise(); } @@ -322,7 +323,7 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration): Promise { + public createUser(user: User, _options?: Configuration | Middleware[]): Promise { const result = this.api.createUser(user, _options); return result.toPromise(); } @@ -332,7 +333,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration): Promise> { + public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.createUsersWithArrayInputWithHttpInfo(user, _options); return result.toPromise(); } @@ -342,7 +343,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration): Promise { + public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Promise { const result = this.api.createUsersWithArrayInput(user, _options); return result.toPromise(); } @@ -352,7 +353,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration): Promise> { + public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.createUsersWithListInputWithHttpInfo(user, _options); return result.toPromise(); } @@ -362,7 +363,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration): Promise { + public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Promise { const result = this.api.createUsersWithListInput(user, _options); return result.toPromise(); } @@ -372,7 +373,7 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, _options?: Configuration): Promise> { + public deleteUserWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.deleteUserWithHttpInfo(username, _options); return result.toPromise(); } @@ -382,7 +383,7 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration): Promise { + public deleteUser(username: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.deleteUser(username, _options); return result.toPromise(); } @@ -392,7 +393,7 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, _options?: Configuration): Promise> { + public getUserByNameWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.getUserByNameWithHttpInfo(username, _options); return result.toPromise(); } @@ -402,7 +403,7 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration): Promise { + public getUserByName(username: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.getUserByName(username, _options); return result.toPromise(); } @@ -413,7 +414,7 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration): Promise> { + public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.loginUserWithHttpInfo(username, password, _options); return result.toPromise(); } @@ -424,7 +425,7 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration): Promise { + public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.loginUser(username, password, _options); return result.toPromise(); } @@ -433,7 +434,7 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUserWithHttpInfo(_options?: Configuration): Promise> { + public logoutUserWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.logoutUserWithHttpInfo(_options); return result.toPromise(); } @@ -442,7 +443,7 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration): Promise { + public logoutUser(_options?: Configuration | Middleware[]): Promise { const result = this.api.logoutUser(_options); return result.toPromise(); } @@ -453,7 +454,7 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration): Promise> { + public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | Middleware[]): Promise> { const result = this.api.updateUserWithHttpInfo(username, user, _options); return result.toPromise(); } @@ -464,7 +465,7 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration): Promise { + public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Promise { const result = this.api.updateUser(username, user, _options); return result.toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/apis/PetApi.ts b/samples/openapi3/client/petstore/typescript/builds/deno/apis/PetApi.ts index 4e3e8d09e837..81e2af700ff1 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/apis/PetApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/apis/PetApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi.ts'; import {Configuration} from '../configuration.ts'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http.ts'; import {ObjectSerializer} from '../models/ObjectSerializer.ts'; import {ApiException} from './exception.ts'; @@ -21,8 +22,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public async addPet(pet: Pet, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async addPet(pet: Pet, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'pet' is not null or undefined if (pet === null || pet === undefined) { @@ -58,7 +62,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -72,8 +76,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param petId Pet id to delete * @param apiKey */ - public async deletePet(petId: number, apiKey?: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -101,7 +108,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -114,8 +121,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'status' is not null or undefined if (status === null || status === undefined) { @@ -143,7 +153,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -156,8 +166,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Finds Pets by tags * @param tags Tags to filter by */ - public async findPetsByTags(tags: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'tags' is not null or undefined if (tags === null || tags === undefined) { @@ -185,7 +198,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -198,8 +211,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Find pet by ID * @param petId ID of pet to return */ - public async getPetById(petId: number, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getPetById(petId: number, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -223,7 +239,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -236,8 +252,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public async updatePet(pet: Pet, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async updatePet(pet: Pet, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'pet' is not null or undefined if (pet === null || pet === undefined) { @@ -273,7 +292,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -288,8 +307,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param name Updated name of the pet * @param status Updated status of the pet */ - public async updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -344,7 +366,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -359,8 +381,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - public async uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -417,7 +442,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/apis/StoreApi.ts b/samples/openapi3/client/petstore/typescript/builds/deno/apis/StoreApi.ts index a4eab6982ce6..1f1f79c1f6a3 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/apis/StoreApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/apis/StoreApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi.ts'; import {Configuration} from '../configuration.ts'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http.ts'; import {ObjectSerializer} from '../models/ObjectSerializer.ts'; import {ApiException} from './exception.ts'; @@ -20,8 +21,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public async deleteOrder(orderId: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'orderId' is not null or undefined if (orderId === null || orderId === undefined) { @@ -39,7 +43,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -51,8 +55,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public async getInventory(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getInventory(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/store/inventory'; @@ -69,7 +76,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -82,8 +89,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public async getOrderById(orderId: number, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getOrderById(orderId: number, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'orderId' is not null or undefined if (orderId === null || orderId === undefined) { @@ -101,7 +111,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -114,8 +124,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Place an order for a pet * @param order order placed for purchasing the pet */ - public async placeOrder(order: Order, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async placeOrder(order: Order, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'order' is not null or undefined if (order === null || order === undefined) { @@ -143,7 +156,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/apis/UserApi.ts b/samples/openapi3/client/petstore/typescript/builds/deno/apis/UserApi.ts index ed456958be92..cf54805548b3 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/apis/UserApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/apis/UserApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi.ts'; import {Configuration} from '../configuration.ts'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http.ts'; import {ObjectSerializer} from '../models/ObjectSerializer.ts'; import {ApiException} from './exception.ts'; @@ -20,8 +21,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Create user * @param user Created user object */ - public async createUser(user: User, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async createUser(user: User, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'user' is not null or undefined if (user === null || user === undefined) { @@ -55,7 +59,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -68,8 +72,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Creates list of users with given input array * @param user List of user object */ - public async createUsersWithArrayInput(user: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'user' is not null or undefined if (user === null || user === undefined) { @@ -103,7 +110,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -116,8 +123,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Creates list of users with given input array * @param user List of user object */ - public async createUsersWithListInput(user: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'user' is not null or undefined if (user === null || user === undefined) { @@ -151,7 +161,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -164,8 +174,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Delete user * @param username The name that needs to be deleted */ - public async deleteUser(username: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async deleteUser(username: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -189,7 +202,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -202,8 +215,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public async getUserByName(username: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getUserByName(username: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -221,7 +237,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -235,8 +251,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * @param username The user name for login * @param password The password for login in clear text */ - public async loginUser(username: string, password: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -269,7 +288,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -281,8 +300,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * * Logs out current logged in user session */ - public async logoutUser(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async logoutUser(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/user/logout'; @@ -299,7 +321,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -313,8 +335,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * @param username name that need to be deleted * @param user Updated user object */ - public async updateUser(username: string, user: User, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -355,7 +380,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/deno/types/ObjectParamAPI.ts index 5adebe19e36d..654b88cad6b4 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/types/ObjectParamAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http.ts'; import { Configuration} from '../configuration.ts' +import type { Middleware } from "../middleware"; import { ApiResponse } from '../models/ApiResponse.ts'; import { Category } from '../models/Category.ts'; @@ -136,7 +137,7 @@ export class ObjectPetApi { * Add a new pet to the store * @param param the request object */ - public addPetWithHttpInfo(param: PetApiAddPetRequest, options?: Configuration): Promise> { + public addPetWithHttpInfo(param: PetApiAddPetRequest, options?: Configuration | Middleware[]): Promise> { return this.api.addPetWithHttpInfo(param.pet, options).toPromise(); } @@ -145,7 +146,7 @@ export class ObjectPetApi { * Add a new pet to the store * @param param the request object */ - public addPet(param: PetApiAddPetRequest, options?: Configuration): Promise { + public addPet(param: PetApiAddPetRequest, options?: Configuration | Middleware[]): Promise { return this.api.addPet(param.pet, options).toPromise(); } @@ -154,7 +155,7 @@ export class ObjectPetApi { * Deletes a pet * @param param the request object */ - public deletePetWithHttpInfo(param: PetApiDeletePetRequest, options?: Configuration): Promise> { + public deletePetWithHttpInfo(param: PetApiDeletePetRequest, options?: Configuration | Middleware[]): Promise> { return this.api.deletePetWithHttpInfo(param.petId, param.apiKey, options).toPromise(); } @@ -163,7 +164,7 @@ export class ObjectPetApi { * Deletes a pet * @param param the request object */ - public deletePet(param: PetApiDeletePetRequest, options?: Configuration): Promise { + public deletePet(param: PetApiDeletePetRequest, options?: Configuration | Middleware[]): Promise { return this.api.deletePet(param.petId, param.apiKey, options).toPromise(); } @@ -172,7 +173,7 @@ export class ObjectPetApi { * Finds Pets by status * @param param the request object */ - public findPetsByStatusWithHttpInfo(param: PetApiFindPetsByStatusRequest, options?: Configuration): Promise>> { + public findPetsByStatusWithHttpInfo(param: PetApiFindPetsByStatusRequest, options?: Configuration | Middleware[]): Promise>> { return this.api.findPetsByStatusWithHttpInfo(param.status, options).toPromise(); } @@ -181,7 +182,7 @@ export class ObjectPetApi { * Finds Pets by status * @param param the request object */ - public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration): Promise> { + public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration | Middleware[]): Promise> { return this.api.findPetsByStatus(param.status, options).toPromise(); } @@ -190,7 +191,7 @@ export class ObjectPetApi { * Finds Pets by tags * @param param the request object */ - public findPetsByTagsWithHttpInfo(param: PetApiFindPetsByTagsRequest, options?: Configuration): Promise>> { + public findPetsByTagsWithHttpInfo(param: PetApiFindPetsByTagsRequest, options?: Configuration | Middleware[]): Promise>> { return this.api.findPetsByTagsWithHttpInfo(param.tags, options).toPromise(); } @@ -199,7 +200,7 @@ export class ObjectPetApi { * Finds Pets by tags * @param param the request object */ - public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration): Promise> { + public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration | Middleware[]): Promise> { return this.api.findPetsByTags(param.tags, options).toPromise(); } @@ -208,7 +209,7 @@ export class ObjectPetApi { * Find pet by ID * @param param the request object */ - public getPetByIdWithHttpInfo(param: PetApiGetPetByIdRequest, options?: Configuration): Promise> { + public getPetByIdWithHttpInfo(param: PetApiGetPetByIdRequest, options?: Configuration | Middleware[]): Promise> { return this.api.getPetByIdWithHttpInfo(param.petId, options).toPromise(); } @@ -217,7 +218,7 @@ export class ObjectPetApi { * Find pet by ID * @param param the request object */ - public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration): Promise { + public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration | Middleware[]): Promise { return this.api.getPetById(param.petId, options).toPromise(); } @@ -226,7 +227,7 @@ export class ObjectPetApi { * Update an existing pet * @param param the request object */ - public updatePetWithHttpInfo(param: PetApiUpdatePetRequest, options?: Configuration): Promise> { + public updatePetWithHttpInfo(param: PetApiUpdatePetRequest, options?: Configuration | Middleware[]): Promise> { return this.api.updatePetWithHttpInfo(param.pet, options).toPromise(); } @@ -235,7 +236,7 @@ export class ObjectPetApi { * Update an existing pet * @param param the request object */ - public updatePet(param: PetApiUpdatePetRequest, options?: Configuration): Promise { + public updatePet(param: PetApiUpdatePetRequest, options?: Configuration | Middleware[]): Promise { return this.api.updatePet(param.pet, options).toPromise(); } @@ -244,7 +245,7 @@ export class ObjectPetApi { * Updates a pet in the store with form data * @param param the request object */ - public updatePetWithFormWithHttpInfo(param: PetApiUpdatePetWithFormRequest, options?: Configuration): Promise> { + public updatePetWithFormWithHttpInfo(param: PetApiUpdatePetWithFormRequest, options?: Configuration | Middleware[]): Promise> { return this.api.updatePetWithFormWithHttpInfo(param.petId, param.name, param.status, options).toPromise(); } @@ -253,7 +254,7 @@ export class ObjectPetApi { * Updates a pet in the store with form data * @param param the request object */ - public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration): Promise { + public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration | Middleware[]): Promise { return this.api.updatePetWithForm(param.petId, param.name, param.status, options).toPromise(); } @@ -262,7 +263,7 @@ export class ObjectPetApi { * uploads an image * @param param the request object */ - public uploadFileWithHttpInfo(param: PetApiUploadFileRequest, options?: Configuration): Promise> { + public uploadFileWithHttpInfo(param: PetApiUploadFileRequest, options?: Configuration | Middleware[]): Promise> { return this.api.uploadFileWithHttpInfo(param.petId, param.additionalMetadata, param.file, options).toPromise(); } @@ -271,7 +272,7 @@ export class ObjectPetApi { * uploads an image * @param param the request object */ - public uploadFile(param: PetApiUploadFileRequest, options?: Configuration): Promise { + public uploadFile(param: PetApiUploadFileRequest, options?: Configuration | Middleware[]): Promise { return this.api.uploadFile(param.petId, param.additionalMetadata, param.file, options).toPromise(); } @@ -326,7 +327,7 @@ export class ObjectStoreApi { * Delete purchase order by ID * @param param the request object */ - public deleteOrderWithHttpInfo(param: StoreApiDeleteOrderRequest, options?: Configuration): Promise> { + public deleteOrderWithHttpInfo(param: StoreApiDeleteOrderRequest, options?: Configuration | Middleware[]): Promise> { return this.api.deleteOrderWithHttpInfo(param.orderId, options).toPromise(); } @@ -335,7 +336,7 @@ export class ObjectStoreApi { * Delete purchase order by ID * @param param the request object */ - public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration): Promise { + public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration | Middleware[]): Promise { return this.api.deleteOrder(param.orderId, options).toPromise(); } @@ -344,7 +345,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventoryWithHttpInfo(param: StoreApiGetInventoryRequest = {}, options?: Configuration): Promise> { + public getInventoryWithHttpInfo(param: StoreApiGetInventoryRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.getInventoryWithHttpInfo( options).toPromise(); } @@ -353,7 +354,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration): Promise<{ [key: string]: number; }> { + public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { return this.api.getInventory( options).toPromise(); } @@ -362,7 +363,7 @@ export class ObjectStoreApi { * Find purchase order by ID * @param param the request object */ - public getOrderByIdWithHttpInfo(param: StoreApiGetOrderByIdRequest, options?: Configuration): Promise> { + public getOrderByIdWithHttpInfo(param: StoreApiGetOrderByIdRequest, options?: Configuration | Middleware[]): Promise> { return this.api.getOrderByIdWithHttpInfo(param.orderId, options).toPromise(); } @@ -371,7 +372,7 @@ export class ObjectStoreApi { * Find purchase order by ID * @param param the request object */ - public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration): Promise { + public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration | Middleware[]): Promise { return this.api.getOrderById(param.orderId, options).toPromise(); } @@ -380,7 +381,7 @@ export class ObjectStoreApi { * Place an order for a pet * @param param the request object */ - public placeOrderWithHttpInfo(param: StoreApiPlaceOrderRequest, options?: Configuration): Promise> { + public placeOrderWithHttpInfo(param: StoreApiPlaceOrderRequest, options?: Configuration | Middleware[]): Promise> { return this.api.placeOrderWithHttpInfo(param.order, options).toPromise(); } @@ -389,7 +390,7 @@ export class ObjectStoreApi { * Place an order for a pet * @param param the request object */ - public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration): Promise { + public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration | Middleware[]): Promise { return this.api.placeOrder(param.order, options).toPromise(); } @@ -493,7 +494,7 @@ export class ObjectUserApi { * Create user * @param param the request object */ - public createUserWithHttpInfo(param: UserApiCreateUserRequest, options?: Configuration): Promise> { + public createUserWithHttpInfo(param: UserApiCreateUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.createUserWithHttpInfo(param.user, options).toPromise(); } @@ -502,7 +503,7 @@ export class ObjectUserApi { * Create user * @param param the request object */ - public createUser(param: UserApiCreateUserRequest, options?: Configuration): Promise { + public createUser(param: UserApiCreateUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.createUser(param.user, options).toPromise(); } @@ -511,7 +512,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithArrayInputWithHttpInfo(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration): Promise> { + public createUsersWithArrayInputWithHttpInfo(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration | Middleware[]): Promise> { return this.api.createUsersWithArrayInputWithHttpInfo(param.user, options).toPromise(); } @@ -520,7 +521,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration): Promise { + public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration | Middleware[]): Promise { return this.api.createUsersWithArrayInput(param.user, options).toPromise(); } @@ -529,7 +530,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithListInputWithHttpInfo(param: UserApiCreateUsersWithListInputRequest, options?: Configuration): Promise> { + public createUsersWithListInputWithHttpInfo(param: UserApiCreateUsersWithListInputRequest, options?: Configuration | Middleware[]): Promise> { return this.api.createUsersWithListInputWithHttpInfo(param.user, options).toPromise(); } @@ -538,7 +539,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration): Promise { + public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration | Middleware[]): Promise { return this.api.createUsersWithListInput(param.user, options).toPromise(); } @@ -547,7 +548,7 @@ export class ObjectUserApi { * Delete user * @param param the request object */ - public deleteUserWithHttpInfo(param: UserApiDeleteUserRequest, options?: Configuration): Promise> { + public deleteUserWithHttpInfo(param: UserApiDeleteUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.deleteUserWithHttpInfo(param.username, options).toPromise(); } @@ -556,7 +557,7 @@ export class ObjectUserApi { * Delete user * @param param the request object */ - public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration): Promise { + public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.deleteUser(param.username, options).toPromise(); } @@ -565,7 +566,7 @@ export class ObjectUserApi { * Get user by user name * @param param the request object */ - public getUserByNameWithHttpInfo(param: UserApiGetUserByNameRequest, options?: Configuration): Promise> { + public getUserByNameWithHttpInfo(param: UserApiGetUserByNameRequest, options?: Configuration | Middleware[]): Promise> { return this.api.getUserByNameWithHttpInfo(param.username, options).toPromise(); } @@ -574,7 +575,7 @@ export class ObjectUserApi { * Get user by user name * @param param the request object */ - public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration): Promise { + public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration | Middleware[]): Promise { return this.api.getUserByName(param.username, options).toPromise(); } @@ -583,7 +584,7 @@ export class ObjectUserApi { * Logs user into the system * @param param the request object */ - public loginUserWithHttpInfo(param: UserApiLoginUserRequest, options?: Configuration): Promise> { + public loginUserWithHttpInfo(param: UserApiLoginUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.loginUserWithHttpInfo(param.username, param.password, options).toPromise(); } @@ -592,7 +593,7 @@ export class ObjectUserApi { * Logs user into the system * @param param the request object */ - public loginUser(param: UserApiLoginUserRequest, options?: Configuration): Promise { + public loginUser(param: UserApiLoginUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.loginUser(param.username, param.password, options).toPromise(); } @@ -601,7 +602,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUserWithHttpInfo(param: UserApiLogoutUserRequest = {}, options?: Configuration): Promise> { + public logoutUserWithHttpInfo(param: UserApiLogoutUserRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.logoutUserWithHttpInfo( options).toPromise(); } @@ -610,7 +611,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration): Promise { + public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.logoutUser( options).toPromise(); } @@ -619,7 +620,7 @@ export class ObjectUserApi { * Updated user * @param param the request object */ - public updateUserWithHttpInfo(param: UserApiUpdateUserRequest, options?: Configuration): Promise> { + public updateUserWithHttpInfo(param: UserApiUpdateUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.updateUserWithHttpInfo(param.username, param.user, options).toPromise(); } @@ -628,7 +629,7 @@ export class ObjectUserApi { * Updated user * @param param the request object */ - public updateUser(param: UserApiUpdateUserRequest, options?: Configuration): Promise { + public updateUser(param: UserApiUpdateUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.updateUser(param.username, param.user, options).toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/deno/types/ObservableAPI.ts index db37cb934a00..a9173ffe386a 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/types/ObservableAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http.ts'; import { Configuration} from '../configuration.ts' +import type { Middleware } from "../middleware"; import { Observable, of, from } from '../rxjsStub.ts'; import {mergeMap, map} from '../rxjsStub.ts'; import { ApiResponse } from '../models/ApiResponse.ts'; @@ -30,12 +31,21 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(pet: Pet, _options?: Configuration): Observable> { + public addPetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.addPet(pet, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -54,7 +64,7 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration): Observable { + public addPet(pet: Pet, _options?: Configuration | Middleware[]): Observable { return this.addPetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -64,12 +74,21 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration): Observable> { + public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.deletePet(petId, apiKey, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -89,7 +108,7 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration): Observable { + public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable { return this.deletePetWithHttpInfo(petId, apiKey, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -98,12 +117,21 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Observable>> { + public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable>> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.findPetsByStatus(status, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -122,7 +150,7 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Observable> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable> { return this.findPetsByStatusWithHttpInfo(status, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -131,12 +159,21 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration): Observable>> { + public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | Middleware[]): Observable>> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.findPetsByTags(tags, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -155,7 +192,7 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration): Observable> { + public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Observable> { return this.findPetsByTagsWithHttpInfo(tags, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -164,12 +201,21 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, _options?: Configuration): Observable> { + public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getPetById(petId, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -188,7 +234,7 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration): Observable { + public getPetById(petId: number, _options?: Configuration | Middleware[]): Observable { return this.getPetByIdWithHttpInfo(petId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -197,12 +243,21 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(pet: Pet, _options?: Configuration): Observable> { + public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.updatePet(pet, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -221,7 +276,7 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration): Observable { + public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Observable { return this.updatePetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -232,12 +287,21 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration): Observable> { + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.updatePetWithForm(petId, name, status, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -258,7 +322,7 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable { return this.updatePetWithFormWithHttpInfo(petId, name, status, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -269,12 +333,21 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Observable> { + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.uploadFile(petId, additionalMetadata, file, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -295,7 +368,7 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable { return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -322,12 +395,21 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration): Observable> { + public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.deleteOrder(orderId, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -346,7 +428,7 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration): Observable { + public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Observable { return this.deleteOrderWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -354,12 +436,21 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventoryWithHttpInfo(_options?: Configuration): Observable> { + public getInventoryWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getInventory(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -377,7 +468,7 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration): Observable<{ [key: string]: number; }> { + public getInventory(_options?: Configuration | Middleware[]): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo<{ [key: string]: number; }>) => apiResponse.data)); } @@ -386,12 +477,21 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration): Observable> { + public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getOrderById(orderId, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -410,7 +510,7 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration): Observable { + public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Observable { return this.getOrderByIdWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -419,12 +519,21 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(order: Order, _options?: Configuration): Observable> { + public placeOrderWithHttpInfo(order: Order, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.placeOrder(order, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -443,7 +552,7 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration): Observable { + public placeOrder(order: Order, _options?: Configuration | Middleware[]): Observable { return this.placeOrderWithHttpInfo(order, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -470,12 +579,21 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUserWithHttpInfo(user: User, _options?: Configuration): Observable> { + public createUserWithHttpInfo(user: User, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.createUser(user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -494,7 +612,7 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration): Observable { + public createUser(user: User, _options?: Configuration | Middleware[]): Observable { return this.createUserWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -503,12 +621,21 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration): Observable> { + public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.createUsersWithArrayInput(user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -527,7 +654,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration): Observable { + public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Observable { return this.createUsersWithArrayInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -536,12 +663,21 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration): Observable> { + public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.createUsersWithListInput(user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -560,7 +696,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration): Observable { + public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Observable { return this.createUsersWithListInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -569,12 +705,21 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, _options?: Configuration): Observable> { + public deleteUserWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.deleteUser(username, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -593,7 +738,7 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration): Observable { + public deleteUser(username: string, _options?: Configuration | Middleware[]): Observable { return this.deleteUserWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -602,12 +747,21 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, _options?: Configuration): Observable> { + public getUserByNameWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getUserByName(username, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -626,7 +780,7 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration): Observable { + public getUserByName(username: string, _options?: Configuration | Middleware[]): Observable { return this.getUserByNameWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -636,12 +790,21 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration): Observable> { + public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.loginUser(username, password, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -661,7 +824,7 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration): Observable { + public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Observable { return this.loginUserWithHttpInfo(username, password, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -669,12 +832,21 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUserWithHttpInfo(_options?: Configuration): Observable> { + public logoutUserWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.logoutUser(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -692,7 +864,7 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration): Observable { + public logoutUser(_options?: Configuration | Middleware[]): Observable { return this.logoutUserWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -702,12 +874,21 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration): Observable> { + public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.updateUser(username, user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -727,7 +908,7 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration): Observable { + public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Observable { return this.updateUserWithHttpInfo(username, user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/deno/types/PromiseAPI.ts index f6909b6249aa..089425c36809 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/types/PromiseAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http.ts'; import { Configuration} from '../configuration.ts' +import type { Middleware } from "../middleware"; import { ApiResponse } from '../models/ApiResponse.ts'; import { Category } from '../models/Category.ts'; @@ -26,7 +27,7 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(pet: Pet, _options?: Configuration): Promise> { + public addPetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { const result = this.api.addPetWithHttpInfo(pet, _options); return result.toPromise(); } @@ -36,7 +37,7 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration): Promise { + public addPet(pet: Pet, _options?: Configuration | Middleware[]): Promise { const result = this.api.addPet(pet, _options); return result.toPromise(); } @@ -47,7 +48,7 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration): Promise> { + public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.deletePetWithHttpInfo(petId, apiKey, _options); return result.toPromise(); } @@ -58,7 +59,7 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration): Promise { + public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.deletePet(petId, apiKey, _options); return result.toPromise(); } @@ -68,7 +69,7 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise>> { + public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise>> { const result = this.api.findPetsByStatusWithHttpInfo(status, _options); return result.toPromise(); } @@ -78,7 +79,7 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise> { const result = this.api.findPetsByStatus(status, _options); return result.toPromise(); } @@ -88,7 +89,7 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration): Promise>> { + public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | Middleware[]): Promise>> { const result = this.api.findPetsByTagsWithHttpInfo(tags, _options); return result.toPromise(); } @@ -98,7 +99,7 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration): Promise> { + public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.findPetsByTags(tags, _options); return result.toPromise(); } @@ -108,7 +109,7 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, _options?: Configuration): Promise> { + public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | Middleware[]): Promise> { const result = this.api.getPetByIdWithHttpInfo(petId, _options); return result.toPromise(); } @@ -118,7 +119,7 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration): Promise { + public getPetById(petId: number, _options?: Configuration | Middleware[]): Promise { const result = this.api.getPetById(petId, _options); return result.toPromise(); } @@ -128,7 +129,7 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(pet: Pet, _options?: Configuration): Promise> { + public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { const result = this.api.updatePetWithHttpInfo(pet, _options); return result.toPromise(); } @@ -138,7 +139,7 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration): Promise { + public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Promise { const result = this.api.updatePet(pet, _options); return result.toPromise(); } @@ -150,7 +151,7 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration): Promise> { + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.updatePetWithFormWithHttpInfo(petId, name, status, _options); return result.toPromise(); } @@ -162,7 +163,7 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Promise { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.updatePetWithForm(petId, name, status, _options); return result.toPromise(); } @@ -174,7 +175,7 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise> { + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise> { const result = this.api.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options); return result.toPromise(); } @@ -186,7 +187,7 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise { const result = this.api.uploadFile(petId, additionalMetadata, file, _options); return result.toPromise(); } @@ -215,7 +216,7 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration): Promise> { + public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.deleteOrderWithHttpInfo(orderId, _options); return result.toPromise(); } @@ -225,7 +226,7 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration): Promise { + public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.deleteOrder(orderId, _options); return result.toPromise(); } @@ -234,7 +235,7 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventoryWithHttpInfo(_options?: Configuration): Promise> { + public getInventoryWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.getInventoryWithHttpInfo(_options); return result.toPromise(); } @@ -243,7 +244,7 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration): Promise<{ [key: string]: number; }> { + public getInventory(_options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { const result = this.api.getInventory(_options); return result.toPromise(); } @@ -253,7 +254,7 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration): Promise> { + public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | Middleware[]): Promise> { const result = this.api.getOrderByIdWithHttpInfo(orderId, _options); return result.toPromise(); } @@ -263,7 +264,7 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration): Promise { + public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Promise { const result = this.api.getOrderById(orderId, _options); return result.toPromise(); } @@ -273,7 +274,7 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(order: Order, _options?: Configuration): Promise> { + public placeOrderWithHttpInfo(order: Order, _options?: Configuration | Middleware[]): Promise> { const result = this.api.placeOrderWithHttpInfo(order, _options); return result.toPromise(); } @@ -283,7 +284,7 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration): Promise { + public placeOrder(order: Order, _options?: Configuration | Middleware[]): Promise { const result = this.api.placeOrder(order, _options); return result.toPromise(); } @@ -312,7 +313,7 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUserWithHttpInfo(user: User, _options?: Configuration): Promise> { + public createUserWithHttpInfo(user: User, _options?: Configuration | Middleware[]): Promise> { const result = this.api.createUserWithHttpInfo(user, _options); return result.toPromise(); } @@ -322,7 +323,7 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration): Promise { + public createUser(user: User, _options?: Configuration | Middleware[]): Promise { const result = this.api.createUser(user, _options); return result.toPromise(); } @@ -332,7 +333,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration): Promise> { + public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.createUsersWithArrayInputWithHttpInfo(user, _options); return result.toPromise(); } @@ -342,7 +343,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration): Promise { + public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Promise { const result = this.api.createUsersWithArrayInput(user, _options); return result.toPromise(); } @@ -352,7 +353,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration): Promise> { + public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.createUsersWithListInputWithHttpInfo(user, _options); return result.toPromise(); } @@ -362,7 +363,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration): Promise { + public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Promise { const result = this.api.createUsersWithListInput(user, _options); return result.toPromise(); } @@ -372,7 +373,7 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, _options?: Configuration): Promise> { + public deleteUserWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.deleteUserWithHttpInfo(username, _options); return result.toPromise(); } @@ -382,7 +383,7 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration): Promise { + public deleteUser(username: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.deleteUser(username, _options); return result.toPromise(); } @@ -392,7 +393,7 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, _options?: Configuration): Promise> { + public getUserByNameWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.getUserByNameWithHttpInfo(username, _options); return result.toPromise(); } @@ -402,7 +403,7 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration): Promise { + public getUserByName(username: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.getUserByName(username, _options); return result.toPromise(); } @@ -413,7 +414,7 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration): Promise> { + public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.loginUserWithHttpInfo(username, password, _options); return result.toPromise(); } @@ -424,7 +425,7 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration): Promise { + public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.loginUser(username, password, _options); return result.toPromise(); } @@ -433,7 +434,7 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUserWithHttpInfo(_options?: Configuration): Promise> { + public logoutUserWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.logoutUserWithHttpInfo(_options); return result.toPromise(); } @@ -442,7 +443,7 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration): Promise { + public logoutUser(_options?: Configuration | Middleware[]): Promise { const result = this.api.logoutUser(_options); return result.toPromise(); } @@ -453,7 +454,7 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration): Promise> { + public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | Middleware[]): Promise> { const result = this.api.updateUserWithHttpInfo(username, user, _options); return result.toPromise(); } @@ -464,7 +465,7 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration): Promise { + public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Promise { const result = this.api.updateUser(username, user, _options); return result.toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/apis/PetApi.ts b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/apis/PetApi.ts index 4e3e8d09e837..81e2af700ff1 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/apis/PetApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/apis/PetApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi.ts'; import {Configuration} from '../configuration.ts'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http.ts'; import {ObjectSerializer} from '../models/ObjectSerializer.ts'; import {ApiException} from './exception.ts'; @@ -21,8 +22,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public async addPet(pet: Pet, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async addPet(pet: Pet, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'pet' is not null or undefined if (pet === null || pet === undefined) { @@ -58,7 +62,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -72,8 +76,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param petId Pet id to delete * @param apiKey */ - public async deletePet(petId: number, apiKey?: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -101,7 +108,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -114,8 +121,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'status' is not null or undefined if (status === null || status === undefined) { @@ -143,7 +153,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -156,8 +166,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Finds Pets by tags * @param tags Tags to filter by */ - public async findPetsByTags(tags: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'tags' is not null or undefined if (tags === null || tags === undefined) { @@ -185,7 +198,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -198,8 +211,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Find pet by ID * @param petId ID of pet to return */ - public async getPetById(petId: number, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getPetById(petId: number, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -223,7 +239,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -236,8 +252,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public async updatePet(pet: Pet, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async updatePet(pet: Pet, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'pet' is not null or undefined if (pet === null || pet === undefined) { @@ -273,7 +292,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -288,8 +307,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param name Updated name of the pet * @param status Updated status of the pet */ - public async updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -344,7 +366,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -359,8 +381,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - public async uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -417,7 +442,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/apis/StoreApi.ts b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/apis/StoreApi.ts index a4eab6982ce6..1f1f79c1f6a3 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/apis/StoreApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/apis/StoreApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi.ts'; import {Configuration} from '../configuration.ts'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http.ts'; import {ObjectSerializer} from '../models/ObjectSerializer.ts'; import {ApiException} from './exception.ts'; @@ -20,8 +21,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public async deleteOrder(orderId: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'orderId' is not null or undefined if (orderId === null || orderId === undefined) { @@ -39,7 +43,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -51,8 +55,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public async getInventory(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getInventory(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/store/inventory'; @@ -69,7 +76,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -82,8 +89,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public async getOrderById(orderId: number, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getOrderById(orderId: number, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'orderId' is not null or undefined if (orderId === null || orderId === undefined) { @@ -101,7 +111,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -114,8 +124,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Place an order for a pet * @param order order placed for purchasing the pet */ - public async placeOrder(order: Order, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async placeOrder(order: Order, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'order' is not null or undefined if (order === null || order === undefined) { @@ -143,7 +156,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/apis/UserApi.ts b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/apis/UserApi.ts index ed456958be92..cf54805548b3 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/apis/UserApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/apis/UserApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi.ts'; import {Configuration} from '../configuration.ts'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http.ts'; import {ObjectSerializer} from '../models/ObjectSerializer.ts'; import {ApiException} from './exception.ts'; @@ -20,8 +21,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Create user * @param user Created user object */ - public async createUser(user: User, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async createUser(user: User, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'user' is not null or undefined if (user === null || user === undefined) { @@ -55,7 +59,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -68,8 +72,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Creates list of users with given input array * @param user List of user object */ - public async createUsersWithArrayInput(user: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'user' is not null or undefined if (user === null || user === undefined) { @@ -103,7 +110,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -116,8 +123,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Creates list of users with given input array * @param user List of user object */ - public async createUsersWithListInput(user: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'user' is not null or undefined if (user === null || user === undefined) { @@ -151,7 +161,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -164,8 +174,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Delete user * @param username The name that needs to be deleted */ - public async deleteUser(username: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async deleteUser(username: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -189,7 +202,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -202,8 +215,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public async getUserByName(username: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getUserByName(username: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -221,7 +237,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -235,8 +251,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * @param username The user name for login * @param password The password for login in clear text */ - public async loginUser(username: string, password: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -269,7 +288,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -281,8 +300,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * * Logs out current logged in user session */ - public async logoutUser(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async logoutUser(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/user/logout'; @@ -299,7 +321,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -313,8 +335,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * @param username name that need to be deleted * @param user Updated user object */ - public async updateUser(username: string, user: User, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -355,7 +380,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/ObjectParamAPI.ts index 5adebe19e36d..654b88cad6b4 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/ObjectParamAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http.ts'; import { Configuration} from '../configuration.ts' +import type { Middleware } from "../middleware"; import { ApiResponse } from '../models/ApiResponse.ts'; import { Category } from '../models/Category.ts'; @@ -136,7 +137,7 @@ export class ObjectPetApi { * Add a new pet to the store * @param param the request object */ - public addPetWithHttpInfo(param: PetApiAddPetRequest, options?: Configuration): Promise> { + public addPetWithHttpInfo(param: PetApiAddPetRequest, options?: Configuration | Middleware[]): Promise> { return this.api.addPetWithHttpInfo(param.pet, options).toPromise(); } @@ -145,7 +146,7 @@ export class ObjectPetApi { * Add a new pet to the store * @param param the request object */ - public addPet(param: PetApiAddPetRequest, options?: Configuration): Promise { + public addPet(param: PetApiAddPetRequest, options?: Configuration | Middleware[]): Promise { return this.api.addPet(param.pet, options).toPromise(); } @@ -154,7 +155,7 @@ export class ObjectPetApi { * Deletes a pet * @param param the request object */ - public deletePetWithHttpInfo(param: PetApiDeletePetRequest, options?: Configuration): Promise> { + public deletePetWithHttpInfo(param: PetApiDeletePetRequest, options?: Configuration | Middleware[]): Promise> { return this.api.deletePetWithHttpInfo(param.petId, param.apiKey, options).toPromise(); } @@ -163,7 +164,7 @@ export class ObjectPetApi { * Deletes a pet * @param param the request object */ - public deletePet(param: PetApiDeletePetRequest, options?: Configuration): Promise { + public deletePet(param: PetApiDeletePetRequest, options?: Configuration | Middleware[]): Promise { return this.api.deletePet(param.petId, param.apiKey, options).toPromise(); } @@ -172,7 +173,7 @@ export class ObjectPetApi { * Finds Pets by status * @param param the request object */ - public findPetsByStatusWithHttpInfo(param: PetApiFindPetsByStatusRequest, options?: Configuration): Promise>> { + public findPetsByStatusWithHttpInfo(param: PetApiFindPetsByStatusRequest, options?: Configuration | Middleware[]): Promise>> { return this.api.findPetsByStatusWithHttpInfo(param.status, options).toPromise(); } @@ -181,7 +182,7 @@ export class ObjectPetApi { * Finds Pets by status * @param param the request object */ - public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration): Promise> { + public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration | Middleware[]): Promise> { return this.api.findPetsByStatus(param.status, options).toPromise(); } @@ -190,7 +191,7 @@ export class ObjectPetApi { * Finds Pets by tags * @param param the request object */ - public findPetsByTagsWithHttpInfo(param: PetApiFindPetsByTagsRequest, options?: Configuration): Promise>> { + public findPetsByTagsWithHttpInfo(param: PetApiFindPetsByTagsRequest, options?: Configuration | Middleware[]): Promise>> { return this.api.findPetsByTagsWithHttpInfo(param.tags, options).toPromise(); } @@ -199,7 +200,7 @@ export class ObjectPetApi { * Finds Pets by tags * @param param the request object */ - public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration): Promise> { + public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration | Middleware[]): Promise> { return this.api.findPetsByTags(param.tags, options).toPromise(); } @@ -208,7 +209,7 @@ export class ObjectPetApi { * Find pet by ID * @param param the request object */ - public getPetByIdWithHttpInfo(param: PetApiGetPetByIdRequest, options?: Configuration): Promise> { + public getPetByIdWithHttpInfo(param: PetApiGetPetByIdRequest, options?: Configuration | Middleware[]): Promise> { return this.api.getPetByIdWithHttpInfo(param.petId, options).toPromise(); } @@ -217,7 +218,7 @@ export class ObjectPetApi { * Find pet by ID * @param param the request object */ - public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration): Promise { + public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration | Middleware[]): Promise { return this.api.getPetById(param.petId, options).toPromise(); } @@ -226,7 +227,7 @@ export class ObjectPetApi { * Update an existing pet * @param param the request object */ - public updatePetWithHttpInfo(param: PetApiUpdatePetRequest, options?: Configuration): Promise> { + public updatePetWithHttpInfo(param: PetApiUpdatePetRequest, options?: Configuration | Middleware[]): Promise> { return this.api.updatePetWithHttpInfo(param.pet, options).toPromise(); } @@ -235,7 +236,7 @@ export class ObjectPetApi { * Update an existing pet * @param param the request object */ - public updatePet(param: PetApiUpdatePetRequest, options?: Configuration): Promise { + public updatePet(param: PetApiUpdatePetRequest, options?: Configuration | Middleware[]): Promise { return this.api.updatePet(param.pet, options).toPromise(); } @@ -244,7 +245,7 @@ export class ObjectPetApi { * Updates a pet in the store with form data * @param param the request object */ - public updatePetWithFormWithHttpInfo(param: PetApiUpdatePetWithFormRequest, options?: Configuration): Promise> { + public updatePetWithFormWithHttpInfo(param: PetApiUpdatePetWithFormRequest, options?: Configuration | Middleware[]): Promise> { return this.api.updatePetWithFormWithHttpInfo(param.petId, param.name, param.status, options).toPromise(); } @@ -253,7 +254,7 @@ export class ObjectPetApi { * Updates a pet in the store with form data * @param param the request object */ - public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration): Promise { + public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration | Middleware[]): Promise { return this.api.updatePetWithForm(param.petId, param.name, param.status, options).toPromise(); } @@ -262,7 +263,7 @@ export class ObjectPetApi { * uploads an image * @param param the request object */ - public uploadFileWithHttpInfo(param: PetApiUploadFileRequest, options?: Configuration): Promise> { + public uploadFileWithHttpInfo(param: PetApiUploadFileRequest, options?: Configuration | Middleware[]): Promise> { return this.api.uploadFileWithHttpInfo(param.petId, param.additionalMetadata, param.file, options).toPromise(); } @@ -271,7 +272,7 @@ export class ObjectPetApi { * uploads an image * @param param the request object */ - public uploadFile(param: PetApiUploadFileRequest, options?: Configuration): Promise { + public uploadFile(param: PetApiUploadFileRequest, options?: Configuration | Middleware[]): Promise { return this.api.uploadFile(param.petId, param.additionalMetadata, param.file, options).toPromise(); } @@ -326,7 +327,7 @@ export class ObjectStoreApi { * Delete purchase order by ID * @param param the request object */ - public deleteOrderWithHttpInfo(param: StoreApiDeleteOrderRequest, options?: Configuration): Promise> { + public deleteOrderWithHttpInfo(param: StoreApiDeleteOrderRequest, options?: Configuration | Middleware[]): Promise> { return this.api.deleteOrderWithHttpInfo(param.orderId, options).toPromise(); } @@ -335,7 +336,7 @@ export class ObjectStoreApi { * Delete purchase order by ID * @param param the request object */ - public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration): Promise { + public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration | Middleware[]): Promise { return this.api.deleteOrder(param.orderId, options).toPromise(); } @@ -344,7 +345,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventoryWithHttpInfo(param: StoreApiGetInventoryRequest = {}, options?: Configuration): Promise> { + public getInventoryWithHttpInfo(param: StoreApiGetInventoryRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.getInventoryWithHttpInfo( options).toPromise(); } @@ -353,7 +354,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration): Promise<{ [key: string]: number; }> { + public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { return this.api.getInventory( options).toPromise(); } @@ -362,7 +363,7 @@ export class ObjectStoreApi { * Find purchase order by ID * @param param the request object */ - public getOrderByIdWithHttpInfo(param: StoreApiGetOrderByIdRequest, options?: Configuration): Promise> { + public getOrderByIdWithHttpInfo(param: StoreApiGetOrderByIdRequest, options?: Configuration | Middleware[]): Promise> { return this.api.getOrderByIdWithHttpInfo(param.orderId, options).toPromise(); } @@ -371,7 +372,7 @@ export class ObjectStoreApi { * Find purchase order by ID * @param param the request object */ - public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration): Promise { + public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration | Middleware[]): Promise { return this.api.getOrderById(param.orderId, options).toPromise(); } @@ -380,7 +381,7 @@ export class ObjectStoreApi { * Place an order for a pet * @param param the request object */ - public placeOrderWithHttpInfo(param: StoreApiPlaceOrderRequest, options?: Configuration): Promise> { + public placeOrderWithHttpInfo(param: StoreApiPlaceOrderRequest, options?: Configuration | Middleware[]): Promise> { return this.api.placeOrderWithHttpInfo(param.order, options).toPromise(); } @@ -389,7 +390,7 @@ export class ObjectStoreApi { * Place an order for a pet * @param param the request object */ - public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration): Promise { + public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration | Middleware[]): Promise { return this.api.placeOrder(param.order, options).toPromise(); } @@ -493,7 +494,7 @@ export class ObjectUserApi { * Create user * @param param the request object */ - public createUserWithHttpInfo(param: UserApiCreateUserRequest, options?: Configuration): Promise> { + public createUserWithHttpInfo(param: UserApiCreateUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.createUserWithHttpInfo(param.user, options).toPromise(); } @@ -502,7 +503,7 @@ export class ObjectUserApi { * Create user * @param param the request object */ - public createUser(param: UserApiCreateUserRequest, options?: Configuration): Promise { + public createUser(param: UserApiCreateUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.createUser(param.user, options).toPromise(); } @@ -511,7 +512,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithArrayInputWithHttpInfo(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration): Promise> { + public createUsersWithArrayInputWithHttpInfo(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration | Middleware[]): Promise> { return this.api.createUsersWithArrayInputWithHttpInfo(param.user, options).toPromise(); } @@ -520,7 +521,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration): Promise { + public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration | Middleware[]): Promise { return this.api.createUsersWithArrayInput(param.user, options).toPromise(); } @@ -529,7 +530,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithListInputWithHttpInfo(param: UserApiCreateUsersWithListInputRequest, options?: Configuration): Promise> { + public createUsersWithListInputWithHttpInfo(param: UserApiCreateUsersWithListInputRequest, options?: Configuration | Middleware[]): Promise> { return this.api.createUsersWithListInputWithHttpInfo(param.user, options).toPromise(); } @@ -538,7 +539,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration): Promise { + public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration | Middleware[]): Promise { return this.api.createUsersWithListInput(param.user, options).toPromise(); } @@ -547,7 +548,7 @@ export class ObjectUserApi { * Delete user * @param param the request object */ - public deleteUserWithHttpInfo(param: UserApiDeleteUserRequest, options?: Configuration): Promise> { + public deleteUserWithHttpInfo(param: UserApiDeleteUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.deleteUserWithHttpInfo(param.username, options).toPromise(); } @@ -556,7 +557,7 @@ export class ObjectUserApi { * Delete user * @param param the request object */ - public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration): Promise { + public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.deleteUser(param.username, options).toPromise(); } @@ -565,7 +566,7 @@ export class ObjectUserApi { * Get user by user name * @param param the request object */ - public getUserByNameWithHttpInfo(param: UserApiGetUserByNameRequest, options?: Configuration): Promise> { + public getUserByNameWithHttpInfo(param: UserApiGetUserByNameRequest, options?: Configuration | Middleware[]): Promise> { return this.api.getUserByNameWithHttpInfo(param.username, options).toPromise(); } @@ -574,7 +575,7 @@ export class ObjectUserApi { * Get user by user name * @param param the request object */ - public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration): Promise { + public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration | Middleware[]): Promise { return this.api.getUserByName(param.username, options).toPromise(); } @@ -583,7 +584,7 @@ export class ObjectUserApi { * Logs user into the system * @param param the request object */ - public loginUserWithHttpInfo(param: UserApiLoginUserRequest, options?: Configuration): Promise> { + public loginUserWithHttpInfo(param: UserApiLoginUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.loginUserWithHttpInfo(param.username, param.password, options).toPromise(); } @@ -592,7 +593,7 @@ export class ObjectUserApi { * Logs user into the system * @param param the request object */ - public loginUser(param: UserApiLoginUserRequest, options?: Configuration): Promise { + public loginUser(param: UserApiLoginUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.loginUser(param.username, param.password, options).toPromise(); } @@ -601,7 +602,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUserWithHttpInfo(param: UserApiLogoutUserRequest = {}, options?: Configuration): Promise> { + public logoutUserWithHttpInfo(param: UserApiLogoutUserRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.logoutUserWithHttpInfo( options).toPromise(); } @@ -610,7 +611,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration): Promise { + public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.logoutUser( options).toPromise(); } @@ -619,7 +620,7 @@ export class ObjectUserApi { * Updated user * @param param the request object */ - public updateUserWithHttpInfo(param: UserApiUpdateUserRequest, options?: Configuration): Promise> { + public updateUserWithHttpInfo(param: UserApiUpdateUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.updateUserWithHttpInfo(param.username, param.user, options).toPromise(); } @@ -628,7 +629,7 @@ export class ObjectUserApi { * Updated user * @param param the request object */ - public updateUser(param: UserApiUpdateUserRequest, options?: Configuration): Promise { + public updateUser(param: UserApiUpdateUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.updateUser(param.username, param.user, options).toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/ObservableAPI.ts index db37cb934a00..a9173ffe386a 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/ObservableAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http.ts'; import { Configuration} from '../configuration.ts' +import type { Middleware } from "../middleware"; import { Observable, of, from } from '../rxjsStub.ts'; import {mergeMap, map} from '../rxjsStub.ts'; import { ApiResponse } from '../models/ApiResponse.ts'; @@ -30,12 +31,21 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(pet: Pet, _options?: Configuration): Observable> { + public addPetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.addPet(pet, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -54,7 +64,7 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration): Observable { + public addPet(pet: Pet, _options?: Configuration | Middleware[]): Observable { return this.addPetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -64,12 +74,21 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration): Observable> { + public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.deletePet(petId, apiKey, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -89,7 +108,7 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration): Observable { + public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable { return this.deletePetWithHttpInfo(petId, apiKey, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -98,12 +117,21 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Observable>> { + public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable>> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.findPetsByStatus(status, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -122,7 +150,7 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Observable> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable> { return this.findPetsByStatusWithHttpInfo(status, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -131,12 +159,21 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration): Observable>> { + public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | Middleware[]): Observable>> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.findPetsByTags(tags, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -155,7 +192,7 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration): Observable> { + public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Observable> { return this.findPetsByTagsWithHttpInfo(tags, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -164,12 +201,21 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, _options?: Configuration): Observable> { + public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getPetById(petId, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -188,7 +234,7 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration): Observable { + public getPetById(petId: number, _options?: Configuration | Middleware[]): Observable { return this.getPetByIdWithHttpInfo(petId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -197,12 +243,21 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(pet: Pet, _options?: Configuration): Observable> { + public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.updatePet(pet, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -221,7 +276,7 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration): Observable { + public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Observable { return this.updatePetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -232,12 +287,21 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration): Observable> { + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.updatePetWithForm(petId, name, status, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -258,7 +322,7 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable { return this.updatePetWithFormWithHttpInfo(petId, name, status, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -269,12 +333,21 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Observable> { + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.uploadFile(petId, additionalMetadata, file, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -295,7 +368,7 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable { return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -322,12 +395,21 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration): Observable> { + public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.deleteOrder(orderId, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -346,7 +428,7 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration): Observable { + public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Observable { return this.deleteOrderWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -354,12 +436,21 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventoryWithHttpInfo(_options?: Configuration): Observable> { + public getInventoryWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getInventory(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -377,7 +468,7 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration): Observable<{ [key: string]: number; }> { + public getInventory(_options?: Configuration | Middleware[]): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo<{ [key: string]: number; }>) => apiResponse.data)); } @@ -386,12 +477,21 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration): Observable> { + public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getOrderById(orderId, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -410,7 +510,7 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration): Observable { + public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Observable { return this.getOrderByIdWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -419,12 +519,21 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(order: Order, _options?: Configuration): Observable> { + public placeOrderWithHttpInfo(order: Order, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.placeOrder(order, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -443,7 +552,7 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration): Observable { + public placeOrder(order: Order, _options?: Configuration | Middleware[]): Observable { return this.placeOrderWithHttpInfo(order, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -470,12 +579,21 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUserWithHttpInfo(user: User, _options?: Configuration): Observable> { + public createUserWithHttpInfo(user: User, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.createUser(user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -494,7 +612,7 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration): Observable { + public createUser(user: User, _options?: Configuration | Middleware[]): Observable { return this.createUserWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -503,12 +621,21 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration): Observable> { + public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.createUsersWithArrayInput(user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -527,7 +654,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration): Observable { + public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Observable { return this.createUsersWithArrayInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -536,12 +663,21 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration): Observable> { + public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.createUsersWithListInput(user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -560,7 +696,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration): Observable { + public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Observable { return this.createUsersWithListInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -569,12 +705,21 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, _options?: Configuration): Observable> { + public deleteUserWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.deleteUser(username, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -593,7 +738,7 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration): Observable { + public deleteUser(username: string, _options?: Configuration | Middleware[]): Observable { return this.deleteUserWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -602,12 +747,21 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, _options?: Configuration): Observable> { + public getUserByNameWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getUserByName(username, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -626,7 +780,7 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration): Observable { + public getUserByName(username: string, _options?: Configuration | Middleware[]): Observable { return this.getUserByNameWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -636,12 +790,21 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration): Observable> { + public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.loginUser(username, password, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -661,7 +824,7 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration): Observable { + public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Observable { return this.loginUserWithHttpInfo(username, password, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -669,12 +832,21 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUserWithHttpInfo(_options?: Configuration): Observable> { + public logoutUserWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.logoutUser(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -692,7 +864,7 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration): Observable { + public logoutUser(_options?: Configuration | Middleware[]): Observable { return this.logoutUserWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -702,12 +874,21 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration): Observable> { + public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.updateUser(username, user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -727,7 +908,7 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration): Observable { + public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Observable { return this.updateUserWithHttpInfo(username, user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/PromiseAPI.ts index f6909b6249aa..089425c36809 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/PromiseAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http.ts'; import { Configuration} from '../configuration.ts' +import type { Middleware } from "../middleware"; import { ApiResponse } from '../models/ApiResponse.ts'; import { Category } from '../models/Category.ts'; @@ -26,7 +27,7 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(pet: Pet, _options?: Configuration): Promise> { + public addPetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { const result = this.api.addPetWithHttpInfo(pet, _options); return result.toPromise(); } @@ -36,7 +37,7 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration): Promise { + public addPet(pet: Pet, _options?: Configuration | Middleware[]): Promise { const result = this.api.addPet(pet, _options); return result.toPromise(); } @@ -47,7 +48,7 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration): Promise> { + public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.deletePetWithHttpInfo(petId, apiKey, _options); return result.toPromise(); } @@ -58,7 +59,7 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration): Promise { + public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.deletePet(petId, apiKey, _options); return result.toPromise(); } @@ -68,7 +69,7 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise>> { + public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise>> { const result = this.api.findPetsByStatusWithHttpInfo(status, _options); return result.toPromise(); } @@ -78,7 +79,7 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise> { const result = this.api.findPetsByStatus(status, _options); return result.toPromise(); } @@ -88,7 +89,7 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration): Promise>> { + public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | Middleware[]): Promise>> { const result = this.api.findPetsByTagsWithHttpInfo(tags, _options); return result.toPromise(); } @@ -98,7 +99,7 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration): Promise> { + public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.findPetsByTags(tags, _options); return result.toPromise(); } @@ -108,7 +109,7 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, _options?: Configuration): Promise> { + public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | Middleware[]): Promise> { const result = this.api.getPetByIdWithHttpInfo(petId, _options); return result.toPromise(); } @@ -118,7 +119,7 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration): Promise { + public getPetById(petId: number, _options?: Configuration | Middleware[]): Promise { const result = this.api.getPetById(petId, _options); return result.toPromise(); } @@ -128,7 +129,7 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(pet: Pet, _options?: Configuration): Promise> { + public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { const result = this.api.updatePetWithHttpInfo(pet, _options); return result.toPromise(); } @@ -138,7 +139,7 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration): Promise { + public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Promise { const result = this.api.updatePet(pet, _options); return result.toPromise(); } @@ -150,7 +151,7 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration): Promise> { + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.updatePetWithFormWithHttpInfo(petId, name, status, _options); return result.toPromise(); } @@ -162,7 +163,7 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Promise { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.updatePetWithForm(petId, name, status, _options); return result.toPromise(); } @@ -174,7 +175,7 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise> { + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise> { const result = this.api.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options); return result.toPromise(); } @@ -186,7 +187,7 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise { const result = this.api.uploadFile(petId, additionalMetadata, file, _options); return result.toPromise(); } @@ -215,7 +216,7 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration): Promise> { + public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.deleteOrderWithHttpInfo(orderId, _options); return result.toPromise(); } @@ -225,7 +226,7 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration): Promise { + public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.deleteOrder(orderId, _options); return result.toPromise(); } @@ -234,7 +235,7 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventoryWithHttpInfo(_options?: Configuration): Promise> { + public getInventoryWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.getInventoryWithHttpInfo(_options); return result.toPromise(); } @@ -243,7 +244,7 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration): Promise<{ [key: string]: number; }> { + public getInventory(_options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { const result = this.api.getInventory(_options); return result.toPromise(); } @@ -253,7 +254,7 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration): Promise> { + public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | Middleware[]): Promise> { const result = this.api.getOrderByIdWithHttpInfo(orderId, _options); return result.toPromise(); } @@ -263,7 +264,7 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration): Promise { + public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Promise { const result = this.api.getOrderById(orderId, _options); return result.toPromise(); } @@ -273,7 +274,7 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(order: Order, _options?: Configuration): Promise> { + public placeOrderWithHttpInfo(order: Order, _options?: Configuration | Middleware[]): Promise> { const result = this.api.placeOrderWithHttpInfo(order, _options); return result.toPromise(); } @@ -283,7 +284,7 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration): Promise { + public placeOrder(order: Order, _options?: Configuration | Middleware[]): Promise { const result = this.api.placeOrder(order, _options); return result.toPromise(); } @@ -312,7 +313,7 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUserWithHttpInfo(user: User, _options?: Configuration): Promise> { + public createUserWithHttpInfo(user: User, _options?: Configuration | Middleware[]): Promise> { const result = this.api.createUserWithHttpInfo(user, _options); return result.toPromise(); } @@ -322,7 +323,7 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration): Promise { + public createUser(user: User, _options?: Configuration | Middleware[]): Promise { const result = this.api.createUser(user, _options); return result.toPromise(); } @@ -332,7 +333,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration): Promise> { + public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.createUsersWithArrayInputWithHttpInfo(user, _options); return result.toPromise(); } @@ -342,7 +343,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration): Promise { + public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Promise { const result = this.api.createUsersWithArrayInput(user, _options); return result.toPromise(); } @@ -352,7 +353,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration): Promise> { + public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.createUsersWithListInputWithHttpInfo(user, _options); return result.toPromise(); } @@ -362,7 +363,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration): Promise { + public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Promise { const result = this.api.createUsersWithListInput(user, _options); return result.toPromise(); } @@ -372,7 +373,7 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, _options?: Configuration): Promise> { + public deleteUserWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.deleteUserWithHttpInfo(username, _options); return result.toPromise(); } @@ -382,7 +383,7 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration): Promise { + public deleteUser(username: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.deleteUser(username, _options); return result.toPromise(); } @@ -392,7 +393,7 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, _options?: Configuration): Promise> { + public getUserByNameWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.getUserByNameWithHttpInfo(username, _options); return result.toPromise(); } @@ -402,7 +403,7 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration): Promise { + public getUserByName(username: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.getUserByName(username, _options); return result.toPromise(); } @@ -413,7 +414,7 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration): Promise> { + public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.loginUserWithHttpInfo(username, password, _options); return result.toPromise(); } @@ -424,7 +425,7 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration): Promise { + public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.loginUser(username, password, _options); return result.toPromise(); } @@ -433,7 +434,7 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUserWithHttpInfo(_options?: Configuration): Promise> { + public logoutUserWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.logoutUserWithHttpInfo(_options); return result.toPromise(); } @@ -442,7 +443,7 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration): Promise { + public logoutUser(_options?: Configuration | Middleware[]): Promise { const result = this.api.logoutUser(_options); return result.toPromise(); } @@ -453,7 +454,7 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration): Promise> { + public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | Middleware[]): Promise> { const result = this.api.updateUserWithHttpInfo(username, user, _options); return result.toPromise(); } @@ -464,7 +465,7 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration): Promise { + public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Promise { const result = this.api.updateUser(username, user, _options); return result.toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/AnotherFakeApi.ts b/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/AnotherFakeApi.ts index b5dd6b2e1682..13a866942fa1 100644 --- a/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/AnotherFakeApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/AnotherFakeApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; @@ -22,8 +23,11 @@ export class AnotherFakeApiRequestFactory extends BaseAPIRequestFactory { * To test special tags * @param client client model */ - public async _123testSpecialTags(client: Client, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async _123testSpecialTags(client: Client, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'client' is not null or undefined if (client === null || client === undefined) { @@ -51,7 +55,7 @@ export class AnotherFakeApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/DefaultApi.ts b/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/DefaultApi.ts index e496b26dd732..8dd992ac5d61 100644 --- a/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/DefaultApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/DefaultApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; @@ -19,8 +20,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** */ - public async fooGet(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async fooGet(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/foo'; @@ -31,7 +35,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/FakeApi.ts b/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/FakeApi.ts index 3658e77fcbec..d3a51ccaa673 100644 --- a/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/FakeApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/FakeApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; @@ -28,8 +29,11 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { /** * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys */ - public async fakeBigDecimalMap(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async fakeBigDecimalMap(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/fake/BigDecimalMap'; @@ -40,7 +44,7 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -51,8 +55,11 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { /** * Health check endpoint */ - public async fakeHealthGet(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async fakeHealthGet(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/fake/health'; @@ -63,7 +70,7 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -77,8 +84,11 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { * @param query1 query parameter * @param header1 header parameter */ - public async fakeHttpSignatureTest(pet: Pet, query1?: string, header1?: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async fakeHttpSignatureTest(pet: Pet, query1?: string, header1?: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'pet' is not null or undefined if (pet === null || pet === undefined) { @@ -124,7 +134,7 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -136,8 +146,11 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { * Test serialization of outer boolean types * @param body Input boolean as post body */ - public async fakeOuterBooleanSerialize(body?: boolean, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async fakeOuterBooleanSerialize(body?: boolean, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params @@ -160,7 +173,7 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -172,8 +185,11 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { * Test serialization of object with outer number type * @param outerComposite Input composite as post body */ - public async fakeOuterCompositeSerialize(outerComposite?: OuterComposite, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async fakeOuterCompositeSerialize(outerComposite?: OuterComposite, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params @@ -196,7 +212,7 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -208,8 +224,11 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { * Test serialization of outer number types * @param body Input number as post body */ - public async fakeOuterNumberSerialize(body?: number, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async fakeOuterNumberSerialize(body?: number, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params @@ -232,7 +251,7 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -244,8 +263,11 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { * Test serialization of outer string types * @param body Input string as post body */ - public async fakeOuterStringSerialize(body?: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async fakeOuterStringSerialize(body?: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params @@ -268,7 +290,7 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -280,8 +302,11 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { * Test serialization of enum (int) properties with examples * @param outerObjectWithEnumProperty Input enum (int) as post body */ - public async fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty: OuterObjectWithEnumProperty, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty: OuterObjectWithEnumProperty, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'outerObjectWithEnumProperty' is not null or undefined if (outerObjectWithEnumProperty === null || outerObjectWithEnumProperty === undefined) { @@ -309,7 +334,7 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -321,8 +346,11 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { * For this test, the body has to be a binary file. * @param body image to upload */ - public async testBodyWithBinary(body: HttpFile, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testBodyWithBinary(body: HttpFile, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { @@ -350,7 +378,7 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -362,8 +390,11 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { * For this test, the body for this request must reference a schema named `File`. * @param fileSchemaTestClass */ - public async testBodyWithFileSchema(fileSchemaTestClass: FileSchemaTestClass, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testBodyWithFileSchema(fileSchemaTestClass: FileSchemaTestClass, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'fileSchemaTestClass' is not null or undefined if (fileSchemaTestClass === null || fileSchemaTestClass === undefined) { @@ -391,7 +422,7 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -403,8 +434,11 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { * @param query * @param user */ - public async testBodyWithQueryParams(query: string, user: User, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testBodyWithQueryParams(query: string, user: User, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'query' is not null or undefined if (query === null || query === undefined) { @@ -443,7 +477,7 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -456,8 +490,11 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { * To test \"client\" model * @param client client model */ - public async testClientModel(client: Client, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testClientModel(client: Client, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'client' is not null or undefined if (client === null || client === undefined) { @@ -485,7 +522,7 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -511,8 +548,11 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { * @param password None * @param callback None */ - public async testEndpointParameters(number: number, _double: number, patternWithoutDelimiter: string, _byte: string, integer?: number, int32?: number, int64?: number, _float?: number, string?: string, binary?: HttpFile, date?: string, dateTime?: Date, password?: string, callback?: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testEndpointParameters(number: number, _double: number, patternWithoutDelimiter: string, _byte: string, integer?: number, int32?: number, int64?: number, _float?: number, string?: string, binary?: HttpFile, date?: string, dateTime?: Date, password?: string, callback?: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'number' is not null or undefined if (number === null || number === undefined) { @@ -642,7 +682,7 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -663,8 +703,11 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { * @param enumFormStringArray Form parameter enum test (string array) * @param enumFormString Form parameter enum test (string) */ - public async testEnumParameters(enumHeaderStringArray?: Array<'>' | '$'>, enumHeaderString?: '_abc' | '-efg' | '(xyz)', enumQueryStringArray?: Array<'>' | '$'>, enumQueryString?: '_abc' | '-efg' | '(xyz)', enumQueryInteger?: 1 | -2, enumQueryDouble?: 1.1 | -1.2, enumQueryModelArray?: Array, enumFormStringArray?: Array, enumFormString?: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testEnumParameters(enumHeaderStringArray?: Array<'>' | '$'>, enumHeaderString?: '_abc' | '-efg' | '(xyz)', enumQueryStringArray?: Array<'>' | '$'>, enumQueryString?: '_abc' | '-efg' | '(xyz)', enumQueryInteger?: 1 | -2, enumQueryDouble?: 1.1 | -1.2, enumQueryModelArray?: Array, enumFormStringArray?: Array, enumFormString?: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } @@ -750,7 +793,7 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -768,8 +811,11 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { * @param booleanGroup Boolean in group parameters * @param int64Group Integer in group parameters */ - public async testGroupParameters(requiredStringGroup: number, requiredBooleanGroup: boolean, requiredInt64Group: number, stringGroup?: number, booleanGroup?: boolean, int64Group?: number, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testGroupParameters(requiredStringGroup: number, requiredBooleanGroup: boolean, requiredInt64Group: number, stringGroup?: number, booleanGroup?: boolean, int64Group?: number, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'requiredStringGroup' is not null or undefined if (requiredStringGroup === null || requiredStringGroup === undefined) { @@ -833,7 +879,7 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -846,8 +892,11 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { * test inline additionalProperties * @param requestBody request body */ - public async testInlineAdditionalProperties(requestBody: { [key: string]: string; }, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testInlineAdditionalProperties(requestBody: { [key: string]: string; }, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'requestBody' is not null or undefined if (requestBody === null || requestBody === undefined) { @@ -875,7 +924,7 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -889,8 +938,11 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { * @param param field1 * @param param2 field2 */ - public async testJsonFormData(param: string, param2: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testJsonFormData(param: string, param2: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'param' is not null or undefined if (param === null || param === undefined) { @@ -942,7 +994,7 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -960,8 +1012,11 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { * @param allowEmpty * @param language */ - public async testQueryParameterCollectionFormat(pipe: Array, ioutil: Array, http: Array, url: Array, context: Array, allowEmpty: string, language?: { [key: string]: string; }, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testQueryParameterCollectionFormat(pipe: Array, ioutil: Array, http: Array, url: Array, context: Array, allowEmpty: string, language?: { [key: string]: string; }, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'pipe' is not null or undefined if (pipe === null || pipe === undefined) { @@ -1050,7 +1105,7 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/FakeClassnameTags123Api.ts b/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/FakeClassnameTags123Api.ts index fb090d1cf66e..dab46487caa7 100644 --- a/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/FakeClassnameTags123Api.ts +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/FakeClassnameTags123Api.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; @@ -22,8 +23,11 @@ export class FakeClassnameTags123ApiRequestFactory extends BaseAPIRequestFactory * To test class name in snake case * @param client client model */ - public async testClassname(client: Client, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async testClassname(client: Client, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'client' is not null or undefined if (client === null || client === undefined) { @@ -57,7 +61,7 @@ export class FakeClassnameTags123ApiRequestFactory extends BaseAPIRequestFactory await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/PetApi.ts b/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/PetApi.ts index 09f3ca2f6adf..63f2cfd04516 100644 --- a/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/PetApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/PetApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; @@ -23,8 +24,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public async addPet(pet: Pet, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async addPet(pet: Pet, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'pet' is not null or undefined if (pet === null || pet === undefined) { @@ -60,7 +64,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -74,8 +78,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param petId Pet id to delete * @param apiKey */ - public async deletePet(petId: number, apiKey?: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -103,7 +110,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -116,8 +123,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'status' is not null or undefined if (status === null || status === undefined) { @@ -145,7 +155,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -158,8 +168,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Finds Pets by tags * @param tags Tags to filter by */ - public async findPetsByTags(tags: Set, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async findPetsByTags(tags: Set, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'tags' is not null or undefined if (tags === null || tags === undefined) { @@ -187,7 +200,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -200,8 +213,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Find pet by ID * @param petId ID of pet to return */ - public async getPetById(petId: number, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getPetById(petId: number, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -225,7 +241,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -238,8 +254,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public async updatePet(pet: Pet, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async updatePet(pet: Pet, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'pet' is not null or undefined if (pet === null || pet === undefined) { @@ -275,7 +294,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -290,8 +309,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param name Updated name of the pet * @param status Updated status of the pet */ - public async updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -346,7 +368,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -361,8 +383,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - public async uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -419,7 +444,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -434,8 +459,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param requiredFile file to upload * @param additionalMetadata Additional data to pass to server */ - public async uploadFileWithRequiredFile(petId: number, requiredFile: HttpFile, additionalMetadata?: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async uploadFileWithRequiredFile(petId: number, requiredFile: HttpFile, additionalMetadata?: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -497,7 +525,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/StoreApi.ts b/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/StoreApi.ts index 129ccfed17b1..3de742e31d3f 100644 --- a/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/StoreApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/StoreApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; @@ -22,8 +23,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public async deleteOrder(orderId: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'orderId' is not null or undefined if (orderId === null || orderId === undefined) { @@ -41,7 +45,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -53,8 +57,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public async getInventory(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getInventory(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/store/inventory'; @@ -71,7 +78,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -84,8 +91,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public async getOrderById(orderId: number, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getOrderById(orderId: number, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'orderId' is not null or undefined if (orderId === null || orderId === undefined) { @@ -103,7 +113,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -116,8 +126,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Place an order for a pet * @param order order placed for purchasing the pet */ - public async placeOrder(order: Order, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async placeOrder(order: Order, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'order' is not null or undefined if (order === null || order === undefined) { @@ -145,7 +158,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/UserApi.ts b/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/UserApi.ts index da60fbe50ff2..1b4657352d73 100644 --- a/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/UserApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/UserApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; @@ -22,8 +23,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Create user * @param user Created user object */ - public async createUser(user: User, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async createUser(user: User, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'user' is not null or undefined if (user === null || user === undefined) { @@ -51,7 +55,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -64,8 +68,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Creates list of users with given input array * @param user List of user object */ - public async createUsersWithArrayInput(user: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'user' is not null or undefined if (user === null || user === undefined) { @@ -93,7 +100,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -106,8 +113,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Creates list of users with given input array * @param user List of user object */ - public async createUsersWithListInput(user: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'user' is not null or undefined if (user === null || user === undefined) { @@ -135,7 +145,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -148,8 +158,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Delete user * @param username The name that needs to be deleted */ - public async deleteUser(username: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async deleteUser(username: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -167,7 +180,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -180,8 +193,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public async getUserByName(username: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getUserByName(username: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -199,7 +215,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -213,8 +229,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * @param username The user name for login * @param password The password for login in clear text */ - public async loginUser(username: string, password: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -247,7 +266,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -259,8 +278,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * * Logs out current logged in user session */ - public async logoutUser(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async logoutUser(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/user/logout'; @@ -271,7 +293,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -285,8 +307,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * @param username name that need to be deleted * @param user Updated user object */ - public async updateUser(username: string, user: User, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -321,7 +346,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/explode-query/types/ObjectParamAPI.ts index 8eea550598e5..43dc279321a2 100644 --- a/samples/openapi3/client/petstore/typescript/builds/explode-query/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/types/ObjectParamAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { AdditionalPropertiesClass } from '../models/AdditionalPropertiesClass'; import { AllOfWithSingleRef } from '../models/AllOfWithSingleRef'; @@ -73,7 +74,7 @@ export class ObjectAnotherFakeApi { * To test special tags * @param param the request object */ - public _123testSpecialTagsWithHttpInfo(param: AnotherFakeApi123testSpecialTagsRequest, options?: Configuration): Promise> { + public _123testSpecialTagsWithHttpInfo(param: AnotherFakeApi123testSpecialTagsRequest, options?: Configuration | Middleware[]): Promise> { return this.api._123testSpecialTagsWithHttpInfo(param.client, options).toPromise(); } @@ -82,7 +83,7 @@ export class ObjectAnotherFakeApi { * To test special tags * @param param the request object */ - public _123testSpecialTags(param: AnotherFakeApi123testSpecialTagsRequest, options?: Configuration): Promise { + public _123testSpecialTags(param: AnotherFakeApi123testSpecialTagsRequest, options?: Configuration | Middleware[]): Promise { return this.api._123testSpecialTags(param.client, options).toPromise(); } @@ -104,14 +105,14 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public fooGetWithHttpInfo(param: DefaultApiFooGetRequest = {}, options?: Configuration): Promise> { + public fooGetWithHttpInfo(param: DefaultApiFooGetRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.fooGetWithHttpInfo( options).toPromise(); } /** * @param param the request object */ - public fooGet(param: DefaultApiFooGetRequest = {}, options?: Configuration): Promise { + public fooGet(param: DefaultApiFooGetRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.fooGet( options).toPromise(); } @@ -547,7 +548,7 @@ export class ObjectFakeApi { * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys * @param param the request object */ - public fakeBigDecimalMapWithHttpInfo(param: FakeApiFakeBigDecimalMapRequest = {}, options?: Configuration): Promise> { + public fakeBigDecimalMapWithHttpInfo(param: FakeApiFakeBigDecimalMapRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.fakeBigDecimalMapWithHttpInfo( options).toPromise(); } @@ -555,7 +556,7 @@ export class ObjectFakeApi { * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys * @param param the request object */ - public fakeBigDecimalMap(param: FakeApiFakeBigDecimalMapRequest = {}, options?: Configuration): Promise { + public fakeBigDecimalMap(param: FakeApiFakeBigDecimalMapRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.fakeBigDecimalMap( options).toPromise(); } @@ -563,7 +564,7 @@ export class ObjectFakeApi { * Health check endpoint * @param param the request object */ - public fakeHealthGetWithHttpInfo(param: FakeApiFakeHealthGetRequest = {}, options?: Configuration): Promise> { + public fakeHealthGetWithHttpInfo(param: FakeApiFakeHealthGetRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.fakeHealthGetWithHttpInfo( options).toPromise(); } @@ -571,7 +572,7 @@ export class ObjectFakeApi { * Health check endpoint * @param param the request object */ - public fakeHealthGet(param: FakeApiFakeHealthGetRequest = {}, options?: Configuration): Promise { + public fakeHealthGet(param: FakeApiFakeHealthGetRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.fakeHealthGet( options).toPromise(); } @@ -579,7 +580,7 @@ export class ObjectFakeApi { * test http signature authentication * @param param the request object */ - public fakeHttpSignatureTestWithHttpInfo(param: FakeApiFakeHttpSignatureTestRequest, options?: Configuration): Promise> { + public fakeHttpSignatureTestWithHttpInfo(param: FakeApiFakeHttpSignatureTestRequest, options?: Configuration | Middleware[]): Promise> { return this.api.fakeHttpSignatureTestWithHttpInfo(param.pet, param.query1, param.header1, options).toPromise(); } @@ -587,7 +588,7 @@ export class ObjectFakeApi { * test http signature authentication * @param param the request object */ - public fakeHttpSignatureTest(param: FakeApiFakeHttpSignatureTestRequest, options?: Configuration): Promise { + public fakeHttpSignatureTest(param: FakeApiFakeHttpSignatureTestRequest, options?: Configuration | Middleware[]): Promise { return this.api.fakeHttpSignatureTest(param.pet, param.query1, param.header1, options).toPromise(); } @@ -595,7 +596,7 @@ export class ObjectFakeApi { * Test serialization of outer boolean types * @param param the request object */ - public fakeOuterBooleanSerializeWithHttpInfo(param: FakeApiFakeOuterBooleanSerializeRequest = {}, options?: Configuration): Promise> { + public fakeOuterBooleanSerializeWithHttpInfo(param: FakeApiFakeOuterBooleanSerializeRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.fakeOuterBooleanSerializeWithHttpInfo(param.body, options).toPromise(); } @@ -603,7 +604,7 @@ export class ObjectFakeApi { * Test serialization of outer boolean types * @param param the request object */ - public fakeOuterBooleanSerialize(param: FakeApiFakeOuterBooleanSerializeRequest = {}, options?: Configuration): Promise { + public fakeOuterBooleanSerialize(param: FakeApiFakeOuterBooleanSerializeRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.fakeOuterBooleanSerialize(param.body, options).toPromise(); } @@ -611,7 +612,7 @@ export class ObjectFakeApi { * Test serialization of object with outer number type * @param param the request object */ - public fakeOuterCompositeSerializeWithHttpInfo(param: FakeApiFakeOuterCompositeSerializeRequest = {}, options?: Configuration): Promise> { + public fakeOuterCompositeSerializeWithHttpInfo(param: FakeApiFakeOuterCompositeSerializeRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.fakeOuterCompositeSerializeWithHttpInfo(param.outerComposite, options).toPromise(); } @@ -619,7 +620,7 @@ export class ObjectFakeApi { * Test serialization of object with outer number type * @param param the request object */ - public fakeOuterCompositeSerialize(param: FakeApiFakeOuterCompositeSerializeRequest = {}, options?: Configuration): Promise { + public fakeOuterCompositeSerialize(param: FakeApiFakeOuterCompositeSerializeRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.fakeOuterCompositeSerialize(param.outerComposite, options).toPromise(); } @@ -627,7 +628,7 @@ export class ObjectFakeApi { * Test serialization of outer number types * @param param the request object */ - public fakeOuterNumberSerializeWithHttpInfo(param: FakeApiFakeOuterNumberSerializeRequest = {}, options?: Configuration): Promise> { + public fakeOuterNumberSerializeWithHttpInfo(param: FakeApiFakeOuterNumberSerializeRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.fakeOuterNumberSerializeWithHttpInfo(param.body, options).toPromise(); } @@ -635,7 +636,7 @@ export class ObjectFakeApi { * Test serialization of outer number types * @param param the request object */ - public fakeOuterNumberSerialize(param: FakeApiFakeOuterNumberSerializeRequest = {}, options?: Configuration): Promise { + public fakeOuterNumberSerialize(param: FakeApiFakeOuterNumberSerializeRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.fakeOuterNumberSerialize(param.body, options).toPromise(); } @@ -643,7 +644,7 @@ export class ObjectFakeApi { * Test serialization of outer string types * @param param the request object */ - public fakeOuterStringSerializeWithHttpInfo(param: FakeApiFakeOuterStringSerializeRequest = {}, options?: Configuration): Promise> { + public fakeOuterStringSerializeWithHttpInfo(param: FakeApiFakeOuterStringSerializeRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.fakeOuterStringSerializeWithHttpInfo(param.body, options).toPromise(); } @@ -651,7 +652,7 @@ export class ObjectFakeApi { * Test serialization of outer string types * @param param the request object */ - public fakeOuterStringSerialize(param: FakeApiFakeOuterStringSerializeRequest = {}, options?: Configuration): Promise { + public fakeOuterStringSerialize(param: FakeApiFakeOuterStringSerializeRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.fakeOuterStringSerialize(param.body, options).toPromise(); } @@ -659,7 +660,7 @@ export class ObjectFakeApi { * Test serialization of enum (int) properties with examples * @param param the request object */ - public fakePropertyEnumIntegerSerializeWithHttpInfo(param: FakeApiFakePropertyEnumIntegerSerializeRequest, options?: Configuration): Promise> { + public fakePropertyEnumIntegerSerializeWithHttpInfo(param: FakeApiFakePropertyEnumIntegerSerializeRequest, options?: Configuration | Middleware[]): Promise> { return this.api.fakePropertyEnumIntegerSerializeWithHttpInfo(param.outerObjectWithEnumProperty, options).toPromise(); } @@ -667,7 +668,7 @@ export class ObjectFakeApi { * Test serialization of enum (int) properties with examples * @param param the request object */ - public fakePropertyEnumIntegerSerialize(param: FakeApiFakePropertyEnumIntegerSerializeRequest, options?: Configuration): Promise { + public fakePropertyEnumIntegerSerialize(param: FakeApiFakePropertyEnumIntegerSerializeRequest, options?: Configuration | Middleware[]): Promise { return this.api.fakePropertyEnumIntegerSerialize(param.outerObjectWithEnumProperty, options).toPromise(); } @@ -675,7 +676,7 @@ export class ObjectFakeApi { * For this test, the body has to be a binary file. * @param param the request object */ - public testBodyWithBinaryWithHttpInfo(param: FakeApiTestBodyWithBinaryRequest, options?: Configuration): Promise> { + public testBodyWithBinaryWithHttpInfo(param: FakeApiTestBodyWithBinaryRequest, options?: Configuration | Middleware[]): Promise> { return this.api.testBodyWithBinaryWithHttpInfo(param.body, options).toPromise(); } @@ -683,7 +684,7 @@ export class ObjectFakeApi { * For this test, the body has to be a binary file. * @param param the request object */ - public testBodyWithBinary(param: FakeApiTestBodyWithBinaryRequest, options?: Configuration): Promise { + public testBodyWithBinary(param: FakeApiTestBodyWithBinaryRequest, options?: Configuration | Middleware[]): Promise { return this.api.testBodyWithBinary(param.body, options).toPromise(); } @@ -691,7 +692,7 @@ export class ObjectFakeApi { * For this test, the body for this request must reference a schema named `File`. * @param param the request object */ - public testBodyWithFileSchemaWithHttpInfo(param: FakeApiTestBodyWithFileSchemaRequest, options?: Configuration): Promise> { + public testBodyWithFileSchemaWithHttpInfo(param: FakeApiTestBodyWithFileSchemaRequest, options?: Configuration | Middleware[]): Promise> { return this.api.testBodyWithFileSchemaWithHttpInfo(param.fileSchemaTestClass, options).toPromise(); } @@ -699,21 +700,21 @@ export class ObjectFakeApi { * For this test, the body for this request must reference a schema named `File`. * @param param the request object */ - public testBodyWithFileSchema(param: FakeApiTestBodyWithFileSchemaRequest, options?: Configuration): Promise { + public testBodyWithFileSchema(param: FakeApiTestBodyWithFileSchemaRequest, options?: Configuration | Middleware[]): Promise { return this.api.testBodyWithFileSchema(param.fileSchemaTestClass, options).toPromise(); } /** * @param param the request object */ - public testBodyWithQueryParamsWithHttpInfo(param: FakeApiTestBodyWithQueryParamsRequest, options?: Configuration): Promise> { + public testBodyWithQueryParamsWithHttpInfo(param: FakeApiTestBodyWithQueryParamsRequest, options?: Configuration | Middleware[]): Promise> { return this.api.testBodyWithQueryParamsWithHttpInfo(param.query, param.user, options).toPromise(); } /** * @param param the request object */ - public testBodyWithQueryParams(param: FakeApiTestBodyWithQueryParamsRequest, options?: Configuration): Promise { + public testBodyWithQueryParams(param: FakeApiTestBodyWithQueryParamsRequest, options?: Configuration | Middleware[]): Promise { return this.api.testBodyWithQueryParams(param.query, param.user, options).toPromise(); } @@ -722,7 +723,7 @@ export class ObjectFakeApi { * To test \"client\" model * @param param the request object */ - public testClientModelWithHttpInfo(param: FakeApiTestClientModelRequest, options?: Configuration): Promise> { + public testClientModelWithHttpInfo(param: FakeApiTestClientModelRequest, options?: Configuration | Middleware[]): Promise> { return this.api.testClientModelWithHttpInfo(param.client, options).toPromise(); } @@ -731,7 +732,7 @@ export class ObjectFakeApi { * To test \"client\" model * @param param the request object */ - public testClientModel(param: FakeApiTestClientModelRequest, options?: Configuration): Promise { + public testClientModel(param: FakeApiTestClientModelRequest, options?: Configuration | Middleware[]): Promise { return this.api.testClientModel(param.client, options).toPromise(); } @@ -740,7 +741,7 @@ export class ObjectFakeApi { * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * @param param the request object */ - public testEndpointParametersWithHttpInfo(param: FakeApiTestEndpointParametersRequest, options?: Configuration): Promise> { + public testEndpointParametersWithHttpInfo(param: FakeApiTestEndpointParametersRequest, options?: Configuration | Middleware[]): Promise> { return this.api.testEndpointParametersWithHttpInfo(param.number, param._double, param.patternWithoutDelimiter, param._byte, param.integer, param.int32, param.int64, param._float, param.string, param.binary, param.date, param.dateTime, param.password, param.callback, options).toPromise(); } @@ -749,7 +750,7 @@ export class ObjectFakeApi { * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * @param param the request object */ - public testEndpointParameters(param: FakeApiTestEndpointParametersRequest, options?: Configuration): Promise { + public testEndpointParameters(param: FakeApiTestEndpointParametersRequest, options?: Configuration | Middleware[]): Promise { return this.api.testEndpointParameters(param.number, param._double, param.patternWithoutDelimiter, param._byte, param.integer, param.int32, param.int64, param._float, param.string, param.binary, param.date, param.dateTime, param.password, param.callback, options).toPromise(); } @@ -758,7 +759,7 @@ export class ObjectFakeApi { * To test enum parameters * @param param the request object */ - public testEnumParametersWithHttpInfo(param: FakeApiTestEnumParametersRequest = {}, options?: Configuration): Promise> { + public testEnumParametersWithHttpInfo(param: FakeApiTestEnumParametersRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.testEnumParametersWithHttpInfo(param.enumHeaderStringArray, param.enumHeaderString, param.enumQueryStringArray, param.enumQueryString, param.enumQueryInteger, param.enumQueryDouble, param.enumQueryModelArray, param.enumFormStringArray, param.enumFormString, options).toPromise(); } @@ -767,7 +768,7 @@ export class ObjectFakeApi { * To test enum parameters * @param param the request object */ - public testEnumParameters(param: FakeApiTestEnumParametersRequest = {}, options?: Configuration): Promise { + public testEnumParameters(param: FakeApiTestEnumParametersRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.testEnumParameters(param.enumHeaderStringArray, param.enumHeaderString, param.enumQueryStringArray, param.enumQueryString, param.enumQueryInteger, param.enumQueryDouble, param.enumQueryModelArray, param.enumFormStringArray, param.enumFormString, options).toPromise(); } @@ -776,7 +777,7 @@ export class ObjectFakeApi { * Fake endpoint to test group parameters (optional) * @param param the request object */ - public testGroupParametersWithHttpInfo(param: FakeApiTestGroupParametersRequest, options?: Configuration): Promise> { + public testGroupParametersWithHttpInfo(param: FakeApiTestGroupParametersRequest, options?: Configuration | Middleware[]): Promise> { return this.api.testGroupParametersWithHttpInfo(param.requiredStringGroup, param.requiredBooleanGroup, param.requiredInt64Group, param.stringGroup, param.booleanGroup, param.int64Group, options).toPromise(); } @@ -785,7 +786,7 @@ export class ObjectFakeApi { * Fake endpoint to test group parameters (optional) * @param param the request object */ - public testGroupParameters(param: FakeApiTestGroupParametersRequest, options?: Configuration): Promise { + public testGroupParameters(param: FakeApiTestGroupParametersRequest, options?: Configuration | Middleware[]): Promise { return this.api.testGroupParameters(param.requiredStringGroup, param.requiredBooleanGroup, param.requiredInt64Group, param.stringGroup, param.booleanGroup, param.int64Group, options).toPromise(); } @@ -794,7 +795,7 @@ export class ObjectFakeApi { * test inline additionalProperties * @param param the request object */ - public testInlineAdditionalPropertiesWithHttpInfo(param: FakeApiTestInlineAdditionalPropertiesRequest, options?: Configuration): Promise> { + public testInlineAdditionalPropertiesWithHttpInfo(param: FakeApiTestInlineAdditionalPropertiesRequest, options?: Configuration | Middleware[]): Promise> { return this.api.testInlineAdditionalPropertiesWithHttpInfo(param.requestBody, options).toPromise(); } @@ -803,7 +804,7 @@ export class ObjectFakeApi { * test inline additionalProperties * @param param the request object */ - public testInlineAdditionalProperties(param: FakeApiTestInlineAdditionalPropertiesRequest, options?: Configuration): Promise { + public testInlineAdditionalProperties(param: FakeApiTestInlineAdditionalPropertiesRequest, options?: Configuration | Middleware[]): Promise { return this.api.testInlineAdditionalProperties(param.requestBody, options).toPromise(); } @@ -812,7 +813,7 @@ export class ObjectFakeApi { * test json serialization of form data * @param param the request object */ - public testJsonFormDataWithHttpInfo(param: FakeApiTestJsonFormDataRequest, options?: Configuration): Promise> { + public testJsonFormDataWithHttpInfo(param: FakeApiTestJsonFormDataRequest, options?: Configuration | Middleware[]): Promise> { return this.api.testJsonFormDataWithHttpInfo(param.param, param.param2, options).toPromise(); } @@ -821,7 +822,7 @@ export class ObjectFakeApi { * test json serialization of form data * @param param the request object */ - public testJsonFormData(param: FakeApiTestJsonFormDataRequest, options?: Configuration): Promise { + public testJsonFormData(param: FakeApiTestJsonFormDataRequest, options?: Configuration | Middleware[]): Promise { return this.api.testJsonFormData(param.param, param.param2, options).toPromise(); } @@ -829,7 +830,7 @@ export class ObjectFakeApi { * To test the collection format in query parameters * @param param the request object */ - public testQueryParameterCollectionFormatWithHttpInfo(param: FakeApiTestQueryParameterCollectionFormatRequest, options?: Configuration): Promise> { + public testQueryParameterCollectionFormatWithHttpInfo(param: FakeApiTestQueryParameterCollectionFormatRequest, options?: Configuration | Middleware[]): Promise> { return this.api.testQueryParameterCollectionFormatWithHttpInfo(param.pipe, param.ioutil, param.http, param.url, param.context, param.allowEmpty, param.language, options).toPromise(); } @@ -837,7 +838,7 @@ export class ObjectFakeApi { * To test the collection format in query parameters * @param param the request object */ - public testQueryParameterCollectionFormat(param: FakeApiTestQueryParameterCollectionFormatRequest, options?: Configuration): Promise { + public testQueryParameterCollectionFormat(param: FakeApiTestQueryParameterCollectionFormatRequest, options?: Configuration | Middleware[]): Promise { return this.api.testQueryParameterCollectionFormat(param.pipe, param.ioutil, param.http, param.url, param.context, param.allowEmpty, param.language, options).toPromise(); } @@ -867,7 +868,7 @@ export class ObjectFakeClassnameTags123Api { * To test class name in snake case * @param param the request object */ - public testClassnameWithHttpInfo(param: FakeClassnameTags123ApiTestClassnameRequest, options?: Configuration): Promise> { + public testClassnameWithHttpInfo(param: FakeClassnameTags123ApiTestClassnameRequest, options?: Configuration | Middleware[]): Promise> { return this.api.testClassnameWithHttpInfo(param.client, options).toPromise(); } @@ -876,7 +877,7 @@ export class ObjectFakeClassnameTags123Api { * To test class name in snake case * @param param the request object */ - public testClassname(param: FakeClassnameTags123ApiTestClassnameRequest, options?: Configuration): Promise { + public testClassname(param: FakeClassnameTags123ApiTestClassnameRequest, options?: Configuration | Middleware[]): Promise { return this.api.testClassname(param.client, options).toPromise(); } @@ -1034,7 +1035,7 @@ export class ObjectPetApi { * Add a new pet to the store * @param param the request object */ - public addPetWithHttpInfo(param: PetApiAddPetRequest, options?: Configuration): Promise> { + public addPetWithHttpInfo(param: PetApiAddPetRequest, options?: Configuration | Middleware[]): Promise> { return this.api.addPetWithHttpInfo(param.pet, options).toPromise(); } @@ -1043,7 +1044,7 @@ export class ObjectPetApi { * Add a new pet to the store * @param param the request object */ - public addPet(param: PetApiAddPetRequest, options?: Configuration): Promise { + public addPet(param: PetApiAddPetRequest, options?: Configuration | Middleware[]): Promise { return this.api.addPet(param.pet, options).toPromise(); } @@ -1052,7 +1053,7 @@ export class ObjectPetApi { * Deletes a pet * @param param the request object */ - public deletePetWithHttpInfo(param: PetApiDeletePetRequest, options?: Configuration): Promise> { + public deletePetWithHttpInfo(param: PetApiDeletePetRequest, options?: Configuration | Middleware[]): Promise> { return this.api.deletePetWithHttpInfo(param.petId, param.apiKey, options).toPromise(); } @@ -1061,7 +1062,7 @@ export class ObjectPetApi { * Deletes a pet * @param param the request object */ - public deletePet(param: PetApiDeletePetRequest, options?: Configuration): Promise { + public deletePet(param: PetApiDeletePetRequest, options?: Configuration | Middleware[]): Promise { return this.api.deletePet(param.petId, param.apiKey, options).toPromise(); } @@ -1070,7 +1071,7 @@ export class ObjectPetApi { * Finds Pets by status * @param param the request object */ - public findPetsByStatusWithHttpInfo(param: PetApiFindPetsByStatusRequest, options?: Configuration): Promise>> { + public findPetsByStatusWithHttpInfo(param: PetApiFindPetsByStatusRequest, options?: Configuration | Middleware[]): Promise>> { return this.api.findPetsByStatusWithHttpInfo(param.status, options).toPromise(); } @@ -1079,7 +1080,7 @@ export class ObjectPetApi { * Finds Pets by status * @param param the request object */ - public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration): Promise> { + public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration | Middleware[]): Promise> { return this.api.findPetsByStatus(param.status, options).toPromise(); } @@ -1088,7 +1089,7 @@ export class ObjectPetApi { * Finds Pets by tags * @param param the request object */ - public findPetsByTagsWithHttpInfo(param: PetApiFindPetsByTagsRequest, options?: Configuration): Promise>> { + public findPetsByTagsWithHttpInfo(param: PetApiFindPetsByTagsRequest, options?: Configuration | Middleware[]): Promise>> { return this.api.findPetsByTagsWithHttpInfo(param.tags, options).toPromise(); } @@ -1097,7 +1098,7 @@ export class ObjectPetApi { * Finds Pets by tags * @param param the request object */ - public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration): Promise> { + public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration | Middleware[]): Promise> { return this.api.findPetsByTags(param.tags, options).toPromise(); } @@ -1106,7 +1107,7 @@ export class ObjectPetApi { * Find pet by ID * @param param the request object */ - public getPetByIdWithHttpInfo(param: PetApiGetPetByIdRequest, options?: Configuration): Promise> { + public getPetByIdWithHttpInfo(param: PetApiGetPetByIdRequest, options?: Configuration | Middleware[]): Promise> { return this.api.getPetByIdWithHttpInfo(param.petId, options).toPromise(); } @@ -1115,7 +1116,7 @@ export class ObjectPetApi { * Find pet by ID * @param param the request object */ - public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration): Promise { + public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration | Middleware[]): Promise { return this.api.getPetById(param.petId, options).toPromise(); } @@ -1124,7 +1125,7 @@ export class ObjectPetApi { * Update an existing pet * @param param the request object */ - public updatePetWithHttpInfo(param: PetApiUpdatePetRequest, options?: Configuration): Promise> { + public updatePetWithHttpInfo(param: PetApiUpdatePetRequest, options?: Configuration | Middleware[]): Promise> { return this.api.updatePetWithHttpInfo(param.pet, options).toPromise(); } @@ -1133,7 +1134,7 @@ export class ObjectPetApi { * Update an existing pet * @param param the request object */ - public updatePet(param: PetApiUpdatePetRequest, options?: Configuration): Promise { + public updatePet(param: PetApiUpdatePetRequest, options?: Configuration | Middleware[]): Promise { return this.api.updatePet(param.pet, options).toPromise(); } @@ -1142,7 +1143,7 @@ export class ObjectPetApi { * Updates a pet in the store with form data * @param param the request object */ - public updatePetWithFormWithHttpInfo(param: PetApiUpdatePetWithFormRequest, options?: Configuration): Promise> { + public updatePetWithFormWithHttpInfo(param: PetApiUpdatePetWithFormRequest, options?: Configuration | Middleware[]): Promise> { return this.api.updatePetWithFormWithHttpInfo(param.petId, param.name, param.status, options).toPromise(); } @@ -1151,7 +1152,7 @@ export class ObjectPetApi { * Updates a pet in the store with form data * @param param the request object */ - public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration): Promise { + public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration | Middleware[]): Promise { return this.api.updatePetWithForm(param.petId, param.name, param.status, options).toPromise(); } @@ -1160,7 +1161,7 @@ export class ObjectPetApi { * uploads an image * @param param the request object */ - public uploadFileWithHttpInfo(param: PetApiUploadFileRequest, options?: Configuration): Promise> { + public uploadFileWithHttpInfo(param: PetApiUploadFileRequest, options?: Configuration | Middleware[]): Promise> { return this.api.uploadFileWithHttpInfo(param.petId, param.additionalMetadata, param.file, options).toPromise(); } @@ -1169,7 +1170,7 @@ export class ObjectPetApi { * uploads an image * @param param the request object */ - public uploadFile(param: PetApiUploadFileRequest, options?: Configuration): Promise { + public uploadFile(param: PetApiUploadFileRequest, options?: Configuration | Middleware[]): Promise { return this.api.uploadFile(param.petId, param.additionalMetadata, param.file, options).toPromise(); } @@ -1178,7 +1179,7 @@ export class ObjectPetApi { * uploads an image (required) * @param param the request object */ - public uploadFileWithRequiredFileWithHttpInfo(param: PetApiUploadFileWithRequiredFileRequest, options?: Configuration): Promise> { + public uploadFileWithRequiredFileWithHttpInfo(param: PetApiUploadFileWithRequiredFileRequest, options?: Configuration | Middleware[]): Promise> { return this.api.uploadFileWithRequiredFileWithHttpInfo(param.petId, param.requiredFile, param.additionalMetadata, options).toPromise(); } @@ -1187,7 +1188,7 @@ export class ObjectPetApi { * uploads an image (required) * @param param the request object */ - public uploadFileWithRequiredFile(param: PetApiUploadFileWithRequiredFileRequest, options?: Configuration): Promise { + public uploadFileWithRequiredFile(param: PetApiUploadFileWithRequiredFileRequest, options?: Configuration | Middleware[]): Promise { return this.api.uploadFileWithRequiredFile(param.petId, param.requiredFile, param.additionalMetadata, options).toPromise(); } @@ -1242,7 +1243,7 @@ export class ObjectStoreApi { * Delete purchase order by ID * @param param the request object */ - public deleteOrderWithHttpInfo(param: StoreApiDeleteOrderRequest, options?: Configuration): Promise> { + public deleteOrderWithHttpInfo(param: StoreApiDeleteOrderRequest, options?: Configuration | Middleware[]): Promise> { return this.api.deleteOrderWithHttpInfo(param.orderId, options).toPromise(); } @@ -1251,7 +1252,7 @@ export class ObjectStoreApi { * Delete purchase order by ID * @param param the request object */ - public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration): Promise { + public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration | Middleware[]): Promise { return this.api.deleteOrder(param.orderId, options).toPromise(); } @@ -1260,7 +1261,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventoryWithHttpInfo(param: StoreApiGetInventoryRequest = {}, options?: Configuration): Promise> { + public getInventoryWithHttpInfo(param: StoreApiGetInventoryRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.getInventoryWithHttpInfo( options).toPromise(); } @@ -1269,7 +1270,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration): Promise<{ [key: string]: number; }> { + public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { return this.api.getInventory( options).toPromise(); } @@ -1278,7 +1279,7 @@ export class ObjectStoreApi { * Find purchase order by ID * @param param the request object */ - public getOrderByIdWithHttpInfo(param: StoreApiGetOrderByIdRequest, options?: Configuration): Promise> { + public getOrderByIdWithHttpInfo(param: StoreApiGetOrderByIdRequest, options?: Configuration | Middleware[]): Promise> { return this.api.getOrderByIdWithHttpInfo(param.orderId, options).toPromise(); } @@ -1287,7 +1288,7 @@ export class ObjectStoreApi { * Find purchase order by ID * @param param the request object */ - public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration): Promise { + public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration | Middleware[]): Promise { return this.api.getOrderById(param.orderId, options).toPromise(); } @@ -1296,7 +1297,7 @@ export class ObjectStoreApi { * Place an order for a pet * @param param the request object */ - public placeOrderWithHttpInfo(param: StoreApiPlaceOrderRequest, options?: Configuration): Promise> { + public placeOrderWithHttpInfo(param: StoreApiPlaceOrderRequest, options?: Configuration | Middleware[]): Promise> { return this.api.placeOrderWithHttpInfo(param.order, options).toPromise(); } @@ -1305,7 +1306,7 @@ export class ObjectStoreApi { * Place an order for a pet * @param param the request object */ - public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration): Promise { + public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration | Middleware[]): Promise { return this.api.placeOrder(param.order, options).toPromise(); } @@ -1409,7 +1410,7 @@ export class ObjectUserApi { * Create user * @param param the request object */ - public createUserWithHttpInfo(param: UserApiCreateUserRequest, options?: Configuration): Promise> { + public createUserWithHttpInfo(param: UserApiCreateUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.createUserWithHttpInfo(param.user, options).toPromise(); } @@ -1418,7 +1419,7 @@ export class ObjectUserApi { * Create user * @param param the request object */ - public createUser(param: UserApiCreateUserRequest, options?: Configuration): Promise { + public createUser(param: UserApiCreateUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.createUser(param.user, options).toPromise(); } @@ -1427,7 +1428,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithArrayInputWithHttpInfo(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration): Promise> { + public createUsersWithArrayInputWithHttpInfo(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration | Middleware[]): Promise> { return this.api.createUsersWithArrayInputWithHttpInfo(param.user, options).toPromise(); } @@ -1436,7 +1437,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration): Promise { + public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration | Middleware[]): Promise { return this.api.createUsersWithArrayInput(param.user, options).toPromise(); } @@ -1445,7 +1446,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithListInputWithHttpInfo(param: UserApiCreateUsersWithListInputRequest, options?: Configuration): Promise> { + public createUsersWithListInputWithHttpInfo(param: UserApiCreateUsersWithListInputRequest, options?: Configuration | Middleware[]): Promise> { return this.api.createUsersWithListInputWithHttpInfo(param.user, options).toPromise(); } @@ -1454,7 +1455,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration): Promise { + public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration | Middleware[]): Promise { return this.api.createUsersWithListInput(param.user, options).toPromise(); } @@ -1463,7 +1464,7 @@ export class ObjectUserApi { * Delete user * @param param the request object */ - public deleteUserWithHttpInfo(param: UserApiDeleteUserRequest, options?: Configuration): Promise> { + public deleteUserWithHttpInfo(param: UserApiDeleteUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.deleteUserWithHttpInfo(param.username, options).toPromise(); } @@ -1472,7 +1473,7 @@ export class ObjectUserApi { * Delete user * @param param the request object */ - public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration): Promise { + public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.deleteUser(param.username, options).toPromise(); } @@ -1481,7 +1482,7 @@ export class ObjectUserApi { * Get user by user name * @param param the request object */ - public getUserByNameWithHttpInfo(param: UserApiGetUserByNameRequest, options?: Configuration): Promise> { + public getUserByNameWithHttpInfo(param: UserApiGetUserByNameRequest, options?: Configuration | Middleware[]): Promise> { return this.api.getUserByNameWithHttpInfo(param.username, options).toPromise(); } @@ -1490,7 +1491,7 @@ export class ObjectUserApi { * Get user by user name * @param param the request object */ - public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration): Promise { + public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration | Middleware[]): Promise { return this.api.getUserByName(param.username, options).toPromise(); } @@ -1499,7 +1500,7 @@ export class ObjectUserApi { * Logs user into the system * @param param the request object */ - public loginUserWithHttpInfo(param: UserApiLoginUserRequest, options?: Configuration): Promise> { + public loginUserWithHttpInfo(param: UserApiLoginUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.loginUserWithHttpInfo(param.username, param.password, options).toPromise(); } @@ -1508,7 +1509,7 @@ export class ObjectUserApi { * Logs user into the system * @param param the request object */ - public loginUser(param: UserApiLoginUserRequest, options?: Configuration): Promise { + public loginUser(param: UserApiLoginUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.loginUser(param.username, param.password, options).toPromise(); } @@ -1517,7 +1518,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUserWithHttpInfo(param: UserApiLogoutUserRequest = {}, options?: Configuration): Promise> { + public logoutUserWithHttpInfo(param: UserApiLogoutUserRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.logoutUserWithHttpInfo( options).toPromise(); } @@ -1526,7 +1527,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration): Promise { + public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.logoutUser( options).toPromise(); } @@ -1535,7 +1536,7 @@ export class ObjectUserApi { * Updated user * @param param the request object */ - public updateUserWithHttpInfo(param: UserApiUpdateUserRequest, options?: Configuration): Promise> { + public updateUserWithHttpInfo(param: UserApiUpdateUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.updateUserWithHttpInfo(param.username, param.user, options).toPromise(); } @@ -1544,7 +1545,7 @@ export class ObjectUserApi { * Updated user * @param param the request object */ - public updateUser(param: UserApiUpdateUserRequest, options?: Configuration): Promise { + public updateUser(param: UserApiUpdateUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.updateUser(param.username, param.user, options).toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/explode-query/types/ObservableAPI.ts index 6f5c1e6f210b..bdf9c8708daa 100644 --- a/samples/openapi3/client/petstore/typescript/builds/explode-query/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/types/ObservableAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { Observable, of, from } from '../rxjsStub'; import {mergeMap, map} from '../rxjsStub'; import { AdditionalPropertiesClass } from '../models/AdditionalPropertiesClass'; @@ -71,12 +72,21 @@ export class ObservableAnotherFakeApi { * To test special tags * @param client client model */ - public _123testSpecialTagsWithHttpInfo(client: Client, _options?: Configuration): Observable> { + public _123testSpecialTagsWithHttpInfo(client: Client, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory._123testSpecialTags(client, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -95,7 +105,7 @@ export class ObservableAnotherFakeApi { * To test special tags * @param client client model */ - public _123testSpecialTags(client: Client, _options?: Configuration): Observable { + public _123testSpecialTags(client: Client, _options?: Configuration | Middleware[]): Observable { return this._123testSpecialTagsWithHttpInfo(client, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -119,12 +129,21 @@ export class ObservableDefaultApi { /** */ - public fooGetWithHttpInfo(_options?: Configuration): Observable> { + public fooGetWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.fooGet(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -140,7 +159,7 @@ export class ObservableDefaultApi { /** */ - public fooGet(_options?: Configuration): Observable { + public fooGet(_options?: Configuration | Middleware[]): Observable { return this.fooGetWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -165,12 +184,21 @@ export class ObservableFakeApi { /** * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys */ - public fakeBigDecimalMapWithHttpInfo(_options?: Configuration): Observable> { + public fakeBigDecimalMapWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.fakeBigDecimalMap(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -187,19 +215,28 @@ export class ObservableFakeApi { /** * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys */ - public fakeBigDecimalMap(_options?: Configuration): Observable { + public fakeBigDecimalMap(_options?: Configuration | Middleware[]): Observable { return this.fakeBigDecimalMapWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } /** * Health check endpoint */ - public fakeHealthGetWithHttpInfo(_options?: Configuration): Observable> { + public fakeHealthGetWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.fakeHealthGet(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -216,7 +253,7 @@ export class ObservableFakeApi { /** * Health check endpoint */ - public fakeHealthGet(_options?: Configuration): Observable { + public fakeHealthGet(_options?: Configuration | Middleware[]): Observable { return this.fakeHealthGetWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -226,12 +263,21 @@ export class ObservableFakeApi { * @param [query1] query parameter * @param [header1] header parameter */ - public fakeHttpSignatureTestWithHttpInfo(pet: Pet, query1?: string, header1?: string, _options?: Configuration): Observable> { + public fakeHttpSignatureTestWithHttpInfo(pet: Pet, query1?: string, header1?: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.fakeHttpSignatureTest(pet, query1, header1, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -251,7 +297,7 @@ export class ObservableFakeApi { * @param [query1] query parameter * @param [header1] header parameter */ - public fakeHttpSignatureTest(pet: Pet, query1?: string, header1?: string, _options?: Configuration): Observable { + public fakeHttpSignatureTest(pet: Pet, query1?: string, header1?: string, _options?: Configuration | Middleware[]): Observable { return this.fakeHttpSignatureTestWithHttpInfo(pet, query1, header1, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -259,12 +305,21 @@ export class ObservableFakeApi { * Test serialization of outer boolean types * @param [body] Input boolean as post body */ - public fakeOuterBooleanSerializeWithHttpInfo(body?: boolean, _options?: Configuration): Observable> { + public fakeOuterBooleanSerializeWithHttpInfo(body?: boolean, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.fakeOuterBooleanSerialize(body, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -282,7 +337,7 @@ export class ObservableFakeApi { * Test serialization of outer boolean types * @param [body] Input boolean as post body */ - public fakeOuterBooleanSerialize(body?: boolean, _options?: Configuration): Observable { + public fakeOuterBooleanSerialize(body?: boolean, _options?: Configuration | Middleware[]): Observable { return this.fakeOuterBooleanSerializeWithHttpInfo(body, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -290,12 +345,21 @@ export class ObservableFakeApi { * Test serialization of object with outer number type * @param [outerComposite] Input composite as post body */ - public fakeOuterCompositeSerializeWithHttpInfo(outerComposite?: OuterComposite, _options?: Configuration): Observable> { + public fakeOuterCompositeSerializeWithHttpInfo(outerComposite?: OuterComposite, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.fakeOuterCompositeSerialize(outerComposite, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -313,7 +377,7 @@ export class ObservableFakeApi { * Test serialization of object with outer number type * @param [outerComposite] Input composite as post body */ - public fakeOuterCompositeSerialize(outerComposite?: OuterComposite, _options?: Configuration): Observable { + public fakeOuterCompositeSerialize(outerComposite?: OuterComposite, _options?: Configuration | Middleware[]): Observable { return this.fakeOuterCompositeSerializeWithHttpInfo(outerComposite, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -321,12 +385,21 @@ export class ObservableFakeApi { * Test serialization of outer number types * @param [body] Input number as post body */ - public fakeOuterNumberSerializeWithHttpInfo(body?: number, _options?: Configuration): Observable> { + public fakeOuterNumberSerializeWithHttpInfo(body?: number, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.fakeOuterNumberSerialize(body, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -344,7 +417,7 @@ export class ObservableFakeApi { * Test serialization of outer number types * @param [body] Input number as post body */ - public fakeOuterNumberSerialize(body?: number, _options?: Configuration): Observable { + public fakeOuterNumberSerialize(body?: number, _options?: Configuration | Middleware[]): Observable { return this.fakeOuterNumberSerializeWithHttpInfo(body, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -352,12 +425,21 @@ export class ObservableFakeApi { * Test serialization of outer string types * @param [body] Input string as post body */ - public fakeOuterStringSerializeWithHttpInfo(body?: string, _options?: Configuration): Observable> { + public fakeOuterStringSerializeWithHttpInfo(body?: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.fakeOuterStringSerialize(body, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -375,7 +457,7 @@ export class ObservableFakeApi { * Test serialization of outer string types * @param [body] Input string as post body */ - public fakeOuterStringSerialize(body?: string, _options?: Configuration): Observable { + public fakeOuterStringSerialize(body?: string, _options?: Configuration | Middleware[]): Observable { return this.fakeOuterStringSerializeWithHttpInfo(body, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -383,12 +465,21 @@ export class ObservableFakeApi { * Test serialization of enum (int) properties with examples * @param outerObjectWithEnumProperty Input enum (int) as post body */ - public fakePropertyEnumIntegerSerializeWithHttpInfo(outerObjectWithEnumProperty: OuterObjectWithEnumProperty, _options?: Configuration): Observable> { + public fakePropertyEnumIntegerSerializeWithHttpInfo(outerObjectWithEnumProperty: OuterObjectWithEnumProperty, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -406,7 +497,7 @@ export class ObservableFakeApi { * Test serialization of enum (int) properties with examples * @param outerObjectWithEnumProperty Input enum (int) as post body */ - public fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty: OuterObjectWithEnumProperty, _options?: Configuration): Observable { + public fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty: OuterObjectWithEnumProperty, _options?: Configuration | Middleware[]): Observable { return this.fakePropertyEnumIntegerSerializeWithHttpInfo(outerObjectWithEnumProperty, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -414,12 +505,21 @@ export class ObservableFakeApi { * For this test, the body has to be a binary file. * @param body image to upload */ - public testBodyWithBinaryWithHttpInfo(body: HttpFile, _options?: Configuration): Observable> { + public testBodyWithBinaryWithHttpInfo(body: HttpFile, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testBodyWithBinary(body, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -437,7 +537,7 @@ export class ObservableFakeApi { * For this test, the body has to be a binary file. * @param body image to upload */ - public testBodyWithBinary(body: HttpFile, _options?: Configuration): Observable { + public testBodyWithBinary(body: HttpFile, _options?: Configuration | Middleware[]): Observable { return this.testBodyWithBinaryWithHttpInfo(body, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -445,12 +545,21 @@ export class ObservableFakeApi { * For this test, the body for this request must reference a schema named `File`. * @param fileSchemaTestClass */ - public testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass: FileSchemaTestClass, _options?: Configuration): Observable> { + public testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass: FileSchemaTestClass, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testBodyWithFileSchema(fileSchemaTestClass, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -468,7 +577,7 @@ export class ObservableFakeApi { * For this test, the body for this request must reference a schema named `File`. * @param fileSchemaTestClass */ - public testBodyWithFileSchema(fileSchemaTestClass: FileSchemaTestClass, _options?: Configuration): Observable { + public testBodyWithFileSchema(fileSchemaTestClass: FileSchemaTestClass, _options?: Configuration | Middleware[]): Observable { return this.testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -476,12 +585,21 @@ export class ObservableFakeApi { * @param query * @param user */ - public testBodyWithQueryParamsWithHttpInfo(query: string, user: User, _options?: Configuration): Observable> { + public testBodyWithQueryParamsWithHttpInfo(query: string, user: User, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testBodyWithQueryParams(query, user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -499,7 +617,7 @@ export class ObservableFakeApi { * @param query * @param user */ - public testBodyWithQueryParams(query: string, user: User, _options?: Configuration): Observable { + public testBodyWithQueryParams(query: string, user: User, _options?: Configuration | Middleware[]): Observable { return this.testBodyWithQueryParamsWithHttpInfo(query, user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -508,12 +626,21 @@ export class ObservableFakeApi { * To test \"client\" model * @param client client model */ - public testClientModelWithHttpInfo(client: Client, _options?: Configuration): Observable> { + public testClientModelWithHttpInfo(client: Client, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testClientModel(client, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -532,7 +659,7 @@ export class ObservableFakeApi { * To test \"client\" model * @param client client model */ - public testClientModel(client: Client, _options?: Configuration): Observable { + public testClientModel(client: Client, _options?: Configuration | Middleware[]): Observable { return this.testClientModelWithHttpInfo(client, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -554,12 +681,21 @@ export class ObservableFakeApi { * @param [password] None * @param [callback] None */ - public testEndpointParametersWithHttpInfo(number: number, _double: number, patternWithoutDelimiter: string, _byte: string, integer?: number, int32?: number, int64?: number, _float?: number, string?: string, binary?: HttpFile, date?: string, dateTime?: Date, password?: string, callback?: string, _options?: Configuration): Observable> { + public testEndpointParametersWithHttpInfo(number: number, _double: number, patternWithoutDelimiter: string, _byte: string, integer?: number, int32?: number, int64?: number, _float?: number, string?: string, binary?: HttpFile, date?: string, dateTime?: Date, password?: string, callback?: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, callback, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -591,7 +727,7 @@ export class ObservableFakeApi { * @param [password] None * @param [callback] None */ - public testEndpointParameters(number: number, _double: number, patternWithoutDelimiter: string, _byte: string, integer?: number, int32?: number, int64?: number, _float?: number, string?: string, binary?: HttpFile, date?: string, dateTime?: Date, password?: string, callback?: string, _options?: Configuration): Observable { + public testEndpointParameters(number: number, _double: number, patternWithoutDelimiter: string, _byte: string, integer?: number, int32?: number, int64?: number, _float?: number, string?: string, binary?: HttpFile, date?: string, dateTime?: Date, password?: string, callback?: string, _options?: Configuration | Middleware[]): Observable { return this.testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, callback, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -608,12 +744,21 @@ export class ObservableFakeApi { * @param [enumFormStringArray] Form parameter enum test (string array) * @param [enumFormString] Form parameter enum test (string) */ - public testEnumParametersWithHttpInfo(enumHeaderStringArray?: Array<'>' | '$'>, enumHeaderString?: '_abc' | '-efg' | '(xyz)', enumQueryStringArray?: Array<'>' | '$'>, enumQueryString?: '_abc' | '-efg' | '(xyz)', enumQueryInteger?: 1 | -2, enumQueryDouble?: 1.1 | -1.2, enumQueryModelArray?: Array, enumFormStringArray?: Array, enumFormString?: string, _options?: Configuration): Observable> { + public testEnumParametersWithHttpInfo(enumHeaderStringArray?: Array<'>' | '$'>, enumHeaderString?: '_abc' | '-efg' | '(xyz)', enumQueryStringArray?: Array<'>' | '$'>, enumQueryString?: '_abc' | '-efg' | '(xyz)', enumQueryInteger?: 1 | -2, enumQueryDouble?: 1.1 | -1.2, enumQueryModelArray?: Array, enumFormStringArray?: Array, enumFormString?: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -640,7 +785,7 @@ export class ObservableFakeApi { * @param [enumFormStringArray] Form parameter enum test (string array) * @param [enumFormString] Form parameter enum test (string) */ - public testEnumParameters(enumHeaderStringArray?: Array<'>' | '$'>, enumHeaderString?: '_abc' | '-efg' | '(xyz)', enumQueryStringArray?: Array<'>' | '$'>, enumQueryString?: '_abc' | '-efg' | '(xyz)', enumQueryInteger?: 1 | -2, enumQueryDouble?: 1.1 | -1.2, enumQueryModelArray?: Array, enumFormStringArray?: Array, enumFormString?: string, _options?: Configuration): Observable { + public testEnumParameters(enumHeaderStringArray?: Array<'>' | '$'>, enumHeaderString?: '_abc' | '-efg' | '(xyz)', enumQueryStringArray?: Array<'>' | '$'>, enumQueryString?: '_abc' | '-efg' | '(xyz)', enumQueryInteger?: 1 | -2, enumQueryDouble?: 1.1 | -1.2, enumQueryModelArray?: Array, enumFormStringArray?: Array, enumFormString?: string, _options?: Configuration | Middleware[]): Observable { return this.testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -654,12 +799,21 @@ export class ObservableFakeApi { * @param [booleanGroup] Boolean in group parameters * @param [int64Group] Integer in group parameters */ - public testGroupParametersWithHttpInfo(requiredStringGroup: number, requiredBooleanGroup: boolean, requiredInt64Group: number, stringGroup?: number, booleanGroup?: boolean, int64Group?: number, _options?: Configuration): Observable> { + public testGroupParametersWithHttpInfo(requiredStringGroup: number, requiredBooleanGroup: boolean, requiredInt64Group: number, stringGroup?: number, booleanGroup?: boolean, int64Group?: number, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -683,7 +837,7 @@ export class ObservableFakeApi { * @param [booleanGroup] Boolean in group parameters * @param [int64Group] Integer in group parameters */ - public testGroupParameters(requiredStringGroup: number, requiredBooleanGroup: boolean, requiredInt64Group: number, stringGroup?: number, booleanGroup?: boolean, int64Group?: number, _options?: Configuration): Observable { + public testGroupParameters(requiredStringGroup: number, requiredBooleanGroup: boolean, requiredInt64Group: number, stringGroup?: number, booleanGroup?: boolean, int64Group?: number, _options?: Configuration | Middleware[]): Observable { return this.testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -692,12 +846,21 @@ export class ObservableFakeApi { * test inline additionalProperties * @param requestBody request body */ - public testInlineAdditionalPropertiesWithHttpInfo(requestBody: { [key: string]: string; }, _options?: Configuration): Observable> { + public testInlineAdditionalPropertiesWithHttpInfo(requestBody: { [key: string]: string; }, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testInlineAdditionalProperties(requestBody, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -716,7 +879,7 @@ export class ObservableFakeApi { * test inline additionalProperties * @param requestBody request body */ - public testInlineAdditionalProperties(requestBody: { [key: string]: string; }, _options?: Configuration): Observable { + public testInlineAdditionalProperties(requestBody: { [key: string]: string; }, _options?: Configuration | Middleware[]): Observable { return this.testInlineAdditionalPropertiesWithHttpInfo(requestBody, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -726,12 +889,21 @@ export class ObservableFakeApi { * @param param field1 * @param param2 field2 */ - public testJsonFormDataWithHttpInfo(param: string, param2: string, _options?: Configuration): Observable> { + public testJsonFormDataWithHttpInfo(param: string, param2: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testJsonFormData(param, param2, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -751,7 +923,7 @@ export class ObservableFakeApi { * @param param field1 * @param param2 field2 */ - public testJsonFormData(param: string, param2: string, _options?: Configuration): Observable { + public testJsonFormData(param: string, param2: string, _options?: Configuration | Middleware[]): Observable { return this.testJsonFormDataWithHttpInfo(param, param2, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -765,12 +937,21 @@ export class ObservableFakeApi { * @param allowEmpty * @param [language] */ - public testQueryParameterCollectionFormatWithHttpInfo(pipe: Array, ioutil: Array, http: Array, url: Array, context: Array, allowEmpty: string, language?: { [key: string]: string; }, _options?: Configuration): Observable> { + public testQueryParameterCollectionFormatWithHttpInfo(pipe: Array, ioutil: Array, http: Array, url: Array, context: Array, allowEmpty: string, language?: { [key: string]: string; }, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -794,7 +975,7 @@ export class ObservableFakeApi { * @param allowEmpty * @param [language] */ - public testQueryParameterCollectionFormat(pipe: Array, ioutil: Array, http: Array, url: Array, context: Array, allowEmpty: string, language?: { [key: string]: string; }, _options?: Configuration): Observable { + public testQueryParameterCollectionFormat(pipe: Array, ioutil: Array, http: Array, url: Array, context: Array, allowEmpty: string, language?: { [key: string]: string; }, _options?: Configuration | Middleware[]): Observable { return this.testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, allowEmpty, language, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -821,12 +1002,21 @@ export class ObservableFakeClassnameTags123Api { * To test class name in snake case * @param client client model */ - public testClassnameWithHttpInfo(client: Client, _options?: Configuration): Observable> { + public testClassnameWithHttpInfo(client: Client, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.testClassname(client, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -845,7 +1035,7 @@ export class ObservableFakeClassnameTags123Api { * To test class name in snake case * @param client client model */ - public testClassname(client: Client, _options?: Configuration): Observable { + public testClassname(client: Client, _options?: Configuration | Middleware[]): Observable { return this.testClassnameWithHttpInfo(client, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -872,12 +1062,21 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(pet: Pet, _options?: Configuration): Observable> { + public addPetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.addPet(pet, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -896,7 +1095,7 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration): Observable { + public addPet(pet: Pet, _options?: Configuration | Middleware[]): Observable { return this.addPetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -906,12 +1105,21 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration): Observable> { + public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.deletePet(petId, apiKey, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -931,7 +1139,7 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration): Observable { + public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable { return this.deletePetWithHttpInfo(petId, apiKey, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -940,12 +1148,21 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Observable>> { + public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable>> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.findPetsByStatus(status, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -964,7 +1181,7 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Observable> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable> { return this.findPetsByStatusWithHttpInfo(status, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -973,12 +1190,21 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Set, _options?: Configuration): Observable>> { + public findPetsByTagsWithHttpInfo(tags: Set, _options?: Configuration | Middleware[]): Observable>> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.findPetsByTags(tags, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -997,7 +1223,7 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Set, _options?: Configuration): Observable> { + public findPetsByTags(tags: Set, _options?: Configuration | Middleware[]): Observable> { return this.findPetsByTagsWithHttpInfo(tags, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -1006,12 +1232,21 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, _options?: Configuration): Observable> { + public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getPetById(petId, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -1030,7 +1265,7 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration): Observable { + public getPetById(petId: number, _options?: Configuration | Middleware[]): Observable { return this.getPetByIdWithHttpInfo(petId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -1039,12 +1274,21 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(pet: Pet, _options?: Configuration): Observable> { + public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.updatePet(pet, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -1063,7 +1307,7 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration): Observable { + public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Observable { return this.updatePetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -1074,12 +1318,21 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration): Observable> { + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.updatePetWithForm(petId, name, status, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -1100,7 +1353,7 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable { return this.updatePetWithFormWithHttpInfo(petId, name, status, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -1111,12 +1364,21 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Observable> { + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.uploadFile(petId, additionalMetadata, file, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -1137,7 +1399,7 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable { return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -1148,12 +1410,21 @@ export class ObservablePetApi { * @param requiredFile file to upload * @param [additionalMetadata] Additional data to pass to server */ - public uploadFileWithRequiredFileWithHttpInfo(petId: number, requiredFile: HttpFile, additionalMetadata?: string, _options?: Configuration): Observable> { + public uploadFileWithRequiredFileWithHttpInfo(petId: number, requiredFile: HttpFile, additionalMetadata?: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -1174,7 +1445,7 @@ export class ObservablePetApi { * @param requiredFile file to upload * @param [additionalMetadata] Additional data to pass to server */ - public uploadFileWithRequiredFile(petId: number, requiredFile: HttpFile, additionalMetadata?: string, _options?: Configuration): Observable { + public uploadFileWithRequiredFile(petId: number, requiredFile: HttpFile, additionalMetadata?: string, _options?: Configuration | Middleware[]): Observable { return this.uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -1201,12 +1472,21 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration): Observable> { + public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.deleteOrder(orderId, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -1225,7 +1505,7 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration): Observable { + public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Observable { return this.deleteOrderWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -1233,12 +1513,21 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventoryWithHttpInfo(_options?: Configuration): Observable> { + public getInventoryWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getInventory(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -1256,7 +1545,7 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration): Observable<{ [key: string]: number; }> { + public getInventory(_options?: Configuration | Middleware[]): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo<{ [key: string]: number; }>) => apiResponse.data)); } @@ -1265,12 +1554,21 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration): Observable> { + public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getOrderById(orderId, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -1289,7 +1587,7 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration): Observable { + public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Observable { return this.getOrderByIdWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -1298,12 +1596,21 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(order: Order, _options?: Configuration): Observable> { + public placeOrderWithHttpInfo(order: Order, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.placeOrder(order, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -1322,7 +1629,7 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration): Observable { + public placeOrder(order: Order, _options?: Configuration | Middleware[]): Observable { return this.placeOrderWithHttpInfo(order, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -1349,12 +1656,21 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUserWithHttpInfo(user: User, _options?: Configuration): Observable> { + public createUserWithHttpInfo(user: User, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.createUser(user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -1373,7 +1689,7 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration): Observable { + public createUser(user: User, _options?: Configuration | Middleware[]): Observable { return this.createUserWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -1382,12 +1698,21 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration): Observable> { + public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.createUsersWithArrayInput(user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -1406,7 +1731,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration): Observable { + public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Observable { return this.createUsersWithArrayInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -1415,12 +1740,21 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration): Observable> { + public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.createUsersWithListInput(user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -1439,7 +1773,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration): Observable { + public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Observable { return this.createUsersWithListInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -1448,12 +1782,21 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, _options?: Configuration): Observable> { + public deleteUserWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.deleteUser(username, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -1472,7 +1815,7 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration): Observable { + public deleteUser(username: string, _options?: Configuration | Middleware[]): Observable { return this.deleteUserWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -1481,12 +1824,21 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, _options?: Configuration): Observable> { + public getUserByNameWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getUserByName(username, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -1505,7 +1857,7 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration): Observable { + public getUserByName(username: string, _options?: Configuration | Middleware[]): Observable { return this.getUserByNameWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -1515,12 +1867,21 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration): Observable> { + public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.loginUser(username, password, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -1540,7 +1901,7 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration): Observable { + public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Observable { return this.loginUserWithHttpInfo(username, password, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -1548,12 +1909,21 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUserWithHttpInfo(_options?: Configuration): Observable> { + public logoutUserWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.logoutUser(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -1571,7 +1941,7 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration): Observable { + public logoutUser(_options?: Configuration | Middleware[]): Observable { return this.logoutUserWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -1581,12 +1951,21 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration): Observable> { + public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.updateUser(username, user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -1606,7 +1985,7 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration): Observable { + public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Observable { return this.updateUserWithHttpInfo(username, user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/explode-query/types/PromiseAPI.ts index 68c347230b9f..05cd2bcdc0b1 100644 --- a/samples/openapi3/client/petstore/typescript/builds/explode-query/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/types/PromiseAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { AdditionalPropertiesClass } from '../models/AdditionalPropertiesClass'; import { AllOfWithSingleRef } from '../models/AllOfWithSingleRef'; @@ -67,7 +68,7 @@ export class PromiseAnotherFakeApi { * To test special tags * @param client client model */ - public _123testSpecialTagsWithHttpInfo(client: Client, _options?: Configuration): Promise> { + public _123testSpecialTagsWithHttpInfo(client: Client, _options?: Configuration | Middleware[]): Promise> { const result = this.api._123testSpecialTagsWithHttpInfo(client, _options); return result.toPromise(); } @@ -77,7 +78,7 @@ export class PromiseAnotherFakeApi { * To test special tags * @param client client model */ - public _123testSpecialTags(client: Client, _options?: Configuration): Promise { + public _123testSpecialTags(client: Client, _options?: Configuration | Middleware[]): Promise { const result = this.api._123testSpecialTags(client, _options); return result.toPromise(); } @@ -103,14 +104,14 @@ export class PromiseDefaultApi { /** */ - public fooGetWithHttpInfo(_options?: Configuration): Promise> { + public fooGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.fooGetWithHttpInfo(_options); return result.toPromise(); } /** */ - public fooGet(_options?: Configuration): Promise { + public fooGet(_options?: Configuration | Middleware[]): Promise { const result = this.api.fooGet(_options); return result.toPromise(); } @@ -137,7 +138,7 @@ export class PromiseFakeApi { /** * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys */ - public fakeBigDecimalMapWithHttpInfo(_options?: Configuration): Promise> { + public fakeBigDecimalMapWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.fakeBigDecimalMapWithHttpInfo(_options); return result.toPromise(); } @@ -145,7 +146,7 @@ export class PromiseFakeApi { /** * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys */ - public fakeBigDecimalMap(_options?: Configuration): Promise { + public fakeBigDecimalMap(_options?: Configuration | Middleware[]): Promise { const result = this.api.fakeBigDecimalMap(_options); return result.toPromise(); } @@ -153,7 +154,7 @@ export class PromiseFakeApi { /** * Health check endpoint */ - public fakeHealthGetWithHttpInfo(_options?: Configuration): Promise> { + public fakeHealthGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.fakeHealthGetWithHttpInfo(_options); return result.toPromise(); } @@ -161,7 +162,7 @@ export class PromiseFakeApi { /** * Health check endpoint */ - public fakeHealthGet(_options?: Configuration): Promise { + public fakeHealthGet(_options?: Configuration | Middleware[]): Promise { const result = this.api.fakeHealthGet(_options); return result.toPromise(); } @@ -172,7 +173,7 @@ export class PromiseFakeApi { * @param [query1] query parameter * @param [header1] header parameter */ - public fakeHttpSignatureTestWithHttpInfo(pet: Pet, query1?: string, header1?: string, _options?: Configuration): Promise> { + public fakeHttpSignatureTestWithHttpInfo(pet: Pet, query1?: string, header1?: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.fakeHttpSignatureTestWithHttpInfo(pet, query1, header1, _options); return result.toPromise(); } @@ -183,7 +184,7 @@ export class PromiseFakeApi { * @param [query1] query parameter * @param [header1] header parameter */ - public fakeHttpSignatureTest(pet: Pet, query1?: string, header1?: string, _options?: Configuration): Promise { + public fakeHttpSignatureTest(pet: Pet, query1?: string, header1?: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.fakeHttpSignatureTest(pet, query1, header1, _options); return result.toPromise(); } @@ -192,7 +193,7 @@ export class PromiseFakeApi { * Test serialization of outer boolean types * @param [body] Input boolean as post body */ - public fakeOuterBooleanSerializeWithHttpInfo(body?: boolean, _options?: Configuration): Promise> { + public fakeOuterBooleanSerializeWithHttpInfo(body?: boolean, _options?: Configuration | Middleware[]): Promise> { const result = this.api.fakeOuterBooleanSerializeWithHttpInfo(body, _options); return result.toPromise(); } @@ -201,7 +202,7 @@ export class PromiseFakeApi { * Test serialization of outer boolean types * @param [body] Input boolean as post body */ - public fakeOuterBooleanSerialize(body?: boolean, _options?: Configuration): Promise { + public fakeOuterBooleanSerialize(body?: boolean, _options?: Configuration | Middleware[]): Promise { const result = this.api.fakeOuterBooleanSerialize(body, _options); return result.toPromise(); } @@ -210,7 +211,7 @@ export class PromiseFakeApi { * Test serialization of object with outer number type * @param [outerComposite] Input composite as post body */ - public fakeOuterCompositeSerializeWithHttpInfo(outerComposite?: OuterComposite, _options?: Configuration): Promise> { + public fakeOuterCompositeSerializeWithHttpInfo(outerComposite?: OuterComposite, _options?: Configuration | Middleware[]): Promise> { const result = this.api.fakeOuterCompositeSerializeWithHttpInfo(outerComposite, _options); return result.toPromise(); } @@ -219,7 +220,7 @@ export class PromiseFakeApi { * Test serialization of object with outer number type * @param [outerComposite] Input composite as post body */ - public fakeOuterCompositeSerialize(outerComposite?: OuterComposite, _options?: Configuration): Promise { + public fakeOuterCompositeSerialize(outerComposite?: OuterComposite, _options?: Configuration | Middleware[]): Promise { const result = this.api.fakeOuterCompositeSerialize(outerComposite, _options); return result.toPromise(); } @@ -228,7 +229,7 @@ export class PromiseFakeApi { * Test serialization of outer number types * @param [body] Input number as post body */ - public fakeOuterNumberSerializeWithHttpInfo(body?: number, _options?: Configuration): Promise> { + public fakeOuterNumberSerializeWithHttpInfo(body?: number, _options?: Configuration | Middleware[]): Promise> { const result = this.api.fakeOuterNumberSerializeWithHttpInfo(body, _options); return result.toPromise(); } @@ -237,7 +238,7 @@ export class PromiseFakeApi { * Test serialization of outer number types * @param [body] Input number as post body */ - public fakeOuterNumberSerialize(body?: number, _options?: Configuration): Promise { + public fakeOuterNumberSerialize(body?: number, _options?: Configuration | Middleware[]): Promise { const result = this.api.fakeOuterNumberSerialize(body, _options); return result.toPromise(); } @@ -246,7 +247,7 @@ export class PromiseFakeApi { * Test serialization of outer string types * @param [body] Input string as post body */ - public fakeOuterStringSerializeWithHttpInfo(body?: string, _options?: Configuration): Promise> { + public fakeOuterStringSerializeWithHttpInfo(body?: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.fakeOuterStringSerializeWithHttpInfo(body, _options); return result.toPromise(); } @@ -255,7 +256,7 @@ export class PromiseFakeApi { * Test serialization of outer string types * @param [body] Input string as post body */ - public fakeOuterStringSerialize(body?: string, _options?: Configuration): Promise { + public fakeOuterStringSerialize(body?: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.fakeOuterStringSerialize(body, _options); return result.toPromise(); } @@ -264,7 +265,7 @@ export class PromiseFakeApi { * Test serialization of enum (int) properties with examples * @param outerObjectWithEnumProperty Input enum (int) as post body */ - public fakePropertyEnumIntegerSerializeWithHttpInfo(outerObjectWithEnumProperty: OuterObjectWithEnumProperty, _options?: Configuration): Promise> { + public fakePropertyEnumIntegerSerializeWithHttpInfo(outerObjectWithEnumProperty: OuterObjectWithEnumProperty, _options?: Configuration | Middleware[]): Promise> { const result = this.api.fakePropertyEnumIntegerSerializeWithHttpInfo(outerObjectWithEnumProperty, _options); return result.toPromise(); } @@ -273,7 +274,7 @@ export class PromiseFakeApi { * Test serialization of enum (int) properties with examples * @param outerObjectWithEnumProperty Input enum (int) as post body */ - public fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty: OuterObjectWithEnumProperty, _options?: Configuration): Promise { + public fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty: OuterObjectWithEnumProperty, _options?: Configuration | Middleware[]): Promise { const result = this.api.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty, _options); return result.toPromise(); } @@ -282,7 +283,7 @@ export class PromiseFakeApi { * For this test, the body has to be a binary file. * @param body image to upload */ - public testBodyWithBinaryWithHttpInfo(body: HttpFile, _options?: Configuration): Promise> { + public testBodyWithBinaryWithHttpInfo(body: HttpFile, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testBodyWithBinaryWithHttpInfo(body, _options); return result.toPromise(); } @@ -291,7 +292,7 @@ export class PromiseFakeApi { * For this test, the body has to be a binary file. * @param body image to upload */ - public testBodyWithBinary(body: HttpFile, _options?: Configuration): Promise { + public testBodyWithBinary(body: HttpFile, _options?: Configuration | Middleware[]): Promise { const result = this.api.testBodyWithBinary(body, _options); return result.toPromise(); } @@ -300,7 +301,7 @@ export class PromiseFakeApi { * For this test, the body for this request must reference a schema named `File`. * @param fileSchemaTestClass */ - public testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass: FileSchemaTestClass, _options?: Configuration): Promise> { + public testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass: FileSchemaTestClass, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass, _options); return result.toPromise(); } @@ -309,7 +310,7 @@ export class PromiseFakeApi { * For this test, the body for this request must reference a schema named `File`. * @param fileSchemaTestClass */ - public testBodyWithFileSchema(fileSchemaTestClass: FileSchemaTestClass, _options?: Configuration): Promise { + public testBodyWithFileSchema(fileSchemaTestClass: FileSchemaTestClass, _options?: Configuration | Middleware[]): Promise { const result = this.api.testBodyWithFileSchema(fileSchemaTestClass, _options); return result.toPromise(); } @@ -318,7 +319,7 @@ export class PromiseFakeApi { * @param query * @param user */ - public testBodyWithQueryParamsWithHttpInfo(query: string, user: User, _options?: Configuration): Promise> { + public testBodyWithQueryParamsWithHttpInfo(query: string, user: User, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testBodyWithQueryParamsWithHttpInfo(query, user, _options); return result.toPromise(); } @@ -327,7 +328,7 @@ export class PromiseFakeApi { * @param query * @param user */ - public testBodyWithQueryParams(query: string, user: User, _options?: Configuration): Promise { + public testBodyWithQueryParams(query: string, user: User, _options?: Configuration | Middleware[]): Promise { const result = this.api.testBodyWithQueryParams(query, user, _options); return result.toPromise(); } @@ -337,7 +338,7 @@ export class PromiseFakeApi { * To test \"client\" model * @param client client model */ - public testClientModelWithHttpInfo(client: Client, _options?: Configuration): Promise> { + public testClientModelWithHttpInfo(client: Client, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testClientModelWithHttpInfo(client, _options); return result.toPromise(); } @@ -347,7 +348,7 @@ export class PromiseFakeApi { * To test \"client\" model * @param client client model */ - public testClientModel(client: Client, _options?: Configuration): Promise { + public testClientModel(client: Client, _options?: Configuration | Middleware[]): Promise { const result = this.api.testClientModel(client, _options); return result.toPromise(); } @@ -370,7 +371,7 @@ export class PromiseFakeApi { * @param [password] None * @param [callback] None */ - public testEndpointParametersWithHttpInfo(number: number, _double: number, patternWithoutDelimiter: string, _byte: string, integer?: number, int32?: number, int64?: number, _float?: number, string?: string, binary?: HttpFile, date?: string, dateTime?: Date, password?: string, callback?: string, _options?: Configuration): Promise> { + public testEndpointParametersWithHttpInfo(number: number, _double: number, patternWithoutDelimiter: string, _byte: string, integer?: number, int32?: number, int64?: number, _float?: number, string?: string, binary?: HttpFile, date?: string, dateTime?: Date, password?: string, callback?: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, callback, _options); return result.toPromise(); } @@ -393,7 +394,7 @@ export class PromiseFakeApi { * @param [password] None * @param [callback] None */ - public testEndpointParameters(number: number, _double: number, patternWithoutDelimiter: string, _byte: string, integer?: number, int32?: number, int64?: number, _float?: number, string?: string, binary?: HttpFile, date?: string, dateTime?: Date, password?: string, callback?: string, _options?: Configuration): Promise { + public testEndpointParameters(number: number, _double: number, patternWithoutDelimiter: string, _byte: string, integer?: number, int32?: number, int64?: number, _float?: number, string?: string, binary?: HttpFile, date?: string, dateTime?: Date, password?: string, callback?: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, callback, _options); return result.toPromise(); } @@ -411,7 +412,7 @@ export class PromiseFakeApi { * @param [enumFormStringArray] Form parameter enum test (string array) * @param [enumFormString] Form parameter enum test (string) */ - public testEnumParametersWithHttpInfo(enumHeaderStringArray?: Array<'>' | '$'>, enumHeaderString?: '_abc' | '-efg' | '(xyz)', enumQueryStringArray?: Array<'>' | '$'>, enumQueryString?: '_abc' | '-efg' | '(xyz)', enumQueryInteger?: 1 | -2, enumQueryDouble?: 1.1 | -1.2, enumQueryModelArray?: Array, enumFormStringArray?: Array, enumFormString?: string, _options?: Configuration): Promise> { + public testEnumParametersWithHttpInfo(enumHeaderStringArray?: Array<'>' | '$'>, enumHeaderString?: '_abc' | '-efg' | '(xyz)', enumQueryStringArray?: Array<'>' | '$'>, enumQueryString?: '_abc' | '-efg' | '(xyz)', enumQueryInteger?: 1 | -2, enumQueryDouble?: 1.1 | -1.2, enumQueryModelArray?: Array, enumFormStringArray?: Array, enumFormString?: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString, _options); return result.toPromise(); } @@ -429,7 +430,7 @@ export class PromiseFakeApi { * @param [enumFormStringArray] Form parameter enum test (string array) * @param [enumFormString] Form parameter enum test (string) */ - public testEnumParameters(enumHeaderStringArray?: Array<'>' | '$'>, enumHeaderString?: '_abc' | '-efg' | '(xyz)', enumQueryStringArray?: Array<'>' | '$'>, enumQueryString?: '_abc' | '-efg' | '(xyz)', enumQueryInteger?: 1 | -2, enumQueryDouble?: 1.1 | -1.2, enumQueryModelArray?: Array, enumFormStringArray?: Array, enumFormString?: string, _options?: Configuration): Promise { + public testEnumParameters(enumHeaderStringArray?: Array<'>' | '$'>, enumHeaderString?: '_abc' | '-efg' | '(xyz)', enumQueryStringArray?: Array<'>' | '$'>, enumQueryString?: '_abc' | '-efg' | '(xyz)', enumQueryInteger?: 1 | -2, enumQueryDouble?: 1.1 | -1.2, enumQueryModelArray?: Array, enumFormStringArray?: Array, enumFormString?: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString, _options); return result.toPromise(); } @@ -444,7 +445,7 @@ export class PromiseFakeApi { * @param [booleanGroup] Boolean in group parameters * @param [int64Group] Integer in group parameters */ - public testGroupParametersWithHttpInfo(requiredStringGroup: number, requiredBooleanGroup: boolean, requiredInt64Group: number, stringGroup?: number, booleanGroup?: boolean, int64Group?: number, _options?: Configuration): Promise> { + public testGroupParametersWithHttpInfo(requiredStringGroup: number, requiredBooleanGroup: boolean, requiredInt64Group: number, stringGroup?: number, booleanGroup?: boolean, int64Group?: number, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, _options); return result.toPromise(); } @@ -459,7 +460,7 @@ export class PromiseFakeApi { * @param [booleanGroup] Boolean in group parameters * @param [int64Group] Integer in group parameters */ - public testGroupParameters(requiredStringGroup: number, requiredBooleanGroup: boolean, requiredInt64Group: number, stringGroup?: number, booleanGroup?: boolean, int64Group?: number, _options?: Configuration): Promise { + public testGroupParameters(requiredStringGroup: number, requiredBooleanGroup: boolean, requiredInt64Group: number, stringGroup?: number, booleanGroup?: boolean, int64Group?: number, _options?: Configuration | Middleware[]): Promise { const result = this.api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, _options); return result.toPromise(); } @@ -469,7 +470,7 @@ export class PromiseFakeApi { * test inline additionalProperties * @param requestBody request body */ - public testInlineAdditionalPropertiesWithHttpInfo(requestBody: { [key: string]: string; }, _options?: Configuration): Promise> { + public testInlineAdditionalPropertiesWithHttpInfo(requestBody: { [key: string]: string; }, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testInlineAdditionalPropertiesWithHttpInfo(requestBody, _options); return result.toPromise(); } @@ -479,7 +480,7 @@ export class PromiseFakeApi { * test inline additionalProperties * @param requestBody request body */ - public testInlineAdditionalProperties(requestBody: { [key: string]: string; }, _options?: Configuration): Promise { + public testInlineAdditionalProperties(requestBody: { [key: string]: string; }, _options?: Configuration | Middleware[]): Promise { const result = this.api.testInlineAdditionalProperties(requestBody, _options); return result.toPromise(); } @@ -490,7 +491,7 @@ export class PromiseFakeApi { * @param param field1 * @param param2 field2 */ - public testJsonFormDataWithHttpInfo(param: string, param2: string, _options?: Configuration): Promise> { + public testJsonFormDataWithHttpInfo(param: string, param2: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testJsonFormDataWithHttpInfo(param, param2, _options); return result.toPromise(); } @@ -501,7 +502,7 @@ export class PromiseFakeApi { * @param param field1 * @param param2 field2 */ - public testJsonFormData(param: string, param2: string, _options?: Configuration): Promise { + public testJsonFormData(param: string, param2: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.testJsonFormData(param, param2, _options); return result.toPromise(); } @@ -516,7 +517,7 @@ export class PromiseFakeApi { * @param allowEmpty * @param [language] */ - public testQueryParameterCollectionFormatWithHttpInfo(pipe: Array, ioutil: Array, http: Array, url: Array, context: Array, allowEmpty: string, language?: { [key: string]: string; }, _options?: Configuration): Promise> { + public testQueryParameterCollectionFormatWithHttpInfo(pipe: Array, ioutil: Array, http: Array, url: Array, context: Array, allowEmpty: string, language?: { [key: string]: string; }, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, allowEmpty, language, _options); return result.toPromise(); } @@ -531,7 +532,7 @@ export class PromiseFakeApi { * @param allowEmpty * @param [language] */ - public testQueryParameterCollectionFormat(pipe: Array, ioutil: Array, http: Array, url: Array, context: Array, allowEmpty: string, language?: { [key: string]: string; }, _options?: Configuration): Promise { + public testQueryParameterCollectionFormat(pipe: Array, ioutil: Array, http: Array, url: Array, context: Array, allowEmpty: string, language?: { [key: string]: string; }, _options?: Configuration | Middleware[]): Promise { const result = this.api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language, _options); return result.toPromise(); } @@ -560,7 +561,7 @@ export class PromiseFakeClassnameTags123Api { * To test class name in snake case * @param client client model */ - public testClassnameWithHttpInfo(client: Client, _options?: Configuration): Promise> { + public testClassnameWithHttpInfo(client: Client, _options?: Configuration | Middleware[]): Promise> { const result = this.api.testClassnameWithHttpInfo(client, _options); return result.toPromise(); } @@ -570,7 +571,7 @@ export class PromiseFakeClassnameTags123Api { * To test class name in snake case * @param client client model */ - public testClassname(client: Client, _options?: Configuration): Promise { + public testClassname(client: Client, _options?: Configuration | Middleware[]): Promise { const result = this.api.testClassname(client, _options); return result.toPromise(); } @@ -599,7 +600,7 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(pet: Pet, _options?: Configuration): Promise> { + public addPetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { const result = this.api.addPetWithHttpInfo(pet, _options); return result.toPromise(); } @@ -609,7 +610,7 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration): Promise { + public addPet(pet: Pet, _options?: Configuration | Middleware[]): Promise { const result = this.api.addPet(pet, _options); return result.toPromise(); } @@ -620,7 +621,7 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration): Promise> { + public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.deletePetWithHttpInfo(petId, apiKey, _options); return result.toPromise(); } @@ -631,7 +632,7 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration): Promise { + public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.deletePet(petId, apiKey, _options); return result.toPromise(); } @@ -641,7 +642,7 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise>> { + public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise>> { const result = this.api.findPetsByStatusWithHttpInfo(status, _options); return result.toPromise(); } @@ -651,7 +652,7 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise> { const result = this.api.findPetsByStatus(status, _options); return result.toPromise(); } @@ -661,7 +662,7 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Set, _options?: Configuration): Promise>> { + public findPetsByTagsWithHttpInfo(tags: Set, _options?: Configuration | Middleware[]): Promise>> { const result = this.api.findPetsByTagsWithHttpInfo(tags, _options); return result.toPromise(); } @@ -671,7 +672,7 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Set, _options?: Configuration): Promise> { + public findPetsByTags(tags: Set, _options?: Configuration | Middleware[]): Promise> { const result = this.api.findPetsByTags(tags, _options); return result.toPromise(); } @@ -681,7 +682,7 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, _options?: Configuration): Promise> { + public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | Middleware[]): Promise> { const result = this.api.getPetByIdWithHttpInfo(petId, _options); return result.toPromise(); } @@ -691,7 +692,7 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration): Promise { + public getPetById(petId: number, _options?: Configuration | Middleware[]): Promise { const result = this.api.getPetById(petId, _options); return result.toPromise(); } @@ -701,7 +702,7 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(pet: Pet, _options?: Configuration): Promise> { + public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { const result = this.api.updatePetWithHttpInfo(pet, _options); return result.toPromise(); } @@ -711,7 +712,7 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration): Promise { + public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Promise { const result = this.api.updatePet(pet, _options); return result.toPromise(); } @@ -723,7 +724,7 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration): Promise> { + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.updatePetWithFormWithHttpInfo(petId, name, status, _options); return result.toPromise(); } @@ -735,7 +736,7 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Promise { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.updatePetWithForm(petId, name, status, _options); return result.toPromise(); } @@ -747,7 +748,7 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise> { + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise> { const result = this.api.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options); return result.toPromise(); } @@ -759,7 +760,7 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise { const result = this.api.uploadFile(petId, additionalMetadata, file, _options); return result.toPromise(); } @@ -771,7 +772,7 @@ export class PromisePetApi { * @param requiredFile file to upload * @param [additionalMetadata] Additional data to pass to server */ - public uploadFileWithRequiredFileWithHttpInfo(petId: number, requiredFile: HttpFile, additionalMetadata?: string, _options?: Configuration): Promise> { + public uploadFileWithRequiredFileWithHttpInfo(petId: number, requiredFile: HttpFile, additionalMetadata?: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata, _options); return result.toPromise(); } @@ -783,7 +784,7 @@ export class PromisePetApi { * @param requiredFile file to upload * @param [additionalMetadata] Additional data to pass to server */ - public uploadFileWithRequiredFile(petId: number, requiredFile: HttpFile, additionalMetadata?: string, _options?: Configuration): Promise { + public uploadFileWithRequiredFile(petId: number, requiredFile: HttpFile, additionalMetadata?: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, _options); return result.toPromise(); } @@ -812,7 +813,7 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration): Promise> { + public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.deleteOrderWithHttpInfo(orderId, _options); return result.toPromise(); } @@ -822,7 +823,7 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration): Promise { + public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.deleteOrder(orderId, _options); return result.toPromise(); } @@ -831,7 +832,7 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventoryWithHttpInfo(_options?: Configuration): Promise> { + public getInventoryWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.getInventoryWithHttpInfo(_options); return result.toPromise(); } @@ -840,7 +841,7 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration): Promise<{ [key: string]: number; }> { + public getInventory(_options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { const result = this.api.getInventory(_options); return result.toPromise(); } @@ -850,7 +851,7 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration): Promise> { + public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | Middleware[]): Promise> { const result = this.api.getOrderByIdWithHttpInfo(orderId, _options); return result.toPromise(); } @@ -860,7 +861,7 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration): Promise { + public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Promise { const result = this.api.getOrderById(orderId, _options); return result.toPromise(); } @@ -870,7 +871,7 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(order: Order, _options?: Configuration): Promise> { + public placeOrderWithHttpInfo(order: Order, _options?: Configuration | Middleware[]): Promise> { const result = this.api.placeOrderWithHttpInfo(order, _options); return result.toPromise(); } @@ -880,7 +881,7 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration): Promise { + public placeOrder(order: Order, _options?: Configuration | Middleware[]): Promise { const result = this.api.placeOrder(order, _options); return result.toPromise(); } @@ -909,7 +910,7 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUserWithHttpInfo(user: User, _options?: Configuration): Promise> { + public createUserWithHttpInfo(user: User, _options?: Configuration | Middleware[]): Promise> { const result = this.api.createUserWithHttpInfo(user, _options); return result.toPromise(); } @@ -919,7 +920,7 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration): Promise { + public createUser(user: User, _options?: Configuration | Middleware[]): Promise { const result = this.api.createUser(user, _options); return result.toPromise(); } @@ -929,7 +930,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration): Promise> { + public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.createUsersWithArrayInputWithHttpInfo(user, _options); return result.toPromise(); } @@ -939,7 +940,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration): Promise { + public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Promise { const result = this.api.createUsersWithArrayInput(user, _options); return result.toPromise(); } @@ -949,7 +950,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration): Promise> { + public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.createUsersWithListInputWithHttpInfo(user, _options); return result.toPromise(); } @@ -959,7 +960,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration): Promise { + public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Promise { const result = this.api.createUsersWithListInput(user, _options); return result.toPromise(); } @@ -969,7 +970,7 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, _options?: Configuration): Promise> { + public deleteUserWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.deleteUserWithHttpInfo(username, _options); return result.toPromise(); } @@ -979,7 +980,7 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration): Promise { + public deleteUser(username: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.deleteUser(username, _options); return result.toPromise(); } @@ -989,7 +990,7 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, _options?: Configuration): Promise> { + public getUserByNameWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.getUserByNameWithHttpInfo(username, _options); return result.toPromise(); } @@ -999,7 +1000,7 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration): Promise { + public getUserByName(username: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.getUserByName(username, _options); return result.toPromise(); } @@ -1010,7 +1011,7 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration): Promise> { + public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.loginUserWithHttpInfo(username, password, _options); return result.toPromise(); } @@ -1021,7 +1022,7 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration): Promise { + public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.loginUser(username, password, _options); return result.toPromise(); } @@ -1030,7 +1031,7 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUserWithHttpInfo(_options?: Configuration): Promise> { + public logoutUserWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.logoutUserWithHttpInfo(_options); return result.toPromise(); } @@ -1039,7 +1040,7 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration): Promise { + public logoutUser(_options?: Configuration | Middleware[]): Promise { const result = this.api.logoutUser(_options); return result.toPromise(); } @@ -1050,7 +1051,7 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration): Promise> { + public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | Middleware[]): Promise> { const result = this.api.updateUserWithHttpInfo(username, user, _options); return result.toPromise(); } @@ -1061,7 +1062,7 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration): Promise { + public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Promise { const result = this.api.updateUser(username, user, _options); return result.toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/PetApi.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/PetApi.ts index 984dbd77dcea..02345624cd51 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/PetApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/PetApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import FormData from "form-data"; import { URLSearchParams } from 'url'; @@ -25,8 +26,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public async addPet(pet: Pet, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async addPet(pet: Pet, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'pet' is not null or undefined if (pet === null || pet === undefined) { @@ -72,8 +76,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param petId Pet id to delete * @param apiKey */ - public async deletePet(petId: number, apiKey?: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -110,8 +117,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'status' is not null or undefined if (status === null || status === undefined) { @@ -148,8 +158,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Finds Pets by tags * @param tags Tags to filter by */ - public async findPetsByTags(tags: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'tags' is not null or undefined if (tags === null || tags === undefined) { @@ -186,8 +199,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Find pet by ID * @param petId ID of pet to return */ - public async getPetById(petId: number, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getPetById(petId: number, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -220,8 +236,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public async updatePet(pet: Pet, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async updatePet(pet: Pet, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'pet' is not null or undefined if (pet === null || pet === undefined) { @@ -268,8 +287,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param name Updated name of the pet * @param status Updated status of the pet */ - public async updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -335,8 +357,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - public async uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/StoreApi.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/StoreApi.ts index 2bbb54b777bc..dc6a44a10944 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/StoreApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/StoreApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import FormData from "form-data"; import { URLSearchParams } from 'url'; @@ -24,8 +25,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public async deleteOrder(orderId: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'orderId' is not null or undefined if (orderId === null || orderId === undefined) { @@ -51,8 +55,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public async getInventory(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getInventory(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/store/inventory'; @@ -78,8 +85,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public async getOrderById(orderId: number, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getOrderById(orderId: number, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'orderId' is not null or undefined if (orderId === null || orderId === undefined) { @@ -106,8 +116,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Place an order for a pet * @param order order placed for purchasing the pet */ - public async placeOrder(order: Order, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async placeOrder(order: Order, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'order' is not null or undefined if (order === null || order === undefined) { diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/UserApi.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/UserApi.ts index 13aca4d0559e..109522d8c67f 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/UserApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/UserApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import FormData from "form-data"; import { URLSearchParams } from 'url'; @@ -24,8 +25,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Create user * @param user Created user object */ - public async createUser(user: User, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async createUser(user: User, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'user' is not null or undefined if (user === null || user === undefined) { @@ -68,8 +72,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Creates list of users with given input array * @param user List of user object */ - public async createUsersWithArrayInput(user: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'user' is not null or undefined if (user === null || user === undefined) { @@ -112,8 +119,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Creates list of users with given input array * @param user List of user object */ - public async createUsersWithListInput(user: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'user' is not null or undefined if (user === null || user === undefined) { @@ -156,8 +166,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Delete user * @param username The name that needs to be deleted */ - public async deleteUser(username: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async deleteUser(username: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -190,8 +203,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public async getUserByName(username: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getUserByName(username: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -219,8 +235,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * @param username The user name for login * @param password The password for login in clear text */ - public async loginUser(username: string, password: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -261,8 +280,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * * Logs out current logged in user session */ - public async logoutUser(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async logoutUser(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/user/logout'; @@ -289,8 +311,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * @param username name that need to be deleted * @param user Updated user object */ - public async updateUser(username: string, user: User, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/services/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/services/ObservableAPI.ts index 014636645ab2..e8e3e63f58c2 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/services/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/services/ObservableAPI.ts @@ -1,6 +1,7 @@ import type { HttpFile } from "../http/http"; import type { Observable } from "../rxjsStub"; import type { Configuration } from "../configuration"; +import type { Middleware } from "../middleware"; import { ApiResponse } from "../models/ApiResponse"; import { Category } from "../models/Category"; @@ -11,52 +12,52 @@ import { User } from "../models/User"; export abstract class AbstractObservablePetApi { - public abstract addPet(pet: Pet, options?: Configuration): Observable; + public abstract addPet(pet: Pet, options?: Configuration | Middleware[]): Observable; - public abstract deletePet(petId: number, apiKey?: string, options?: Configuration): Observable; + public abstract deletePet(petId: number, apiKey?: string, options?: Configuration | Middleware[]): Observable; - public abstract findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: Configuration): Observable>; + public abstract findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: Configuration | Middleware[]): Observable>; - public abstract findPetsByTags(tags: Array, options?: Configuration): Observable>; + public abstract findPetsByTags(tags: Array, options?: Configuration | Middleware[]): Observable>; - public abstract getPetById(petId: number, options?: Configuration): Observable; + public abstract getPetById(petId: number, options?: Configuration | Middleware[]): Observable; - public abstract updatePet(pet: Pet, options?: Configuration): Observable; + public abstract updatePet(pet: Pet, options?: Configuration | Middleware[]): Observable; - public abstract updatePetWithForm(petId: number, name?: string, status?: string, options?: Configuration): Observable; + public abstract updatePetWithForm(petId: number, name?: string, status?: string, options?: Configuration | Middleware[]): Observable; - public abstract uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, options?: Configuration): Observable; + public abstract uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, options?: Configuration | Middleware[]): Observable; } export abstract class AbstractObservableStoreApi { - public abstract deleteOrder(orderId: string, options?: Configuration): Observable; + public abstract deleteOrder(orderId: string, options?: Configuration | Middleware[]): Observable; - public abstract getInventory(options?: Configuration): Observable<{ [key: string]: number; }>; + public abstract getInventory(options?: Configuration | Middleware[]): Observable<{ [key: string]: number; }>; - public abstract getOrderById(orderId: number, options?: Configuration): Observable; + public abstract getOrderById(orderId: number, options?: Configuration | Middleware[]): Observable; - public abstract placeOrder(order: Order, options?: Configuration): Observable; + public abstract placeOrder(order: Order, options?: Configuration | Middleware[]): Observable; } export abstract class AbstractObservableUserApi { - public abstract createUser(user: User, options?: Configuration): Observable; + public abstract createUser(user: User, options?: Configuration | Middleware[]): Observable; - public abstract createUsersWithArrayInput(user: Array, options?: Configuration): Observable; + public abstract createUsersWithArrayInput(user: Array, options?: Configuration | Middleware[]): Observable; - public abstract createUsersWithListInput(user: Array, options?: Configuration): Observable; + public abstract createUsersWithListInput(user: Array, options?: Configuration | Middleware[]): Observable; - public abstract deleteUser(username: string, options?: Configuration): Observable; + public abstract deleteUser(username: string, options?: Configuration | Middleware[]): Observable; - public abstract getUserByName(username: string, options?: Configuration): Observable; + public abstract getUserByName(username: string, options?: Configuration | Middleware[]): Observable; - public abstract loginUser(username: string, password: string, options?: Configuration): Observable; + public abstract loginUser(username: string, password: string, options?: Configuration | Middleware[]): Observable; - public abstract logoutUser(options?: Configuration): Observable; + public abstract logoutUser(options?: Configuration | Middleware[]): Observable; - public abstract updateUser(username: string, user: User, options?: Configuration): Observable; + public abstract updateUser(username: string, user: User, options?: Configuration | Middleware[]): Observable; } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObjectParamAPI.ts index 568cc5c507b1..b1512d688646 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObjectParamAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { ApiResponse } from '../models/ApiResponse'; import { Category } from '../models/Category'; @@ -136,7 +137,7 @@ export class ObjectPetApi { * Add a new pet to the store * @param param the request object */ - public addPetWithHttpInfo(param: PetApiAddPetRequest, options?: Configuration): Promise> { + public addPetWithHttpInfo(param: PetApiAddPetRequest, options?: Configuration | Middleware[]): Promise> { return this.api.addPetWithHttpInfo(param.pet, options).toPromise(); } @@ -145,7 +146,7 @@ export class ObjectPetApi { * Add a new pet to the store * @param param the request object */ - public addPet(param: PetApiAddPetRequest, options?: Configuration): Promise { + public addPet(param: PetApiAddPetRequest, options?: Configuration | Middleware[]): Promise { return this.api.addPet(param.pet, options).toPromise(); } @@ -154,7 +155,7 @@ export class ObjectPetApi { * Deletes a pet * @param param the request object */ - public deletePetWithHttpInfo(param: PetApiDeletePetRequest, options?: Configuration): Promise> { + public deletePetWithHttpInfo(param: PetApiDeletePetRequest, options?: Configuration | Middleware[]): Promise> { return this.api.deletePetWithHttpInfo(param.petId, param.apiKey, options).toPromise(); } @@ -163,7 +164,7 @@ export class ObjectPetApi { * Deletes a pet * @param param the request object */ - public deletePet(param: PetApiDeletePetRequest, options?: Configuration): Promise { + public deletePet(param: PetApiDeletePetRequest, options?: Configuration | Middleware[]): Promise { return this.api.deletePet(param.petId, param.apiKey, options).toPromise(); } @@ -172,7 +173,7 @@ export class ObjectPetApi { * Finds Pets by status * @param param the request object */ - public findPetsByStatusWithHttpInfo(param: PetApiFindPetsByStatusRequest, options?: Configuration): Promise>> { + public findPetsByStatusWithHttpInfo(param: PetApiFindPetsByStatusRequest, options?: Configuration | Middleware[]): Promise>> { return this.api.findPetsByStatusWithHttpInfo(param.status, options).toPromise(); } @@ -181,7 +182,7 @@ export class ObjectPetApi { * Finds Pets by status * @param param the request object */ - public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration): Promise> { + public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration | Middleware[]): Promise> { return this.api.findPetsByStatus(param.status, options).toPromise(); } @@ -190,7 +191,7 @@ export class ObjectPetApi { * Finds Pets by tags * @param param the request object */ - public findPetsByTagsWithHttpInfo(param: PetApiFindPetsByTagsRequest, options?: Configuration): Promise>> { + public findPetsByTagsWithHttpInfo(param: PetApiFindPetsByTagsRequest, options?: Configuration | Middleware[]): Promise>> { return this.api.findPetsByTagsWithHttpInfo(param.tags, options).toPromise(); } @@ -199,7 +200,7 @@ export class ObjectPetApi { * Finds Pets by tags * @param param the request object */ - public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration): Promise> { + public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration | Middleware[]): Promise> { return this.api.findPetsByTags(param.tags, options).toPromise(); } @@ -208,7 +209,7 @@ export class ObjectPetApi { * Find pet by ID * @param param the request object */ - public getPetByIdWithHttpInfo(param: PetApiGetPetByIdRequest, options?: Configuration): Promise> { + public getPetByIdWithHttpInfo(param: PetApiGetPetByIdRequest, options?: Configuration | Middleware[]): Promise> { return this.api.getPetByIdWithHttpInfo(param.petId, options).toPromise(); } @@ -217,7 +218,7 @@ export class ObjectPetApi { * Find pet by ID * @param param the request object */ - public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration): Promise { + public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration | Middleware[]): Promise { return this.api.getPetById(param.petId, options).toPromise(); } @@ -226,7 +227,7 @@ export class ObjectPetApi { * Update an existing pet * @param param the request object */ - public updatePetWithHttpInfo(param: PetApiUpdatePetRequest, options?: Configuration): Promise> { + public updatePetWithHttpInfo(param: PetApiUpdatePetRequest, options?: Configuration | Middleware[]): Promise> { return this.api.updatePetWithHttpInfo(param.pet, options).toPromise(); } @@ -235,7 +236,7 @@ export class ObjectPetApi { * Update an existing pet * @param param the request object */ - public updatePet(param: PetApiUpdatePetRequest, options?: Configuration): Promise { + public updatePet(param: PetApiUpdatePetRequest, options?: Configuration | Middleware[]): Promise { return this.api.updatePet(param.pet, options).toPromise(); } @@ -244,7 +245,7 @@ export class ObjectPetApi { * Updates a pet in the store with form data * @param param the request object */ - public updatePetWithFormWithHttpInfo(param: PetApiUpdatePetWithFormRequest, options?: Configuration): Promise> { + public updatePetWithFormWithHttpInfo(param: PetApiUpdatePetWithFormRequest, options?: Configuration | Middleware[]): Promise> { return this.api.updatePetWithFormWithHttpInfo(param.petId, param.name, param.status, options).toPromise(); } @@ -253,7 +254,7 @@ export class ObjectPetApi { * Updates a pet in the store with form data * @param param the request object */ - public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration): Promise { + public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration | Middleware[]): Promise { return this.api.updatePetWithForm(param.petId, param.name, param.status, options).toPromise(); } @@ -262,7 +263,7 @@ export class ObjectPetApi { * uploads an image * @param param the request object */ - public uploadFileWithHttpInfo(param: PetApiUploadFileRequest, options?: Configuration): Promise> { + public uploadFileWithHttpInfo(param: PetApiUploadFileRequest, options?: Configuration | Middleware[]): Promise> { return this.api.uploadFileWithHttpInfo(param.petId, param.additionalMetadata, param.file, options).toPromise(); } @@ -271,7 +272,7 @@ export class ObjectPetApi { * uploads an image * @param param the request object */ - public uploadFile(param: PetApiUploadFileRequest, options?: Configuration): Promise { + public uploadFile(param: PetApiUploadFileRequest, options?: Configuration | Middleware[]): Promise { return this.api.uploadFile(param.petId, param.additionalMetadata, param.file, options).toPromise(); } @@ -326,7 +327,7 @@ export class ObjectStoreApi { * Delete purchase order by ID * @param param the request object */ - public deleteOrderWithHttpInfo(param: StoreApiDeleteOrderRequest, options?: Configuration): Promise> { + public deleteOrderWithHttpInfo(param: StoreApiDeleteOrderRequest, options?: Configuration | Middleware[]): Promise> { return this.api.deleteOrderWithHttpInfo(param.orderId, options).toPromise(); } @@ -335,7 +336,7 @@ export class ObjectStoreApi { * Delete purchase order by ID * @param param the request object */ - public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration): Promise { + public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration | Middleware[]): Promise { return this.api.deleteOrder(param.orderId, options).toPromise(); } @@ -344,7 +345,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventoryWithHttpInfo(param: StoreApiGetInventoryRequest = {}, options?: Configuration): Promise> { + public getInventoryWithHttpInfo(param: StoreApiGetInventoryRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.getInventoryWithHttpInfo( options).toPromise(); } @@ -353,7 +354,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration): Promise<{ [key: string]: number; }> { + public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { return this.api.getInventory( options).toPromise(); } @@ -362,7 +363,7 @@ export class ObjectStoreApi { * Find purchase order by ID * @param param the request object */ - public getOrderByIdWithHttpInfo(param: StoreApiGetOrderByIdRequest, options?: Configuration): Promise> { + public getOrderByIdWithHttpInfo(param: StoreApiGetOrderByIdRequest, options?: Configuration | Middleware[]): Promise> { return this.api.getOrderByIdWithHttpInfo(param.orderId, options).toPromise(); } @@ -371,7 +372,7 @@ export class ObjectStoreApi { * Find purchase order by ID * @param param the request object */ - public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration): Promise { + public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration | Middleware[]): Promise { return this.api.getOrderById(param.orderId, options).toPromise(); } @@ -380,7 +381,7 @@ export class ObjectStoreApi { * Place an order for a pet * @param param the request object */ - public placeOrderWithHttpInfo(param: StoreApiPlaceOrderRequest, options?: Configuration): Promise> { + public placeOrderWithHttpInfo(param: StoreApiPlaceOrderRequest, options?: Configuration | Middleware[]): Promise> { return this.api.placeOrderWithHttpInfo(param.order, options).toPromise(); } @@ -389,7 +390,7 @@ export class ObjectStoreApi { * Place an order for a pet * @param param the request object */ - public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration): Promise { + public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration | Middleware[]): Promise { return this.api.placeOrder(param.order, options).toPromise(); } @@ -493,7 +494,7 @@ export class ObjectUserApi { * Create user * @param param the request object */ - public createUserWithHttpInfo(param: UserApiCreateUserRequest, options?: Configuration): Promise> { + public createUserWithHttpInfo(param: UserApiCreateUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.createUserWithHttpInfo(param.user, options).toPromise(); } @@ -502,7 +503,7 @@ export class ObjectUserApi { * Create user * @param param the request object */ - public createUser(param: UserApiCreateUserRequest, options?: Configuration): Promise { + public createUser(param: UserApiCreateUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.createUser(param.user, options).toPromise(); } @@ -511,7 +512,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithArrayInputWithHttpInfo(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration): Promise> { + public createUsersWithArrayInputWithHttpInfo(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration | Middleware[]): Promise> { return this.api.createUsersWithArrayInputWithHttpInfo(param.user, options).toPromise(); } @@ -520,7 +521,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration): Promise { + public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration | Middleware[]): Promise { return this.api.createUsersWithArrayInput(param.user, options).toPromise(); } @@ -529,7 +530,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithListInputWithHttpInfo(param: UserApiCreateUsersWithListInputRequest, options?: Configuration): Promise> { + public createUsersWithListInputWithHttpInfo(param: UserApiCreateUsersWithListInputRequest, options?: Configuration | Middleware[]): Promise> { return this.api.createUsersWithListInputWithHttpInfo(param.user, options).toPromise(); } @@ -538,7 +539,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration): Promise { + public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration | Middleware[]): Promise { return this.api.createUsersWithListInput(param.user, options).toPromise(); } @@ -547,7 +548,7 @@ export class ObjectUserApi { * Delete user * @param param the request object */ - public deleteUserWithHttpInfo(param: UserApiDeleteUserRequest, options?: Configuration): Promise> { + public deleteUserWithHttpInfo(param: UserApiDeleteUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.deleteUserWithHttpInfo(param.username, options).toPromise(); } @@ -556,7 +557,7 @@ export class ObjectUserApi { * Delete user * @param param the request object */ - public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration): Promise { + public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.deleteUser(param.username, options).toPromise(); } @@ -565,7 +566,7 @@ export class ObjectUserApi { * Get user by user name * @param param the request object */ - public getUserByNameWithHttpInfo(param: UserApiGetUserByNameRequest, options?: Configuration): Promise> { + public getUserByNameWithHttpInfo(param: UserApiGetUserByNameRequest, options?: Configuration | Middleware[]): Promise> { return this.api.getUserByNameWithHttpInfo(param.username, options).toPromise(); } @@ -574,7 +575,7 @@ export class ObjectUserApi { * Get user by user name * @param param the request object */ - public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration): Promise { + public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration | Middleware[]): Promise { return this.api.getUserByName(param.username, options).toPromise(); } @@ -583,7 +584,7 @@ export class ObjectUserApi { * Logs user into the system * @param param the request object */ - public loginUserWithHttpInfo(param: UserApiLoginUserRequest, options?: Configuration): Promise> { + public loginUserWithHttpInfo(param: UserApiLoginUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.loginUserWithHttpInfo(param.username, param.password, options).toPromise(); } @@ -592,7 +593,7 @@ export class ObjectUserApi { * Logs user into the system * @param param the request object */ - public loginUser(param: UserApiLoginUserRequest, options?: Configuration): Promise { + public loginUser(param: UserApiLoginUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.loginUser(param.username, param.password, options).toPromise(); } @@ -601,7 +602,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUserWithHttpInfo(param: UserApiLogoutUserRequest = {}, options?: Configuration): Promise> { + public logoutUserWithHttpInfo(param: UserApiLogoutUserRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.logoutUserWithHttpInfo( options).toPromise(); } @@ -610,7 +611,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration): Promise { + public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.logoutUser( options).toPromise(); } @@ -619,7 +620,7 @@ export class ObjectUserApi { * Updated user * @param param the request object */ - public updateUserWithHttpInfo(param: UserApiUpdateUserRequest, options?: Configuration): Promise> { + public updateUserWithHttpInfo(param: UserApiUpdateUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.updateUserWithHttpInfo(param.username, param.user, options).toPromise(); } @@ -628,7 +629,7 @@ export class ObjectUserApi { * Updated user * @param param the request object */ - public updateUser(param: UserApiUpdateUserRequest, options?: Configuration): Promise { + public updateUser(param: UserApiUpdateUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.updateUser(param.username, param.user, options).toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObservableAPI.ts index a749f28cac18..bf9ab6df7c5c 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObservableAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { Observable, of, from } from '../rxjsStub'; import {mergeMap, map} from '../rxjsStub'; import { injectable, inject, optional } from "inversify"; @@ -35,12 +36,21 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(pet: Pet, _options?: Configuration): Observable> { + public addPetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.addPet(pet, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -59,7 +69,7 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration): Observable { + public addPet(pet: Pet, _options?: Configuration | Middleware[]): Observable { return this.addPetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -69,12 +79,21 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration): Observable> { + public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.deletePet(petId, apiKey, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -94,7 +113,7 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration): Observable { + public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable { return this.deletePetWithHttpInfo(petId, apiKey, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -103,12 +122,21 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Observable>> { + public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable>> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.findPetsByStatus(status, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -127,7 +155,7 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Observable> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable> { return this.findPetsByStatusWithHttpInfo(status, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -136,12 +164,21 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration): Observable>> { + public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | Middleware[]): Observable>> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.findPetsByTags(tags, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -160,7 +197,7 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration): Observable> { + public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Observable> { return this.findPetsByTagsWithHttpInfo(tags, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -169,12 +206,21 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, _options?: Configuration): Observable> { + public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getPetById(petId, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -193,7 +239,7 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration): Observable { + public getPetById(petId: number, _options?: Configuration | Middleware[]): Observable { return this.getPetByIdWithHttpInfo(petId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -202,12 +248,21 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(pet: Pet, _options?: Configuration): Observable> { + public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.updatePet(pet, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -226,7 +281,7 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration): Observable { + public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Observable { return this.updatePetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -237,12 +292,21 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration): Observable> { + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.updatePetWithForm(petId, name, status, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -263,7 +327,7 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable { return this.updatePetWithFormWithHttpInfo(petId, name, status, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -274,12 +338,21 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Observable> { + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.uploadFile(petId, additionalMetadata, file, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -300,7 +373,7 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable { return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -330,12 +403,21 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration): Observable> { + public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.deleteOrder(orderId, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -354,7 +436,7 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration): Observable { + public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Observable { return this.deleteOrderWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -362,12 +444,21 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventoryWithHttpInfo(_options?: Configuration): Observable> { + public getInventoryWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getInventory(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -385,7 +476,7 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration): Observable<{ [key: string]: number; }> { + public getInventory(_options?: Configuration | Middleware[]): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo<{ [key: string]: number; }>) => apiResponse.data)); } @@ -394,12 +485,21 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration): Observable> { + public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getOrderById(orderId, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -418,7 +518,7 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration): Observable { + public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Observable { return this.getOrderByIdWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -427,12 +527,21 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(order: Order, _options?: Configuration): Observable> { + public placeOrderWithHttpInfo(order: Order, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.placeOrder(order, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -451,7 +560,7 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration): Observable { + public placeOrder(order: Order, _options?: Configuration | Middleware[]): Observable { return this.placeOrderWithHttpInfo(order, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -481,12 +590,21 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUserWithHttpInfo(user: User, _options?: Configuration): Observable> { + public createUserWithHttpInfo(user: User, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.createUser(user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -505,7 +623,7 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration): Observable { + public createUser(user: User, _options?: Configuration | Middleware[]): Observable { return this.createUserWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -514,12 +632,21 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration): Observable> { + public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.createUsersWithArrayInput(user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -538,7 +665,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration): Observable { + public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Observable { return this.createUsersWithArrayInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -547,12 +674,21 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration): Observable> { + public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.createUsersWithListInput(user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -571,7 +707,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration): Observable { + public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Observable { return this.createUsersWithListInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -580,12 +716,21 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, _options?: Configuration): Observable> { + public deleteUserWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.deleteUser(username, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -604,7 +749,7 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration): Observable { + public deleteUser(username: string, _options?: Configuration | Middleware[]): Observable { return this.deleteUserWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -613,12 +758,21 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, _options?: Configuration): Observable> { + public getUserByNameWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getUserByName(username, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -637,7 +791,7 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration): Observable { + public getUserByName(username: string, _options?: Configuration | Middleware[]): Observable { return this.getUserByNameWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -647,12 +801,21 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration): Observable> { + public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.loginUser(username, password, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -672,7 +835,7 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration): Observable { + public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Observable { return this.loginUserWithHttpInfo(username, password, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -680,12 +843,21 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUserWithHttpInfo(_options?: Configuration): Observable> { + public logoutUserWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.logoutUser(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -703,7 +875,7 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration): Observable { + public logoutUser(_options?: Configuration | Middleware[]): Observable { return this.logoutUserWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -713,12 +885,21 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration): Observable> { + public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.updateUser(username, user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -738,7 +919,7 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration): Observable { + public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Observable { return this.updateUserWithHttpInfo(username, user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/types/PromiseAPI.ts index cd43df466230..bad01413b306 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/types/PromiseAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { injectable, inject, optional } from "inversify"; import { AbstractConfiguration } from "../services/configuration"; @@ -31,7 +32,7 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(pet: Pet, _options?: Configuration): Promise> { + public addPetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { const result = this.api.addPetWithHttpInfo(pet, _options); return result.toPromise(); } @@ -41,7 +42,7 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration): Promise { + public addPet(pet: Pet, _options?: Configuration | Middleware[]): Promise { const result = this.api.addPet(pet, _options); return result.toPromise(); } @@ -52,7 +53,7 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration): Promise> { + public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.deletePetWithHttpInfo(petId, apiKey, _options); return result.toPromise(); } @@ -63,7 +64,7 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration): Promise { + public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.deletePet(petId, apiKey, _options); return result.toPromise(); } @@ -73,7 +74,7 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise>> { + public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise>> { const result = this.api.findPetsByStatusWithHttpInfo(status, _options); return result.toPromise(); } @@ -83,7 +84,7 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise> { const result = this.api.findPetsByStatus(status, _options); return result.toPromise(); } @@ -93,7 +94,7 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration): Promise>> { + public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | Middleware[]): Promise>> { const result = this.api.findPetsByTagsWithHttpInfo(tags, _options); return result.toPromise(); } @@ -103,7 +104,7 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration): Promise> { + public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.findPetsByTags(tags, _options); return result.toPromise(); } @@ -113,7 +114,7 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, _options?: Configuration): Promise> { + public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | Middleware[]): Promise> { const result = this.api.getPetByIdWithHttpInfo(petId, _options); return result.toPromise(); } @@ -123,7 +124,7 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration): Promise { + public getPetById(petId: number, _options?: Configuration | Middleware[]): Promise { const result = this.api.getPetById(petId, _options); return result.toPromise(); } @@ -133,7 +134,7 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(pet: Pet, _options?: Configuration): Promise> { + public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { const result = this.api.updatePetWithHttpInfo(pet, _options); return result.toPromise(); } @@ -143,7 +144,7 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration): Promise { + public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Promise { const result = this.api.updatePet(pet, _options); return result.toPromise(); } @@ -155,7 +156,7 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration): Promise> { + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.updatePetWithFormWithHttpInfo(petId, name, status, _options); return result.toPromise(); } @@ -167,7 +168,7 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Promise { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.updatePetWithForm(petId, name, status, _options); return result.toPromise(); } @@ -179,7 +180,7 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise> { + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise> { const result = this.api.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options); return result.toPromise(); } @@ -191,7 +192,7 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise { const result = this.api.uploadFile(petId, additionalMetadata, file, _options); return result.toPromise(); } @@ -223,7 +224,7 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration): Promise> { + public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.deleteOrderWithHttpInfo(orderId, _options); return result.toPromise(); } @@ -233,7 +234,7 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration): Promise { + public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.deleteOrder(orderId, _options); return result.toPromise(); } @@ -242,7 +243,7 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventoryWithHttpInfo(_options?: Configuration): Promise> { + public getInventoryWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.getInventoryWithHttpInfo(_options); return result.toPromise(); } @@ -251,7 +252,7 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration): Promise<{ [key: string]: number; }> { + public getInventory(_options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { const result = this.api.getInventory(_options); return result.toPromise(); } @@ -261,7 +262,7 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration): Promise> { + public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | Middleware[]): Promise> { const result = this.api.getOrderByIdWithHttpInfo(orderId, _options); return result.toPromise(); } @@ -271,7 +272,7 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration): Promise { + public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Promise { const result = this.api.getOrderById(orderId, _options); return result.toPromise(); } @@ -281,7 +282,7 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(order: Order, _options?: Configuration): Promise> { + public placeOrderWithHttpInfo(order: Order, _options?: Configuration | Middleware[]): Promise> { const result = this.api.placeOrderWithHttpInfo(order, _options); return result.toPromise(); } @@ -291,7 +292,7 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration): Promise { + public placeOrder(order: Order, _options?: Configuration | Middleware[]): Promise { const result = this.api.placeOrder(order, _options); return result.toPromise(); } @@ -323,7 +324,7 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUserWithHttpInfo(user: User, _options?: Configuration): Promise> { + public createUserWithHttpInfo(user: User, _options?: Configuration | Middleware[]): Promise> { const result = this.api.createUserWithHttpInfo(user, _options); return result.toPromise(); } @@ -333,7 +334,7 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration): Promise { + public createUser(user: User, _options?: Configuration | Middleware[]): Promise { const result = this.api.createUser(user, _options); return result.toPromise(); } @@ -343,7 +344,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration): Promise> { + public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.createUsersWithArrayInputWithHttpInfo(user, _options); return result.toPromise(); } @@ -353,7 +354,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration): Promise { + public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Promise { const result = this.api.createUsersWithArrayInput(user, _options); return result.toPromise(); } @@ -363,7 +364,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration): Promise> { + public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.createUsersWithListInputWithHttpInfo(user, _options); return result.toPromise(); } @@ -373,7 +374,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration): Promise { + public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Promise { const result = this.api.createUsersWithListInput(user, _options); return result.toPromise(); } @@ -383,7 +384,7 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, _options?: Configuration): Promise> { + public deleteUserWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.deleteUserWithHttpInfo(username, _options); return result.toPromise(); } @@ -393,7 +394,7 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration): Promise { + public deleteUser(username: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.deleteUser(username, _options); return result.toPromise(); } @@ -403,7 +404,7 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, _options?: Configuration): Promise> { + public getUserByNameWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.getUserByNameWithHttpInfo(username, _options); return result.toPromise(); } @@ -413,7 +414,7 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration): Promise { + public getUserByName(username: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.getUserByName(username, _options); return result.toPromise(); } @@ -424,7 +425,7 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration): Promise> { + public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.loginUserWithHttpInfo(username, password, _options); return result.toPromise(); } @@ -435,7 +436,7 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration): Promise { + public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.loginUser(username, password, _options); return result.toPromise(); } @@ -444,7 +445,7 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUserWithHttpInfo(_options?: Configuration): Promise> { + public logoutUserWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.logoutUserWithHttpInfo(_options); return result.toPromise(); } @@ -453,7 +454,7 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration): Promise { + public logoutUser(_options?: Configuration | Middleware[]): Promise { const result = this.api.logoutUser(_options); return result.toPromise(); } @@ -464,7 +465,7 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration): Promise> { + public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | Middleware[]): Promise> { const result = this.api.updateUserWithHttpInfo(username, user, _options); return result.toPromise(); } @@ -475,7 +476,7 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration): Promise { + public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Promise { const result = this.api.updateUser(username, user, _options); return result.toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/apis/PetApi.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/apis/PetApi.ts index b8a08514c5c6..c83eeae27060 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/apis/PetApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/apis/PetApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; @@ -21,8 +22,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public async addPet(pet: Pet, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async addPet(pet: Pet, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'pet' is not null or undefined if (pet === null || pet === undefined) { @@ -58,7 +62,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -72,8 +76,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param petId Pet id to delete * @param apiKey */ - public async deletePet(petId: number, apiKey?: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -101,7 +108,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -114,8 +121,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'status' is not null or undefined if (status === null || status === undefined) { @@ -143,7 +153,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -156,8 +166,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Finds Pets by tags * @param tags Tags to filter by */ - public async findPetsByTags(tags: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'tags' is not null or undefined if (tags === null || tags === undefined) { @@ -185,7 +198,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -198,8 +211,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Find pet by ID * @param petId ID of pet to return */ - public async getPetById(petId: number, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getPetById(petId: number, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -223,7 +239,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -236,8 +252,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public async updatePet(pet: Pet, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async updatePet(pet: Pet, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'pet' is not null or undefined if (pet === null || pet === undefined) { @@ -273,7 +292,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -288,8 +307,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param name Updated name of the pet * @param status Updated status of the pet */ - public async updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -344,7 +366,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -359,8 +381,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - public async uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -417,7 +442,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/apis/StoreApi.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/apis/StoreApi.ts index 6474ad8a3044..8c55e2d1b6b6 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/apis/StoreApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/apis/StoreApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; @@ -20,8 +21,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public async deleteOrder(orderId: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'orderId' is not null or undefined if (orderId === null || orderId === undefined) { @@ -39,7 +43,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -51,8 +55,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public async getInventory(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getInventory(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/store/inventory'; @@ -69,7 +76,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -82,8 +89,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public async getOrderById(orderId: number, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getOrderById(orderId: number, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'orderId' is not null or undefined if (orderId === null || orderId === undefined) { @@ -101,7 +111,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -114,8 +124,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Place an order for a pet * @param order order placed for purchasing the pet */ - public async placeOrder(order: Order, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async placeOrder(order: Order, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'order' is not null or undefined if (order === null || order === undefined) { @@ -143,7 +156,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/apis/UserApi.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/apis/UserApi.ts index 70aee8ce5e2f..42f8058cac54 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/apis/UserApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/apis/UserApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; @@ -20,8 +21,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Create user * @param user Created user object */ - public async createUser(user: User, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async createUser(user: User, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'user' is not null or undefined if (user === null || user === undefined) { @@ -55,7 +59,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -68,8 +72,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Creates list of users with given input array * @param user List of user object */ - public async createUsersWithArrayInput(user: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'user' is not null or undefined if (user === null || user === undefined) { @@ -103,7 +110,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -116,8 +123,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Creates list of users with given input array * @param user List of user object */ - public async createUsersWithListInput(user: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'user' is not null or undefined if (user === null || user === undefined) { @@ -151,7 +161,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -164,8 +174,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Delete user * @param username The name that needs to be deleted */ - public async deleteUser(username: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async deleteUser(username: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -189,7 +202,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -202,8 +215,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public async getUserByName(username: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getUserByName(username: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -221,7 +237,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -235,8 +251,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * @param username The user name for login * @param password The password for login in clear text */ - public async loginUser(username: string, password: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -269,7 +288,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -281,8 +300,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * * Logs out current logged in user session */ - public async logoutUser(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async logoutUser(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/user/logout'; @@ -299,7 +321,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -313,8 +335,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * @param username name that need to be deleted * @param user Updated user object */ - public async updateUser(username: string, user: User, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -355,7 +380,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/types/ObjectParamAPI.ts index 568cc5c507b1..b1512d688646 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/types/ObjectParamAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { ApiResponse } from '../models/ApiResponse'; import { Category } from '../models/Category'; @@ -136,7 +137,7 @@ export class ObjectPetApi { * Add a new pet to the store * @param param the request object */ - public addPetWithHttpInfo(param: PetApiAddPetRequest, options?: Configuration): Promise> { + public addPetWithHttpInfo(param: PetApiAddPetRequest, options?: Configuration | Middleware[]): Promise> { return this.api.addPetWithHttpInfo(param.pet, options).toPromise(); } @@ -145,7 +146,7 @@ export class ObjectPetApi { * Add a new pet to the store * @param param the request object */ - public addPet(param: PetApiAddPetRequest, options?: Configuration): Promise { + public addPet(param: PetApiAddPetRequest, options?: Configuration | Middleware[]): Promise { return this.api.addPet(param.pet, options).toPromise(); } @@ -154,7 +155,7 @@ export class ObjectPetApi { * Deletes a pet * @param param the request object */ - public deletePetWithHttpInfo(param: PetApiDeletePetRequest, options?: Configuration): Promise> { + public deletePetWithHttpInfo(param: PetApiDeletePetRequest, options?: Configuration | Middleware[]): Promise> { return this.api.deletePetWithHttpInfo(param.petId, param.apiKey, options).toPromise(); } @@ -163,7 +164,7 @@ export class ObjectPetApi { * Deletes a pet * @param param the request object */ - public deletePet(param: PetApiDeletePetRequest, options?: Configuration): Promise { + public deletePet(param: PetApiDeletePetRequest, options?: Configuration | Middleware[]): Promise { return this.api.deletePet(param.petId, param.apiKey, options).toPromise(); } @@ -172,7 +173,7 @@ export class ObjectPetApi { * Finds Pets by status * @param param the request object */ - public findPetsByStatusWithHttpInfo(param: PetApiFindPetsByStatusRequest, options?: Configuration): Promise>> { + public findPetsByStatusWithHttpInfo(param: PetApiFindPetsByStatusRequest, options?: Configuration | Middleware[]): Promise>> { return this.api.findPetsByStatusWithHttpInfo(param.status, options).toPromise(); } @@ -181,7 +182,7 @@ export class ObjectPetApi { * Finds Pets by status * @param param the request object */ - public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration): Promise> { + public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration | Middleware[]): Promise> { return this.api.findPetsByStatus(param.status, options).toPromise(); } @@ -190,7 +191,7 @@ export class ObjectPetApi { * Finds Pets by tags * @param param the request object */ - public findPetsByTagsWithHttpInfo(param: PetApiFindPetsByTagsRequest, options?: Configuration): Promise>> { + public findPetsByTagsWithHttpInfo(param: PetApiFindPetsByTagsRequest, options?: Configuration | Middleware[]): Promise>> { return this.api.findPetsByTagsWithHttpInfo(param.tags, options).toPromise(); } @@ -199,7 +200,7 @@ export class ObjectPetApi { * Finds Pets by tags * @param param the request object */ - public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration): Promise> { + public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration | Middleware[]): Promise> { return this.api.findPetsByTags(param.tags, options).toPromise(); } @@ -208,7 +209,7 @@ export class ObjectPetApi { * Find pet by ID * @param param the request object */ - public getPetByIdWithHttpInfo(param: PetApiGetPetByIdRequest, options?: Configuration): Promise> { + public getPetByIdWithHttpInfo(param: PetApiGetPetByIdRequest, options?: Configuration | Middleware[]): Promise> { return this.api.getPetByIdWithHttpInfo(param.petId, options).toPromise(); } @@ -217,7 +218,7 @@ export class ObjectPetApi { * Find pet by ID * @param param the request object */ - public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration): Promise { + public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration | Middleware[]): Promise { return this.api.getPetById(param.petId, options).toPromise(); } @@ -226,7 +227,7 @@ export class ObjectPetApi { * Update an existing pet * @param param the request object */ - public updatePetWithHttpInfo(param: PetApiUpdatePetRequest, options?: Configuration): Promise> { + public updatePetWithHttpInfo(param: PetApiUpdatePetRequest, options?: Configuration | Middleware[]): Promise> { return this.api.updatePetWithHttpInfo(param.pet, options).toPromise(); } @@ -235,7 +236,7 @@ export class ObjectPetApi { * Update an existing pet * @param param the request object */ - public updatePet(param: PetApiUpdatePetRequest, options?: Configuration): Promise { + public updatePet(param: PetApiUpdatePetRequest, options?: Configuration | Middleware[]): Promise { return this.api.updatePet(param.pet, options).toPromise(); } @@ -244,7 +245,7 @@ export class ObjectPetApi { * Updates a pet in the store with form data * @param param the request object */ - public updatePetWithFormWithHttpInfo(param: PetApiUpdatePetWithFormRequest, options?: Configuration): Promise> { + public updatePetWithFormWithHttpInfo(param: PetApiUpdatePetWithFormRequest, options?: Configuration | Middleware[]): Promise> { return this.api.updatePetWithFormWithHttpInfo(param.petId, param.name, param.status, options).toPromise(); } @@ -253,7 +254,7 @@ export class ObjectPetApi { * Updates a pet in the store with form data * @param param the request object */ - public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration): Promise { + public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration | Middleware[]): Promise { return this.api.updatePetWithForm(param.petId, param.name, param.status, options).toPromise(); } @@ -262,7 +263,7 @@ export class ObjectPetApi { * uploads an image * @param param the request object */ - public uploadFileWithHttpInfo(param: PetApiUploadFileRequest, options?: Configuration): Promise> { + public uploadFileWithHttpInfo(param: PetApiUploadFileRequest, options?: Configuration | Middleware[]): Promise> { return this.api.uploadFileWithHttpInfo(param.petId, param.additionalMetadata, param.file, options).toPromise(); } @@ -271,7 +272,7 @@ export class ObjectPetApi { * uploads an image * @param param the request object */ - public uploadFile(param: PetApiUploadFileRequest, options?: Configuration): Promise { + public uploadFile(param: PetApiUploadFileRequest, options?: Configuration | Middleware[]): Promise { return this.api.uploadFile(param.petId, param.additionalMetadata, param.file, options).toPromise(); } @@ -326,7 +327,7 @@ export class ObjectStoreApi { * Delete purchase order by ID * @param param the request object */ - public deleteOrderWithHttpInfo(param: StoreApiDeleteOrderRequest, options?: Configuration): Promise> { + public deleteOrderWithHttpInfo(param: StoreApiDeleteOrderRequest, options?: Configuration | Middleware[]): Promise> { return this.api.deleteOrderWithHttpInfo(param.orderId, options).toPromise(); } @@ -335,7 +336,7 @@ export class ObjectStoreApi { * Delete purchase order by ID * @param param the request object */ - public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration): Promise { + public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration | Middleware[]): Promise { return this.api.deleteOrder(param.orderId, options).toPromise(); } @@ -344,7 +345,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventoryWithHttpInfo(param: StoreApiGetInventoryRequest = {}, options?: Configuration): Promise> { + public getInventoryWithHttpInfo(param: StoreApiGetInventoryRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.getInventoryWithHttpInfo( options).toPromise(); } @@ -353,7 +354,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration): Promise<{ [key: string]: number; }> { + public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { return this.api.getInventory( options).toPromise(); } @@ -362,7 +363,7 @@ export class ObjectStoreApi { * Find purchase order by ID * @param param the request object */ - public getOrderByIdWithHttpInfo(param: StoreApiGetOrderByIdRequest, options?: Configuration): Promise> { + public getOrderByIdWithHttpInfo(param: StoreApiGetOrderByIdRequest, options?: Configuration | Middleware[]): Promise> { return this.api.getOrderByIdWithHttpInfo(param.orderId, options).toPromise(); } @@ -371,7 +372,7 @@ export class ObjectStoreApi { * Find purchase order by ID * @param param the request object */ - public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration): Promise { + public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration | Middleware[]): Promise { return this.api.getOrderById(param.orderId, options).toPromise(); } @@ -380,7 +381,7 @@ export class ObjectStoreApi { * Place an order for a pet * @param param the request object */ - public placeOrderWithHttpInfo(param: StoreApiPlaceOrderRequest, options?: Configuration): Promise> { + public placeOrderWithHttpInfo(param: StoreApiPlaceOrderRequest, options?: Configuration | Middleware[]): Promise> { return this.api.placeOrderWithHttpInfo(param.order, options).toPromise(); } @@ -389,7 +390,7 @@ export class ObjectStoreApi { * Place an order for a pet * @param param the request object */ - public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration): Promise { + public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration | Middleware[]): Promise { return this.api.placeOrder(param.order, options).toPromise(); } @@ -493,7 +494,7 @@ export class ObjectUserApi { * Create user * @param param the request object */ - public createUserWithHttpInfo(param: UserApiCreateUserRequest, options?: Configuration): Promise> { + public createUserWithHttpInfo(param: UserApiCreateUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.createUserWithHttpInfo(param.user, options).toPromise(); } @@ -502,7 +503,7 @@ export class ObjectUserApi { * Create user * @param param the request object */ - public createUser(param: UserApiCreateUserRequest, options?: Configuration): Promise { + public createUser(param: UserApiCreateUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.createUser(param.user, options).toPromise(); } @@ -511,7 +512,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithArrayInputWithHttpInfo(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration): Promise> { + public createUsersWithArrayInputWithHttpInfo(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration | Middleware[]): Promise> { return this.api.createUsersWithArrayInputWithHttpInfo(param.user, options).toPromise(); } @@ -520,7 +521,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration): Promise { + public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration | Middleware[]): Promise { return this.api.createUsersWithArrayInput(param.user, options).toPromise(); } @@ -529,7 +530,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithListInputWithHttpInfo(param: UserApiCreateUsersWithListInputRequest, options?: Configuration): Promise> { + public createUsersWithListInputWithHttpInfo(param: UserApiCreateUsersWithListInputRequest, options?: Configuration | Middleware[]): Promise> { return this.api.createUsersWithListInputWithHttpInfo(param.user, options).toPromise(); } @@ -538,7 +539,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration): Promise { + public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration | Middleware[]): Promise { return this.api.createUsersWithListInput(param.user, options).toPromise(); } @@ -547,7 +548,7 @@ export class ObjectUserApi { * Delete user * @param param the request object */ - public deleteUserWithHttpInfo(param: UserApiDeleteUserRequest, options?: Configuration): Promise> { + public deleteUserWithHttpInfo(param: UserApiDeleteUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.deleteUserWithHttpInfo(param.username, options).toPromise(); } @@ -556,7 +557,7 @@ export class ObjectUserApi { * Delete user * @param param the request object */ - public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration): Promise { + public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.deleteUser(param.username, options).toPromise(); } @@ -565,7 +566,7 @@ export class ObjectUserApi { * Get user by user name * @param param the request object */ - public getUserByNameWithHttpInfo(param: UserApiGetUserByNameRequest, options?: Configuration): Promise> { + public getUserByNameWithHttpInfo(param: UserApiGetUserByNameRequest, options?: Configuration | Middleware[]): Promise> { return this.api.getUserByNameWithHttpInfo(param.username, options).toPromise(); } @@ -574,7 +575,7 @@ export class ObjectUserApi { * Get user by user name * @param param the request object */ - public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration): Promise { + public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration | Middleware[]): Promise { return this.api.getUserByName(param.username, options).toPromise(); } @@ -583,7 +584,7 @@ export class ObjectUserApi { * Logs user into the system * @param param the request object */ - public loginUserWithHttpInfo(param: UserApiLoginUserRequest, options?: Configuration): Promise> { + public loginUserWithHttpInfo(param: UserApiLoginUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.loginUserWithHttpInfo(param.username, param.password, options).toPromise(); } @@ -592,7 +593,7 @@ export class ObjectUserApi { * Logs user into the system * @param param the request object */ - public loginUser(param: UserApiLoginUserRequest, options?: Configuration): Promise { + public loginUser(param: UserApiLoginUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.loginUser(param.username, param.password, options).toPromise(); } @@ -601,7 +602,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUserWithHttpInfo(param: UserApiLogoutUserRequest = {}, options?: Configuration): Promise> { + public logoutUserWithHttpInfo(param: UserApiLogoutUserRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.logoutUserWithHttpInfo( options).toPromise(); } @@ -610,7 +611,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration): Promise { + public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.logoutUser( options).toPromise(); } @@ -619,7 +620,7 @@ export class ObjectUserApi { * Updated user * @param param the request object */ - public updateUserWithHttpInfo(param: UserApiUpdateUserRequest, options?: Configuration): Promise> { + public updateUserWithHttpInfo(param: UserApiUpdateUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.updateUserWithHttpInfo(param.username, param.user, options).toPromise(); } @@ -628,7 +629,7 @@ export class ObjectUserApi { * Updated user * @param param the request object */ - public updateUser(param: UserApiUpdateUserRequest, options?: Configuration): Promise { + public updateUser(param: UserApiUpdateUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.updateUser(param.username, param.user, options).toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/types/ObservableAPI.ts index f344144c8b37..585735aa7842 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/types/ObservableAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { Observable, of, from } from '../rxjsStub'; import {mergeMap, map} from '../rxjsStub'; import { ApiResponse } from '../models/ApiResponse'; @@ -30,12 +31,21 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(pet: Pet, _options?: Configuration): Observable> { + public addPetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.addPet(pet, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -54,7 +64,7 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration): Observable { + public addPet(pet: Pet, _options?: Configuration | Middleware[]): Observable { return this.addPetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -64,12 +74,21 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration): Observable> { + public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.deletePet(petId, apiKey, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -89,7 +108,7 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration): Observable { + public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable { return this.deletePetWithHttpInfo(petId, apiKey, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -98,12 +117,21 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Observable>> { + public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable>> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.findPetsByStatus(status, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -122,7 +150,7 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Observable> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable> { return this.findPetsByStatusWithHttpInfo(status, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -131,12 +159,21 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration): Observable>> { + public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | Middleware[]): Observable>> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.findPetsByTags(tags, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -155,7 +192,7 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration): Observable> { + public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Observable> { return this.findPetsByTagsWithHttpInfo(tags, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -164,12 +201,21 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, _options?: Configuration): Observable> { + public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getPetById(petId, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -188,7 +234,7 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration): Observable { + public getPetById(petId: number, _options?: Configuration | Middleware[]): Observable { return this.getPetByIdWithHttpInfo(petId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -197,12 +243,21 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(pet: Pet, _options?: Configuration): Observable> { + public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.updatePet(pet, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -221,7 +276,7 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration): Observable { + public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Observable { return this.updatePetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -232,12 +287,21 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration): Observable> { + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.updatePetWithForm(petId, name, status, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -258,7 +322,7 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable { return this.updatePetWithFormWithHttpInfo(petId, name, status, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -269,12 +333,21 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Observable> { + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.uploadFile(petId, additionalMetadata, file, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -295,7 +368,7 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable { return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -322,12 +395,21 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration): Observable> { + public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.deleteOrder(orderId, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -346,7 +428,7 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration): Observable { + public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Observable { return this.deleteOrderWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -354,12 +436,21 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventoryWithHttpInfo(_options?: Configuration): Observable> { + public getInventoryWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getInventory(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -377,7 +468,7 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration): Observable<{ [key: string]: number; }> { + public getInventory(_options?: Configuration | Middleware[]): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo<{ [key: string]: number; }>) => apiResponse.data)); } @@ -386,12 +477,21 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration): Observable> { + public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getOrderById(orderId, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -410,7 +510,7 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration): Observable { + public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Observable { return this.getOrderByIdWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -419,12 +519,21 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(order: Order, _options?: Configuration): Observable> { + public placeOrderWithHttpInfo(order: Order, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.placeOrder(order, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -443,7 +552,7 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration): Observable { + public placeOrder(order: Order, _options?: Configuration | Middleware[]): Observable { return this.placeOrderWithHttpInfo(order, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -470,12 +579,21 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUserWithHttpInfo(user: User, _options?: Configuration): Observable> { + public createUserWithHttpInfo(user: User, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.createUser(user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -494,7 +612,7 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration): Observable { + public createUser(user: User, _options?: Configuration | Middleware[]): Observable { return this.createUserWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -503,12 +621,21 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration): Observable> { + public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.createUsersWithArrayInput(user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -527,7 +654,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration): Observable { + public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Observable { return this.createUsersWithArrayInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -536,12 +663,21 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration): Observable> { + public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.createUsersWithListInput(user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -560,7 +696,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration): Observable { + public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Observable { return this.createUsersWithListInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -569,12 +705,21 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, _options?: Configuration): Observable> { + public deleteUserWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.deleteUser(username, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -593,7 +738,7 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration): Observable { + public deleteUser(username: string, _options?: Configuration | Middleware[]): Observable { return this.deleteUserWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -602,12 +747,21 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, _options?: Configuration): Observable> { + public getUserByNameWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getUserByName(username, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -626,7 +780,7 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration): Observable { + public getUserByName(username: string, _options?: Configuration | Middleware[]): Observable { return this.getUserByNameWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -636,12 +790,21 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration): Observable> { + public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.loginUser(username, password, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -661,7 +824,7 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration): Observable { + public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Observable { return this.loginUserWithHttpInfo(username, password, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -669,12 +832,21 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUserWithHttpInfo(_options?: Configuration): Observable> { + public logoutUserWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.logoutUser(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -692,7 +864,7 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration): Observable { + public logoutUser(_options?: Configuration | Middleware[]): Observable { return this.logoutUserWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -702,12 +874,21 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration): Observable> { + public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.updateUser(username, user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -727,7 +908,7 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration): Observable { + public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Observable { return this.updateUserWithHttpInfo(username, user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/types/PromiseAPI.ts index 55af604f4659..d74bd8f9e572 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/types/PromiseAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { ApiResponse } from '../models/ApiResponse'; import { Category } from '../models/Category'; @@ -26,7 +27,7 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(pet: Pet, _options?: Configuration): Promise> { + public addPetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { const result = this.api.addPetWithHttpInfo(pet, _options); return result.toPromise(); } @@ -36,7 +37,7 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration): Promise { + public addPet(pet: Pet, _options?: Configuration | Middleware[]): Promise { const result = this.api.addPet(pet, _options); return result.toPromise(); } @@ -47,7 +48,7 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration): Promise> { + public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.deletePetWithHttpInfo(petId, apiKey, _options); return result.toPromise(); } @@ -58,7 +59,7 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration): Promise { + public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.deletePet(petId, apiKey, _options); return result.toPromise(); } @@ -68,7 +69,7 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise>> { + public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise>> { const result = this.api.findPetsByStatusWithHttpInfo(status, _options); return result.toPromise(); } @@ -78,7 +79,7 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise> { const result = this.api.findPetsByStatus(status, _options); return result.toPromise(); } @@ -88,7 +89,7 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration): Promise>> { + public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | Middleware[]): Promise>> { const result = this.api.findPetsByTagsWithHttpInfo(tags, _options); return result.toPromise(); } @@ -98,7 +99,7 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration): Promise> { + public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.findPetsByTags(tags, _options); return result.toPromise(); } @@ -108,7 +109,7 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, _options?: Configuration): Promise> { + public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | Middleware[]): Promise> { const result = this.api.getPetByIdWithHttpInfo(petId, _options); return result.toPromise(); } @@ -118,7 +119,7 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration): Promise { + public getPetById(petId: number, _options?: Configuration | Middleware[]): Promise { const result = this.api.getPetById(petId, _options); return result.toPromise(); } @@ -128,7 +129,7 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(pet: Pet, _options?: Configuration): Promise> { + public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { const result = this.api.updatePetWithHttpInfo(pet, _options); return result.toPromise(); } @@ -138,7 +139,7 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration): Promise { + public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Promise { const result = this.api.updatePet(pet, _options); return result.toPromise(); } @@ -150,7 +151,7 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration): Promise> { + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.updatePetWithFormWithHttpInfo(petId, name, status, _options); return result.toPromise(); } @@ -162,7 +163,7 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Promise { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.updatePetWithForm(petId, name, status, _options); return result.toPromise(); } @@ -174,7 +175,7 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise> { + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise> { const result = this.api.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options); return result.toPromise(); } @@ -186,7 +187,7 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise { const result = this.api.uploadFile(petId, additionalMetadata, file, _options); return result.toPromise(); } @@ -215,7 +216,7 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration): Promise> { + public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.deleteOrderWithHttpInfo(orderId, _options); return result.toPromise(); } @@ -225,7 +226,7 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration): Promise { + public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.deleteOrder(orderId, _options); return result.toPromise(); } @@ -234,7 +235,7 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventoryWithHttpInfo(_options?: Configuration): Promise> { + public getInventoryWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.getInventoryWithHttpInfo(_options); return result.toPromise(); } @@ -243,7 +244,7 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration): Promise<{ [key: string]: number; }> { + public getInventory(_options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { const result = this.api.getInventory(_options); return result.toPromise(); } @@ -253,7 +254,7 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration): Promise> { + public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | Middleware[]): Promise> { const result = this.api.getOrderByIdWithHttpInfo(orderId, _options); return result.toPromise(); } @@ -263,7 +264,7 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration): Promise { + public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Promise { const result = this.api.getOrderById(orderId, _options); return result.toPromise(); } @@ -273,7 +274,7 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(order: Order, _options?: Configuration): Promise> { + public placeOrderWithHttpInfo(order: Order, _options?: Configuration | Middleware[]): Promise> { const result = this.api.placeOrderWithHttpInfo(order, _options); return result.toPromise(); } @@ -283,7 +284,7 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration): Promise { + public placeOrder(order: Order, _options?: Configuration | Middleware[]): Promise { const result = this.api.placeOrder(order, _options); return result.toPromise(); } @@ -312,7 +313,7 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUserWithHttpInfo(user: User, _options?: Configuration): Promise> { + public createUserWithHttpInfo(user: User, _options?: Configuration | Middleware[]): Promise> { const result = this.api.createUserWithHttpInfo(user, _options); return result.toPromise(); } @@ -322,7 +323,7 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration): Promise { + public createUser(user: User, _options?: Configuration | Middleware[]): Promise { const result = this.api.createUser(user, _options); return result.toPromise(); } @@ -332,7 +333,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration): Promise> { + public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.createUsersWithArrayInputWithHttpInfo(user, _options); return result.toPromise(); } @@ -342,7 +343,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration): Promise { + public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Promise { const result = this.api.createUsersWithArrayInput(user, _options); return result.toPromise(); } @@ -352,7 +353,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration): Promise> { + public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.createUsersWithListInputWithHttpInfo(user, _options); return result.toPromise(); } @@ -362,7 +363,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration): Promise { + public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Promise { const result = this.api.createUsersWithListInput(user, _options); return result.toPromise(); } @@ -372,7 +373,7 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, _options?: Configuration): Promise> { + public deleteUserWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.deleteUserWithHttpInfo(username, _options); return result.toPromise(); } @@ -382,7 +383,7 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration): Promise { + public deleteUser(username: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.deleteUser(username, _options); return result.toPromise(); } @@ -392,7 +393,7 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, _options?: Configuration): Promise> { + public getUserByNameWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.getUserByNameWithHttpInfo(username, _options); return result.toPromise(); } @@ -402,7 +403,7 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration): Promise { + public getUserByName(username: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.getUserByName(username, _options); return result.toPromise(); } @@ -413,7 +414,7 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration): Promise> { + public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.loginUserWithHttpInfo(username, password, _options); return result.toPromise(); } @@ -424,7 +425,7 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration): Promise { + public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.loginUser(username, password, _options); return result.toPromise(); } @@ -433,7 +434,7 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUserWithHttpInfo(_options?: Configuration): Promise> { + public logoutUserWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.logoutUserWithHttpInfo(_options); return result.toPromise(); } @@ -442,7 +443,7 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration): Promise { + public logoutUser(_options?: Configuration | Middleware[]): Promise { const result = this.api.logoutUser(_options); return result.toPromise(); } @@ -453,7 +454,7 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration): Promise> { + public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | Middleware[]): Promise> { const result = this.api.updateUserWithHttpInfo(username, user, _options); return result.toPromise(); } @@ -464,7 +465,7 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration): Promise { + public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Promise { const result = this.api.updateUser(username, user, _options); return result.toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/apis/DefaultApi.ts b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/apis/DefaultApi.ts index db62475226d0..7d064dd8772a 100644 --- a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/apis/DefaultApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/apis/DefaultApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import {ObjectSerializer} from '../models/ObjectSerializer'; import {ApiException} from './exception'; @@ -17,8 +18,11 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { /** */ - public async uniqueItems(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async uniqueItems(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/unique-items'; @@ -29,7 +33,7 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/ObjectParamAPI.ts index 2c5db71a9382..09b5873c11ef 100644 --- a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/ObjectParamAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { Response } from '../models/Response'; @@ -19,14 +20,14 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public uniqueItemsWithHttpInfo(param: DefaultApiUniqueItemsRequest = {}, options?: Configuration): Promise> { + public uniqueItemsWithHttpInfo(param: DefaultApiUniqueItemsRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.uniqueItemsWithHttpInfo( options).toPromise(); } /** * @param param the request object */ - public uniqueItems(param: DefaultApiUniqueItemsRequest = {}, options?: Configuration): Promise { + public uniqueItems(param: DefaultApiUniqueItemsRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.uniqueItems( options).toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/ObservableAPI.ts index 02bae11fe29c..905d507a360d 100644 --- a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/ObservableAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { Observable, of, from } from '../rxjsStub'; import {mergeMap, map} from '../rxjsStub'; import { Response } from '../models/Response'; @@ -22,12 +23,21 @@ export class ObservableDefaultApi { /** */ - public uniqueItemsWithHttpInfo(_options?: Configuration): Observable> { + public uniqueItemsWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.uniqueItems(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -43,7 +53,7 @@ export class ObservableDefaultApi { /** */ - public uniqueItems(_options?: Configuration): Observable { + public uniqueItems(_options?: Configuration | Middleware[]): Observable { return this.uniqueItemsWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/PromiseAPI.ts index a133e29a6f4d..418fd986e291 100644 --- a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/PromiseAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { Response } from '../models/Response'; import { ObservableDefaultApi } from './ObservableAPI'; @@ -18,14 +19,14 @@ export class PromiseDefaultApi { /** */ - public uniqueItemsWithHttpInfo(_options?: Configuration): Promise> { + public uniqueItemsWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.uniqueItemsWithHttpInfo(_options); return result.toPromise(); } /** */ - public uniqueItems(_options?: Configuration): Promise { + public uniqueItems(_options?: Configuration | Middleware[]): Promise { const result = this.api.uniqueItems(_options); return result.toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/apis/PetApi.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/apis/PetApi.ts index 02f9d230affe..0799a319b3ca 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/apis/PetApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/apis/PetApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; @@ -23,8 +24,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public async addPet(pet: Pet, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async addPet(pet: Pet, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'pet' is not null or undefined if (pet === null || pet === undefined) { @@ -60,7 +64,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -74,8 +78,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param petId Pet id to delete * @param apiKey */ - public async deletePet(petId: number, apiKey?: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -103,7 +110,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -116,8 +123,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'status' is not null or undefined if (status === null || status === undefined) { @@ -145,7 +155,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -158,8 +168,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Finds Pets by tags * @param tags Tags to filter by */ - public async findPetsByTags(tags: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'tags' is not null or undefined if (tags === null || tags === undefined) { @@ -187,7 +200,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -200,8 +213,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Find pet by ID * @param petId ID of pet to return */ - public async getPetById(petId: number, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getPetById(petId: number, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -225,7 +241,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -238,8 +254,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public async updatePet(pet: Pet, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async updatePet(pet: Pet, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'pet' is not null or undefined if (pet === null || pet === undefined) { @@ -275,7 +294,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -290,8 +309,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param name Updated name of the pet * @param status Updated status of the pet */ - public async updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -346,7 +368,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -361,8 +383,11 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - public async uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'petId' is not null or undefined if (petId === null || petId === undefined) { @@ -419,7 +444,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/apis/StoreApi.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/apis/StoreApi.ts index f4861af0df0c..77b19f3c02d8 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/apis/StoreApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/apis/StoreApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; @@ -22,8 +23,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public async deleteOrder(orderId: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'orderId' is not null or undefined if (orderId === null || orderId === undefined) { @@ -41,7 +45,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -53,8 +57,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public async getInventory(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getInventory(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/store/inventory'; @@ -71,7 +78,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -84,8 +91,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public async getOrderById(orderId: number, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getOrderById(orderId: number, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'orderId' is not null or undefined if (orderId === null || orderId === undefined) { @@ -103,7 +113,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -116,8 +126,11 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Place an order for a pet * @param order order placed for purchasing the pet */ - public async placeOrder(order: Order, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async placeOrder(order: Order, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'order' is not null or undefined if (order === null || order === undefined) { @@ -145,7 +158,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { requestContext.setBody(serializedBody); - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/apis/UserApi.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/apis/UserApi.ts index b8f2c3313e26..abf735a140ff 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/apis/UserApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/apis/UserApi.ts @@ -1,6 +1,7 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; +import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import * as FormData from "form-data"; import { URLSearchParams } from 'url'; @@ -22,8 +23,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Create user * @param user Created user object */ - public async createUser(user: User, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async createUser(user: User, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'user' is not null or undefined if (user === null || user === undefined) { @@ -57,7 +61,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -70,8 +74,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Creates list of users with given input array * @param user List of user object */ - public async createUsersWithArrayInput(user: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'user' is not null or undefined if (user === null || user === undefined) { @@ -105,7 +112,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -118,8 +125,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Creates list of users with given input array * @param user List of user object */ - public async createUsersWithListInput(user: Array, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'user' is not null or undefined if (user === null || user === undefined) { @@ -153,7 +163,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -166,8 +176,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Delete user * @param username The name that needs to be deleted */ - public async deleteUser(username: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async deleteUser(username: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -191,7 +204,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -204,8 +217,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public async getUserByName(username: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async getUserByName(username: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -223,7 +239,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -237,8 +253,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * @param username The user name for login * @param password The password for login in clear text */ - public async loginUser(username: string, password: string, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -271,7 +290,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -283,8 +302,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * * Logs out current logged in user session */ - public async logoutUser(_options?: Configuration): Promise { - let _config = _options || this.configuration; + public async logoutUser(_options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // Path Params const localVarPath = '/user/logout'; @@ -301,7 +323,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } @@ -315,8 +337,11 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * @param username name that need to be deleted * @param user Updated user object */ - public async updateUser(username: string, user: User, _options?: Configuration): Promise { - let _config = _options || this.configuration; + public async updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Promise { + let _config = this.configuration; + if (_options && !Array.isArray(_options)){ + _config = _options + } // verify required parameter 'username' is not null or undefined if (username === null || username === undefined) { @@ -357,7 +382,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { await authMethod?.applySecurityAuthentication(requestContext); } - const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + const defaultAuth: SecurityAuthentication | undefined = _config?.authMethods?.default if (defaultAuth?.applySecurityAuthentication) { await defaultAuth?.applySecurityAuthentication(requestContext); } diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObjectParamAPI.ts index 568cc5c507b1..b1512d688646 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObjectParamAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { ApiResponse } from '../models/ApiResponse'; import { Category } from '../models/Category'; @@ -136,7 +137,7 @@ export class ObjectPetApi { * Add a new pet to the store * @param param the request object */ - public addPetWithHttpInfo(param: PetApiAddPetRequest, options?: Configuration): Promise> { + public addPetWithHttpInfo(param: PetApiAddPetRequest, options?: Configuration | Middleware[]): Promise> { return this.api.addPetWithHttpInfo(param.pet, options).toPromise(); } @@ -145,7 +146,7 @@ export class ObjectPetApi { * Add a new pet to the store * @param param the request object */ - public addPet(param: PetApiAddPetRequest, options?: Configuration): Promise { + public addPet(param: PetApiAddPetRequest, options?: Configuration | Middleware[]): Promise { return this.api.addPet(param.pet, options).toPromise(); } @@ -154,7 +155,7 @@ export class ObjectPetApi { * Deletes a pet * @param param the request object */ - public deletePetWithHttpInfo(param: PetApiDeletePetRequest, options?: Configuration): Promise> { + public deletePetWithHttpInfo(param: PetApiDeletePetRequest, options?: Configuration | Middleware[]): Promise> { return this.api.deletePetWithHttpInfo(param.petId, param.apiKey, options).toPromise(); } @@ -163,7 +164,7 @@ export class ObjectPetApi { * Deletes a pet * @param param the request object */ - public deletePet(param: PetApiDeletePetRequest, options?: Configuration): Promise { + public deletePet(param: PetApiDeletePetRequest, options?: Configuration | Middleware[]): Promise { return this.api.deletePet(param.petId, param.apiKey, options).toPromise(); } @@ -172,7 +173,7 @@ export class ObjectPetApi { * Finds Pets by status * @param param the request object */ - public findPetsByStatusWithHttpInfo(param: PetApiFindPetsByStatusRequest, options?: Configuration): Promise>> { + public findPetsByStatusWithHttpInfo(param: PetApiFindPetsByStatusRequest, options?: Configuration | Middleware[]): Promise>> { return this.api.findPetsByStatusWithHttpInfo(param.status, options).toPromise(); } @@ -181,7 +182,7 @@ export class ObjectPetApi { * Finds Pets by status * @param param the request object */ - public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration): Promise> { + public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration | Middleware[]): Promise> { return this.api.findPetsByStatus(param.status, options).toPromise(); } @@ -190,7 +191,7 @@ export class ObjectPetApi { * Finds Pets by tags * @param param the request object */ - public findPetsByTagsWithHttpInfo(param: PetApiFindPetsByTagsRequest, options?: Configuration): Promise>> { + public findPetsByTagsWithHttpInfo(param: PetApiFindPetsByTagsRequest, options?: Configuration | Middleware[]): Promise>> { return this.api.findPetsByTagsWithHttpInfo(param.tags, options).toPromise(); } @@ -199,7 +200,7 @@ export class ObjectPetApi { * Finds Pets by tags * @param param the request object */ - public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration): Promise> { + public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration | Middleware[]): Promise> { return this.api.findPetsByTags(param.tags, options).toPromise(); } @@ -208,7 +209,7 @@ export class ObjectPetApi { * Find pet by ID * @param param the request object */ - public getPetByIdWithHttpInfo(param: PetApiGetPetByIdRequest, options?: Configuration): Promise> { + public getPetByIdWithHttpInfo(param: PetApiGetPetByIdRequest, options?: Configuration | Middleware[]): Promise> { return this.api.getPetByIdWithHttpInfo(param.petId, options).toPromise(); } @@ -217,7 +218,7 @@ export class ObjectPetApi { * Find pet by ID * @param param the request object */ - public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration): Promise { + public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration | Middleware[]): Promise { return this.api.getPetById(param.petId, options).toPromise(); } @@ -226,7 +227,7 @@ export class ObjectPetApi { * Update an existing pet * @param param the request object */ - public updatePetWithHttpInfo(param: PetApiUpdatePetRequest, options?: Configuration): Promise> { + public updatePetWithHttpInfo(param: PetApiUpdatePetRequest, options?: Configuration | Middleware[]): Promise> { return this.api.updatePetWithHttpInfo(param.pet, options).toPromise(); } @@ -235,7 +236,7 @@ export class ObjectPetApi { * Update an existing pet * @param param the request object */ - public updatePet(param: PetApiUpdatePetRequest, options?: Configuration): Promise { + public updatePet(param: PetApiUpdatePetRequest, options?: Configuration | Middleware[]): Promise { return this.api.updatePet(param.pet, options).toPromise(); } @@ -244,7 +245,7 @@ export class ObjectPetApi { * Updates a pet in the store with form data * @param param the request object */ - public updatePetWithFormWithHttpInfo(param: PetApiUpdatePetWithFormRequest, options?: Configuration): Promise> { + public updatePetWithFormWithHttpInfo(param: PetApiUpdatePetWithFormRequest, options?: Configuration | Middleware[]): Promise> { return this.api.updatePetWithFormWithHttpInfo(param.petId, param.name, param.status, options).toPromise(); } @@ -253,7 +254,7 @@ export class ObjectPetApi { * Updates a pet in the store with form data * @param param the request object */ - public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration): Promise { + public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration | Middleware[]): Promise { return this.api.updatePetWithForm(param.petId, param.name, param.status, options).toPromise(); } @@ -262,7 +263,7 @@ export class ObjectPetApi { * uploads an image * @param param the request object */ - public uploadFileWithHttpInfo(param: PetApiUploadFileRequest, options?: Configuration): Promise> { + public uploadFileWithHttpInfo(param: PetApiUploadFileRequest, options?: Configuration | Middleware[]): Promise> { return this.api.uploadFileWithHttpInfo(param.petId, param.additionalMetadata, param.file, options).toPromise(); } @@ -271,7 +272,7 @@ export class ObjectPetApi { * uploads an image * @param param the request object */ - public uploadFile(param: PetApiUploadFileRequest, options?: Configuration): Promise { + public uploadFile(param: PetApiUploadFileRequest, options?: Configuration | Middleware[]): Promise { return this.api.uploadFile(param.petId, param.additionalMetadata, param.file, options).toPromise(); } @@ -326,7 +327,7 @@ export class ObjectStoreApi { * Delete purchase order by ID * @param param the request object */ - public deleteOrderWithHttpInfo(param: StoreApiDeleteOrderRequest, options?: Configuration): Promise> { + public deleteOrderWithHttpInfo(param: StoreApiDeleteOrderRequest, options?: Configuration | Middleware[]): Promise> { return this.api.deleteOrderWithHttpInfo(param.orderId, options).toPromise(); } @@ -335,7 +336,7 @@ export class ObjectStoreApi { * Delete purchase order by ID * @param param the request object */ - public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration): Promise { + public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration | Middleware[]): Promise { return this.api.deleteOrder(param.orderId, options).toPromise(); } @@ -344,7 +345,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventoryWithHttpInfo(param: StoreApiGetInventoryRequest = {}, options?: Configuration): Promise> { + public getInventoryWithHttpInfo(param: StoreApiGetInventoryRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.getInventoryWithHttpInfo( options).toPromise(); } @@ -353,7 +354,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration): Promise<{ [key: string]: number; }> { + public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { return this.api.getInventory( options).toPromise(); } @@ -362,7 +363,7 @@ export class ObjectStoreApi { * Find purchase order by ID * @param param the request object */ - public getOrderByIdWithHttpInfo(param: StoreApiGetOrderByIdRequest, options?: Configuration): Promise> { + public getOrderByIdWithHttpInfo(param: StoreApiGetOrderByIdRequest, options?: Configuration | Middleware[]): Promise> { return this.api.getOrderByIdWithHttpInfo(param.orderId, options).toPromise(); } @@ -371,7 +372,7 @@ export class ObjectStoreApi { * Find purchase order by ID * @param param the request object */ - public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration): Promise { + public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration | Middleware[]): Promise { return this.api.getOrderById(param.orderId, options).toPromise(); } @@ -380,7 +381,7 @@ export class ObjectStoreApi { * Place an order for a pet * @param param the request object */ - public placeOrderWithHttpInfo(param: StoreApiPlaceOrderRequest, options?: Configuration): Promise> { + public placeOrderWithHttpInfo(param: StoreApiPlaceOrderRequest, options?: Configuration | Middleware[]): Promise> { return this.api.placeOrderWithHttpInfo(param.order, options).toPromise(); } @@ -389,7 +390,7 @@ export class ObjectStoreApi { * Place an order for a pet * @param param the request object */ - public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration): Promise { + public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration | Middleware[]): Promise { return this.api.placeOrder(param.order, options).toPromise(); } @@ -493,7 +494,7 @@ export class ObjectUserApi { * Create user * @param param the request object */ - public createUserWithHttpInfo(param: UserApiCreateUserRequest, options?: Configuration): Promise> { + public createUserWithHttpInfo(param: UserApiCreateUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.createUserWithHttpInfo(param.user, options).toPromise(); } @@ -502,7 +503,7 @@ export class ObjectUserApi { * Create user * @param param the request object */ - public createUser(param: UserApiCreateUserRequest, options?: Configuration): Promise { + public createUser(param: UserApiCreateUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.createUser(param.user, options).toPromise(); } @@ -511,7 +512,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithArrayInputWithHttpInfo(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration): Promise> { + public createUsersWithArrayInputWithHttpInfo(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration | Middleware[]): Promise> { return this.api.createUsersWithArrayInputWithHttpInfo(param.user, options).toPromise(); } @@ -520,7 +521,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration): Promise { + public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration | Middleware[]): Promise { return this.api.createUsersWithArrayInput(param.user, options).toPromise(); } @@ -529,7 +530,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithListInputWithHttpInfo(param: UserApiCreateUsersWithListInputRequest, options?: Configuration): Promise> { + public createUsersWithListInputWithHttpInfo(param: UserApiCreateUsersWithListInputRequest, options?: Configuration | Middleware[]): Promise> { return this.api.createUsersWithListInputWithHttpInfo(param.user, options).toPromise(); } @@ -538,7 +539,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration): Promise { + public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration | Middleware[]): Promise { return this.api.createUsersWithListInput(param.user, options).toPromise(); } @@ -547,7 +548,7 @@ export class ObjectUserApi { * Delete user * @param param the request object */ - public deleteUserWithHttpInfo(param: UserApiDeleteUserRequest, options?: Configuration): Promise> { + public deleteUserWithHttpInfo(param: UserApiDeleteUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.deleteUserWithHttpInfo(param.username, options).toPromise(); } @@ -556,7 +557,7 @@ export class ObjectUserApi { * Delete user * @param param the request object */ - public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration): Promise { + public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.deleteUser(param.username, options).toPromise(); } @@ -565,7 +566,7 @@ export class ObjectUserApi { * Get user by user name * @param param the request object */ - public getUserByNameWithHttpInfo(param: UserApiGetUserByNameRequest, options?: Configuration): Promise> { + public getUserByNameWithHttpInfo(param: UserApiGetUserByNameRequest, options?: Configuration | Middleware[]): Promise> { return this.api.getUserByNameWithHttpInfo(param.username, options).toPromise(); } @@ -574,7 +575,7 @@ export class ObjectUserApi { * Get user by user name * @param param the request object */ - public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration): Promise { + public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration | Middleware[]): Promise { return this.api.getUserByName(param.username, options).toPromise(); } @@ -583,7 +584,7 @@ export class ObjectUserApi { * Logs user into the system * @param param the request object */ - public loginUserWithHttpInfo(param: UserApiLoginUserRequest, options?: Configuration): Promise> { + public loginUserWithHttpInfo(param: UserApiLoginUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.loginUserWithHttpInfo(param.username, param.password, options).toPromise(); } @@ -592,7 +593,7 @@ export class ObjectUserApi { * Logs user into the system * @param param the request object */ - public loginUser(param: UserApiLoginUserRequest, options?: Configuration): Promise { + public loginUser(param: UserApiLoginUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.loginUser(param.username, param.password, options).toPromise(); } @@ -601,7 +602,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUserWithHttpInfo(param: UserApiLogoutUserRequest = {}, options?: Configuration): Promise> { + public logoutUserWithHttpInfo(param: UserApiLogoutUserRequest = {}, options?: Configuration | Middleware[]): Promise> { return this.api.logoutUserWithHttpInfo( options).toPromise(); } @@ -610,7 +611,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration): Promise { + public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration | Middleware[]): Promise { return this.api.logoutUser( options).toPromise(); } @@ -619,7 +620,7 @@ export class ObjectUserApi { * Updated user * @param param the request object */ - public updateUserWithHttpInfo(param: UserApiUpdateUserRequest, options?: Configuration): Promise> { + public updateUserWithHttpInfo(param: UserApiUpdateUserRequest, options?: Configuration | Middleware[]): Promise> { return this.api.updateUserWithHttpInfo(param.username, param.user, options).toPromise(); } @@ -628,7 +629,7 @@ export class ObjectUserApi { * Updated user * @param param the request object */ - public updateUser(param: UserApiUpdateUserRequest, options?: Configuration): Promise { + public updateUser(param: UserApiUpdateUserRequest, options?: Configuration | Middleware[]): Promise { return this.api.updateUser(param.username, param.user, options).toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObservableAPI.ts index f344144c8b37..585735aa7842 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObservableAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { Observable, of, from } from '../rxjsStub'; import {mergeMap, map} from '../rxjsStub'; import { ApiResponse } from '../models/ApiResponse'; @@ -30,12 +31,21 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(pet: Pet, _options?: Configuration): Observable> { + public addPetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.addPet(pet, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -54,7 +64,7 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration): Observable { + public addPet(pet: Pet, _options?: Configuration | Middleware[]): Observable { return this.addPetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -64,12 +74,21 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration): Observable> { + public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.deletePet(petId, apiKey, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -89,7 +108,7 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration): Observable { + public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable { return this.deletePetWithHttpInfo(petId, apiKey, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -98,12 +117,21 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Observable>> { + public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable>> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.findPetsByStatus(status, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -122,7 +150,7 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Observable> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable> { return this.findPetsByStatusWithHttpInfo(status, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -131,12 +159,21 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration): Observable>> { + public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | Middleware[]): Observable>> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.findPetsByTags(tags, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -155,7 +192,7 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration): Observable> { + public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Observable> { return this.findPetsByTagsWithHttpInfo(tags, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -164,12 +201,21 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, _options?: Configuration): Observable> { + public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getPetById(petId, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -188,7 +234,7 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration): Observable { + public getPetById(petId: number, _options?: Configuration | Middleware[]): Observable { return this.getPetByIdWithHttpInfo(petId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -197,12 +243,21 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(pet: Pet, _options?: Configuration): Observable> { + public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.updatePet(pet, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -221,7 +276,7 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration): Observable { + public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Observable { return this.updatePetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -232,12 +287,21 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration): Observable> { + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.updatePetWithForm(petId, name, status, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -258,7 +322,7 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable { return this.updatePetWithFormWithHttpInfo(petId, name, status, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -269,12 +333,21 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Observable> { + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.uploadFile(petId, additionalMetadata, file, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -295,7 +368,7 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable { return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -322,12 +395,21 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration): Observable> { + public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.deleteOrder(orderId, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -346,7 +428,7 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration): Observable { + public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Observable { return this.deleteOrderWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -354,12 +436,21 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventoryWithHttpInfo(_options?: Configuration): Observable> { + public getInventoryWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getInventory(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -377,7 +468,7 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration): Observable<{ [key: string]: number; }> { + public getInventory(_options?: Configuration | Middleware[]): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo<{ [key: string]: number; }>) => apiResponse.data)); } @@ -386,12 +477,21 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration): Observable> { + public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getOrderById(orderId, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -410,7 +510,7 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration): Observable { + public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Observable { return this.getOrderByIdWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -419,12 +519,21 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(order: Order, _options?: Configuration): Observable> { + public placeOrderWithHttpInfo(order: Order, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.placeOrder(order, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -443,7 +552,7 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration): Observable { + public placeOrder(order: Order, _options?: Configuration | Middleware[]): Observable { return this.placeOrderWithHttpInfo(order, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -470,12 +579,21 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUserWithHttpInfo(user: User, _options?: Configuration): Observable> { + public createUserWithHttpInfo(user: User, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.createUser(user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -494,7 +612,7 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration): Observable { + public createUser(user: User, _options?: Configuration | Middleware[]): Observable { return this.createUserWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -503,12 +621,21 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration): Observable> { + public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.createUsersWithArrayInput(user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -527,7 +654,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration): Observable { + public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Observable { return this.createUsersWithArrayInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -536,12 +663,21 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration): Observable> { + public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.createUsersWithListInput(user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -560,7 +696,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration): Observable { + public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Observable { return this.createUsersWithListInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -569,12 +705,21 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, _options?: Configuration): Observable> { + public deleteUserWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.deleteUser(username, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -593,7 +738,7 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration): Observable { + public deleteUser(username: string, _options?: Configuration | Middleware[]): Observable { return this.deleteUserWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -602,12 +747,21 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, _options?: Configuration): Observable> { + public getUserByNameWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.getUserByName(username, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -626,7 +780,7 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration): Observable { + public getUserByName(username: string, _options?: Configuration | Middleware[]): Observable { return this.getUserByNameWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -636,12 +790,21 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration): Observable> { + public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.loginUser(username, password, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -661,7 +824,7 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration): Observable { + public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Observable { return this.loginUserWithHttpInfo(username, password, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -669,12 +832,21 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUserWithHttpInfo(_options?: Configuration): Observable> { + public logoutUserWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.logoutUser(_options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -692,7 +864,7 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration): Observable { + public logoutUser(_options?: Configuration | Middleware[]): Observable { return this.logoutUserWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -702,12 +874,21 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration): Observable> { + public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | Middleware[]): Observable> { + let configuration = undefined + let calltimeMiddleware: Middleware[] = [] + if (Array.isArray(_options)){ + // call-time middleware provided + calltimeMiddleware = _options + }else{ + configuration = _options + } const requestContextPromise = this.requestFactory.updateUser(username, user, _options); // build promise chain + let allMiddleware = this.configuration.middleware.concat(calltimeMiddleware) let middlewarePreObservable = from(requestContextPromise); - for (const middleware of this.configuration.middleware) { + for (const middleware of allMiddleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); } @@ -727,7 +908,7 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration): Observable { + public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Observable { return this.updateUserWithHttpInfo(username, user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/types/PromiseAPI.ts index 55af604f4659..d74bd8f9e572 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/types/PromiseAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { ApiResponse } from '../models/ApiResponse'; import { Category } from '../models/Category'; @@ -26,7 +27,7 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(pet: Pet, _options?: Configuration): Promise> { + public addPetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { const result = this.api.addPetWithHttpInfo(pet, _options); return result.toPromise(); } @@ -36,7 +37,7 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration): Promise { + public addPet(pet: Pet, _options?: Configuration | Middleware[]): Promise { const result = this.api.addPet(pet, _options); return result.toPromise(); } @@ -47,7 +48,7 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration): Promise> { + public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.deletePetWithHttpInfo(petId, apiKey, _options); return result.toPromise(); } @@ -58,7 +59,7 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration): Promise { + public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.deletePet(petId, apiKey, _options); return result.toPromise(); } @@ -68,7 +69,7 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise>> { + public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise>> { const result = this.api.findPetsByStatusWithHttpInfo(status, _options); return result.toPromise(); } @@ -78,7 +79,7 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise> { const result = this.api.findPetsByStatus(status, _options); return result.toPromise(); } @@ -88,7 +89,7 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration): Promise>> { + public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | Middleware[]): Promise>> { const result = this.api.findPetsByTagsWithHttpInfo(tags, _options); return result.toPromise(); } @@ -98,7 +99,7 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration): Promise> { + public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.findPetsByTags(tags, _options); return result.toPromise(); } @@ -108,7 +109,7 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, _options?: Configuration): Promise> { + public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | Middleware[]): Promise> { const result = this.api.getPetByIdWithHttpInfo(petId, _options); return result.toPromise(); } @@ -118,7 +119,7 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration): Promise { + public getPetById(petId: number, _options?: Configuration | Middleware[]): Promise { const result = this.api.getPetById(petId, _options); return result.toPromise(); } @@ -128,7 +129,7 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(pet: Pet, _options?: Configuration): Promise> { + public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { const result = this.api.updatePetWithHttpInfo(pet, _options); return result.toPromise(); } @@ -138,7 +139,7 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration): Promise { + public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Promise { const result = this.api.updatePet(pet, _options); return result.toPromise(); } @@ -150,7 +151,7 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration): Promise> { + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.updatePetWithFormWithHttpInfo(petId, name, status, _options); return result.toPromise(); } @@ -162,7 +163,7 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Promise { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.updatePetWithForm(petId, name, status, _options); return result.toPromise(); } @@ -174,7 +175,7 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise> { + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise> { const result = this.api.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options); return result.toPromise(); } @@ -186,7 +187,7 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise { const result = this.api.uploadFile(petId, additionalMetadata, file, _options); return result.toPromise(); } @@ -215,7 +216,7 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration): Promise> { + public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.deleteOrderWithHttpInfo(orderId, _options); return result.toPromise(); } @@ -225,7 +226,7 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration): Promise { + public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.deleteOrder(orderId, _options); return result.toPromise(); } @@ -234,7 +235,7 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventoryWithHttpInfo(_options?: Configuration): Promise> { + public getInventoryWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.getInventoryWithHttpInfo(_options); return result.toPromise(); } @@ -243,7 +244,7 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration): Promise<{ [key: string]: number; }> { + public getInventory(_options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { const result = this.api.getInventory(_options); return result.toPromise(); } @@ -253,7 +254,7 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration): Promise> { + public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | Middleware[]): Promise> { const result = this.api.getOrderByIdWithHttpInfo(orderId, _options); return result.toPromise(); } @@ -263,7 +264,7 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration): Promise { + public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Promise { const result = this.api.getOrderById(orderId, _options); return result.toPromise(); } @@ -273,7 +274,7 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(order: Order, _options?: Configuration): Promise> { + public placeOrderWithHttpInfo(order: Order, _options?: Configuration | Middleware[]): Promise> { const result = this.api.placeOrderWithHttpInfo(order, _options); return result.toPromise(); } @@ -283,7 +284,7 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration): Promise { + public placeOrder(order: Order, _options?: Configuration | Middleware[]): Promise { const result = this.api.placeOrder(order, _options); return result.toPromise(); } @@ -312,7 +313,7 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUserWithHttpInfo(user: User, _options?: Configuration): Promise> { + public createUserWithHttpInfo(user: User, _options?: Configuration | Middleware[]): Promise> { const result = this.api.createUserWithHttpInfo(user, _options); return result.toPromise(); } @@ -322,7 +323,7 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration): Promise { + public createUser(user: User, _options?: Configuration | Middleware[]): Promise { const result = this.api.createUser(user, _options); return result.toPromise(); } @@ -332,7 +333,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration): Promise> { + public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.createUsersWithArrayInputWithHttpInfo(user, _options); return result.toPromise(); } @@ -342,7 +343,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration): Promise { + public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Promise { const result = this.api.createUsersWithArrayInput(user, _options); return result.toPromise(); } @@ -352,7 +353,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration): Promise> { + public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { const result = this.api.createUsersWithListInputWithHttpInfo(user, _options); return result.toPromise(); } @@ -362,7 +363,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration): Promise { + public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Promise { const result = this.api.createUsersWithListInput(user, _options); return result.toPromise(); } @@ -372,7 +373,7 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, _options?: Configuration): Promise> { + public deleteUserWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.deleteUserWithHttpInfo(username, _options); return result.toPromise(); } @@ -382,7 +383,7 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration): Promise { + public deleteUser(username: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.deleteUser(username, _options); return result.toPromise(); } @@ -392,7 +393,7 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, _options?: Configuration): Promise> { + public getUserByNameWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.getUserByNameWithHttpInfo(username, _options); return result.toPromise(); } @@ -402,7 +403,7 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration): Promise { + public getUserByName(username: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.getUserByName(username, _options); return result.toPromise(); } @@ -413,7 +414,7 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration): Promise> { + public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | Middleware[]): Promise> { const result = this.api.loginUserWithHttpInfo(username, password, _options); return result.toPromise(); } @@ -424,7 +425,7 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration): Promise { + public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Promise { const result = this.api.loginUser(username, password, _options); return result.toPromise(); } @@ -433,7 +434,7 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUserWithHttpInfo(_options?: Configuration): Promise> { + public logoutUserWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { const result = this.api.logoutUserWithHttpInfo(_options); return result.toPromise(); } @@ -442,7 +443,7 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration): Promise { + public logoutUser(_options?: Configuration | Middleware[]): Promise { const result = this.api.logoutUser(_options); return result.toPromise(); } @@ -453,7 +454,7 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration): Promise> { + public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | Middleware[]): Promise> { const result = this.api.updateUserWithHttpInfo(username, user, _options); return result.toPromise(); } @@ -464,7 +465,7 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration): Promise { + public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Promise { const result = this.api.updateUser(username, user, _options); return result.toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/tests/default/package-lock.json b/samples/openapi3/client/petstore/typescript/tests/default/package-lock.json index d1ecb18ec29e..3d8e3396f619 100644 --- a/samples/openapi3/client/petstore/typescript/tests/default/package-lock.json +++ b/samples/openapi3/client/petstore/typescript/tests/default/package-lock.json @@ -16,14 +16,14 @@ "ts-petstore-client": "file:../../builds/default" }, "devDependencies": { - "@types/chai": "^4.0.1", + "@types/chai": "4.0.1 - 4.1.x", "@types/isomorphic-fetch": "0.0.34", "@types/mocha": "^2.2.41", - "@types/node": "^8.10.38", + "@types/node": "8.10.38 - 8.10.62", "chai": "^4.1.0", "mocha": "^5.2.0", "ts-loader": "^2.3.0", - "typescript": "^2.4.1" + "typescript": "^4" } }, "../../builds/default": { @@ -35,11 +35,9 @@ "@types/node-fetch": "^2.5.7", "es6-promise": "^4.2.4", "form-data": "^2.5.0", - "node-fetch": "^2.6.0", - "url-parse": "^1.4.3" + "node-fetch": "^2.6.0" }, "devDependencies": { - "@types/url-parse": "1.4.4", "typescript": "^4.0" } }, @@ -142,30 +140,35 @@ } }, "../../builds/default/node_modules/node-fetch": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", - "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, "engines": { "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } } }, - "../../builds/default/node_modules/querystringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.0.tgz", - "integrity": "sha512-sluvZZ1YiTLD5jsqZcDmFyV2EwToyXZBfpoVOmktMmW+VEnhgakFHnasVph65fOjGPTWN0Nw3+XQaSeMayr0kg==", - "license": "MIT" - }, - "../../builds/default/node_modules/requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", + "../../builds/default/node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", "license": "MIT" }, "../../builds/default/node_modules/typescript": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz", - "integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true, "license": "Apache-2.0", "bin": { @@ -176,14 +179,20 @@ "node": ">=4.2.0" } }, - "../../builds/default/node_modules/url-parse": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.3.tgz", - "integrity": "sha512-rh+KuAW36YKo0vClhQzLLveoj8FwPJNu65xLb7Mrt+eZht0IPT0IXgSv8gcMegZ6NvjJUALf6Mf25POlMwD1Fw==", + "../../builds/default/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause" + }, + "../../builds/default/node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "license": "MIT", "dependencies": { - "querystringify": "^2.0.0", - "requires-port": "^1.0.0" + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" } }, "node_modules/@types/chai": { @@ -256,7 +265,7 @@ "node_modules/ajv": { "version": "5.5.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "integrity": "sha512-Ajr4IcMXq/2QmMkEmSvxqfLN5zGmJ92gHXAeOXq1OekoH2rfDNsgdDoL2f7QaRCy7G/E6TpxBVdRuNraMztGHw==", "license": "MIT", "dependencies": { "co": "^4.6.0", @@ -402,9 +411,9 @@ "license": "MIT" }, "node_modules/big.js": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", - "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", "dev": true, "license": "MIT", "engines": { @@ -601,7 +610,7 @@ "node_modules/cross-spawn": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==", "license": "MIT", "dependencies": { "lru-cache": "^4.0.1", @@ -668,13 +677,13 @@ } }, "node_modules/emojis-list": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", - "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", "dev": true, "license": "MIT", "engines": { - "node": ">= 0.10" + "node": ">= 4" } }, "node_modules/enhanced-resolve": { @@ -954,9 +963,9 @@ "license": "MIT" }, "node_modules/get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", "dev": true, "license": "MIT", "engines": { @@ -1181,11 +1190,14 @@ "license": "MIT" }, "node_modules/json5": { - "version": "0.5.1", - "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, "license": "MIT", + "dependencies": { + "minimist": "^1.2.0" + }, "bin": { "json5": "lib/cli.js" } @@ -1204,24 +1216,24 @@ } }, "node_modules/loader-utils": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", - "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", "dev": true, "license": "MIT", "dependencies": { - "big.js": "^3.1.3", - "emojis-list": "^2.0.0", - "json5": "^0.5.0" + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" }, "engines": { "node": ">=4.0.0" } }, "node_modules/lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "license": "MIT" }, "node_modules/lru-cache": { @@ -1294,10 +1306,13 @@ } }, "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "license": "MIT" + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/mkdirp": { "version": "0.5.5", @@ -1341,14 +1356,15 @@ "node_modules/mocha/node_modules/minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "integrity": "sha512-miQKw5Hv4NS1Psg2517mV4e4dYNaO3++hjAvLOAzKqZ61rH8NS1SK+vbfBWZ5PY/Me/bEWhUwqMghEW5Fb9T7Q==", "dev": true, "license": "MIT" }, "node_modules/mocha/node_modules/mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "integrity": "sha512-SknJC52obPfGQPnjIkXbmA6+5H15E+fR+E4iR2oQ3zzCLbd7/ONua69R/Gw7AgkTLsRG+r5fzksYwWe1AgTyWA==", + "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)", "dev": true, "license": "MIT", "dependencies": { @@ -1470,9 +1486,9 @@ "license": "(WTFPL OR MIT)" }, "node_modules/pathval": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", - "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", "dev": true, "license": "MIT", "engines": { @@ -1642,9 +1658,9 @@ "license": "MIT" }, "node_modules/semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "license": "ISC", "bin": { "semver": "bin/semver" @@ -1748,9 +1764,9 @@ } }, "node_modules/strip-ansi/node_modules/ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", "license": "MIT", "engines": { "node": ">=4" @@ -1918,9 +1934,9 @@ "license": "MIT" }, "node_modules/typescript": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz", - "integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true, "license": "Apache-2.0", "bin": { @@ -2053,7 +2069,7 @@ "ajv": { "version": "5.5.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "integrity": "sha512-Ajr4IcMXq/2QmMkEmSvxqfLN5zGmJ92gHXAeOXq1OekoH2rfDNsgdDoL2f7QaRCy7G/E6TpxBVdRuNraMztGHw==", "requires": { "co": "^4.6.0", "fast-deep-equal": "^1.0.0", @@ -2157,9 +2173,9 @@ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "big.js": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", - "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", "dev": true }, "brace-expansion": { @@ -2304,7 +2320,7 @@ "cross-spawn": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==", "requires": { "lru-cache": "^4.0.1", "shebang-command": "^1.2.0", @@ -2352,9 +2368,9 @@ } }, "emojis-list": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", - "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", "dev": true }, "enhanced-resolve": { @@ -2556,9 +2572,9 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" }, "get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", "dev": true }, "glob": { @@ -2720,10 +2736,13 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=" }, "json5": { - "version": "0.5.1", - "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", - "dev": true + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } }, "levn": { "version": "0.3.0", @@ -2735,20 +2754,20 @@ } }, "loader-utils": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", - "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", "dev": true, "requires": { - "big.js": "^3.1.3", - "emojis-list": "^2.0.0", - "json5": "^0.5.0" + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "lru-cache": { "version": "4.1.5", @@ -2801,9 +2820,9 @@ } }, "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==" }, "mkdirp": { "version": "0.5.5", @@ -2835,13 +2854,13 @@ "minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "integrity": "sha512-miQKw5Hv4NS1Psg2517mV4e4dYNaO3++hjAvLOAzKqZ61rH8NS1SK+vbfBWZ5PY/Me/bEWhUwqMghEW5Fb9T7Q==", "dev": true }, "mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "integrity": "sha512-SknJC52obPfGQPnjIkXbmA6+5H15E+fR+E4iR2oQ3zzCLbd7/ONua69R/Gw7AgkTLsRG+r5fzksYwWe1AgTyWA==", "dev": true, "requires": { "minimist": "0.0.8" @@ -2928,9 +2947,9 @@ "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=" }, "pathval": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", - "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", "dev": true }, "pluralize": { @@ -3054,9 +3073,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==" }, "shebang-command": { "version": "1.2.0", @@ -3128,9 +3147,9 @@ }, "dependencies": { "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==" } } }, @@ -3223,12 +3242,10 @@ "requires": { "@types/node": "*", "@types/node-fetch": "^2.5.7", - "@types/url-parse": "1.4.4", "es6-promise": "^4.2.4", "form-data": "^2.5.0", "node-fetch": "^2.6.0", - "typescript": "^4.0", - "url-parse": "^1.4.3" + "typescript": "^4.0" }, "dependencies": { "@types/node": { @@ -3304,32 +3321,36 @@ } }, "node-fetch": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", - "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" - }, - "querystringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.0.tgz", - "integrity": "sha512-sluvZZ1YiTLD5jsqZcDmFyV2EwToyXZBfpoVOmktMmW+VEnhgakFHnasVph65fOjGPTWN0Nw3+XQaSeMayr0kg==" + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "requires": { + "whatwg-url": "^5.0.0" + } }, - "requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, "typescript": { - "version": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz", - "integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true }, - "url-parse": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.3.tgz", - "integrity": "sha512-rh+KuAW36YKo0vClhQzLLveoj8FwPJNu65xLb7Mrt+eZht0IPT0IXgSv8gcMegZ6NvjJUALf6Mf25POlMwD1Fw==", + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "requires": { - "querystringify": "^2.0.0", - "requires-port": "^1.0.0" + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" } } } @@ -3363,9 +3384,9 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" }, "typescript": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz", - "integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true }, "util-deprecate": { diff --git a/samples/openapi3/client/petstore/typescript/tests/default/package.json b/samples/openapi3/client/petstore/typescript/tests/default/package.json index 1f0c9d646bde..a87d0b3a5331 100644 --- a/samples/openapi3/client/petstore/typescript/tests/default/package.json +++ b/samples/openapi3/client/petstore/typescript/tests/default/package.json @@ -19,7 +19,7 @@ "chai": "^4.1.0", "mocha": "^5.2.0", "ts-loader": "^2.3.0", - "typescript": "^2.4.1" + "typescript": "^4" }, "name": "typescript-test", "version": "1.0.0", From 98219633c8f62530075c1cde290ae440453a570f Mon Sep 17 00:00:00 2001 From: David Gamero Date: Thu, 9 Jan 2025 13:35:06 -0500 Subject: [PATCH 02/10] update dependencies to run on current tsc --- .../tests/default/package-lock.json | 4607 ++++++++++++----- .../typescript/tests/default/package.json | 6 +- 2 files changed, 3256 insertions(+), 1357 deletions(-) diff --git a/samples/openapi3/client/petstore/typescript/tests/default/package-lock.json b/samples/openapi3/client/petstore/typescript/tests/default/package-lock.json index 3d8e3396f619..4a0f07395cdf 100644 --- a/samples/openapi3/client/petstore/typescript/tests/default/package-lock.json +++ b/samples/openapi3/client/petstore/typescript/tests/default/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@types/rewire": "^2.5.28", "form-data": "^2.5.0", - "rewire": "^4.0.1", + "rewire": "^7.0.0", "ts-node": "^3.3.0", "ts-petstore-client": "file:../../builds/default" }, @@ -19,9 +19,9 @@ "@types/chai": "4.0.1 - 4.1.x", "@types/isomorphic-fetch": "0.0.34", "@types/mocha": "^2.2.41", - "@types/node": "8.10.38 - 8.10.62", + "@types/node": "^20", "chai": "^4.1.0", - "mocha": "^5.2.0", + "mocha": "^11.0.1", "ts-loader": "^2.3.0", "typescript": "^4" } @@ -195,6 +195,220 @@ "webidl-conversions": "^3.0.0" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", + "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/eslintrc/node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", + "deprecated": "Use @eslint/config-array instead", + "license": "Apache-2.0", + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.3", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "deprecated": "Use @eslint/object-schema instead", + "license": "BSD-3-Clause" + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, "node_modules/@types/chai": { "version": "4.1.6", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.6.tgz", @@ -217,11 +431,14 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "8.10.38", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.38.tgz", - "integrity": "sha512-EibsnbJerd0hBFaDjJStFrVbVBAtOy4dgL8zZFw0uOvPqzBAX59Ci8cgjg3+RgJIWhsB5A4c+pi+D4P9tQQh/A==", + "version": "20.17.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.12.tgz", + "integrity": "sha512-vo/wmBgMIiEA23A/knMfn/cf37VnuF52nZh5ZoW0GWt4e4sxNquibrMRJ7UQsA06+MBx9r/H1jsI9grYjQCQlw==", "dev": true, - "license": "MIT" + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.2" + } }, "node_modules/@types/rewire": { "version": "2.5.28", @@ -229,10 +446,16 @@ "integrity": "sha512-uD0j/AQOa5le7afuK+u+woi8jNKF1vf3DN0H7LCJhft/lNNibUr7VcAesdgtWfEKveZol3ZG1CJqwx2Bhrnl8w==", "license": "MIT" }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.1.tgz", + "integrity": "sha512-fEzPV3hSkSMltkw152tJKNARhOupqbH96MZWyRjNaYZOMIzbrTeQDG+MTc6Mr2pgzFQzFxAfmhGDNP5QK++2ZA==", + "license": "ISC" + }, "node_modules/acorn": { - "version": "5.7.4", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", - "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "license": "MIT", "bin": { "acorn": "bin/acorn" @@ -242,63 +465,51 @@ } }, "node_modules/acorn-jsx": { - "version": "3.0.1", - "resolved": "http://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", - "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "license": "MIT", - "dependencies": { - "acorn": "^3.0.4" - } - }, - "node_modules/acorn-jsx/node_modules/acorn": { - "version": "3.3.0", - "resolved": "http://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", - "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", - "license": "MIT", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "node_modules/ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha512-Ajr4IcMXq/2QmMkEmSvxqfLN5zGmJ92gHXAeOXq1OekoH2rfDNsgdDoL2f7QaRCy7G/E6TpxBVdRuNraMztGHw==", + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "license": "MIT", "dependencies": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", + "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" - } - }, - "node_modules/ajv-keywords": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", - "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", - "license": "MIT", - "peerDependencies": { - "ajv": "^5.0.0" + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/ansi-escapes": { - "version": "3.1.0", - "resolved": "http://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", - "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, "license": "MIT", "engines": { - "node": ">=4" + "node": ">=6" } }, "node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/ansi-styles": { @@ -313,15 +524,26 @@ "node": ">=4" } }, - "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "license": "MIT", + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", "dependencies": { - "sprintf-js": "~1.0.2" + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" } }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "license": "Python-2.0" + }, "node_modules/arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", @@ -347,67 +569,10 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "license": "MIT" }, - "node_modules/babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "license": "MIT", - "dependencies": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - } - }, - "node_modules/babel-code-frame/node_modules/ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/babel-code-frame/node_modules/chalk": { - "version": "1.1.3", - "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "license": "MIT", - "dependencies": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/babel-code-frame/node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "license": "MIT", - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/babel-code-frame/node_modules/supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "license": "MIT", - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "license": "MIT" }, "node_modules/big.js": { @@ -420,14 +585,40 @@ "node": "*" } }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, "license": "MIT", "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" } }, "node_modules/browser-stdout": { @@ -437,31 +628,26 @@ "dev": true, "license": "ISC" }, - "node_modules/buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "license": "MIT" - }, - "node_modules/caller-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", - "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "license": "MIT", - "dependencies": { - "callsites": "^0.2.0" - }, "engines": { - "node": ">=0.10.0" + "node": ">=6" } }, - "node_modules/callsites": { - "version": "0.2.0", - "resolved": "http://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", - "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/chai": { @@ -496,12 +682,6 @@ "node": ">=4" } }, - "node_modules/chardet": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", - "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", - "license": "MIT" - }, "node_modules/check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", @@ -512,38 +692,140 @@ "node": "*" } }, - "node_modules/circular-json": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/cliui/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/cliui/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, "license": "MIT" }, - "node_modules/cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, "license": "MIT", "dependencies": { - "restore-cursor": "^2.0.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/cli-width": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", - "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", - "license": "ISC" + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } }, - "node_modules/co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, "engines": { - "iojs": ">= 1.0.0", - "node": ">= 0.12.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, "node_modules/color-convert": { @@ -573,58 +855,61 @@ "node": ">= 0.8" } }, - "node_modules/commander": { - "version": "2.15.1", - "resolved": "http://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", - "dev": true, - "license": "MIT" - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "license": "MIT" }, - "node_modules/concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "engines": [ - "node >= 0.8" - ], - "license": "MIT", - "dependencies": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, "node_modules/core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true, "license": "MIT" }, "node_modules/cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "license": "MIT", "dependencies": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" } }, "node_modules/debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "license": "MIT", "dependencies": { - "ms": "2.0.0" + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/deep-eql": { @@ -641,10 +926,10 @@ } }, "node_modules/deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "license": "MIT (https://github.com/thlorenz/deep-is/blob/master/LICENSE)" + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "license": "MIT" }, "node_modules/delayed-stream": { "version": "1.0.0", @@ -665,17 +950,31 @@ } }, "node_modules/doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "license": "Apache-2.0", "dependencies": { "esutils": "^2.0.2" }, "engines": { - "node": ">=0.10.0" + "node": ">=6.0.0" } }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true, + "license": "MIT" + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" + }, "node_modules/emojis-list": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", @@ -714,6 +1013,16 @@ "errno": "cli.js" } }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -724,216 +1033,398 @@ } }, "node_modules/eslint": { - "version": "4.19.1", - "resolved": "http://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", - "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", - "license": "MIT", - "dependencies": { - "ajv": "^5.3.0", - "babel-code-frame": "^6.22.0", - "chalk": "^2.1.0", - "concat-stream": "^1.6.0", - "cross-spawn": "^5.1.0", - "debug": "^3.1.0", - "doctrine": "^2.1.0", - "eslint-scope": "^3.7.1", - "eslint-visitor-keys": "^1.0.0", - "espree": "^3.5.4", - "esquery": "^1.0.0", + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", "esutils": "^2.0.2", - "file-entry-cache": "^2.0.0", - "functional-red-black-tree": "^1.0.1", - "glob": "^7.1.2", - "globals": "^11.0.1", - "ignore": "^3.3.3", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", "imurmurhash": "^0.1.4", - "inquirer": "^3.0.6", - "is-resolvable": "^1.0.0", - "js-yaml": "^3.9.1", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.4", - "minimatch": "^3.0.2", - "mkdirp": "^0.5.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.8.2", - "path-is-inside": "^1.0.2", - "pluralize": "^7.0.0", - "progress": "^2.0.0", - "regexpp": "^1.0.1", - "require-uncached": "^1.0.3", - "semver": "^5.3.0", - "strip-ansi": "^4.0.0", - "strip-json-comments": "~2.0.1", - "table": "4.0.2", - "text-table": "~0.2.0" + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": ">=4" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-scope": { - "version": "3.7.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.3.tgz", - "integrity": "sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA==", + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "license": "BSD-2-Clause", "dependencies": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" }, "engines": { - "node": ">=4.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-visitor-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", - "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "license": "Apache-2.0", "engines": { - "node": ">=4" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/espree": { - "version": "3.5.4", - "resolved": "http://registry.npmjs.org/espree/-/espree-3.5.4.tgz", - "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", - "license": "BSD-2-Clause", + "node_modules/eslint/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", "dependencies": { - "acorn": "^5.5.0", - "acorn-jsx": "^3.0.0" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/eslint/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/eslint/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/eslint/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/eslint/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "license": "BSD-2-Clause", - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" }, "engines": { - "node": ">=4" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/esquery": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", - "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "license": "BSD-3-Clause", "dependencies": { - "estraverse": "^4.0.0" + "estraverse": "^5.1.0" }, "engines": { - "node": ">=0.6" + "node": ">=0.10" } }, "node_modules/esrecurse": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", - "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "license": "BSD-2-Clause", "dependencies": { - "estraverse": "^4.1.0" + "estraverse": "^5.2.0" }, "engines": { "node": ">=4.0" } }, "node_modules/estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "license": "BSD-2-Clause", "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "engines": { - "node": ">=0.10.0" + "node": ">=4.0" } }, - "node_modules/external-editor": { - "version": "2.2.0", - "resolved": "http://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", - "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", - "license": "MIT", - "dependencies": { - "chardet": "^0.4.0", - "iconv-lite": "^0.4.17", - "tmp": "^0.0.33" - }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "license": "BSD-2-Clause", "engines": { - "node": ">=0.12" + "node": ">=0.10.0" } }, "node_modules/fast-deep-equal": { - "version": "1.1.0", - "resolved": "http://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "license": "MIT" }, "node_modules/fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "license": "MIT" }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "license": "MIT" }, - "node_modules/figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "node_modules/fastq": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.18.0.tgz", + "integrity": "sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw==", + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "license": "MIT", "dependencies": { - "escape-string-regexp": "^1.0.5" + "flat-cache": "^3.0.4" }, "engines": { - "node": ">=4" + "node": "^10.12.0 || >=12.0.0" } }, - "node_modules/file-entry-cache": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", - "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, "license": "MIT", "dependencies": { - "flat-cache": "^1.2.1", - "object-assign": "^4.0.1" + "to-regex-range": "^5.0.1" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "license": "BSD-3-Clause", + "bin": { + "flat": "cli.js" } }, "node_modules/flat-cache": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", - "integrity": "sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", "license": "MIT", "dependencies": { - "circular-json": "^0.3.1", - "graceful-fs": "^4.1.2", - "rimraf": "~2.6.2", - "write": "^0.2.1" + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" }, "engines": { - "node": ">=0.10.0" + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", + "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", + "license": "ISC" + }, + "node_modules/foreground-child": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/form-data": { @@ -953,14 +1444,33 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "license": "ISC" }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "license": "MIT" + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } }, "node_modules/get-func-name": { "version": "2.0.2", @@ -973,61 +1483,85 @@ } }, "node_modules/glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, "license": "ISC", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" }, "engines": { - "node": "*" + "node": ">= 6" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/globals": { - "version": "11.9.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.9.0.tgz", - "integrity": "sha512-5cJVtyXWH8PiJPVLZzzoIizXx944O4OmRro5MWKx5fT4MgcN7OfaMutPeaTdJCCURwbWdhhcCWcKIffPnmTzBg==", + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "license": "MIT", + "dependencies": { + "type-fest": "^0.20.2" + }, "engines": { - "node": ">=4" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/graceful-fs": { "version": "4.1.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true, "license": "ISC", "engines": { "node": ">=0.4.0" } }, - "node_modules/growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4.x" - } - }, - "node_modules/has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "license": "MIT", - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "license": "MIT" }, "node_modules/has-flag": { "version": "3.0.0", @@ -1039,9 +1573,9 @@ } }, "node_modules/he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true, "license": "MIT", "bin": { @@ -1060,28 +1594,35 @@ "node": ">=0.10.0" } }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "license": "MIT", "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ignore": { - "version": "3.3.10", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", - "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", - "license": "MIT" - }, "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "license": "MIT", "engines": { "node": ">=0.8.19" @@ -1090,7 +1631,8 @@ "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "license": "ISC", "dependencies": { "once": "^1.3.0", @@ -1103,90 +1645,149 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "license": "ISC" }, - "node_modules/inquirer": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", - "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, "license": "MIT", "dependencies": { - "ansi-escapes": "^3.0.0", - "chalk": "^2.0.0", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^2.0.4", - "figures": "^2.0.0", - "lodash": "^4.3.0", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rx-lite": "^4.0.8", - "rx-lite-aggregates": "^4.0.8", - "string-width": "^2.1.0", - "strip-ansi": "^4.0.0", - "through": "^2.3.6" + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" } }, "node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, "license": "MIT", "engines": { - "node": ">=4" + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "license": "MIT", + "engines": { + "node": ">=8" } }, - "node_modules/is-promise": { + "node_modules/is-plain-obj": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", - "license": "MIT" + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } }, - "node_modules/is-resolvable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", - "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", - "license": "ISC" + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true, "license": "MIT" }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "license": "ISC" }, - "node_modules/js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", - "license": "MIT" + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } }, "node_modules/js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "license": "MIT", "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "license": "MIT" + }, "node_modules/json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "license": "MIT" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "license": "MIT" }, "node_modules/json5": { @@ -1202,14 +1803,23 @@ "json5": "lib/cli.js" } }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "license": "MIT", "dependencies": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" }, "engines": { "node": ">= 0.8.0" @@ -1222,29 +1832,134 @@ "dev": true, "license": "MIT", "dependencies": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^1.0.1" + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "license": "MIT" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-symbols/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/log-symbols/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/log-symbols/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/log-symbols/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" }, "engines": { - "node": ">=4.0.0" + "node": ">=8" } }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "license": "MIT" - }, "node_modules/lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "license": "ISC", - "dependencies": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" }, "node_modules/make-error": { "version": "1.3.5", @@ -1284,25 +1999,17 @@ "node": ">= 0.6" } }, - "node_modules/mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, "license": "ISC", "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=10" } }, "node_modules/minimist": { @@ -1314,6 +2021,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/mkdirp": { "version": "0.5.5", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", @@ -1327,88 +2044,130 @@ } }, "node_modules/mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.0.1.tgz", + "integrity": "sha512-+3GkODfsDG71KSCQhc4IekSW+ItCK/kiez1Z28ksWvYhKXV/syxMlerR/sC7whDp7IyreZ4YxceMLdTs5hQE8A==", "dev": true, "license": "MIT", "dependencies": { - "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.2", - "growl": "1.10.5", - "he": "1.1.1", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "supports-color": "5.4.0" + "ansi-colors": "^4.1.3", + "browser-stdout": "^1.3.1", + "chokidar": "^3.5.3", + "debug": "^4.3.5", + "diff": "^5.2.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^10.4.5", + "he": "^1.2.0", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^5.1.6", + "ms": "^2.1.3", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^6.5.1", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.9", + "yargs-unparser": "^2.0.0" }, "bin": { "_mocha": "bin/_mocha", - "mocha": "bin/mocha" + "mocha": "bin/mocha.js" }, "engines": { - "node": ">= 4.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/mocha/node_modules/minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha512-miQKw5Hv4NS1Psg2517mV4e4dYNaO3++hjAvLOAzKqZ61rH8NS1SK+vbfBWZ5PY/Me/bEWhUwqMghEW5Fb9T7Q==", + "node_modules/mocha/node_modules/diff": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", "dev": true, - "license": "MIT" + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } }, - "node_modules/mocha/node_modules/mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha512-SknJC52obPfGQPnjIkXbmA6+5H15E+fR+E4iR2oQ3zzCLbd7/ONua69R/Gw7AgkTLsRG+r5fzksYwWe1AgTyWA==", - "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)", + "node_modules/mocha/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, "license": "MIT", - "dependencies": { - "minimist": "0.0.8" + "engines": { + "node": ">=10" }, - "bin": { - "mkdirp": "bin/cmd.js" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/mocha/node_modules/supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "license": "MIT", "dependencies": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, "node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, - "node_modules/mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", - "license": "ISC" - }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "license": "MIT" }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -1417,48 +2176,76 @@ "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "license": "ISC", "dependencies": { "wrappy": "1" } }, - "node_modules/onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "license": "MIT", "dependencies": { - "mimic-fn": "^1.0.0" + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" }, "engines": { - "node": ">=4" + "node": ">= 0.8.0" } }, - "node_modules/optionator": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "license": "MIT", "dependencies": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.4", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "wordwrap": "~1.0.0" + "yocto-queue": "^0.1.0" }, "engines": { - "node": ">= 0.8.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/os-tmpdir": { - "version": "1.0.2", - "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, "engines": { - "node": ">=0.10.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" } }, "node_modules/parse-passwd": { @@ -1470,20 +2257,49 @@ "node": ">=0.10.0" } }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "license": "MIT", "engines": { "node": ">=0.10.0" } }, - "node_modules/path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", - "license": "(WTFPL OR MIT)" + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } }, "node_modules/pathval": { "version": "1.1.1", @@ -1495,19 +2311,24 @@ "node": "*" } }, - "node_modules/pluralize": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", - "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, "license": "MIT", "engines": { - "node": ">=4" + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "license": "MIT", "engines": { "node": ">= 0.8.0" } @@ -1516,17 +2337,9 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true, "license": "MIT" }, - "node_modules/progress": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.1.tgz", - "integrity": "sha512-OE+a6vzqazc+K6LxJrX5UPyKFvGnL5CYmq2jFGNIBWHpc4QyE49/YOumcrpQFJpfejmvRtbJzgO1zPmMCqlbBg==", - "license": "MIT", - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/prr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", @@ -1534,16 +2347,50 @@ "dev": true, "license": "MIT" }, - "node_modules/pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", - "license": "ISC" + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.0" + } }, "node_modules/readable-stream": { "version": "2.3.6", "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", @@ -1555,154 +2402,198 @@ "util-deprecate": "~1.0.1" } }, - "node_modules/regexpp": { - "version": "1.1.0", - "resolved": "http://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", - "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==", + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, "engines": { - "node": ">=4.0.0" + "node": ">=8.10.0" } }, - "node_modules/require-uncached": { - "version": "1.0.3", - "resolved": "http://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", - "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, "license": "MIT", - "dependencies": { - "caller-path": "^0.1.0", - "resolve-from": "^1.0.0" - }, "engines": { "node": ">=0.10.0" } }, "node_modules/resolve-from": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", - "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">=4" } }, - "node_modules/restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "license": "MIT", - "dependencies": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" - }, "engines": { - "node": ">=4" + "iojs": ">=1.0.0", + "node": ">=0.10.0" } }, "node_modules/rewire": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/rewire/-/rewire-4.0.1.tgz", - "integrity": "sha512-+7RQ/BYwTieHVXetpKhT11UbfF6v1kGhKFrtZN7UDL2PybMsSt/rpLWeEUGF5Ndsl1D5BxiCB14VDJyoX+noYw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/rewire/-/rewire-7.0.0.tgz", + "integrity": "sha512-DyyNyzwMtGYgu0Zl/ya0PR/oaunM+VuCuBxCuhYJHHaV0V+YvYa3bBGxb5OZ71vndgmp1pYY8F4YOwQo1siRGw==", "license": "MIT", "dependencies": { - "eslint": "^4.19.1" + "eslint": "^8.47.0" } }, "node_modules/rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", "license": "ISC", "dependencies": { - "glob": "^7.0.5" + "glob": "^7.1.3" }, "bin": { "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/run-async": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", - "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "node_modules/rimraf/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "license": "MIT", "dependencies": { - "is-promise": "^2.1.0" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" }, "engines": { - "node": ">=0.12.0" + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/rx-lite": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", - "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=" + "node_modules/rimraf/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } }, - "node_modules/rx-lite-aggregates": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", - "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", "dependencies": { - "rx-lite": "*" + "queue-microtask": "^1.2.2" } }, "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "license": "MIT" - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, "license": "MIT" }, "node_modules/semver": { "version": "5.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, "license": "ISC", "bin": { "semver": "bin/semver" } }, + "node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } + }, "node_modules/shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "license": "MIT", "dependencies": { - "shebang-regex": "^1.0.0" + "shebang-regex": "^3.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "license": "ISC" - }, - "node_modules/slice-ansi": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", - "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", - "license": "MIT", - "dependencies": { - "is-fullwidth-code-point": "^2.0.0" - }, + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", "engines": { - "node": ">=4" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/source-map": { @@ -1711,65 +2602,130 @@ "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "license": "BSD-3-Clause", "engines": { - "node": ">=0.10.0" + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "license": "MIT", + "dependencies": { + "source-map": "^0.5.6" + } + }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/source-map-support": { - "version": "0.4.18", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", - "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, "license": "MIT", "dependencies": { - "source-map": "^0.5.6" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" } }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "license": "BSD-3-Clause" + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } }, - "node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "license": "MIT", "dependencies": { - "safe-buffer": "~5.1.0" + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" } }, - "node_modules/string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, "license": "MIT", "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "ansi-regex": "^6.0.1" }, "engines": { - "node": ">=4" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "license": "MIT", "dependencies": { - "ansi-regex": "^3.0.0" + "ansi-regex": "^5.0.1" }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/strip-ansi/node_modules/ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, "license": "MIT", "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/strip-bom": { @@ -1802,20 +2758,6 @@ "node": ">=4" } }, - "node_modules/table": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", - "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", - "license": "BSD-3-Clause", - "dependencies": { - "ajv": "^5.2.3", - "ajv-keywords": "^2.1.0", - "chalk": "^2.1.0", - "lodash": "^4.17.4", - "slice-ansi": "1.0.0", - "string-width": "^2.1.1" - } - }, "node_modules/tapable": { "version": "0.2.8", "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.2.8.tgz", @@ -1829,25 +2771,20 @@ "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "license": "MIT" - }, - "node_modules/through": { - "version": "2.3.8", - "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "license": "MIT" }, - "node_modules/tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "license": "MIT", "dependencies": { - "os-tmpdir": "~1.0.2" + "is-number": "^7.0.0" }, "engines": { - "node": ">=0.6.0" + "node": ">=8.0" } }, "node_modules/ts-loader": { @@ -1906,12 +2843,12 @@ } }, "node_modules/type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "license": "MIT", "dependencies": { - "prelude-ls": "~1.1.2" + "prelude-ls": "^1.2.1" }, "engines": { "node": ">= 0.8.0" @@ -1927,11 +2864,17 @@ "node": ">=4" } }, - "node_modules/typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "license": "MIT" + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/typescript": { "version": "4.9.5", @@ -1947,10 +2890,27 @@ "node": ">=4.2.0" } }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true, + "license": "MIT" + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true, "license": "MIT" }, "node_modules/v8flags": { @@ -1965,46 +2925,272 @@ } }, "node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, "bin": { - "which": "bin/which" + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" } }, - "node_modules/wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/workerpool": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", + "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, "license": "MIT" }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "license": "ISC" }, - "node_modules/write": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", - "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, "license": "MIT", "dependencies": { - "mkdirp": "^0.5.1" + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" }, "engines": { - "node": ">=0.10.0" + "node": ">=10" } }, - "node_modules/yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "license": "ISC" + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } }, "node_modules/yn": { "version": "2.0.0", @@ -2014,9 +3200,162 @@ "engines": { "node": ">=4" } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } } }, "dependencies": { + "@eslint-community/eslint-utils": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", + "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", + "requires": { + "eslint-visitor-keys": "^3.4.3" + } + }, + "@eslint-community/regexpp": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==" + }, + "@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "requires": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" + } + } + }, + "@eslint/js": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==" + }, + "@humanwhocodes/config-array": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", + "requires": { + "@humanwhocodes/object-schema": "^2.0.3", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "dependencies": { + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + } + } + }, + "@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==" + }, + "@humanwhocodes/object-schema": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==" + }, + "@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "requires": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + } + }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==" + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, + "@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true + }, "@types/chai": { "version": "4.1.6", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.6.tgz", @@ -2036,62 +3375,57 @@ "dev": true }, "@types/node": { - "version": "8.10.38", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.38.tgz", - "integrity": "sha512-EibsnbJerd0hBFaDjJStFrVbVBAtOy4dgL8zZFw0uOvPqzBAX59Ci8cgjg3+RgJIWhsB5A4c+pi+D4P9tQQh/A==", - "dev": true + "version": "20.17.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.12.tgz", + "integrity": "sha512-vo/wmBgMIiEA23A/knMfn/cf37VnuF52nZh5ZoW0GWt4e4sxNquibrMRJ7UQsA06+MBx9r/H1jsI9grYjQCQlw==", + "dev": true, + "requires": { + "undici-types": "~6.19.2" + } }, "@types/rewire": { "version": "2.5.28", "resolved": "https://registry.npmjs.org/@types/rewire/-/rewire-2.5.28.tgz", "integrity": "sha512-uD0j/AQOa5le7afuK+u+woi8jNKF1vf3DN0H7LCJhft/lNNibUr7VcAesdgtWfEKveZol3ZG1CJqwx2Bhrnl8w==" }, + "@ungap/structured-clone": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.1.tgz", + "integrity": "sha512-fEzPV3hSkSMltkw152tJKNARhOupqbH96MZWyRjNaYZOMIzbrTeQDG+MTc6Mr2pgzFQzFxAfmhGDNP5QK++2ZA==" + }, "acorn": { - "version": "5.7.4", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", - "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==" + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==" }, "acorn-jsx": { - "version": "3.0.1", - "resolved": "http://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", - "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", - "requires": { - "acorn": "^3.0.4" - }, - "dependencies": { - "acorn": { - "version": "3.3.0", - "resolved": "http://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", - "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=" - } - } + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "requires": {} }, "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha512-Ajr4IcMXq/2QmMkEmSvxqfLN5zGmJ92gHXAeOXq1OekoH2rfDNsgdDoL2f7QaRCy7G/E6TpxBVdRuNraMztGHw==", + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "requires": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", + "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, - "ajv-keywords": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", - "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", - "requires": {} - }, - "ansi-escapes": { - "version": "3.1.0", - "resolved": "http://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", - "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==" + "ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true }, "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true }, "ansi-styles": { "version": "3.2.1", @@ -2101,14 +3435,21 @@ "color-convert": "^1.9.0" } }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, "requires": { - "sprintf-js": "~1.0.2" + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" } }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", @@ -2125,52 +3466,10 @@ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" - }, - "chalk": { - "version": "1.1.3", - "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" - } - } - }, "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "big.js": { "version": "5.2.2", @@ -2178,13 +3477,28 @@ "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", "dev": true }, + "binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true + }, "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" + } + }, + "braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "requires": { + "fill-range": "^7.1.1" } }, "browser-stdout": { @@ -2193,23 +3507,16 @@ "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" - }, - "caller-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", - "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", - "requires": { - "callsites": "^0.2.0" - } - }, "callsites": { - "version": "0.2.0", - "resolved": "http://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", - "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=" + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" + }, + "camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true }, "chai": { "version": "4.2.0", @@ -2235,40 +3542,108 @@ "supports-color": "^5.3.0" } }, - "chardet": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", - "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=" - }, "check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", "dev": true }, - "circular-json": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==" - }, - "cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + } + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, "requires": { - "restore-cursor": "^2.0.0" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + } } }, - "cli-width": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", - "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=" - }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" - }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -2290,51 +3665,41 @@ "delayed-stream": "~1.0.0" } }, - "commander": { - "version": "2.15.1", - "resolved": "http://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", - "dev": true - }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true }, "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" } }, "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "requires": { - "ms": "2.0.0" + "ms": "^2.1.3" } }, + "decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true + }, "deep-eql": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", @@ -2345,9 +3710,9 @@ } }, "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" }, "delayed-stream": { "version": "1.0.0", @@ -2360,13 +3725,25 @@ "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==" }, "doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "requires": { "esutils": "^2.0.2" } }, + "eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, + "emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, "emojis-list": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", @@ -2394,161 +3771,278 @@ "prr": "~1.0.1" } }, + "escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "eslint": { - "version": "4.19.1", - "resolved": "http://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", - "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", - "requires": { - "ajv": "^5.3.0", - "babel-code-frame": "^6.22.0", - "chalk": "^2.1.0", - "concat-stream": "^1.6.0", - "cross-spawn": "^5.1.0", - "debug": "^3.1.0", - "doctrine": "^2.1.0", - "eslint-scope": "^3.7.1", - "eslint-visitor-keys": "^1.0.0", - "espree": "^3.5.4", - "esquery": "^1.0.0", + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "requires": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", "esutils": "^2.0.2", - "file-entry-cache": "^2.0.0", - "functional-red-black-tree": "^1.0.1", - "glob": "^7.1.2", - "globals": "^11.0.1", - "ignore": "^3.3.3", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", "imurmurhash": "^0.1.4", - "inquirer": "^3.0.6", - "is-resolvable": "^1.0.0", - "js-yaml": "^3.9.1", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.4", - "minimatch": "^3.0.2", - "mkdirp": "^0.5.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.8.2", - "path-is-inside": "^1.0.2", - "pluralize": "^7.0.0", - "progress": "^2.0.0", - "regexpp": "^1.0.1", - "require-uncached": "^1.0.3", - "semver": "^5.3.0", - "strip-ansi": "^4.0.0", - "strip-json-comments": "~2.0.1", - "table": "4.0.2", - "text-table": "~0.2.0" + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" + }, + "glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "requires": { + "is-glob": "^4.0.3" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + } } }, "eslint-scope": { - "version": "3.7.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.3.tgz", - "integrity": "sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA==", + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" } }, "eslint-visitor-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", - "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==" + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==" }, "espree": { - "version": "3.5.4", - "resolved": "http://registry.npmjs.org/espree/-/espree-3.5.4.tgz", - "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "requires": { - "acorn": "^5.5.0", - "acorn-jsx": "^3.0.0" + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" } }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" - }, "esquery": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", - "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "requires": { - "estraverse": "^4.0.0" + "estraverse": "^5.1.0" } }, "esrecurse": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", - "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "requires": { - "estraverse": "^4.1.0" + "estraverse": "^5.2.0" } }, "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=" + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==" }, "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" - }, - "external-editor": { - "version": "2.2.0", - "resolved": "http://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", - "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", - "requires": { - "chardet": "^0.4.0", - "iconv-lite": "^0.4.17", - "tmp": "^0.0.33" - } + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" }, "fast-deep-equal": { - "version": "1.1.0", - "resolved": "http://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" }, - "figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "fastq": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.18.0.tgz", + "integrity": "sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw==", "requires": { - "escape-string-regexp": "^1.0.5" + "reusify": "^1.0.4" } }, "file-entry-cache": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", - "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "requires": { + "flat-cache": "^3.0.4" + } + }, + "fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "requires": { - "flat-cache": "^1.2.1", - "object-assign": "^4.0.1" + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" } }, + "flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true + }, "flat-cache": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", - "integrity": "sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", "requires": { - "circular-json": "^0.3.1", - "graceful-fs": "^4.1.2", - "rimraf": "~2.6.2", - "write": "^0.2.1" + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + } + }, + "flatted": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", + "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==" + }, + "foreground-child": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" } }, "form-data": { @@ -2564,12 +4058,20 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" + "fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "optional": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true }, "get-func-name": { "version": "2.0.2", @@ -2578,41 +4080,57 @@ "dev": true }, "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "dependencies": { + "minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + } + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" } }, "globals": { - "version": "11.9.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.9.0.tgz", - "integrity": "sha512-5cJVtyXWH8PiJPVLZzzoIizXx944O4OmRro5MWKx5fT4MgcN7OfaMutPeaTdJCCURwbWdhhcCWcKIffPnmTzBg==" + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "requires": { + "type-fest": "^0.20.2" + } }, "graceful-fs": { "version": "4.1.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" - }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", "dev": true }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "requires": { - "ansi-regex": "^2.0.0" - } + "graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==" }, "has-flag": { "version": "3.0.0", @@ -2620,9 +4138,9 @@ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" }, "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, "homedir-polyfill": { @@ -2633,28 +4151,29 @@ "parse-passwd": "^1.0.0" } }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==" + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "requires": { - "safer-buffer": ">= 2.1.2 < 3" + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" } }, - "ignore": { - "version": "3.3.10", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", - "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==" - }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==" }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "requires": { "once": "^1.3.0", "wrappy": "1" @@ -2665,75 +4184,100 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, - "inquirer": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", - "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, "requires": { - "ansi-escapes": "^3.0.0", - "chalk": "^2.0.0", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^2.0.4", - "figures": "^2.0.0", - "lodash": "^4.3.0", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rx-lite": "^4.0.8", - "rx-lite-aggregates": "^4.0.8", - "string-width": "^2.1.0", - "strip-ansi": "^4.0.0", - "through": "^2.3.6" + "binary-extensions": "^2.0.0" } }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" + }, "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "requires": { + "is-extglob": "^2.1.1" + } }, - "is-promise": { + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==" + }, + "is-plain-obj": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=" + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true }, - "is-resolvable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", - "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==" + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, - "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" + "jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "requires": { + "@isaacs/cliui": "^8.0.2", + "@pkgjs/parseargs": "^0.11.0" + } }, "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" } }, + "json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" + }, "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=" + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==" }, "json5": { "version": "1.0.2", @@ -2744,13 +4288,21 @@ "minimist": "^1.2.0" } }, + "keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "requires": { + "json-buffer": "3.0.1" + } + }, "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" } }, "loader-utils": { @@ -2764,19 +4316,85 @@ "json5": "^1.0.1" } }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "requires": { + "p-locate": "^5.0.0" + } + }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + }, + "log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true }, "make-error": { "version": "1.3.5", @@ -2806,17 +4424,13 @@ "mime-db": "1.40.0" } }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" - }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, "requires": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" } }, "minimist": { @@ -2824,6 +4438,12 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==" }, + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true + }, "mkdirp": { "version": "0.5.5", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", @@ -2833,118 +4453,170 @@ } }, "mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", - "dev": true, - "requires": { - "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.2", - "growl": "1.10.5", - "he": "1.1.1", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "supports-color": "5.4.0" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha512-miQKw5Hv4NS1Psg2517mV4e4dYNaO3++hjAvLOAzKqZ61rH8NS1SK+vbfBWZ5PY/Me/bEWhUwqMghEW5Fb9T7Q==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.0.1.tgz", + "integrity": "sha512-+3GkODfsDG71KSCQhc4IekSW+ItCK/kiez1Z28ksWvYhKXV/syxMlerR/sC7whDp7IyreZ4YxceMLdTs5hQE8A==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.3", + "browser-stdout": "^1.3.1", + "chokidar": "^3.5.3", + "debug": "^4.3.5", + "diff": "^5.2.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^10.4.5", + "he": "^1.2.0", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^5.1.6", + "ms": "^2.1.3", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^6.5.1", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.9", + "yargs-unparser": "^2.0.0" + }, + "dependencies": { + "diff": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", "dev": true }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha512-SknJC52obPfGQPnjIkXbmA6+5H15E+fR+E4iR2oQ3zzCLbd7/ONua69R/Gw7AgkTLsRG+r5fzksYwWe1AgTyWA==", - "dev": true, - "requires": { - "minimist": "0.0.8" - } + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true }, "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" } } } }, "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==" + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "requires": { "wrappy": "1" } }, - "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "requires": { - "mimic-fn": "^1.0.0" + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" } }, - "optionator": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.4", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "wordwrap": "~1.0.0" + "yocto-queue": "^0.1.0" } }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "requires": { + "p-limit": "^3.0.2" + } + }, + "package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "requires": { + "callsites": "^3.0.0" + } }, "parse-passwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=" }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=" + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + }, + "path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "requires": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + } }, "pathval": { "version": "1.1.1", @@ -2952,25 +4624,22 @@ "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", "dev": true }, - "pluralize": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", - "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==" + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true }, "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==" }, "process-nextick-args": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" - }, - "progress": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.1.tgz", - "integrity": "sha512-OE+a6vzqazc+K6LxJrX5UPyKFvGnL5CYmq2jFGNIBWHpc4QyE49/YOumcrpQFJpfejmvRtbJzgO1zPmMCqlbBg==" + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true }, "prr": { "version": "1.0.1", @@ -2978,15 +4647,30 @@ "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", "dev": true }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" + "punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==" + }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } }, "readable-stream": { "version": "2.3.6", "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -2997,111 +4681,126 @@ "util-deprecate": "~1.0.1" } }, - "regexpp": { - "version": "1.1.0", - "resolved": "http://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", - "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==" - }, - "require-uncached": { - "version": "1.0.3", - "resolved": "http://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", - "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, "requires": { - "caller-path": "^0.1.0", - "resolve-from": "^1.0.0" + "picomatch": "^2.2.1" } }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true + }, "resolve-from": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", - "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" }, - "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", - "requires": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" - } + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" }, "rewire": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/rewire/-/rewire-4.0.1.tgz", - "integrity": "sha512-+7RQ/BYwTieHVXetpKhT11UbfF6v1kGhKFrtZN7UDL2PybMsSt/rpLWeEUGF5Ndsl1D5BxiCB14VDJyoX+noYw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/rewire/-/rewire-7.0.0.tgz", + "integrity": "sha512-DyyNyzwMtGYgu0Zl/ya0PR/oaunM+VuCuBxCuhYJHHaV0V+YvYa3bBGxb5OZ71vndgmp1pYY8F4YOwQo1siRGw==", "requires": { - "eslint": "^4.19.1" + "eslint": "^8.47.0" } }, "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", - "requires": { - "glob": "^7.0.5" - } - }, - "run-async": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", - "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "requires": { - "is-promise": "^2.1.0" + "glob": "^7.1.3" + }, + "dependencies": { + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + } } }, - "rx-lite": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", - "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=" - }, - "rx-lite-aggregates": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", - "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", "requires": { - "rx-lite": "*" + "queue-microtask": "^1.2.2" } }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true }, "semver": { "version": "5.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==" + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true + }, + "serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } }, "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "requires": { - "shebang-regex": "^1.0.0" + "shebang-regex": "^3.0.0" } }, "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" }, "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" - }, - "slice-ansi": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", - "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", - "requires": { - "is-fullwidth-code-point": "^2.0.0" - } + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true }, "source-map": { "version": "0.5.7", @@ -3116,40 +4815,83 @@ "source-map": "^0.5.6" } }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" - }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, "requires": { "safe-buffer": "~5.1.0" } }, "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "requires": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + } + }, + "string-width-cjs": { + "version": "npm:string-width@4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } } }, "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "requires": { + "ansi-regex": "^6.0.1" + } + }, + "strip-ansi-cjs": { + "version": "npm:strip-ansi@6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "ansi-regex": "^5.0.1" }, "dependencies": { "ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==" + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true } } }, @@ -3171,19 +4913,6 @@ "has-flag": "^3.0.0" } }, - "table": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", - "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", - "requires": { - "ajv": "^5.2.3", - "ajv-keywords": "^2.1.0", - "chalk": "^2.1.0", - "lodash": "^4.17.4", - "slice-ansi": "1.0.0", - "string-width": "^2.1.1" - } - }, "tapable": { "version": "0.2.8", "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.2.8.tgz", @@ -3193,19 +4922,15 @@ "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==" }, - "through": { - "version": "2.3.8", - "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" - }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "requires": { - "os-tmpdir": "~1.0.2" + "is-number": "^7.0.0" } }, "ts-loader": { @@ -3365,11 +5090,11 @@ } }, "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "requires": { - "prelude-ls": "~1.1.2" + "prelude-ls": "^1.2.1" } }, "type-detect": { @@ -3378,10 +5103,10 @@ "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==" }, "typescript": { "version": "4.9.5", @@ -3389,10 +5114,25 @@ "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true }, + "undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "requires": { + "punycode": "^2.1.0" + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true }, "v8flags": { "version": "3.1.1", @@ -3403,40 +5143,199 @@ } }, "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "requires": { "isexe": "^2.0.0" } }, - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" + "word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==" + }, + "workerpool": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", + "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", + "dev": true + }, + "wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "requires": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true + } + } + }, + "wrap-ansi-cjs": { + "version": "npm:wrap-ansi@7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true }, - "write": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", - "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, "requires": { - "mkdirp": "^0.5.1" + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } } }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + "yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true + }, + "yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "requires": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + } }, "yn": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz", "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=" + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==" } } } diff --git a/samples/openapi3/client/petstore/typescript/tests/default/package.json b/samples/openapi3/client/petstore/typescript/tests/default/package.json index a87d0b3a5331..22ab73b141b0 100644 --- a/samples/openapi3/client/petstore/typescript/tests/default/package.json +++ b/samples/openapi3/client/petstore/typescript/tests/default/package.json @@ -3,7 +3,7 @@ "dependencies": { "@types/rewire": "^2.5.28", "form-data": "^2.5.0", - "rewire": "^4.0.1", + "rewire": "^7.0.0", "ts-node": "^3.3.0", "ts-petstore-client": "file:../../builds/default" }, @@ -15,9 +15,9 @@ "@types/chai": "4.0.1 - 4.1.x", "@types/isomorphic-fetch": "0.0.34", "@types/mocha": "^2.2.41", - "@types/node": "8.10.38 - 8.10.62", + "@types/node": "^20", "chai": "^4.1.0", - "mocha": "^5.2.0", + "mocha": "^11.0.1", "ts-loader": "^2.3.0", "typescript": "^4" }, From 852829d8680b5fc32f04e42e928f317878bc3c52 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Thu, 9 Jan 2025 14:43:10 -0500 Subject: [PATCH 03/10] exclude middleware from inversify --- .../src/main/resources/typescript/api/api.mustache | 4 +++- .../main/resources/typescript/types/ObjectParamAPI.mustache | 6 ++++-- .../main/resources/typescript/types/ObservableAPI.mustache | 6 ++++-- .../src/main/resources/typescript/types/PromiseAPI.mustache | 6 ++++-- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript/api/api.mustache b/modules/openapi-generator/src/main/resources/typescript/api/api.mustache index 10be5db6889e..3a11cd0b816f 100644 --- a/modules/openapi-generator/src/main/resources/typescript/api/api.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/api/api.mustache @@ -1,7 +1,9 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi{{importFileExtension}}'; import {Configuration} from '../configuration{{importFileExtension}}'; +{{^useInversify}} import {Middleware} from '../middleware'; +{{/useInversify}} import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http{{importFileExtension}}'; {{#platforms}} {{#node}} @@ -43,7 +45,7 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory { * @param {{paramName}} {{description}} {{/allParams}} */ - public async {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration | Middleware[]): Promise { + public async {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration {{^useInversify}}| Middleware[]{{/useInversify}}): Promise { let _config = this.configuration; if (_options && !Array.isArray(_options)){ _config = _options diff --git a/modules/openapi-generator/src/main/resources/typescript/types/ObjectParamAPI.mustache b/modules/openapi-generator/src/main/resources/typescript/types/ObjectParamAPI.mustache index 6e2e33389fb9..74d459b1deb0 100644 --- a/modules/openapi-generator/src/main/resources/typescript/types/ObjectParamAPI.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/types/ObjectParamAPI.mustache @@ -1,6 +1,8 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http{{importFileExtension}}'; import { Configuration} from '../configuration{{importFileExtension}}' +{{^useInversify}} import type { Middleware } from "../middleware"; +{{/useInversify}} {{#useRxJS}} import { Observable } from 'rxjs'; {{/useRxJS}} @@ -56,7 +58,7 @@ export class Object{{classname}} { {{/summary}} * @param param the request object */ - public {{nickname}}WithHttpInfo(param: {{classname}}{{operationIdCamelCase}}Request{{^hasRequiredParams}} = {}{{/hasRequiredParams}}, options?: Configuration | Middleware[]): {{#useRxJS}}Observable{{/useRxJS}}{{^useRxJS}}Promise{{/useRxJS}}> { + public {{nickname}}WithHttpInfo(param: {{classname}}{{operationIdCamelCase}}Request{{^hasRequiredParams}} = {}{{/hasRequiredParams}}, options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}}): {{#useRxJS}}Observable{{/useRxJS}}{{^useRxJS}}Promise{{/useRxJS}}> { return this.api.{{nickname}}WithHttpInfo({{#allParams}}param.{{paramName}}, {{/allParams}} options){{^useRxJS}}.toPromise(){{/useRxJS}}; } @@ -69,7 +71,7 @@ export class Object{{classname}} { {{/summary}} * @param param the request object */ - public {{nickname}}(param: {{classname}}{{operationIdCamelCase}}Request{{^hasRequiredParams}} = {}{{/hasRequiredParams}}, options?: Configuration | Middleware[]): {{#useRxJS}}Observable{{/useRxJS}}{{^useRxJS}}Promise{{/useRxJS}}<{{{returnType}}}{{^returnType}}void{{/returnType}}> { + public {{nickname}}(param: {{classname}}{{operationIdCamelCase}}Request{{^hasRequiredParams}} = {}{{/hasRequiredParams}}, options?: Configuration{{^useInversify}}| Middleware[]{{/useInversify}): {{#useRxJS}}Observable{{/useRxJS}}{{^useRxJS}}Promise{{/useRxJS}}<{{{returnType}}}{{^returnType}}void{{/returnType}}> { return this.api.{{nickname}}({{#allParams}}param.{{paramName}}, {{/allParams}} options){{^useRxJS}}.toPromise(){{/useRxJS}}; } diff --git a/modules/openapi-generator/src/main/resources/typescript/types/ObservableAPI.mustache b/modules/openapi-generator/src/main/resources/typescript/types/ObservableAPI.mustache index ea1191f36c34..6b2d0b8e1a84 100644 --- a/modules/openapi-generator/src/main/resources/typescript/types/ObservableAPI.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/types/ObservableAPI.mustache @@ -1,6 +1,8 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http{{importFileExtension}}'; import { Configuration} from '../configuration{{importFileExtension}}' +{{^useInversify}} import type { Middleware } from "../middleware"; +{{/useInversify}} import { Observable, of, from } from {{#useRxJS}}'rxjs'{{/useRxJS}}{{^useRxJS}}'../rxjsStub{{importFileExtension}}'{{/useRxJS}}; import {mergeMap, map} from {{#useRxJS}}'rxjs/operators'{{/useRxJS}}{{^useRxJS}}'../rxjsStub{{importFileExtension}}'{{/useRxJS}}; {{#useInversify}} @@ -62,7 +64,7 @@ export class Observable{{classname}} { * @param {{#required}}{{paramName}}{{/required}}{{^required}}[{{paramName}}]{{/required}}{{#description}} {{description}}{{/description}} {{/allParams}} */ - public {{nickname}}WithHttpInfo({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration | Middleware[]): Observable> { + public {{nickname}}WithHttpInfo({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration{{^useInversify}} | Middleware[]{{/useInversify}}): Observable> { let configuration = undefined let calltimeMiddleware: Middleware[] = [] if (Array.isArray(_options)){ @@ -101,7 +103,7 @@ export class Observable{{classname}} { * @param {{#required}}{{paramName}}{{/required}}{{^required}}[{{paramName}}]{{/required}}{{#description}} {{description}}{{/description}} {{/allParams}} */ - public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration | Middleware[]): Observable<{{{returnType}}}{{^returnType}}void{{/returnType}}> { + public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable<{{{returnType}}}{{^returnType}}void{{/returnType}}> { return this.{{nickname}}WithHttpInfo({{#allParams}}{{paramName}}, {{/allParams}}_options).pipe(map((apiResponse: HttpInfo<{{{returnType}}}{{^returnType}}void{{/returnType}}>) => apiResponse.data)); } diff --git a/modules/openapi-generator/src/main/resources/typescript/types/PromiseAPI.mustache b/modules/openapi-generator/src/main/resources/typescript/types/PromiseAPI.mustache index 6cd98efaff3f..a9fbf81850e4 100644 --- a/modules/openapi-generator/src/main/resources/typescript/types/PromiseAPI.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/types/PromiseAPI.mustache @@ -1,6 +1,8 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http{{importFileExtension}}'; import { Configuration} from '../configuration{{importFileExtension}}' +{{^useInversify}} import type { Middleware } from "../middleware"; +{{/useInversify}} {{#useInversify}} import { injectable, inject, optional } from "inversify"; import { AbstractConfiguration } from "../services/configuration"; @@ -52,7 +54,7 @@ export class Promise{{classname}} { * @param {{#required}}{{paramName}}{{/required}}{{^required}}[{{paramName}}]{{/required}}{{#description}} {{description}}{{/description}} {{/allParams}} */ - public {{nickname}}WithHttpInfo({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration | Middleware[]): Promise> { + public {{nickname}}WithHttpInfo({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration{{^useInversify}} | Middleware[]{{/useInversify}}): Promise> { const result = this.api.{{nickname}}WithHttpInfo({{#allParams}}{{paramName}}, {{/allParams}}_options); return result.toPromise(); } @@ -68,7 +70,7 @@ export class Promise{{classname}} { * @param {{#required}}{{paramName}}{{/required}}{{^required}}[{{paramName}}]{{/required}}{{#description}} {{description}}{{/description}} {{/allParams}} */ - public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration | Middleware[]): Promise<{{{returnType}}}{{^returnType}}void{{/returnType}}> { + public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration{{^useInversify}} | Middleware[]{{/useInversify}}): Promise<{{{returnType}}}{{^returnType}}void{{/returnType}}> { const result = this.api.{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}_options); return result.toPromise(); } From 126d7e6ba5af1a8ae9b2b16961d5ad12423b226a Mon Sep 17 00:00:00 2001 From: David Gamero Date: Thu, 9 Jan 2025 14:43:47 -0500 Subject: [PATCH 04/10] update samples --- .../typescript/builds/array-of-lists/types/ObservableAPI.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/client/others/typescript/builds/array-of-lists/types/ObservableAPI.ts b/samples/client/others/typescript/builds/array-of-lists/types/ObservableAPI.ts index 77220bb8c5da..abd44f70458a 100644 --- a/samples/client/others/typescript/builds/array-of-lists/types/ObservableAPI.ts +++ b/samples/client/others/typescript/builds/array-of-lists/types/ObservableAPI.ts @@ -54,7 +54,7 @@ export class ObservableDefaultApi { /** */ - public list(_options?: Configuration | Middleware[]): Observable { + public list(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.listWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } From 53c55a63c7afee4b7fcefba1d4cb4f0c11d69118 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Thu, 9 Jan 2025 14:47:25 -0500 Subject: [PATCH 05/10] update service --- .../main/resources/typescript/services/ObservableAPI.mustache | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/typescript/services/ObservableAPI.mustache b/modules/openapi-generator/src/main/resources/typescript/services/ObservableAPI.mustache index 5eb5c172101a..5c4c91dc324c 100644 --- a/modules/openapi-generator/src/main/resources/typescript/services/ObservableAPI.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/services/ObservableAPI.mustache @@ -1,7 +1,9 @@ import type { HttpFile } from "../http/http"; import type { Observable } from {{#useRxJS}}"rxjs"{{/useRxJS}}{{^useRxJS}}"../rxjsStub"{{/useRxJS}}; import type { Configuration } from "../configuration"; +{{^useInversify}} import type { Middleware } from "../middleware"; +{{^useInversify}} {{#models}} {{#model}} @@ -15,7 +17,7 @@ import { {{{ classname }}} } from "{{{ importPath }}}"; export abstract class AbstractObservable{{classname}} { {{#operation}} - public abstract {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: Configuration | Middleware[]): Observable<{{{returnType}}}{{^returnType}}void{{/returnType}}>; + public abstract {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: Configuration{{^useInversify}} | Middleware[]{{/useInversify}}): Observable<{{{returnType}}}{{^returnType}}void{{/returnType}}>; {{/operation}} } From 47df5111dfcb80fc88b0d67979b7368f2c5bfc65 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Thu, 9 Jan 2025 14:47:53 -0500 Subject: [PATCH 06/10] space --- .../src/main/resources/typescript/api/api.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/typescript/api/api.mustache b/modules/openapi-generator/src/main/resources/typescript/api/api.mustache index 3a11cd0b816f..ac07cd1ec476 100644 --- a/modules/openapi-generator/src/main/resources/typescript/api/api.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/api/api.mustache @@ -45,7 +45,7 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory { * @param {{paramName}} {{description}} {{/allParams}} */ - public async {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration {{^useInversify}}| Middleware[]{{/useInversify}}): Promise { + public async {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration{{^useInversify}} | Middleware[]{{/useInversify}}): Promise { let _config = this.configuration; if (_options && !Array.isArray(_options)){ _config = _options From 4ecba4249fef5e8ed04126f5e0e05d8b36b99549 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Thu, 9 Jan 2025 15:02:36 -0500 Subject: [PATCH 07/10] inversify exclude --- .../typescript/types/ObjectParamAPI.mustache | 4 +- .../array-of-lists/types/ObjectParamAPI.ts | 2 +- .../.openapi-generator/FILES | 4 +- .../models/ObjectSerializer.ts | 14 ++-- .../builds/enum-single-value/models/all.ts | 4 +- .../enum-single-value/types/ObjectParamAPI.ts | 4 +- .../enum-single-value/types/ObservableAPI.ts | 4 +- .../enum-single-value/types/PromiseAPI.ts | 4 +- .../with-unique-items/types/ObjectParamAPI.ts | 2 +- .../with-unique-items/types/ObservableAPI.ts | 2 +- .../builds/browser/types/ObjectParamAPI.ts | 40 ++++----- .../builds/browser/types/ObservableAPI.ts | 40 ++++----- .../composed-schemas/types/ObjectParamAPI.ts | 6 +- .../composed-schemas/types/ObservableAPI.ts | 6 +- .../builds/default/types/ObjectParamAPI.ts | 40 ++++----- .../builds/default/types/ObservableAPI.ts | 40 ++++----- .../builds/deno/types/ObjectParamAPI.ts | 40 ++++----- .../builds/deno/types/ObservableAPI.ts | 40 ++++----- .../types/ObjectParamAPI.ts | 40 ++++----- .../deno_object_params/types/ObservableAPI.ts | 40 ++++----- .../builds/inversify/apis/PetApi.ts | 17 ++-- .../builds/inversify/apis/StoreApi.ts | 9 +-- .../builds/inversify/apis/UserApi.ts | 17 ++-- .../builds/inversify/types/ObjectParamAPI.ts | 81 +++++++++---------- .../builds/inversify/types/ObservableAPI.ts | 81 +++++++++---------- .../builds/inversify/types/PromiseAPI.ts | 81 +++++++++---------- .../nullable-enum/types/ObjectParamAPI.ts | 2 +- .../nullable-enum/types/ObservableAPI.ts | 2 +- .../object_params/types/ObjectParamAPI.ts | 40 ++++----- .../object_params/types/ObservableAPI.ts | 40 ++++----- 30 files changed, 369 insertions(+), 377 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript/types/ObjectParamAPI.mustache b/modules/openapi-generator/src/main/resources/typescript/types/ObjectParamAPI.mustache index 74d459b1deb0..97188edc711c 100644 --- a/modules/openapi-generator/src/main/resources/typescript/types/ObjectParamAPI.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/types/ObjectParamAPI.mustache @@ -58,7 +58,7 @@ export class Object{{classname}} { {{/summary}} * @param param the request object */ - public {{nickname}}WithHttpInfo(param: {{classname}}{{operationIdCamelCase}}Request{{^hasRequiredParams}} = {}{{/hasRequiredParams}}, options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}}): {{#useRxJS}}Observable{{/useRxJS}}{{^useRxJS}}Promise{{/useRxJS}}> { + public {{nickname}}WithHttpInfo(param: {{classname}}{{operationIdCamelCase}}Request{{^hasRequiredParams}} = {}{{/hasRequiredParams}}, options?: Configuration{{^useInversify}} | Middleware[]{{/useInversify}}): {{#useRxJS}}Observable{{/useRxJS}}{{^useRxJS}}Promise{{/useRxJS}}> { return this.api.{{nickname}}WithHttpInfo({{#allParams}}param.{{paramName}}, {{/allParams}} options){{^useRxJS}}.toPromise(){{/useRxJS}}; } @@ -71,7 +71,7 @@ export class Object{{classname}} { {{/summary}} * @param param the request object */ - public {{nickname}}(param: {{classname}}{{operationIdCamelCase}}Request{{^hasRequiredParams}} = {}{{/hasRequiredParams}}, options?: Configuration{{^useInversify}}| Middleware[]{{/useInversify}): {{#useRxJS}}Observable{{/useRxJS}}{{^useRxJS}}Promise{{/useRxJS}}<{{{returnType}}}{{^returnType}}void{{/returnType}}> { + public {{nickname}}(param: {{classname}}{{operationIdCamelCase}}Request{{^hasRequiredParams}} = {}{{/hasRequiredParams}}, options?: Configuration{{^useInversify}}| Middleware[]{{/useInversify}}): {{#useRxJS}}Observable{{/useRxJS}}{{^useRxJS}}Promise{{/useRxJS}}<{{{returnType}}}{{^returnType}}void{{/returnType}}> { return this.api.{{nickname}}({{#allParams}}param.{{paramName}}, {{/allParams}} options){{^useRxJS}}.toPromise(){{/useRxJS}}; } diff --git a/samples/client/others/typescript/builds/array-of-lists/types/ObjectParamAPI.ts b/samples/client/others/typescript/builds/array-of-lists/types/ObjectParamAPI.ts index d1c0d70099ad..6f5231b86da3 100644 --- a/samples/client/others/typescript/builds/array-of-lists/types/ObjectParamAPI.ts +++ b/samples/client/others/typescript/builds/array-of-lists/types/ObjectParamAPI.ts @@ -28,7 +28,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public list(param: DefaultApiListRequest = {}, options?: Configuration | Middleware[]): Promise { + public list(param: DefaultApiListRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.list( options).toPromise(); } diff --git a/samples/client/others/typescript/builds/enum-single-value/.openapi-generator/FILES b/samples/client/others/typescript/builds/enum-single-value/.openapi-generator/FILES index 832d1d1b6d4d..f586694f5f67 100644 --- a/samples/client/others/typescript/builds/enum-single-value/.openapi-generator/FILES +++ b/samples/client/others/typescript/builds/enum-single-value/.openapi-generator/FILES @@ -11,8 +11,8 @@ http/isomorphic-fetch.ts index.ts middleware.ts models/ObjectSerializer.ts -models/SingleValueEnum30.ts -models/SingleValueEnum31.ts +models/SomeObject.ts +models/WithNullableType.ts models/all.ts package.json rxjsStub.ts diff --git a/samples/client/others/typescript/builds/enum-single-value/models/ObjectSerializer.ts b/samples/client/others/typescript/builds/enum-single-value/models/ObjectSerializer.ts index 15b6c13639d3..d44f397943e3 100644 --- a/samples/client/others/typescript/builds/enum-single-value/models/ObjectSerializer.ts +++ b/samples/client/others/typescript/builds/enum-single-value/models/ObjectSerializer.ts @@ -1,8 +1,8 @@ -export * from '../models/SingleValueEnum30'; -export * from '../models/SingleValueEnum31'; +export * from '../models/SomeObject'; +export * from '../models/WithNullableType'; -import { SingleValueEnum30, SingleValueEnum30TypeEnum } from '../models/SingleValueEnum30'; -import { SingleValueEnum31, SingleValueEnum31TypeEnum } from '../models/SingleValueEnum31'; +import { SomeObject } from '../models/SomeObject'; +import { WithNullableType } from '../models/WithNullableType'; /* tslint:disable:no-unused-variable */ let primitives = [ @@ -17,13 +17,11 @@ let primitives = [ ]; let enumsMap: Set = new Set([ - "SingleValueEnum30TypeEnum", - "SingleValueEnum31TypeEnum", ]); let typeMap: {[index: string]: any} = { - "SingleValueEnum30": SingleValueEnum30, - "SingleValueEnum31": SingleValueEnum31, + "SomeObject": SomeObject, + "WithNullableType": WithNullableType, } type MimeTypeDescriptor = { diff --git a/samples/client/others/typescript/builds/enum-single-value/models/all.ts b/samples/client/others/typescript/builds/enum-single-value/models/all.ts index dc9e55201d87..ed435990d1a4 100644 --- a/samples/client/others/typescript/builds/enum-single-value/models/all.ts +++ b/samples/client/others/typescript/builds/enum-single-value/models/all.ts @@ -1,2 +1,2 @@ -export * from '../models/SingleValueEnum30' -export * from '../models/SingleValueEnum31' +export * from '../models/SomeObject' +export * from '../models/WithNullableType' diff --git a/samples/client/others/typescript/builds/enum-single-value/types/ObjectParamAPI.ts b/samples/client/others/typescript/builds/enum-single-value/types/ObjectParamAPI.ts index 6c1d433efb38..f6e490661b04 100644 --- a/samples/client/others/typescript/builds/enum-single-value/types/ObjectParamAPI.ts +++ b/samples/client/others/typescript/builds/enum-single-value/types/ObjectParamAPI.ts @@ -2,5 +2,5 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/htt import { Configuration} from '../configuration' import type { Middleware } from "../middleware"; -import { SingleValueEnum30 } from '../models/SingleValueEnum30'; -import { SingleValueEnum31 } from '../models/SingleValueEnum31'; +import { SomeObject } from '../models/SomeObject'; +import { WithNullableType } from '../models/WithNullableType'; diff --git a/samples/client/others/typescript/builds/enum-single-value/types/ObservableAPI.ts b/samples/client/others/typescript/builds/enum-single-value/types/ObservableAPI.ts index 4d3a4f331439..8dd43da8d163 100644 --- a/samples/client/others/typescript/builds/enum-single-value/types/ObservableAPI.ts +++ b/samples/client/others/typescript/builds/enum-single-value/types/ObservableAPI.ts @@ -3,5 +3,5 @@ import { Configuration} from '../configuration' import type { Middleware } from "../middleware"; import { Observable, of, from } from '../rxjsStub'; import {mergeMap, map} from '../rxjsStub'; -import { SingleValueEnum30 } from '../models/SingleValueEnum30'; -import { SingleValueEnum31 } from '../models/SingleValueEnum31'; +import { SomeObject } from '../models/SomeObject'; +import { WithNullableType } from '../models/WithNullableType'; diff --git a/samples/client/others/typescript/builds/enum-single-value/types/PromiseAPI.ts b/samples/client/others/typescript/builds/enum-single-value/types/PromiseAPI.ts index 6c1d433efb38..f6e490661b04 100644 --- a/samples/client/others/typescript/builds/enum-single-value/types/PromiseAPI.ts +++ b/samples/client/others/typescript/builds/enum-single-value/types/PromiseAPI.ts @@ -2,5 +2,5 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/htt import { Configuration} from '../configuration' import type { Middleware } from "../middleware"; -import { SingleValueEnum30 } from '../models/SingleValueEnum30'; -import { SingleValueEnum31 } from '../models/SingleValueEnum31'; +import { SomeObject } from '../models/SomeObject'; +import { WithNullableType } from '../models/WithNullableType'; diff --git a/samples/client/others/typescript/builds/with-unique-items/types/ObjectParamAPI.ts b/samples/client/others/typescript/builds/with-unique-items/types/ObjectParamAPI.ts index 09b5873c11ef..499f39b6a75d 100644 --- a/samples/client/others/typescript/builds/with-unique-items/types/ObjectParamAPI.ts +++ b/samples/client/others/typescript/builds/with-unique-items/types/ObjectParamAPI.ts @@ -27,7 +27,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public uniqueItems(param: DefaultApiUniqueItemsRequest = {}, options?: Configuration | Middleware[]): Promise { + public uniqueItems(param: DefaultApiUniqueItemsRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.uniqueItems( options).toPromise(); } diff --git a/samples/client/others/typescript/builds/with-unique-items/types/ObservableAPI.ts b/samples/client/others/typescript/builds/with-unique-items/types/ObservableAPI.ts index 905d507a360d..4389e97bfb2b 100644 --- a/samples/client/others/typescript/builds/with-unique-items/types/ObservableAPI.ts +++ b/samples/client/others/typescript/builds/with-unique-items/types/ObservableAPI.ts @@ -53,7 +53,7 @@ export class ObservableDefaultApi { /** */ - public uniqueItems(_options?: Configuration | Middleware[]): Observable { + public uniqueItems(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.uniqueItemsWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/openapi3/client/petstore/typescript/builds/browser/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/browser/types/ObjectParamAPI.ts index b1512d688646..e397f9ec18fe 100644 --- a/samples/openapi3/client/petstore/typescript/builds/browser/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/browser/types/ObjectParamAPI.ts @@ -146,7 +146,7 @@ export class ObjectPetApi { * Add a new pet to the store * @param param the request object */ - public addPet(param: PetApiAddPetRequest, options?: Configuration | Middleware[]): Promise { + public addPet(param: PetApiAddPetRequest, options?: Configuration| Middleware[]): Promise { return this.api.addPet(param.pet, options).toPromise(); } @@ -164,7 +164,7 @@ export class ObjectPetApi { * Deletes a pet * @param param the request object */ - public deletePet(param: PetApiDeletePetRequest, options?: Configuration | Middleware[]): Promise { + public deletePet(param: PetApiDeletePetRequest, options?: Configuration| Middleware[]): Promise { return this.api.deletePet(param.petId, param.apiKey, options).toPromise(); } @@ -182,7 +182,7 @@ export class ObjectPetApi { * Finds Pets by status * @param param the request object */ - public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration | Middleware[]): Promise> { + public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration| Middleware[]): Promise> { return this.api.findPetsByStatus(param.status, options).toPromise(); } @@ -200,7 +200,7 @@ export class ObjectPetApi { * Finds Pets by tags * @param param the request object */ - public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration | Middleware[]): Promise> { + public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration| Middleware[]): Promise> { return this.api.findPetsByTags(param.tags, options).toPromise(); } @@ -218,7 +218,7 @@ export class ObjectPetApi { * Find pet by ID * @param param the request object */ - public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration | Middleware[]): Promise { + public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration| Middleware[]): Promise { return this.api.getPetById(param.petId, options).toPromise(); } @@ -236,7 +236,7 @@ export class ObjectPetApi { * Update an existing pet * @param param the request object */ - public updatePet(param: PetApiUpdatePetRequest, options?: Configuration | Middleware[]): Promise { + public updatePet(param: PetApiUpdatePetRequest, options?: Configuration| Middleware[]): Promise { return this.api.updatePet(param.pet, options).toPromise(); } @@ -254,7 +254,7 @@ export class ObjectPetApi { * Updates a pet in the store with form data * @param param the request object */ - public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration | Middleware[]): Promise { + public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration| Middleware[]): Promise { return this.api.updatePetWithForm(param.petId, param.name, param.status, options).toPromise(); } @@ -272,7 +272,7 @@ export class ObjectPetApi { * uploads an image * @param param the request object */ - public uploadFile(param: PetApiUploadFileRequest, options?: Configuration | Middleware[]): Promise { + public uploadFile(param: PetApiUploadFileRequest, options?: Configuration| Middleware[]): Promise { return this.api.uploadFile(param.petId, param.additionalMetadata, param.file, options).toPromise(); } @@ -336,7 +336,7 @@ export class ObjectStoreApi { * Delete purchase order by ID * @param param the request object */ - public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration | Middleware[]): Promise { + public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration| Middleware[]): Promise { return this.api.deleteOrder(param.orderId, options).toPromise(); } @@ -354,7 +354,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { + public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration| Middleware[]): Promise<{ [key: string]: number; }> { return this.api.getInventory( options).toPromise(); } @@ -372,7 +372,7 @@ export class ObjectStoreApi { * Find purchase order by ID * @param param the request object */ - public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration | Middleware[]): Promise { + public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration| Middleware[]): Promise { return this.api.getOrderById(param.orderId, options).toPromise(); } @@ -390,7 +390,7 @@ export class ObjectStoreApi { * Place an order for a pet * @param param the request object */ - public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration | Middleware[]): Promise { + public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration| Middleware[]): Promise { return this.api.placeOrder(param.order, options).toPromise(); } @@ -503,7 +503,7 @@ export class ObjectUserApi { * Create user * @param param the request object */ - public createUser(param: UserApiCreateUserRequest, options?: Configuration | Middleware[]): Promise { + public createUser(param: UserApiCreateUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.createUser(param.user, options).toPromise(); } @@ -521,7 +521,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration | Middleware[]): Promise { + public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration| Middleware[]): Promise { return this.api.createUsersWithArrayInput(param.user, options).toPromise(); } @@ -539,7 +539,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration | Middleware[]): Promise { + public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration| Middleware[]): Promise { return this.api.createUsersWithListInput(param.user, options).toPromise(); } @@ -557,7 +557,7 @@ export class ObjectUserApi { * Delete user * @param param the request object */ - public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration | Middleware[]): Promise { + public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.deleteUser(param.username, options).toPromise(); } @@ -575,7 +575,7 @@ export class ObjectUserApi { * Get user by user name * @param param the request object */ - public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration | Middleware[]): Promise { + public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration| Middleware[]): Promise { return this.api.getUserByName(param.username, options).toPromise(); } @@ -593,7 +593,7 @@ export class ObjectUserApi { * Logs user into the system * @param param the request object */ - public loginUser(param: UserApiLoginUserRequest, options?: Configuration | Middleware[]): Promise { + public loginUser(param: UserApiLoginUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.loginUser(param.username, param.password, options).toPromise(); } @@ -611,7 +611,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration | Middleware[]): Promise { + public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.logoutUser( options).toPromise(); } @@ -629,7 +629,7 @@ export class ObjectUserApi { * Updated user * @param param the request object */ - public updateUser(param: UserApiUpdateUserRequest, options?: Configuration | Middleware[]): Promise { + public updateUser(param: UserApiUpdateUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.updateUser(param.username, param.user, options).toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/browser/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/browser/types/ObservableAPI.ts index 585735aa7842..1ec3fc541335 100644 --- a/samples/openapi3/client/petstore/typescript/builds/browser/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/browser/types/ObservableAPI.ts @@ -64,7 +64,7 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration | Middleware[]): Observable { + public addPet(pet: Pet, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.addPetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -108,7 +108,7 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable { + public deletePet(petId: number, apiKey?: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.deletePetWithHttpInfo(petId, apiKey, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -150,7 +150,7 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable> { return this.findPetsByStatusWithHttpInfo(status, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -192,7 +192,7 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Observable> { + public findPetsByTags(tags: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable> { return this.findPetsByTagsWithHttpInfo(tags, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -234,7 +234,7 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration | Middleware[]): Observable { + public getPetById(petId: number, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.getPetByIdWithHttpInfo(petId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -276,7 +276,7 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Observable { + public updatePet(pet: Pet, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.updatePetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -322,7 +322,7 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.updatePetWithFormWithHttpInfo(petId, name, status, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -368,7 +368,7 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -428,7 +428,7 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Observable { + public deleteOrder(orderId: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.deleteOrderWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -468,7 +468,7 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration | Middleware[]): Observable<{ [key: string]: number; }> { + public getInventory(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo<{ [key: string]: number; }>) => apiResponse.data)); } @@ -510,7 +510,7 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Observable { + public getOrderById(orderId: number, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.getOrderByIdWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -552,7 +552,7 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration | Middleware[]): Observable { + public placeOrder(order: Order, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.placeOrderWithHttpInfo(order, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -612,7 +612,7 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration | Middleware[]): Observable { + public createUser(user: User, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.createUserWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -654,7 +654,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Observable { + public createUsersWithArrayInput(user: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.createUsersWithArrayInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -696,7 +696,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Observable { + public createUsersWithListInput(user: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.createUsersWithListInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -738,7 +738,7 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration | Middleware[]): Observable { + public deleteUser(username: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.deleteUserWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -780,7 +780,7 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration | Middleware[]): Observable { + public getUserByName(username: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.getUserByNameWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -824,7 +824,7 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Observable { + public loginUser(username: string, password: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.loginUserWithHttpInfo(username, password, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -864,7 +864,7 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration | Middleware[]): Observable { + public logoutUser(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.logoutUserWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -908,7 +908,7 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Observable { + public updateUser(username: string, user: User, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.updateUserWithHttpInfo(username, user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObjectParamAPI.ts index 7f87fa41cd73..7b9497221c73 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObjectParamAPI.ts @@ -57,7 +57,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public filePost(param: DefaultApiFilePostRequest = {}, options?: Configuration | Middleware[]): Promise { + public filePost(param: DefaultApiFilePostRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.filePost(param.filePostRequest, options).toPromise(); } @@ -71,7 +71,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public petsFilteredPatch(param: DefaultApiPetsFilteredPatchRequest = {}, options?: Configuration | Middleware[]): Promise { + public petsFilteredPatch(param: DefaultApiPetsFilteredPatchRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.petsFilteredPatch(param.petsFilteredPatchRequest, options).toPromise(); } @@ -85,7 +85,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public petsPatch(param: DefaultApiPetsPatchRequest = {}, options?: Configuration | Middleware[]): Promise { + public petsPatch(param: DefaultApiPetsPatchRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.petsPatch(param.petsPatchRequest, options).toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObservableAPI.ts index 4213bfc97be8..25acc307164a 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObservableAPI.ts @@ -61,7 +61,7 @@ export class ObservableDefaultApi { /** * @param [filePostRequest] */ - public filePost(filePostRequest?: FilePostRequest, _options?: Configuration | Middleware[]): Observable { + public filePost(filePostRequest?: FilePostRequest, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.filePostWithHttpInfo(filePostRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -99,7 +99,7 @@ export class ObservableDefaultApi { /** * @param [petsFilteredPatchRequest] */ - public petsFilteredPatch(petsFilteredPatchRequest?: PetsFilteredPatchRequest, _options?: Configuration | Middleware[]): Observable { + public petsFilteredPatch(petsFilteredPatchRequest?: PetsFilteredPatchRequest, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.petsFilteredPatchWithHttpInfo(petsFilteredPatchRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -137,7 +137,7 @@ export class ObservableDefaultApi { /** * @param [petsPatchRequest] */ - public petsPatch(petsPatchRequest?: PetsPatchRequest, _options?: Configuration | Middleware[]): Observable { + public petsPatch(petsPatchRequest?: PetsPatchRequest, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.petsPatchWithHttpInfo(petsPatchRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/default/types/ObjectParamAPI.ts index b1512d688646..e397f9ec18fe 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/types/ObjectParamAPI.ts @@ -146,7 +146,7 @@ export class ObjectPetApi { * Add a new pet to the store * @param param the request object */ - public addPet(param: PetApiAddPetRequest, options?: Configuration | Middleware[]): Promise { + public addPet(param: PetApiAddPetRequest, options?: Configuration| Middleware[]): Promise { return this.api.addPet(param.pet, options).toPromise(); } @@ -164,7 +164,7 @@ export class ObjectPetApi { * Deletes a pet * @param param the request object */ - public deletePet(param: PetApiDeletePetRequest, options?: Configuration | Middleware[]): Promise { + public deletePet(param: PetApiDeletePetRequest, options?: Configuration| Middleware[]): Promise { return this.api.deletePet(param.petId, param.apiKey, options).toPromise(); } @@ -182,7 +182,7 @@ export class ObjectPetApi { * Finds Pets by status * @param param the request object */ - public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration | Middleware[]): Promise> { + public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration| Middleware[]): Promise> { return this.api.findPetsByStatus(param.status, options).toPromise(); } @@ -200,7 +200,7 @@ export class ObjectPetApi { * Finds Pets by tags * @param param the request object */ - public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration | Middleware[]): Promise> { + public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration| Middleware[]): Promise> { return this.api.findPetsByTags(param.tags, options).toPromise(); } @@ -218,7 +218,7 @@ export class ObjectPetApi { * Find pet by ID * @param param the request object */ - public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration | Middleware[]): Promise { + public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration| Middleware[]): Promise { return this.api.getPetById(param.petId, options).toPromise(); } @@ -236,7 +236,7 @@ export class ObjectPetApi { * Update an existing pet * @param param the request object */ - public updatePet(param: PetApiUpdatePetRequest, options?: Configuration | Middleware[]): Promise { + public updatePet(param: PetApiUpdatePetRequest, options?: Configuration| Middleware[]): Promise { return this.api.updatePet(param.pet, options).toPromise(); } @@ -254,7 +254,7 @@ export class ObjectPetApi { * Updates a pet in the store with form data * @param param the request object */ - public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration | Middleware[]): Promise { + public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration| Middleware[]): Promise { return this.api.updatePetWithForm(param.petId, param.name, param.status, options).toPromise(); } @@ -272,7 +272,7 @@ export class ObjectPetApi { * uploads an image * @param param the request object */ - public uploadFile(param: PetApiUploadFileRequest, options?: Configuration | Middleware[]): Promise { + public uploadFile(param: PetApiUploadFileRequest, options?: Configuration| Middleware[]): Promise { return this.api.uploadFile(param.petId, param.additionalMetadata, param.file, options).toPromise(); } @@ -336,7 +336,7 @@ export class ObjectStoreApi { * Delete purchase order by ID * @param param the request object */ - public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration | Middleware[]): Promise { + public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration| Middleware[]): Promise { return this.api.deleteOrder(param.orderId, options).toPromise(); } @@ -354,7 +354,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { + public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration| Middleware[]): Promise<{ [key: string]: number; }> { return this.api.getInventory( options).toPromise(); } @@ -372,7 +372,7 @@ export class ObjectStoreApi { * Find purchase order by ID * @param param the request object */ - public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration | Middleware[]): Promise { + public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration| Middleware[]): Promise { return this.api.getOrderById(param.orderId, options).toPromise(); } @@ -390,7 +390,7 @@ export class ObjectStoreApi { * Place an order for a pet * @param param the request object */ - public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration | Middleware[]): Promise { + public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration| Middleware[]): Promise { return this.api.placeOrder(param.order, options).toPromise(); } @@ -503,7 +503,7 @@ export class ObjectUserApi { * Create user * @param param the request object */ - public createUser(param: UserApiCreateUserRequest, options?: Configuration | Middleware[]): Promise { + public createUser(param: UserApiCreateUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.createUser(param.user, options).toPromise(); } @@ -521,7 +521,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration | Middleware[]): Promise { + public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration| Middleware[]): Promise { return this.api.createUsersWithArrayInput(param.user, options).toPromise(); } @@ -539,7 +539,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration | Middleware[]): Promise { + public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration| Middleware[]): Promise { return this.api.createUsersWithListInput(param.user, options).toPromise(); } @@ -557,7 +557,7 @@ export class ObjectUserApi { * Delete user * @param param the request object */ - public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration | Middleware[]): Promise { + public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.deleteUser(param.username, options).toPromise(); } @@ -575,7 +575,7 @@ export class ObjectUserApi { * Get user by user name * @param param the request object */ - public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration | Middleware[]): Promise { + public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration| Middleware[]): Promise { return this.api.getUserByName(param.username, options).toPromise(); } @@ -593,7 +593,7 @@ export class ObjectUserApi { * Logs user into the system * @param param the request object */ - public loginUser(param: UserApiLoginUserRequest, options?: Configuration | Middleware[]): Promise { + public loginUser(param: UserApiLoginUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.loginUser(param.username, param.password, options).toPromise(); } @@ -611,7 +611,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration | Middleware[]): Promise { + public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.logoutUser( options).toPromise(); } @@ -629,7 +629,7 @@ export class ObjectUserApi { * Updated user * @param param the request object */ - public updateUser(param: UserApiUpdateUserRequest, options?: Configuration | Middleware[]): Promise { + public updateUser(param: UserApiUpdateUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.updateUser(param.username, param.user, options).toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/default/types/ObservableAPI.ts index 585735aa7842..1ec3fc541335 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/types/ObservableAPI.ts @@ -64,7 +64,7 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration | Middleware[]): Observable { + public addPet(pet: Pet, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.addPetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -108,7 +108,7 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable { + public deletePet(petId: number, apiKey?: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.deletePetWithHttpInfo(petId, apiKey, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -150,7 +150,7 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable> { return this.findPetsByStatusWithHttpInfo(status, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -192,7 +192,7 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Observable> { + public findPetsByTags(tags: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable> { return this.findPetsByTagsWithHttpInfo(tags, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -234,7 +234,7 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration | Middleware[]): Observable { + public getPetById(petId: number, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.getPetByIdWithHttpInfo(petId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -276,7 +276,7 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Observable { + public updatePet(pet: Pet, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.updatePetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -322,7 +322,7 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.updatePetWithFormWithHttpInfo(petId, name, status, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -368,7 +368,7 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -428,7 +428,7 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Observable { + public deleteOrder(orderId: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.deleteOrderWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -468,7 +468,7 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration | Middleware[]): Observable<{ [key: string]: number; }> { + public getInventory(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo<{ [key: string]: number; }>) => apiResponse.data)); } @@ -510,7 +510,7 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Observable { + public getOrderById(orderId: number, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.getOrderByIdWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -552,7 +552,7 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration | Middleware[]): Observable { + public placeOrder(order: Order, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.placeOrderWithHttpInfo(order, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -612,7 +612,7 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration | Middleware[]): Observable { + public createUser(user: User, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.createUserWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -654,7 +654,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Observable { + public createUsersWithArrayInput(user: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.createUsersWithArrayInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -696,7 +696,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Observable { + public createUsersWithListInput(user: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.createUsersWithListInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -738,7 +738,7 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration | Middleware[]): Observable { + public deleteUser(username: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.deleteUserWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -780,7 +780,7 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration | Middleware[]): Observable { + public getUserByName(username: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.getUserByNameWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -824,7 +824,7 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Observable { + public loginUser(username: string, password: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.loginUserWithHttpInfo(username, password, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -864,7 +864,7 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration | Middleware[]): Observable { + public logoutUser(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.logoutUserWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -908,7 +908,7 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Observable { + public updateUser(username: string, user: User, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.updateUserWithHttpInfo(username, user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/deno/types/ObjectParamAPI.ts index 654b88cad6b4..b7286b08c427 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/types/ObjectParamAPI.ts @@ -146,7 +146,7 @@ export class ObjectPetApi { * Add a new pet to the store * @param param the request object */ - public addPet(param: PetApiAddPetRequest, options?: Configuration | Middleware[]): Promise { + public addPet(param: PetApiAddPetRequest, options?: Configuration| Middleware[]): Promise { return this.api.addPet(param.pet, options).toPromise(); } @@ -164,7 +164,7 @@ export class ObjectPetApi { * Deletes a pet * @param param the request object */ - public deletePet(param: PetApiDeletePetRequest, options?: Configuration | Middleware[]): Promise { + public deletePet(param: PetApiDeletePetRequest, options?: Configuration| Middleware[]): Promise { return this.api.deletePet(param.petId, param.apiKey, options).toPromise(); } @@ -182,7 +182,7 @@ export class ObjectPetApi { * Finds Pets by status * @param param the request object */ - public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration | Middleware[]): Promise> { + public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration| Middleware[]): Promise> { return this.api.findPetsByStatus(param.status, options).toPromise(); } @@ -200,7 +200,7 @@ export class ObjectPetApi { * Finds Pets by tags * @param param the request object */ - public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration | Middleware[]): Promise> { + public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration| Middleware[]): Promise> { return this.api.findPetsByTags(param.tags, options).toPromise(); } @@ -218,7 +218,7 @@ export class ObjectPetApi { * Find pet by ID * @param param the request object */ - public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration | Middleware[]): Promise { + public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration| Middleware[]): Promise { return this.api.getPetById(param.petId, options).toPromise(); } @@ -236,7 +236,7 @@ export class ObjectPetApi { * Update an existing pet * @param param the request object */ - public updatePet(param: PetApiUpdatePetRequest, options?: Configuration | Middleware[]): Promise { + public updatePet(param: PetApiUpdatePetRequest, options?: Configuration| Middleware[]): Promise { return this.api.updatePet(param.pet, options).toPromise(); } @@ -254,7 +254,7 @@ export class ObjectPetApi { * Updates a pet in the store with form data * @param param the request object */ - public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration | Middleware[]): Promise { + public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration| Middleware[]): Promise { return this.api.updatePetWithForm(param.petId, param.name, param.status, options).toPromise(); } @@ -272,7 +272,7 @@ export class ObjectPetApi { * uploads an image * @param param the request object */ - public uploadFile(param: PetApiUploadFileRequest, options?: Configuration | Middleware[]): Promise { + public uploadFile(param: PetApiUploadFileRequest, options?: Configuration| Middleware[]): Promise { return this.api.uploadFile(param.petId, param.additionalMetadata, param.file, options).toPromise(); } @@ -336,7 +336,7 @@ export class ObjectStoreApi { * Delete purchase order by ID * @param param the request object */ - public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration | Middleware[]): Promise { + public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration| Middleware[]): Promise { return this.api.deleteOrder(param.orderId, options).toPromise(); } @@ -354,7 +354,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { + public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration| Middleware[]): Promise<{ [key: string]: number; }> { return this.api.getInventory( options).toPromise(); } @@ -372,7 +372,7 @@ export class ObjectStoreApi { * Find purchase order by ID * @param param the request object */ - public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration | Middleware[]): Promise { + public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration| Middleware[]): Promise { return this.api.getOrderById(param.orderId, options).toPromise(); } @@ -390,7 +390,7 @@ export class ObjectStoreApi { * Place an order for a pet * @param param the request object */ - public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration | Middleware[]): Promise { + public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration| Middleware[]): Promise { return this.api.placeOrder(param.order, options).toPromise(); } @@ -503,7 +503,7 @@ export class ObjectUserApi { * Create user * @param param the request object */ - public createUser(param: UserApiCreateUserRequest, options?: Configuration | Middleware[]): Promise { + public createUser(param: UserApiCreateUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.createUser(param.user, options).toPromise(); } @@ -521,7 +521,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration | Middleware[]): Promise { + public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration| Middleware[]): Promise { return this.api.createUsersWithArrayInput(param.user, options).toPromise(); } @@ -539,7 +539,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration | Middleware[]): Promise { + public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration| Middleware[]): Promise { return this.api.createUsersWithListInput(param.user, options).toPromise(); } @@ -557,7 +557,7 @@ export class ObjectUserApi { * Delete user * @param param the request object */ - public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration | Middleware[]): Promise { + public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.deleteUser(param.username, options).toPromise(); } @@ -575,7 +575,7 @@ export class ObjectUserApi { * Get user by user name * @param param the request object */ - public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration | Middleware[]): Promise { + public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration| Middleware[]): Promise { return this.api.getUserByName(param.username, options).toPromise(); } @@ -593,7 +593,7 @@ export class ObjectUserApi { * Logs user into the system * @param param the request object */ - public loginUser(param: UserApiLoginUserRequest, options?: Configuration | Middleware[]): Promise { + public loginUser(param: UserApiLoginUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.loginUser(param.username, param.password, options).toPromise(); } @@ -611,7 +611,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration | Middleware[]): Promise { + public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.logoutUser( options).toPromise(); } @@ -629,7 +629,7 @@ export class ObjectUserApi { * Updated user * @param param the request object */ - public updateUser(param: UserApiUpdateUserRequest, options?: Configuration | Middleware[]): Promise { + public updateUser(param: UserApiUpdateUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.updateUser(param.username, param.user, options).toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/deno/types/ObservableAPI.ts index a9173ffe386a..a1ecc227cf45 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/types/ObservableAPI.ts @@ -64,7 +64,7 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration | Middleware[]): Observable { + public addPet(pet: Pet, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.addPetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -108,7 +108,7 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable { + public deletePet(petId: number, apiKey?: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.deletePetWithHttpInfo(petId, apiKey, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -150,7 +150,7 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable> { return this.findPetsByStatusWithHttpInfo(status, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -192,7 +192,7 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Observable> { + public findPetsByTags(tags: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable> { return this.findPetsByTagsWithHttpInfo(tags, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -234,7 +234,7 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration | Middleware[]): Observable { + public getPetById(petId: number, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.getPetByIdWithHttpInfo(petId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -276,7 +276,7 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Observable { + public updatePet(pet: Pet, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.updatePetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -322,7 +322,7 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.updatePetWithFormWithHttpInfo(petId, name, status, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -368,7 +368,7 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -428,7 +428,7 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Observable { + public deleteOrder(orderId: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.deleteOrderWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -468,7 +468,7 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration | Middleware[]): Observable<{ [key: string]: number; }> { + public getInventory(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo<{ [key: string]: number; }>) => apiResponse.data)); } @@ -510,7 +510,7 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Observable { + public getOrderById(orderId: number, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.getOrderByIdWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -552,7 +552,7 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration | Middleware[]): Observable { + public placeOrder(order: Order, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.placeOrderWithHttpInfo(order, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -612,7 +612,7 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration | Middleware[]): Observable { + public createUser(user: User, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.createUserWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -654,7 +654,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Observable { + public createUsersWithArrayInput(user: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.createUsersWithArrayInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -696,7 +696,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Observable { + public createUsersWithListInput(user: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.createUsersWithListInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -738,7 +738,7 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration | Middleware[]): Observable { + public deleteUser(username: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.deleteUserWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -780,7 +780,7 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration | Middleware[]): Observable { + public getUserByName(username: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.getUserByNameWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -824,7 +824,7 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Observable { + public loginUser(username: string, password: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.loginUserWithHttpInfo(username, password, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -864,7 +864,7 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration | Middleware[]): Observable { + public logoutUser(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.logoutUserWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -908,7 +908,7 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Observable { + public updateUser(username: string, user: User, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.updateUserWithHttpInfo(username, user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/ObjectParamAPI.ts index 654b88cad6b4..b7286b08c427 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/ObjectParamAPI.ts @@ -146,7 +146,7 @@ export class ObjectPetApi { * Add a new pet to the store * @param param the request object */ - public addPet(param: PetApiAddPetRequest, options?: Configuration | Middleware[]): Promise { + public addPet(param: PetApiAddPetRequest, options?: Configuration| Middleware[]): Promise { return this.api.addPet(param.pet, options).toPromise(); } @@ -164,7 +164,7 @@ export class ObjectPetApi { * Deletes a pet * @param param the request object */ - public deletePet(param: PetApiDeletePetRequest, options?: Configuration | Middleware[]): Promise { + public deletePet(param: PetApiDeletePetRequest, options?: Configuration| Middleware[]): Promise { return this.api.deletePet(param.petId, param.apiKey, options).toPromise(); } @@ -182,7 +182,7 @@ export class ObjectPetApi { * Finds Pets by status * @param param the request object */ - public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration | Middleware[]): Promise> { + public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration| Middleware[]): Promise> { return this.api.findPetsByStatus(param.status, options).toPromise(); } @@ -200,7 +200,7 @@ export class ObjectPetApi { * Finds Pets by tags * @param param the request object */ - public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration | Middleware[]): Promise> { + public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration| Middleware[]): Promise> { return this.api.findPetsByTags(param.tags, options).toPromise(); } @@ -218,7 +218,7 @@ export class ObjectPetApi { * Find pet by ID * @param param the request object */ - public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration | Middleware[]): Promise { + public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration| Middleware[]): Promise { return this.api.getPetById(param.petId, options).toPromise(); } @@ -236,7 +236,7 @@ export class ObjectPetApi { * Update an existing pet * @param param the request object */ - public updatePet(param: PetApiUpdatePetRequest, options?: Configuration | Middleware[]): Promise { + public updatePet(param: PetApiUpdatePetRequest, options?: Configuration| Middleware[]): Promise { return this.api.updatePet(param.pet, options).toPromise(); } @@ -254,7 +254,7 @@ export class ObjectPetApi { * Updates a pet in the store with form data * @param param the request object */ - public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration | Middleware[]): Promise { + public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration| Middleware[]): Promise { return this.api.updatePetWithForm(param.petId, param.name, param.status, options).toPromise(); } @@ -272,7 +272,7 @@ export class ObjectPetApi { * uploads an image * @param param the request object */ - public uploadFile(param: PetApiUploadFileRequest, options?: Configuration | Middleware[]): Promise { + public uploadFile(param: PetApiUploadFileRequest, options?: Configuration| Middleware[]): Promise { return this.api.uploadFile(param.petId, param.additionalMetadata, param.file, options).toPromise(); } @@ -336,7 +336,7 @@ export class ObjectStoreApi { * Delete purchase order by ID * @param param the request object */ - public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration | Middleware[]): Promise { + public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration| Middleware[]): Promise { return this.api.deleteOrder(param.orderId, options).toPromise(); } @@ -354,7 +354,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { + public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration| Middleware[]): Promise<{ [key: string]: number; }> { return this.api.getInventory( options).toPromise(); } @@ -372,7 +372,7 @@ export class ObjectStoreApi { * Find purchase order by ID * @param param the request object */ - public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration | Middleware[]): Promise { + public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration| Middleware[]): Promise { return this.api.getOrderById(param.orderId, options).toPromise(); } @@ -390,7 +390,7 @@ export class ObjectStoreApi { * Place an order for a pet * @param param the request object */ - public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration | Middleware[]): Promise { + public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration| Middleware[]): Promise { return this.api.placeOrder(param.order, options).toPromise(); } @@ -503,7 +503,7 @@ export class ObjectUserApi { * Create user * @param param the request object */ - public createUser(param: UserApiCreateUserRequest, options?: Configuration | Middleware[]): Promise { + public createUser(param: UserApiCreateUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.createUser(param.user, options).toPromise(); } @@ -521,7 +521,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration | Middleware[]): Promise { + public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration| Middleware[]): Promise { return this.api.createUsersWithArrayInput(param.user, options).toPromise(); } @@ -539,7 +539,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration | Middleware[]): Promise { + public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration| Middleware[]): Promise { return this.api.createUsersWithListInput(param.user, options).toPromise(); } @@ -557,7 +557,7 @@ export class ObjectUserApi { * Delete user * @param param the request object */ - public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration | Middleware[]): Promise { + public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.deleteUser(param.username, options).toPromise(); } @@ -575,7 +575,7 @@ export class ObjectUserApi { * Get user by user name * @param param the request object */ - public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration | Middleware[]): Promise { + public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration| Middleware[]): Promise { return this.api.getUserByName(param.username, options).toPromise(); } @@ -593,7 +593,7 @@ export class ObjectUserApi { * Logs user into the system * @param param the request object */ - public loginUser(param: UserApiLoginUserRequest, options?: Configuration | Middleware[]): Promise { + public loginUser(param: UserApiLoginUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.loginUser(param.username, param.password, options).toPromise(); } @@ -611,7 +611,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration | Middleware[]): Promise { + public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.logoutUser( options).toPromise(); } @@ -629,7 +629,7 @@ export class ObjectUserApi { * Updated user * @param param the request object */ - public updateUser(param: UserApiUpdateUserRequest, options?: Configuration | Middleware[]): Promise { + public updateUser(param: UserApiUpdateUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.updateUser(param.username, param.user, options).toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/ObservableAPI.ts index a9173ffe386a..a1ecc227cf45 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/ObservableAPI.ts @@ -64,7 +64,7 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration | Middleware[]): Observable { + public addPet(pet: Pet, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.addPetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -108,7 +108,7 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable { + public deletePet(petId: number, apiKey?: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.deletePetWithHttpInfo(petId, apiKey, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -150,7 +150,7 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable> { return this.findPetsByStatusWithHttpInfo(status, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -192,7 +192,7 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Observable> { + public findPetsByTags(tags: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable> { return this.findPetsByTagsWithHttpInfo(tags, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -234,7 +234,7 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration | Middleware[]): Observable { + public getPetById(petId: number, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.getPetByIdWithHttpInfo(petId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -276,7 +276,7 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Observable { + public updatePet(pet: Pet, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.updatePetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -322,7 +322,7 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.updatePetWithFormWithHttpInfo(petId, name, status, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -368,7 +368,7 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -428,7 +428,7 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Observable { + public deleteOrder(orderId: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.deleteOrderWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -468,7 +468,7 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration | Middleware[]): Observable<{ [key: string]: number; }> { + public getInventory(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo<{ [key: string]: number; }>) => apiResponse.data)); } @@ -510,7 +510,7 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Observable { + public getOrderById(orderId: number, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.getOrderByIdWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -552,7 +552,7 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration | Middleware[]): Observable { + public placeOrder(order: Order, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.placeOrderWithHttpInfo(order, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -612,7 +612,7 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration | Middleware[]): Observable { + public createUser(user: User, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.createUserWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -654,7 +654,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Observable { + public createUsersWithArrayInput(user: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.createUsersWithArrayInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -696,7 +696,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Observable { + public createUsersWithListInput(user: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.createUsersWithListInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -738,7 +738,7 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration | Middleware[]): Observable { + public deleteUser(username: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.deleteUserWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -780,7 +780,7 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration | Middleware[]): Observable { + public getUserByName(username: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.getUserByNameWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -824,7 +824,7 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Observable { + public loginUser(username: string, password: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.loginUserWithHttpInfo(username, password, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -864,7 +864,7 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration | Middleware[]): Observable { + public logoutUser(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.logoutUserWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -908,7 +908,7 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Observable { + public updateUser(username: string, user: User, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.updateUserWithHttpInfo(username, user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/PetApi.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/PetApi.ts index 02345624cd51..b25c56977c63 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/PetApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/PetApi.ts @@ -1,7 +1,6 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; -import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import FormData from "form-data"; import { URLSearchParams } from 'url'; @@ -26,7 +25,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public async addPet(pet: Pet, _options?: Configuration | Middleware[]): Promise { + public async addPet(pet: Pet, _options?: Configuration): Promise { let _config = this.configuration; if (_options && !Array.isArray(_options)){ _config = _options @@ -76,7 +75,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param petId Pet id to delete * @param apiKey */ - public async deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise { + public async deletePet(petId: number, apiKey?: string, _options?: Configuration): Promise { let _config = this.configuration; if (_options && !Array.isArray(_options)){ _config = _options @@ -117,7 +116,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise { + public async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise { let _config = this.configuration; if (_options && !Array.isArray(_options)){ _config = _options @@ -158,7 +157,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Finds Pets by tags * @param tags Tags to filter by */ - public async findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Promise { + public async findPetsByTags(tags: Array, _options?: Configuration): Promise { let _config = this.configuration; if (_options && !Array.isArray(_options)){ _config = _options @@ -199,7 +198,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Find pet by ID * @param petId ID of pet to return */ - public async getPetById(petId: number, _options?: Configuration | Middleware[]): Promise { + public async getPetById(petId: number, _options?: Configuration): Promise { let _config = this.configuration; if (_options && !Array.isArray(_options)){ _config = _options @@ -236,7 +235,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public async updatePet(pet: Pet, _options?: Configuration | Middleware[]): Promise { + public async updatePet(pet: Pet, _options?: Configuration): Promise { let _config = this.configuration; if (_options && !Array.isArray(_options)){ _config = _options @@ -287,7 +286,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param name Updated name of the pet * @param status Updated status of the pet */ - public async updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise { + public async updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Promise { let _config = this.configuration; if (_options && !Array.isArray(_options)){ _config = _options @@ -357,7 +356,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - public async uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise { + public async uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise { let _config = this.configuration; if (_options && !Array.isArray(_options)){ _config = _options diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/StoreApi.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/StoreApi.ts index dc6a44a10944..62d3e627f805 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/StoreApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/StoreApi.ts @@ -1,7 +1,6 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; -import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import FormData from "form-data"; import { URLSearchParams } from 'url'; @@ -25,7 +24,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public async deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Promise { + public async deleteOrder(orderId: string, _options?: Configuration): Promise { let _config = this.configuration; if (_options && !Array.isArray(_options)){ _config = _options @@ -55,7 +54,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public async getInventory(_options?: Configuration | Middleware[]): Promise { + public async getInventory(_options?: Configuration): Promise { let _config = this.configuration; if (_options && !Array.isArray(_options)){ _config = _options @@ -85,7 +84,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public async getOrderById(orderId: number, _options?: Configuration | Middleware[]): Promise { + public async getOrderById(orderId: number, _options?: Configuration): Promise { let _config = this.configuration; if (_options && !Array.isArray(_options)){ _config = _options @@ -116,7 +115,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory { * Place an order for a pet * @param order order placed for purchasing the pet */ - public async placeOrder(order: Order, _options?: Configuration | Middleware[]): Promise { + public async placeOrder(order: Order, _options?: Configuration): Promise { let _config = this.configuration; if (_options && !Array.isArray(_options)){ _config = _options diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/UserApi.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/UserApi.ts index 109522d8c67f..ff6fd7050798 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/apis/UserApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/apis/UserApi.ts @@ -1,7 +1,6 @@ // TODO: better import syntax? import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi'; import {Configuration} from '../configuration'; -import {Middleware} from '../middleware'; import {RequestContext, HttpMethod, ResponseContext, HttpFile, HttpInfo} from '../http/http'; import FormData from "form-data"; import { URLSearchParams } from 'url'; @@ -25,7 +24,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Create user * @param user Created user object */ - public async createUser(user: User, _options?: Configuration | Middleware[]): Promise { + public async createUser(user: User, _options?: Configuration): Promise { let _config = this.configuration; if (_options && !Array.isArray(_options)){ _config = _options @@ -72,7 +71,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Creates list of users with given input array * @param user List of user object */ - public async createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Promise { + public async createUsersWithArrayInput(user: Array, _options?: Configuration): Promise { let _config = this.configuration; if (_options && !Array.isArray(_options)){ _config = _options @@ -119,7 +118,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Creates list of users with given input array * @param user List of user object */ - public async createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Promise { + public async createUsersWithListInput(user: Array, _options?: Configuration): Promise { let _config = this.configuration; if (_options && !Array.isArray(_options)){ _config = _options @@ -166,7 +165,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Delete user * @param username The name that needs to be deleted */ - public async deleteUser(username: string, _options?: Configuration | Middleware[]): Promise { + public async deleteUser(username: string, _options?: Configuration): Promise { let _config = this.configuration; if (_options && !Array.isArray(_options)){ _config = _options @@ -203,7 +202,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public async getUserByName(username: string, _options?: Configuration | Middleware[]): Promise { + public async getUserByName(username: string, _options?: Configuration): Promise { let _config = this.configuration; if (_options && !Array.isArray(_options)){ _config = _options @@ -235,7 +234,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * @param username The user name for login * @param password The password for login in clear text */ - public async loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Promise { + public async loginUser(username: string, password: string, _options?: Configuration): Promise { let _config = this.configuration; if (_options && !Array.isArray(_options)){ _config = _options @@ -280,7 +279,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * * Logs out current logged in user session */ - public async logoutUser(_options?: Configuration | Middleware[]): Promise { + public async logoutUser(_options?: Configuration): Promise { let _config = this.configuration; if (_options && !Array.isArray(_options)){ _config = _options @@ -311,7 +310,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory { * @param username name that need to be deleted * @param user Updated user object */ - public async updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Promise { + public async updateUser(username: string, user: User, _options?: Configuration): Promise { let _config = this.configuration; if (_options && !Array.isArray(_options)){ _config = _options diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObjectParamAPI.ts index b1512d688646..568cc5c507b1 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObjectParamAPI.ts @@ -1,6 +1,5 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' -import type { Middleware } from "../middleware"; import { ApiResponse } from '../models/ApiResponse'; import { Category } from '../models/Category'; @@ -137,7 +136,7 @@ export class ObjectPetApi { * Add a new pet to the store * @param param the request object */ - public addPetWithHttpInfo(param: PetApiAddPetRequest, options?: Configuration | Middleware[]): Promise> { + public addPetWithHttpInfo(param: PetApiAddPetRequest, options?: Configuration): Promise> { return this.api.addPetWithHttpInfo(param.pet, options).toPromise(); } @@ -146,7 +145,7 @@ export class ObjectPetApi { * Add a new pet to the store * @param param the request object */ - public addPet(param: PetApiAddPetRequest, options?: Configuration | Middleware[]): Promise { + public addPet(param: PetApiAddPetRequest, options?: Configuration): Promise { return this.api.addPet(param.pet, options).toPromise(); } @@ -155,7 +154,7 @@ export class ObjectPetApi { * Deletes a pet * @param param the request object */ - public deletePetWithHttpInfo(param: PetApiDeletePetRequest, options?: Configuration | Middleware[]): Promise> { + public deletePetWithHttpInfo(param: PetApiDeletePetRequest, options?: Configuration): Promise> { return this.api.deletePetWithHttpInfo(param.petId, param.apiKey, options).toPromise(); } @@ -164,7 +163,7 @@ export class ObjectPetApi { * Deletes a pet * @param param the request object */ - public deletePet(param: PetApiDeletePetRequest, options?: Configuration | Middleware[]): Promise { + public deletePet(param: PetApiDeletePetRequest, options?: Configuration): Promise { return this.api.deletePet(param.petId, param.apiKey, options).toPromise(); } @@ -173,7 +172,7 @@ export class ObjectPetApi { * Finds Pets by status * @param param the request object */ - public findPetsByStatusWithHttpInfo(param: PetApiFindPetsByStatusRequest, options?: Configuration | Middleware[]): Promise>> { + public findPetsByStatusWithHttpInfo(param: PetApiFindPetsByStatusRequest, options?: Configuration): Promise>> { return this.api.findPetsByStatusWithHttpInfo(param.status, options).toPromise(); } @@ -182,7 +181,7 @@ export class ObjectPetApi { * Finds Pets by status * @param param the request object */ - public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration | Middleware[]): Promise> { + public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration): Promise> { return this.api.findPetsByStatus(param.status, options).toPromise(); } @@ -191,7 +190,7 @@ export class ObjectPetApi { * Finds Pets by tags * @param param the request object */ - public findPetsByTagsWithHttpInfo(param: PetApiFindPetsByTagsRequest, options?: Configuration | Middleware[]): Promise>> { + public findPetsByTagsWithHttpInfo(param: PetApiFindPetsByTagsRequest, options?: Configuration): Promise>> { return this.api.findPetsByTagsWithHttpInfo(param.tags, options).toPromise(); } @@ -200,7 +199,7 @@ export class ObjectPetApi { * Finds Pets by tags * @param param the request object */ - public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration | Middleware[]): Promise> { + public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration): Promise> { return this.api.findPetsByTags(param.tags, options).toPromise(); } @@ -209,7 +208,7 @@ export class ObjectPetApi { * Find pet by ID * @param param the request object */ - public getPetByIdWithHttpInfo(param: PetApiGetPetByIdRequest, options?: Configuration | Middleware[]): Promise> { + public getPetByIdWithHttpInfo(param: PetApiGetPetByIdRequest, options?: Configuration): Promise> { return this.api.getPetByIdWithHttpInfo(param.petId, options).toPromise(); } @@ -218,7 +217,7 @@ export class ObjectPetApi { * Find pet by ID * @param param the request object */ - public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration | Middleware[]): Promise { + public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration): Promise { return this.api.getPetById(param.petId, options).toPromise(); } @@ -227,7 +226,7 @@ export class ObjectPetApi { * Update an existing pet * @param param the request object */ - public updatePetWithHttpInfo(param: PetApiUpdatePetRequest, options?: Configuration | Middleware[]): Promise> { + public updatePetWithHttpInfo(param: PetApiUpdatePetRequest, options?: Configuration): Promise> { return this.api.updatePetWithHttpInfo(param.pet, options).toPromise(); } @@ -236,7 +235,7 @@ export class ObjectPetApi { * Update an existing pet * @param param the request object */ - public updatePet(param: PetApiUpdatePetRequest, options?: Configuration | Middleware[]): Promise { + public updatePet(param: PetApiUpdatePetRequest, options?: Configuration): Promise { return this.api.updatePet(param.pet, options).toPromise(); } @@ -245,7 +244,7 @@ export class ObjectPetApi { * Updates a pet in the store with form data * @param param the request object */ - public updatePetWithFormWithHttpInfo(param: PetApiUpdatePetWithFormRequest, options?: Configuration | Middleware[]): Promise> { + public updatePetWithFormWithHttpInfo(param: PetApiUpdatePetWithFormRequest, options?: Configuration): Promise> { return this.api.updatePetWithFormWithHttpInfo(param.petId, param.name, param.status, options).toPromise(); } @@ -254,7 +253,7 @@ export class ObjectPetApi { * Updates a pet in the store with form data * @param param the request object */ - public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration | Middleware[]): Promise { + public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration): Promise { return this.api.updatePetWithForm(param.petId, param.name, param.status, options).toPromise(); } @@ -263,7 +262,7 @@ export class ObjectPetApi { * uploads an image * @param param the request object */ - public uploadFileWithHttpInfo(param: PetApiUploadFileRequest, options?: Configuration | Middleware[]): Promise> { + public uploadFileWithHttpInfo(param: PetApiUploadFileRequest, options?: Configuration): Promise> { return this.api.uploadFileWithHttpInfo(param.petId, param.additionalMetadata, param.file, options).toPromise(); } @@ -272,7 +271,7 @@ export class ObjectPetApi { * uploads an image * @param param the request object */ - public uploadFile(param: PetApiUploadFileRequest, options?: Configuration | Middleware[]): Promise { + public uploadFile(param: PetApiUploadFileRequest, options?: Configuration): Promise { return this.api.uploadFile(param.petId, param.additionalMetadata, param.file, options).toPromise(); } @@ -327,7 +326,7 @@ export class ObjectStoreApi { * Delete purchase order by ID * @param param the request object */ - public deleteOrderWithHttpInfo(param: StoreApiDeleteOrderRequest, options?: Configuration | Middleware[]): Promise> { + public deleteOrderWithHttpInfo(param: StoreApiDeleteOrderRequest, options?: Configuration): Promise> { return this.api.deleteOrderWithHttpInfo(param.orderId, options).toPromise(); } @@ -336,7 +335,7 @@ export class ObjectStoreApi { * Delete purchase order by ID * @param param the request object */ - public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration | Middleware[]): Promise { + public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration): Promise { return this.api.deleteOrder(param.orderId, options).toPromise(); } @@ -345,7 +344,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventoryWithHttpInfo(param: StoreApiGetInventoryRequest = {}, options?: Configuration | Middleware[]): Promise> { + public getInventoryWithHttpInfo(param: StoreApiGetInventoryRequest = {}, options?: Configuration): Promise> { return this.api.getInventoryWithHttpInfo( options).toPromise(); } @@ -354,7 +353,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { + public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration): Promise<{ [key: string]: number; }> { return this.api.getInventory( options).toPromise(); } @@ -363,7 +362,7 @@ export class ObjectStoreApi { * Find purchase order by ID * @param param the request object */ - public getOrderByIdWithHttpInfo(param: StoreApiGetOrderByIdRequest, options?: Configuration | Middleware[]): Promise> { + public getOrderByIdWithHttpInfo(param: StoreApiGetOrderByIdRequest, options?: Configuration): Promise> { return this.api.getOrderByIdWithHttpInfo(param.orderId, options).toPromise(); } @@ -372,7 +371,7 @@ export class ObjectStoreApi { * Find purchase order by ID * @param param the request object */ - public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration | Middleware[]): Promise { + public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration): Promise { return this.api.getOrderById(param.orderId, options).toPromise(); } @@ -381,7 +380,7 @@ export class ObjectStoreApi { * Place an order for a pet * @param param the request object */ - public placeOrderWithHttpInfo(param: StoreApiPlaceOrderRequest, options?: Configuration | Middleware[]): Promise> { + public placeOrderWithHttpInfo(param: StoreApiPlaceOrderRequest, options?: Configuration): Promise> { return this.api.placeOrderWithHttpInfo(param.order, options).toPromise(); } @@ -390,7 +389,7 @@ export class ObjectStoreApi { * Place an order for a pet * @param param the request object */ - public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration | Middleware[]): Promise { + public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration): Promise { return this.api.placeOrder(param.order, options).toPromise(); } @@ -494,7 +493,7 @@ export class ObjectUserApi { * Create user * @param param the request object */ - public createUserWithHttpInfo(param: UserApiCreateUserRequest, options?: Configuration | Middleware[]): Promise> { + public createUserWithHttpInfo(param: UserApiCreateUserRequest, options?: Configuration): Promise> { return this.api.createUserWithHttpInfo(param.user, options).toPromise(); } @@ -503,7 +502,7 @@ export class ObjectUserApi { * Create user * @param param the request object */ - public createUser(param: UserApiCreateUserRequest, options?: Configuration | Middleware[]): Promise { + public createUser(param: UserApiCreateUserRequest, options?: Configuration): Promise { return this.api.createUser(param.user, options).toPromise(); } @@ -512,7 +511,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithArrayInputWithHttpInfo(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration | Middleware[]): Promise> { + public createUsersWithArrayInputWithHttpInfo(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration): Promise> { return this.api.createUsersWithArrayInputWithHttpInfo(param.user, options).toPromise(); } @@ -521,7 +520,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration | Middleware[]): Promise { + public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration): Promise { return this.api.createUsersWithArrayInput(param.user, options).toPromise(); } @@ -530,7 +529,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithListInputWithHttpInfo(param: UserApiCreateUsersWithListInputRequest, options?: Configuration | Middleware[]): Promise> { + public createUsersWithListInputWithHttpInfo(param: UserApiCreateUsersWithListInputRequest, options?: Configuration): Promise> { return this.api.createUsersWithListInputWithHttpInfo(param.user, options).toPromise(); } @@ -539,7 +538,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration | Middleware[]): Promise { + public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration): Promise { return this.api.createUsersWithListInput(param.user, options).toPromise(); } @@ -548,7 +547,7 @@ export class ObjectUserApi { * Delete user * @param param the request object */ - public deleteUserWithHttpInfo(param: UserApiDeleteUserRequest, options?: Configuration | Middleware[]): Promise> { + public deleteUserWithHttpInfo(param: UserApiDeleteUserRequest, options?: Configuration): Promise> { return this.api.deleteUserWithHttpInfo(param.username, options).toPromise(); } @@ -557,7 +556,7 @@ export class ObjectUserApi { * Delete user * @param param the request object */ - public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration | Middleware[]): Promise { + public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration): Promise { return this.api.deleteUser(param.username, options).toPromise(); } @@ -566,7 +565,7 @@ export class ObjectUserApi { * Get user by user name * @param param the request object */ - public getUserByNameWithHttpInfo(param: UserApiGetUserByNameRequest, options?: Configuration | Middleware[]): Promise> { + public getUserByNameWithHttpInfo(param: UserApiGetUserByNameRequest, options?: Configuration): Promise> { return this.api.getUserByNameWithHttpInfo(param.username, options).toPromise(); } @@ -575,7 +574,7 @@ export class ObjectUserApi { * Get user by user name * @param param the request object */ - public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration | Middleware[]): Promise { + public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration): Promise { return this.api.getUserByName(param.username, options).toPromise(); } @@ -584,7 +583,7 @@ export class ObjectUserApi { * Logs user into the system * @param param the request object */ - public loginUserWithHttpInfo(param: UserApiLoginUserRequest, options?: Configuration | Middleware[]): Promise> { + public loginUserWithHttpInfo(param: UserApiLoginUserRequest, options?: Configuration): Promise> { return this.api.loginUserWithHttpInfo(param.username, param.password, options).toPromise(); } @@ -593,7 +592,7 @@ export class ObjectUserApi { * Logs user into the system * @param param the request object */ - public loginUser(param: UserApiLoginUserRequest, options?: Configuration | Middleware[]): Promise { + public loginUser(param: UserApiLoginUserRequest, options?: Configuration): Promise { return this.api.loginUser(param.username, param.password, options).toPromise(); } @@ -602,7 +601,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUserWithHttpInfo(param: UserApiLogoutUserRequest = {}, options?: Configuration | Middleware[]): Promise> { + public logoutUserWithHttpInfo(param: UserApiLogoutUserRequest = {}, options?: Configuration): Promise> { return this.api.logoutUserWithHttpInfo( options).toPromise(); } @@ -611,7 +610,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration | Middleware[]): Promise { + public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration): Promise { return this.api.logoutUser( options).toPromise(); } @@ -620,7 +619,7 @@ export class ObjectUserApi { * Updated user * @param param the request object */ - public updateUserWithHttpInfo(param: UserApiUpdateUserRequest, options?: Configuration | Middleware[]): Promise> { + public updateUserWithHttpInfo(param: UserApiUpdateUserRequest, options?: Configuration): Promise> { return this.api.updateUserWithHttpInfo(param.username, param.user, options).toPromise(); } @@ -629,7 +628,7 @@ export class ObjectUserApi { * Updated user * @param param the request object */ - public updateUser(param: UserApiUpdateUserRequest, options?: Configuration | Middleware[]): Promise { + public updateUser(param: UserApiUpdateUserRequest, options?: Configuration): Promise { return this.api.updateUser(param.username, param.user, options).toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObservableAPI.ts index bf9ab6df7c5c..5bdce1ad0d42 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObservableAPI.ts @@ -1,6 +1,5 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' -import type { Middleware } from "../middleware"; import { Observable, of, from } from '../rxjsStub'; import {mergeMap, map} from '../rxjsStub'; import { injectable, inject, optional } from "inversify"; @@ -36,7 +35,7 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Observable> { + public addPetWithHttpInfo(pet: Pet, _options?: Configuration): Observable> { let configuration = undefined let calltimeMiddleware: Middleware[] = [] if (Array.isArray(_options)){ @@ -69,7 +68,7 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration | Middleware[]): Observable { + public addPet(pet: Pet, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.addPetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -79,7 +78,7 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable> { + public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration): Observable> { let configuration = undefined let calltimeMiddleware: Middleware[] = [] if (Array.isArray(_options)){ @@ -113,7 +112,7 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable { + public deletePet(petId: number, apiKey?: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.deletePetWithHttpInfo(petId, apiKey, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -122,7 +121,7 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable>> { + public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Observable>> { let configuration = undefined let calltimeMiddleware: Middleware[] = [] if (Array.isArray(_options)){ @@ -155,7 +154,7 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable> { return this.findPetsByStatusWithHttpInfo(status, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -164,7 +163,7 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | Middleware[]): Observable>> { + public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration): Observable>> { let configuration = undefined let calltimeMiddleware: Middleware[] = [] if (Array.isArray(_options)){ @@ -197,7 +196,7 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Observable> { + public findPetsByTags(tags: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable> { return this.findPetsByTagsWithHttpInfo(tags, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -206,7 +205,7 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | Middleware[]): Observable> { + public getPetByIdWithHttpInfo(petId: number, _options?: Configuration): Observable> { let configuration = undefined let calltimeMiddleware: Middleware[] = [] if (Array.isArray(_options)){ @@ -239,7 +238,7 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration | Middleware[]): Observable { + public getPetById(petId: number, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.getPetByIdWithHttpInfo(petId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -248,7 +247,7 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Observable> { + public updatePetWithHttpInfo(pet: Pet, _options?: Configuration): Observable> { let configuration = undefined let calltimeMiddleware: Middleware[] = [] if (Array.isArray(_options)){ @@ -281,7 +280,7 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Observable { + public updatePet(pet: Pet, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.updatePetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -292,7 +291,7 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable> { + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration): Observable> { let configuration = undefined let calltimeMiddleware: Middleware[] = [] if (Array.isArray(_options)){ @@ -327,7 +326,7 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.updatePetWithFormWithHttpInfo(petId, name, status, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -338,7 +337,7 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable> { + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Observable> { let configuration = undefined let calltimeMiddleware: Middleware[] = [] if (Array.isArray(_options)){ @@ -373,7 +372,7 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -403,7 +402,7 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | Middleware[]): Observable> { + public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration): Observable> { let configuration = undefined let calltimeMiddleware: Middleware[] = [] if (Array.isArray(_options)){ @@ -436,7 +435,7 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Observable { + public deleteOrder(orderId: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.deleteOrderWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -444,7 +443,7 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventoryWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + public getInventoryWithHttpInfo(_options?: Configuration): Observable> { let configuration = undefined let calltimeMiddleware: Middleware[] = [] if (Array.isArray(_options)){ @@ -476,7 +475,7 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration | Middleware[]): Observable<{ [key: string]: number; }> { + public getInventory(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo<{ [key: string]: number; }>) => apiResponse.data)); } @@ -485,7 +484,7 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | Middleware[]): Observable> { + public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration): Observable> { let configuration = undefined let calltimeMiddleware: Middleware[] = [] if (Array.isArray(_options)){ @@ -518,7 +517,7 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Observable { + public getOrderById(orderId: number, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.getOrderByIdWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -527,7 +526,7 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(order: Order, _options?: Configuration | Middleware[]): Observable> { + public placeOrderWithHttpInfo(order: Order, _options?: Configuration): Observable> { let configuration = undefined let calltimeMiddleware: Middleware[] = [] if (Array.isArray(_options)){ @@ -560,7 +559,7 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration | Middleware[]): Observable { + public placeOrder(order: Order, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.placeOrderWithHttpInfo(order, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -590,7 +589,7 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUserWithHttpInfo(user: User, _options?: Configuration | Middleware[]): Observable> { + public createUserWithHttpInfo(user: User, _options?: Configuration): Observable> { let configuration = undefined let calltimeMiddleware: Middleware[] = [] if (Array.isArray(_options)){ @@ -623,7 +622,7 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration | Middleware[]): Observable { + public createUser(user: User, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.createUserWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -632,7 +631,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Observable> { + public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration): Observable> { let configuration = undefined let calltimeMiddleware: Middleware[] = [] if (Array.isArray(_options)){ @@ -665,7 +664,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Observable { + public createUsersWithArrayInput(user: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.createUsersWithArrayInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -674,7 +673,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Observable> { + public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration): Observable> { let configuration = undefined let calltimeMiddleware: Middleware[] = [] if (Array.isArray(_options)){ @@ -707,7 +706,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Observable { + public createUsersWithListInput(user: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.createUsersWithListInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -716,7 +715,7 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Observable> { + public deleteUserWithHttpInfo(username: string, _options?: Configuration): Observable> { let configuration = undefined let calltimeMiddleware: Middleware[] = [] if (Array.isArray(_options)){ @@ -749,7 +748,7 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration | Middleware[]): Observable { + public deleteUser(username: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.deleteUserWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -758,7 +757,7 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Observable> { + public getUserByNameWithHttpInfo(username: string, _options?: Configuration): Observable> { let configuration = undefined let calltimeMiddleware: Middleware[] = [] if (Array.isArray(_options)){ @@ -791,7 +790,7 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration | Middleware[]): Observable { + public getUserByName(username: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.getUserByNameWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -801,7 +800,7 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | Middleware[]): Observable> { + public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration): Observable> { let configuration = undefined let calltimeMiddleware: Middleware[] = [] if (Array.isArray(_options)){ @@ -835,7 +834,7 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Observable { + public loginUser(username: string, password: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.loginUserWithHttpInfo(username, password, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -843,7 +842,7 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUserWithHttpInfo(_options?: Configuration | Middleware[]): Observable> { + public logoutUserWithHttpInfo(_options?: Configuration): Observable> { let configuration = undefined let calltimeMiddleware: Middleware[] = [] if (Array.isArray(_options)){ @@ -875,7 +874,7 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration | Middleware[]): Observable { + public logoutUser(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.logoutUserWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -885,7 +884,7 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | Middleware[]): Observable> { + public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration): Observable> { let configuration = undefined let calltimeMiddleware: Middleware[] = [] if (Array.isArray(_options)){ @@ -919,7 +918,7 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Observable { + public updateUser(username: string, user: User, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.updateUserWithHttpInfo(username, user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/types/PromiseAPI.ts index bad01413b306..cd43df466230 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/types/PromiseAPI.ts @@ -1,6 +1,5 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' -import type { Middleware } from "../middleware"; import { injectable, inject, optional } from "inversify"; import { AbstractConfiguration } from "../services/configuration"; @@ -32,7 +31,7 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { + public addPetWithHttpInfo(pet: Pet, _options?: Configuration): Promise> { const result = this.api.addPetWithHttpInfo(pet, _options); return result.toPromise(); } @@ -42,7 +41,7 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration | Middleware[]): Promise { + public addPet(pet: Pet, _options?: Configuration): Promise { const result = this.api.addPet(pet, _options); return result.toPromise(); } @@ -53,7 +52,7 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise> { + public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration): Promise> { const result = this.api.deletePetWithHttpInfo(petId, apiKey, _options); return result.toPromise(); } @@ -64,7 +63,7 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise { + public deletePet(petId: number, apiKey?: string, _options?: Configuration): Promise { const result = this.api.deletePet(petId, apiKey, _options); return result.toPromise(); } @@ -74,7 +73,7 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise>> { + public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise>> { const result = this.api.findPetsByStatusWithHttpInfo(status, _options); return result.toPromise(); } @@ -84,7 +83,7 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise> { const result = this.api.findPetsByStatus(status, _options); return result.toPromise(); } @@ -94,7 +93,7 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | Middleware[]): Promise>> { + public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration): Promise>> { const result = this.api.findPetsByTagsWithHttpInfo(tags, _options); return result.toPromise(); } @@ -104,7 +103,7 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Promise> { + public findPetsByTags(tags: Array, _options?: Configuration): Promise> { const result = this.api.findPetsByTags(tags, _options); return result.toPromise(); } @@ -114,7 +113,7 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | Middleware[]): Promise> { + public getPetByIdWithHttpInfo(petId: number, _options?: Configuration): Promise> { const result = this.api.getPetByIdWithHttpInfo(petId, _options); return result.toPromise(); } @@ -124,7 +123,7 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration | Middleware[]): Promise { + public getPetById(petId: number, _options?: Configuration): Promise { const result = this.api.getPetById(petId, _options); return result.toPromise(); } @@ -134,7 +133,7 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { + public updatePetWithHttpInfo(pet: Pet, _options?: Configuration): Promise> { const result = this.api.updatePetWithHttpInfo(pet, _options); return result.toPromise(); } @@ -144,7 +143,7 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Promise { + public updatePet(pet: Pet, _options?: Configuration): Promise { const result = this.api.updatePet(pet, _options); return result.toPromise(); } @@ -156,7 +155,7 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise> { + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration): Promise> { const result = this.api.updatePetWithFormWithHttpInfo(petId, name, status, _options); return result.toPromise(); } @@ -168,7 +167,7 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Promise { const result = this.api.updatePetWithForm(petId, name, status, _options); return result.toPromise(); } @@ -180,7 +179,7 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise> { + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise> { const result = this.api.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options); return result.toPromise(); } @@ -192,7 +191,7 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise { const result = this.api.uploadFile(petId, additionalMetadata, file, _options); return result.toPromise(); } @@ -224,7 +223,7 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | Middleware[]): Promise> { + public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration): Promise> { const result = this.api.deleteOrderWithHttpInfo(orderId, _options); return result.toPromise(); } @@ -234,7 +233,7 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Promise { + public deleteOrder(orderId: string, _options?: Configuration): Promise { const result = this.api.deleteOrder(orderId, _options); return result.toPromise(); } @@ -243,7 +242,7 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventoryWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { + public getInventoryWithHttpInfo(_options?: Configuration): Promise> { const result = this.api.getInventoryWithHttpInfo(_options); return result.toPromise(); } @@ -252,7 +251,7 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { + public getInventory(_options?: Configuration): Promise<{ [key: string]: number; }> { const result = this.api.getInventory(_options); return result.toPromise(); } @@ -262,7 +261,7 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | Middleware[]): Promise> { + public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration): Promise> { const result = this.api.getOrderByIdWithHttpInfo(orderId, _options); return result.toPromise(); } @@ -272,7 +271,7 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Promise { + public getOrderById(orderId: number, _options?: Configuration): Promise { const result = this.api.getOrderById(orderId, _options); return result.toPromise(); } @@ -282,7 +281,7 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(order: Order, _options?: Configuration | Middleware[]): Promise> { + public placeOrderWithHttpInfo(order: Order, _options?: Configuration): Promise> { const result = this.api.placeOrderWithHttpInfo(order, _options); return result.toPromise(); } @@ -292,7 +291,7 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration | Middleware[]): Promise { + public placeOrder(order: Order, _options?: Configuration): Promise { const result = this.api.placeOrder(order, _options); return result.toPromise(); } @@ -324,7 +323,7 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUserWithHttpInfo(user: User, _options?: Configuration | Middleware[]): Promise> { + public createUserWithHttpInfo(user: User, _options?: Configuration): Promise> { const result = this.api.createUserWithHttpInfo(user, _options); return result.toPromise(); } @@ -334,7 +333,7 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration | Middleware[]): Promise { + public createUser(user: User, _options?: Configuration): Promise { const result = this.api.createUser(user, _options); return result.toPromise(); } @@ -344,7 +343,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { + public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration): Promise> { const result = this.api.createUsersWithArrayInputWithHttpInfo(user, _options); return result.toPromise(); } @@ -354,7 +353,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Promise { + public createUsersWithArrayInput(user: Array, _options?: Configuration): Promise { const result = this.api.createUsersWithArrayInput(user, _options); return result.toPromise(); } @@ -364,7 +363,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { + public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration): Promise> { const result = this.api.createUsersWithListInputWithHttpInfo(user, _options); return result.toPromise(); } @@ -374,7 +373,7 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Promise { + public createUsersWithListInput(user: Array, _options?: Configuration): Promise { const result = this.api.createUsersWithListInput(user, _options); return result.toPromise(); } @@ -384,7 +383,7 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { + public deleteUserWithHttpInfo(username: string, _options?: Configuration): Promise> { const result = this.api.deleteUserWithHttpInfo(username, _options); return result.toPromise(); } @@ -394,7 +393,7 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration | Middleware[]): Promise { + public deleteUser(username: string, _options?: Configuration): Promise { const result = this.api.deleteUser(username, _options); return result.toPromise(); } @@ -404,7 +403,7 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { + public getUserByNameWithHttpInfo(username: string, _options?: Configuration): Promise> { const result = this.api.getUserByNameWithHttpInfo(username, _options); return result.toPromise(); } @@ -414,7 +413,7 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration | Middleware[]): Promise { + public getUserByName(username: string, _options?: Configuration): Promise { const result = this.api.getUserByName(username, _options); return result.toPromise(); } @@ -425,7 +424,7 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | Middleware[]): Promise> { + public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration): Promise> { const result = this.api.loginUserWithHttpInfo(username, password, _options); return result.toPromise(); } @@ -436,7 +435,7 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Promise { + public loginUser(username: string, password: string, _options?: Configuration): Promise { const result = this.api.loginUser(username, password, _options); return result.toPromise(); } @@ -445,7 +444,7 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUserWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { + public logoutUserWithHttpInfo(_options?: Configuration): Promise> { const result = this.api.logoutUserWithHttpInfo(_options); return result.toPromise(); } @@ -454,7 +453,7 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration | Middleware[]): Promise { + public logoutUser(_options?: Configuration): Promise { const result = this.api.logoutUser(_options); return result.toPromise(); } @@ -465,7 +464,7 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | Middleware[]): Promise> { + public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration): Promise> { const result = this.api.updateUserWithHttpInfo(username, user, _options); return result.toPromise(); } @@ -476,7 +475,7 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Promise { + public updateUser(username: string, user: User, _options?: Configuration): Promise { const result = this.api.updateUser(username, user, _options); return result.toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/ObjectParamAPI.ts index 09b5873c11ef..499f39b6a75d 100644 --- a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/ObjectParamAPI.ts @@ -27,7 +27,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public uniqueItems(param: DefaultApiUniqueItemsRequest = {}, options?: Configuration | Middleware[]): Promise { + public uniqueItems(param: DefaultApiUniqueItemsRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.uniqueItems( options).toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/ObservableAPI.ts index 905d507a360d..4389e97bfb2b 100644 --- a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/ObservableAPI.ts @@ -53,7 +53,7 @@ export class ObservableDefaultApi { /** */ - public uniqueItems(_options?: Configuration | Middleware[]): Observable { + public uniqueItems(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.uniqueItemsWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObjectParamAPI.ts index b1512d688646..e397f9ec18fe 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObjectParamAPI.ts @@ -146,7 +146,7 @@ export class ObjectPetApi { * Add a new pet to the store * @param param the request object */ - public addPet(param: PetApiAddPetRequest, options?: Configuration | Middleware[]): Promise { + public addPet(param: PetApiAddPetRequest, options?: Configuration| Middleware[]): Promise { return this.api.addPet(param.pet, options).toPromise(); } @@ -164,7 +164,7 @@ export class ObjectPetApi { * Deletes a pet * @param param the request object */ - public deletePet(param: PetApiDeletePetRequest, options?: Configuration | Middleware[]): Promise { + public deletePet(param: PetApiDeletePetRequest, options?: Configuration| Middleware[]): Promise { return this.api.deletePet(param.petId, param.apiKey, options).toPromise(); } @@ -182,7 +182,7 @@ export class ObjectPetApi { * Finds Pets by status * @param param the request object */ - public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration | Middleware[]): Promise> { + public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration| Middleware[]): Promise> { return this.api.findPetsByStatus(param.status, options).toPromise(); } @@ -200,7 +200,7 @@ export class ObjectPetApi { * Finds Pets by tags * @param param the request object */ - public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration | Middleware[]): Promise> { + public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration| Middleware[]): Promise> { return this.api.findPetsByTags(param.tags, options).toPromise(); } @@ -218,7 +218,7 @@ export class ObjectPetApi { * Find pet by ID * @param param the request object */ - public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration | Middleware[]): Promise { + public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration| Middleware[]): Promise { return this.api.getPetById(param.petId, options).toPromise(); } @@ -236,7 +236,7 @@ export class ObjectPetApi { * Update an existing pet * @param param the request object */ - public updatePet(param: PetApiUpdatePetRequest, options?: Configuration | Middleware[]): Promise { + public updatePet(param: PetApiUpdatePetRequest, options?: Configuration| Middleware[]): Promise { return this.api.updatePet(param.pet, options).toPromise(); } @@ -254,7 +254,7 @@ export class ObjectPetApi { * Updates a pet in the store with form data * @param param the request object */ - public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration | Middleware[]): Promise { + public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration| Middleware[]): Promise { return this.api.updatePetWithForm(param.petId, param.name, param.status, options).toPromise(); } @@ -272,7 +272,7 @@ export class ObjectPetApi { * uploads an image * @param param the request object */ - public uploadFile(param: PetApiUploadFileRequest, options?: Configuration | Middleware[]): Promise { + public uploadFile(param: PetApiUploadFileRequest, options?: Configuration| Middleware[]): Promise { return this.api.uploadFile(param.petId, param.additionalMetadata, param.file, options).toPromise(); } @@ -336,7 +336,7 @@ export class ObjectStoreApi { * Delete purchase order by ID * @param param the request object */ - public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration | Middleware[]): Promise { + public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration| Middleware[]): Promise { return this.api.deleteOrder(param.orderId, options).toPromise(); } @@ -354,7 +354,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { + public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration| Middleware[]): Promise<{ [key: string]: number; }> { return this.api.getInventory( options).toPromise(); } @@ -372,7 +372,7 @@ export class ObjectStoreApi { * Find purchase order by ID * @param param the request object */ - public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration | Middleware[]): Promise { + public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration| Middleware[]): Promise { return this.api.getOrderById(param.orderId, options).toPromise(); } @@ -390,7 +390,7 @@ export class ObjectStoreApi { * Place an order for a pet * @param param the request object */ - public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration | Middleware[]): Promise { + public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration| Middleware[]): Promise { return this.api.placeOrder(param.order, options).toPromise(); } @@ -503,7 +503,7 @@ export class ObjectUserApi { * Create user * @param param the request object */ - public createUser(param: UserApiCreateUserRequest, options?: Configuration | Middleware[]): Promise { + public createUser(param: UserApiCreateUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.createUser(param.user, options).toPromise(); } @@ -521,7 +521,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration | Middleware[]): Promise { + public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration| Middleware[]): Promise { return this.api.createUsersWithArrayInput(param.user, options).toPromise(); } @@ -539,7 +539,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration | Middleware[]): Promise { + public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration| Middleware[]): Promise { return this.api.createUsersWithListInput(param.user, options).toPromise(); } @@ -557,7 +557,7 @@ export class ObjectUserApi { * Delete user * @param param the request object */ - public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration | Middleware[]): Promise { + public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.deleteUser(param.username, options).toPromise(); } @@ -575,7 +575,7 @@ export class ObjectUserApi { * Get user by user name * @param param the request object */ - public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration | Middleware[]): Promise { + public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration| Middleware[]): Promise { return this.api.getUserByName(param.username, options).toPromise(); } @@ -593,7 +593,7 @@ export class ObjectUserApi { * Logs user into the system * @param param the request object */ - public loginUser(param: UserApiLoginUserRequest, options?: Configuration | Middleware[]): Promise { + public loginUser(param: UserApiLoginUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.loginUser(param.username, param.password, options).toPromise(); } @@ -611,7 +611,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration | Middleware[]): Promise { + public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.logoutUser( options).toPromise(); } @@ -629,7 +629,7 @@ export class ObjectUserApi { * Updated user * @param param the request object */ - public updateUser(param: UserApiUpdateUserRequest, options?: Configuration | Middleware[]): Promise { + public updateUser(param: UserApiUpdateUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.updateUser(param.username, param.user, options).toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObservableAPI.ts index 585735aa7842..1ec3fc541335 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObservableAPI.ts @@ -64,7 +64,7 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration | Middleware[]): Observable { + public addPet(pet: Pet, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.addPetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -108,7 +108,7 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable { + public deletePet(petId: number, apiKey?: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.deletePetWithHttpInfo(petId, apiKey, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -150,7 +150,7 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable> { return this.findPetsByStatusWithHttpInfo(status, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -192,7 +192,7 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Observable> { + public findPetsByTags(tags: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable> { return this.findPetsByTagsWithHttpInfo(tags, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -234,7 +234,7 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration | Middleware[]): Observable { + public getPetById(petId: number, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.getPetByIdWithHttpInfo(petId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -276,7 +276,7 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Observable { + public updatePet(pet: Pet, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.updatePetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -322,7 +322,7 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.updatePetWithFormWithHttpInfo(petId, name, status, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -368,7 +368,7 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -428,7 +428,7 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Observable { + public deleteOrder(orderId: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.deleteOrderWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -468,7 +468,7 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration | Middleware[]): Observable<{ [key: string]: number; }> { + public getInventory(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo<{ [key: string]: number; }>) => apiResponse.data)); } @@ -510,7 +510,7 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Observable { + public getOrderById(orderId: number, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.getOrderByIdWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -552,7 +552,7 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration | Middleware[]): Observable { + public placeOrder(order: Order, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.placeOrderWithHttpInfo(order, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -612,7 +612,7 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration | Middleware[]): Observable { + public createUser(user: User, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.createUserWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -654,7 +654,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Observable { + public createUsersWithArrayInput(user: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.createUsersWithArrayInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -696,7 +696,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Observable { + public createUsersWithListInput(user: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.createUsersWithListInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -738,7 +738,7 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration | Middleware[]): Observable { + public deleteUser(username: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.deleteUserWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -780,7 +780,7 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration | Middleware[]): Observable { + public getUserByName(username: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.getUserByNameWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -824,7 +824,7 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Observable { + public loginUser(username: string, password: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.loginUserWithHttpInfo(username, password, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -864,7 +864,7 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration | Middleware[]): Observable { + public logoutUser(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.logoutUserWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -908,7 +908,7 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Observable { + public updateUser(username: string, user: User, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { return this.updateUserWithHttpInfo(username, user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } From 58f001ed7d31a5c29b08450e3eaaf47c28186379 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Thu, 9 Jan 2025 15:12:30 -0500 Subject: [PATCH 08/10] braces --- .../services/ObservableAPI.mustache | 2 +- .../typescript/types/ObservableAPI.mustache | 2 +- .../builds/array-of-lists/package-lock.json | 43 ++++++++++++++++ .../array-of-lists/types/ObservableAPI.ts | 2 +- .../.openapi-generator/FILES | 4 +- .../models/ObjectSerializer.ts | 14 ++--- .../enum-single-value/models/SomeObject.ts | 36 +++++++++++++ .../models/WithNullableType.ts | 51 +++++++++++++++++++ .../builds/enum-single-value/models/all.ts | 4 +- .../enum-single-value/types/ObjectParamAPI.ts | 4 +- .../enum-single-value/types/ObservableAPI.ts | 4 +- .../enum-single-value/types/PromiseAPI.ts | 4 +- .../with-unique-items/types/ObservableAPI.ts | 2 +- .../builds/browser/types/ObservableAPI.ts | 40 +++++++-------- .../composed-schemas/types/ObservableAPI.ts | 6 +-- .../builds/default/types/ObservableAPI.ts | 40 +++++++-------- .../builds/deno/types/ObservableAPI.ts | 40 +++++++-------- .../deno_object_params/types/ObservableAPI.ts | 40 +++++++-------- .../builds/inversify/types/ObservableAPI.ts | 40 +++++++-------- .../builds/jquery/types/ObjectParamAPI.ts | 40 +++++++-------- .../nullable-enum/types/ObservableAPI.ts | 2 +- .../object_params/types/ObservableAPI.ts | 40 +++++++-------- 22 files changed, 296 insertions(+), 164 deletions(-) create mode 100644 samples/client/others/typescript/builds/array-of-lists/package-lock.json create mode 100644 samples/client/others/typescript/builds/enum-single-value/models/SomeObject.ts create mode 100644 samples/client/others/typescript/builds/enum-single-value/models/WithNullableType.ts diff --git a/modules/openapi-generator/src/main/resources/typescript/services/ObservableAPI.mustache b/modules/openapi-generator/src/main/resources/typescript/services/ObservableAPI.mustache index 5c4c91dc324c..efe33aae7da4 100644 --- a/modules/openapi-generator/src/main/resources/typescript/services/ObservableAPI.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/services/ObservableAPI.mustache @@ -3,7 +3,7 @@ import type { Observable } from {{#useRxJS}}"rxjs"{{/useRxJS}}{{^useRxJS}}"../rx import type { Configuration } from "../configuration"; {{^useInversify}} import type { Middleware } from "../middleware"; -{{^useInversify}} +{{/useInversify}} {{#models}} {{#model}} diff --git a/modules/openapi-generator/src/main/resources/typescript/types/ObservableAPI.mustache b/modules/openapi-generator/src/main/resources/typescript/types/ObservableAPI.mustache index 6b2d0b8e1a84..63db21c589b8 100644 --- a/modules/openapi-generator/src/main/resources/typescript/types/ObservableAPI.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/types/ObservableAPI.mustache @@ -103,7 +103,7 @@ export class Observable{{classname}} { * @param {{#required}}{{paramName}}{{/required}}{{^required}}[{{paramName}}]{{/required}}{{#description}} {{description}}{{/description}} {{/allParams}} */ - public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable<{{{returnType}}}{{^returnType}}void{{/returnType}}> { + public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration{{^useInversify}} | Middleware[]{{/useInversify}}): Observable<{{{returnType}}}{{^returnType}}void{{/returnType}}> { return this.{{nickname}}WithHttpInfo({{#allParams}}{{paramName}}, {{/allParams}}_options).pipe(map((apiResponse: HttpInfo<{{{returnType}}}{{^returnType}}void{{/returnType}}>) => apiResponse.data)); } diff --git a/samples/client/others/typescript/builds/array-of-lists/package-lock.json b/samples/client/others/typescript/builds/array-of-lists/package-lock.json new file mode 100644 index 000000000000..e8ece374b195 --- /dev/null +++ b/samples/client/others/typescript/builds/array-of-lists/package-lock.json @@ -0,0 +1,43 @@ +{ + "name": "array-of-lists", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "license": "Unlicense", + "dependencies": { + "es6-promise": "^4.2.4", + "whatwg-fetch": "^3.0.0" + }, + "devDependencies": { + "typescript": "^4.0" + } + }, + "node_modules/es6-promise": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", + "license": "MIT" + }, + "node_modules/typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/whatwg-fetch": { + "version": "3.6.20", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.20.tgz", + "integrity": "sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg==", + "license": "MIT" + } + } +} diff --git a/samples/client/others/typescript/builds/array-of-lists/types/ObservableAPI.ts b/samples/client/others/typescript/builds/array-of-lists/types/ObservableAPI.ts index abd44f70458a..77220bb8c5da 100644 --- a/samples/client/others/typescript/builds/array-of-lists/types/ObservableAPI.ts +++ b/samples/client/others/typescript/builds/array-of-lists/types/ObservableAPI.ts @@ -54,7 +54,7 @@ export class ObservableDefaultApi { /** */ - public list(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public list(_options?: Configuration | Middleware[]): Observable { return this.listWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/client/others/typescript/builds/enum-single-value/.openapi-generator/FILES b/samples/client/others/typescript/builds/enum-single-value/.openapi-generator/FILES index f586694f5f67..832d1d1b6d4d 100644 --- a/samples/client/others/typescript/builds/enum-single-value/.openapi-generator/FILES +++ b/samples/client/others/typescript/builds/enum-single-value/.openapi-generator/FILES @@ -11,8 +11,8 @@ http/isomorphic-fetch.ts index.ts middleware.ts models/ObjectSerializer.ts -models/SomeObject.ts -models/WithNullableType.ts +models/SingleValueEnum30.ts +models/SingleValueEnum31.ts models/all.ts package.json rxjsStub.ts diff --git a/samples/client/others/typescript/builds/enum-single-value/models/ObjectSerializer.ts b/samples/client/others/typescript/builds/enum-single-value/models/ObjectSerializer.ts index d44f397943e3..15b6c13639d3 100644 --- a/samples/client/others/typescript/builds/enum-single-value/models/ObjectSerializer.ts +++ b/samples/client/others/typescript/builds/enum-single-value/models/ObjectSerializer.ts @@ -1,8 +1,8 @@ -export * from '../models/SomeObject'; -export * from '../models/WithNullableType'; +export * from '../models/SingleValueEnum30'; +export * from '../models/SingleValueEnum31'; -import { SomeObject } from '../models/SomeObject'; -import { WithNullableType } from '../models/WithNullableType'; +import { SingleValueEnum30, SingleValueEnum30TypeEnum } from '../models/SingleValueEnum30'; +import { SingleValueEnum31, SingleValueEnum31TypeEnum } from '../models/SingleValueEnum31'; /* tslint:disable:no-unused-variable */ let primitives = [ @@ -17,11 +17,13 @@ let primitives = [ ]; let enumsMap: Set = new Set([ + "SingleValueEnum30TypeEnum", + "SingleValueEnum31TypeEnum", ]); let typeMap: {[index: string]: any} = { - "SomeObject": SomeObject, - "WithNullableType": WithNullableType, + "SingleValueEnum30": SingleValueEnum30, + "SingleValueEnum31": SingleValueEnum31, } type MimeTypeDescriptor = { diff --git a/samples/client/others/typescript/builds/enum-single-value/models/SomeObject.ts b/samples/client/others/typescript/builds/enum-single-value/models/SomeObject.ts new file mode 100644 index 000000000000..af82708430ec --- /dev/null +++ b/samples/client/others/typescript/builds/enum-single-value/models/SomeObject.ts @@ -0,0 +1,36 @@ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * OpenAPI spec version: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HttpFile } from '../http/http'; + +export class SomeObject { + 'data'?: string; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "data", + "baseName": "data", + "type": "string", + "format": "" + } ]; + + static getAttributeTypeMap() { + return SomeObject.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/samples/client/others/typescript/builds/enum-single-value/models/WithNullableType.ts b/samples/client/others/typescript/builds/enum-single-value/models/WithNullableType.ts new file mode 100644 index 000000000000..d29b7cc1767f --- /dev/null +++ b/samples/client/others/typescript/builds/enum-single-value/models/WithNullableType.ts @@ -0,0 +1,51 @@ +/** + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * OpenAPI spec version: + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { SomeObject } from '../models/SomeObject'; +import { HttpFile } from '../http/http'; + +export class WithNullableType { + 'arrayDataOrNull': Array | null; + 'stringDataOrNull': string | null; + 'oneofOrNull': SomeObject | null; + + static readonly discriminator: string | undefined = undefined; + + static readonly mapping: {[index: string]: string} | undefined = undefined; + + static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [ + { + "name": "arrayDataOrNull", + "baseName": "arrayDataOrNull", + "type": "Array", + "format": "" + }, + { + "name": "stringDataOrNull", + "baseName": "stringDataOrNull", + "type": "string", + "format": "" + }, + { + "name": "oneofOrNull", + "baseName": "oneofOrNull", + "type": "SomeObject", + "format": "" + } ]; + + static getAttributeTypeMap() { + return WithNullableType.attributeTypeMap; + } + + public constructor() { + } +} diff --git a/samples/client/others/typescript/builds/enum-single-value/models/all.ts b/samples/client/others/typescript/builds/enum-single-value/models/all.ts index ed435990d1a4..dc9e55201d87 100644 --- a/samples/client/others/typescript/builds/enum-single-value/models/all.ts +++ b/samples/client/others/typescript/builds/enum-single-value/models/all.ts @@ -1,2 +1,2 @@ -export * from '../models/SomeObject' -export * from '../models/WithNullableType' +export * from '../models/SingleValueEnum30' +export * from '../models/SingleValueEnum31' diff --git a/samples/client/others/typescript/builds/enum-single-value/types/ObjectParamAPI.ts b/samples/client/others/typescript/builds/enum-single-value/types/ObjectParamAPI.ts index f6e490661b04..6c1d433efb38 100644 --- a/samples/client/others/typescript/builds/enum-single-value/types/ObjectParamAPI.ts +++ b/samples/client/others/typescript/builds/enum-single-value/types/ObjectParamAPI.ts @@ -2,5 +2,5 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/htt import { Configuration} from '../configuration' import type { Middleware } from "../middleware"; -import { SomeObject } from '../models/SomeObject'; -import { WithNullableType } from '../models/WithNullableType'; +import { SingleValueEnum30 } from '../models/SingleValueEnum30'; +import { SingleValueEnum31 } from '../models/SingleValueEnum31'; diff --git a/samples/client/others/typescript/builds/enum-single-value/types/ObservableAPI.ts b/samples/client/others/typescript/builds/enum-single-value/types/ObservableAPI.ts index 8dd43da8d163..4d3a4f331439 100644 --- a/samples/client/others/typescript/builds/enum-single-value/types/ObservableAPI.ts +++ b/samples/client/others/typescript/builds/enum-single-value/types/ObservableAPI.ts @@ -3,5 +3,5 @@ import { Configuration} from '../configuration' import type { Middleware } from "../middleware"; import { Observable, of, from } from '../rxjsStub'; import {mergeMap, map} from '../rxjsStub'; -import { SomeObject } from '../models/SomeObject'; -import { WithNullableType } from '../models/WithNullableType'; +import { SingleValueEnum30 } from '../models/SingleValueEnum30'; +import { SingleValueEnum31 } from '../models/SingleValueEnum31'; diff --git a/samples/client/others/typescript/builds/enum-single-value/types/PromiseAPI.ts b/samples/client/others/typescript/builds/enum-single-value/types/PromiseAPI.ts index f6e490661b04..6c1d433efb38 100644 --- a/samples/client/others/typescript/builds/enum-single-value/types/PromiseAPI.ts +++ b/samples/client/others/typescript/builds/enum-single-value/types/PromiseAPI.ts @@ -2,5 +2,5 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/htt import { Configuration} from '../configuration' import type { Middleware } from "../middleware"; -import { SomeObject } from '../models/SomeObject'; -import { WithNullableType } from '../models/WithNullableType'; +import { SingleValueEnum30 } from '../models/SingleValueEnum30'; +import { SingleValueEnum31 } from '../models/SingleValueEnum31'; diff --git a/samples/client/others/typescript/builds/with-unique-items/types/ObservableAPI.ts b/samples/client/others/typescript/builds/with-unique-items/types/ObservableAPI.ts index 4389e97bfb2b..905d507a360d 100644 --- a/samples/client/others/typescript/builds/with-unique-items/types/ObservableAPI.ts +++ b/samples/client/others/typescript/builds/with-unique-items/types/ObservableAPI.ts @@ -53,7 +53,7 @@ export class ObservableDefaultApi { /** */ - public uniqueItems(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public uniqueItems(_options?: Configuration | Middleware[]): Observable { return this.uniqueItemsWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/openapi3/client/petstore/typescript/builds/browser/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/browser/types/ObservableAPI.ts index 1ec3fc541335..585735aa7842 100644 --- a/samples/openapi3/client/petstore/typescript/builds/browser/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/browser/types/ObservableAPI.ts @@ -64,7 +64,7 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public addPet(pet: Pet, _options?: Configuration | Middleware[]): Observable { return this.addPetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -108,7 +108,7 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable { return this.deletePetWithHttpInfo(petId, apiKey, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -150,7 +150,7 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable> { return this.findPetsByStatusWithHttpInfo(status, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -192,7 +192,7 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable> { + public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Observable> { return this.findPetsByTagsWithHttpInfo(tags, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -234,7 +234,7 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public getPetById(petId: number, _options?: Configuration | Middleware[]): Observable { return this.getPetByIdWithHttpInfo(petId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -276,7 +276,7 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Observable { return this.updatePetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -322,7 +322,7 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable { return this.updatePetWithFormWithHttpInfo(petId, name, status, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -368,7 +368,7 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable { return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -428,7 +428,7 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Observable { return this.deleteOrderWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -468,7 +468,7 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable<{ [key: string]: number; }> { + public getInventory(_options?: Configuration | Middleware[]): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo<{ [key: string]: number; }>) => apiResponse.data)); } @@ -510,7 +510,7 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Observable { return this.getOrderByIdWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -552,7 +552,7 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public placeOrder(order: Order, _options?: Configuration | Middleware[]): Observable { return this.placeOrderWithHttpInfo(order, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -612,7 +612,7 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public createUser(user: User, _options?: Configuration | Middleware[]): Observable { return this.createUserWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -654,7 +654,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Observable { return this.createUsersWithArrayInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -696,7 +696,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Observable { return this.createUsersWithListInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -738,7 +738,7 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public deleteUser(username: string, _options?: Configuration | Middleware[]): Observable { return this.deleteUserWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -780,7 +780,7 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public getUserByName(username: string, _options?: Configuration | Middleware[]): Observable { return this.getUserByNameWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -824,7 +824,7 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Observable { return this.loginUserWithHttpInfo(username, password, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -864,7 +864,7 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public logoutUser(_options?: Configuration | Middleware[]): Observable { return this.logoutUserWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -908,7 +908,7 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Observable { return this.updateUserWithHttpInfo(username, user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObservableAPI.ts index 25acc307164a..4213bfc97be8 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/ObservableAPI.ts @@ -61,7 +61,7 @@ export class ObservableDefaultApi { /** * @param [filePostRequest] */ - public filePost(filePostRequest?: FilePostRequest, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public filePost(filePostRequest?: FilePostRequest, _options?: Configuration | Middleware[]): Observable { return this.filePostWithHttpInfo(filePostRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -99,7 +99,7 @@ export class ObservableDefaultApi { /** * @param [petsFilteredPatchRequest] */ - public petsFilteredPatch(petsFilteredPatchRequest?: PetsFilteredPatchRequest, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public petsFilteredPatch(petsFilteredPatchRequest?: PetsFilteredPatchRequest, _options?: Configuration | Middleware[]): Observable { return this.petsFilteredPatchWithHttpInfo(petsFilteredPatchRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -137,7 +137,7 @@ export class ObservableDefaultApi { /** * @param [petsPatchRequest] */ - public petsPatch(petsPatchRequest?: PetsPatchRequest, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public petsPatch(petsPatchRequest?: PetsPatchRequest, _options?: Configuration | Middleware[]): Observable { return this.petsPatchWithHttpInfo(petsPatchRequest, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/default/types/ObservableAPI.ts index 1ec3fc541335..585735aa7842 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/types/ObservableAPI.ts @@ -64,7 +64,7 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public addPet(pet: Pet, _options?: Configuration | Middleware[]): Observable { return this.addPetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -108,7 +108,7 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable { return this.deletePetWithHttpInfo(petId, apiKey, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -150,7 +150,7 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable> { return this.findPetsByStatusWithHttpInfo(status, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -192,7 +192,7 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable> { + public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Observable> { return this.findPetsByTagsWithHttpInfo(tags, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -234,7 +234,7 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public getPetById(petId: number, _options?: Configuration | Middleware[]): Observable { return this.getPetByIdWithHttpInfo(petId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -276,7 +276,7 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Observable { return this.updatePetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -322,7 +322,7 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable { return this.updatePetWithFormWithHttpInfo(petId, name, status, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -368,7 +368,7 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable { return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -428,7 +428,7 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Observable { return this.deleteOrderWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -468,7 +468,7 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable<{ [key: string]: number; }> { + public getInventory(_options?: Configuration | Middleware[]): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo<{ [key: string]: number; }>) => apiResponse.data)); } @@ -510,7 +510,7 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Observable { return this.getOrderByIdWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -552,7 +552,7 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public placeOrder(order: Order, _options?: Configuration | Middleware[]): Observable { return this.placeOrderWithHttpInfo(order, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -612,7 +612,7 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public createUser(user: User, _options?: Configuration | Middleware[]): Observable { return this.createUserWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -654,7 +654,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Observable { return this.createUsersWithArrayInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -696,7 +696,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Observable { return this.createUsersWithListInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -738,7 +738,7 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public deleteUser(username: string, _options?: Configuration | Middleware[]): Observable { return this.deleteUserWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -780,7 +780,7 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public getUserByName(username: string, _options?: Configuration | Middleware[]): Observable { return this.getUserByNameWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -824,7 +824,7 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Observable { return this.loginUserWithHttpInfo(username, password, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -864,7 +864,7 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public logoutUser(_options?: Configuration | Middleware[]): Observable { return this.logoutUserWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -908,7 +908,7 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Observable { return this.updateUserWithHttpInfo(username, user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/deno/types/ObservableAPI.ts index a1ecc227cf45..a9173ffe386a 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/types/ObservableAPI.ts @@ -64,7 +64,7 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public addPet(pet: Pet, _options?: Configuration | Middleware[]): Observable { return this.addPetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -108,7 +108,7 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable { return this.deletePetWithHttpInfo(petId, apiKey, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -150,7 +150,7 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable> { return this.findPetsByStatusWithHttpInfo(status, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -192,7 +192,7 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable> { + public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Observable> { return this.findPetsByTagsWithHttpInfo(tags, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -234,7 +234,7 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public getPetById(petId: number, _options?: Configuration | Middleware[]): Observable { return this.getPetByIdWithHttpInfo(petId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -276,7 +276,7 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Observable { return this.updatePetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -322,7 +322,7 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable { return this.updatePetWithFormWithHttpInfo(petId, name, status, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -368,7 +368,7 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable { return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -428,7 +428,7 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Observable { return this.deleteOrderWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -468,7 +468,7 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable<{ [key: string]: number; }> { + public getInventory(_options?: Configuration | Middleware[]): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo<{ [key: string]: number; }>) => apiResponse.data)); } @@ -510,7 +510,7 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Observable { return this.getOrderByIdWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -552,7 +552,7 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public placeOrder(order: Order, _options?: Configuration | Middleware[]): Observable { return this.placeOrderWithHttpInfo(order, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -612,7 +612,7 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public createUser(user: User, _options?: Configuration | Middleware[]): Observable { return this.createUserWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -654,7 +654,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Observable { return this.createUsersWithArrayInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -696,7 +696,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Observable { return this.createUsersWithListInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -738,7 +738,7 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public deleteUser(username: string, _options?: Configuration | Middleware[]): Observable { return this.deleteUserWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -780,7 +780,7 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public getUserByName(username: string, _options?: Configuration | Middleware[]): Observable { return this.getUserByNameWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -824,7 +824,7 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Observable { return this.loginUserWithHttpInfo(username, password, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -864,7 +864,7 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public logoutUser(_options?: Configuration | Middleware[]): Observable { return this.logoutUserWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -908,7 +908,7 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Observable { return this.updateUserWithHttpInfo(username, user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/ObservableAPI.ts index a1ecc227cf45..a9173ffe386a 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/ObservableAPI.ts @@ -64,7 +64,7 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public addPet(pet: Pet, _options?: Configuration | Middleware[]): Observable { return this.addPetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -108,7 +108,7 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable { return this.deletePetWithHttpInfo(petId, apiKey, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -150,7 +150,7 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable> { return this.findPetsByStatusWithHttpInfo(status, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -192,7 +192,7 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable> { + public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Observable> { return this.findPetsByTagsWithHttpInfo(tags, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -234,7 +234,7 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public getPetById(petId: number, _options?: Configuration | Middleware[]): Observable { return this.getPetByIdWithHttpInfo(petId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -276,7 +276,7 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Observable { return this.updatePetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -322,7 +322,7 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable { return this.updatePetWithFormWithHttpInfo(petId, name, status, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -368,7 +368,7 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable { return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -428,7 +428,7 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Observable { return this.deleteOrderWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -468,7 +468,7 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable<{ [key: string]: number; }> { + public getInventory(_options?: Configuration | Middleware[]): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo<{ [key: string]: number; }>) => apiResponse.data)); } @@ -510,7 +510,7 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Observable { return this.getOrderByIdWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -552,7 +552,7 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public placeOrder(order: Order, _options?: Configuration | Middleware[]): Observable { return this.placeOrderWithHttpInfo(order, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -612,7 +612,7 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public createUser(user: User, _options?: Configuration | Middleware[]): Observable { return this.createUserWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -654,7 +654,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Observable { return this.createUsersWithArrayInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -696,7 +696,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Observable { return this.createUsersWithListInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -738,7 +738,7 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public deleteUser(username: string, _options?: Configuration | Middleware[]): Observable { return this.deleteUserWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -780,7 +780,7 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public getUserByName(username: string, _options?: Configuration | Middleware[]): Observable { return this.getUserByNameWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -824,7 +824,7 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Observable { return this.loginUserWithHttpInfo(username, password, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -864,7 +864,7 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public logoutUser(_options?: Configuration | Middleware[]): Observable { return this.logoutUserWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -908,7 +908,7 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Observable { return this.updateUserWithHttpInfo(username, user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObservableAPI.ts index 5bdce1ad0d42..687865ff2bff 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObservableAPI.ts @@ -68,7 +68,7 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public addPet(pet: Pet, _options?: Configuration): Observable { return this.addPetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -112,7 +112,7 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public deletePet(petId: number, apiKey?: string, _options?: Configuration): Observable { return this.deletePetWithHttpInfo(petId, apiKey, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -154,7 +154,7 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Observable> { return this.findPetsByStatusWithHttpInfo(status, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -196,7 +196,7 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable> { + public findPetsByTags(tags: Array, _options?: Configuration): Observable> { return this.findPetsByTagsWithHttpInfo(tags, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -238,7 +238,7 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public getPetById(petId: number, _options?: Configuration): Observable { return this.getPetByIdWithHttpInfo(petId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -280,7 +280,7 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public updatePet(pet: Pet, _options?: Configuration): Observable { return this.updatePetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -326,7 +326,7 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Observable { return this.updatePetWithFormWithHttpInfo(petId, name, status, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -372,7 +372,7 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Observable { return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -435,7 +435,7 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public deleteOrder(orderId: string, _options?: Configuration): Observable { return this.deleteOrderWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -475,7 +475,7 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable<{ [key: string]: number; }> { + public getInventory(_options?: Configuration): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo<{ [key: string]: number; }>) => apiResponse.data)); } @@ -517,7 +517,7 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public getOrderById(orderId: number, _options?: Configuration): Observable { return this.getOrderByIdWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -559,7 +559,7 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public placeOrder(order: Order, _options?: Configuration): Observable { return this.placeOrderWithHttpInfo(order, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -622,7 +622,7 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public createUser(user: User, _options?: Configuration): Observable { return this.createUserWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -664,7 +664,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public createUsersWithArrayInput(user: Array, _options?: Configuration): Observable { return this.createUsersWithArrayInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -706,7 +706,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public createUsersWithListInput(user: Array, _options?: Configuration): Observable { return this.createUsersWithListInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -748,7 +748,7 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public deleteUser(username: string, _options?: Configuration): Observable { return this.deleteUserWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -790,7 +790,7 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public getUserByName(username: string, _options?: Configuration): Observable { return this.getUserByNameWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -834,7 +834,7 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public loginUser(username: string, password: string, _options?: Configuration): Observable { return this.loginUserWithHttpInfo(username, password, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -874,7 +874,7 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public logoutUser(_options?: Configuration): Observable { return this.logoutUserWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -918,7 +918,7 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public updateUser(username: string, user: User, _options?: Configuration): Observable { return this.updateUserWithHttpInfo(username, user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/types/ObjectParamAPI.ts index b1512d688646..e397f9ec18fe 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/types/ObjectParamAPI.ts @@ -146,7 +146,7 @@ export class ObjectPetApi { * Add a new pet to the store * @param param the request object */ - public addPet(param: PetApiAddPetRequest, options?: Configuration | Middleware[]): Promise { + public addPet(param: PetApiAddPetRequest, options?: Configuration| Middleware[]): Promise { return this.api.addPet(param.pet, options).toPromise(); } @@ -164,7 +164,7 @@ export class ObjectPetApi { * Deletes a pet * @param param the request object */ - public deletePet(param: PetApiDeletePetRequest, options?: Configuration | Middleware[]): Promise { + public deletePet(param: PetApiDeletePetRequest, options?: Configuration| Middleware[]): Promise { return this.api.deletePet(param.petId, param.apiKey, options).toPromise(); } @@ -182,7 +182,7 @@ export class ObjectPetApi { * Finds Pets by status * @param param the request object */ - public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration | Middleware[]): Promise> { + public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration| Middleware[]): Promise> { return this.api.findPetsByStatus(param.status, options).toPromise(); } @@ -200,7 +200,7 @@ export class ObjectPetApi { * Finds Pets by tags * @param param the request object */ - public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration | Middleware[]): Promise> { + public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration| Middleware[]): Promise> { return this.api.findPetsByTags(param.tags, options).toPromise(); } @@ -218,7 +218,7 @@ export class ObjectPetApi { * Find pet by ID * @param param the request object */ - public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration | Middleware[]): Promise { + public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration| Middleware[]): Promise { return this.api.getPetById(param.petId, options).toPromise(); } @@ -236,7 +236,7 @@ export class ObjectPetApi { * Update an existing pet * @param param the request object */ - public updatePet(param: PetApiUpdatePetRequest, options?: Configuration | Middleware[]): Promise { + public updatePet(param: PetApiUpdatePetRequest, options?: Configuration| Middleware[]): Promise { return this.api.updatePet(param.pet, options).toPromise(); } @@ -254,7 +254,7 @@ export class ObjectPetApi { * Updates a pet in the store with form data * @param param the request object */ - public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration | Middleware[]): Promise { + public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration| Middleware[]): Promise { return this.api.updatePetWithForm(param.petId, param.name, param.status, options).toPromise(); } @@ -272,7 +272,7 @@ export class ObjectPetApi { * uploads an image * @param param the request object */ - public uploadFile(param: PetApiUploadFileRequest, options?: Configuration | Middleware[]): Promise { + public uploadFile(param: PetApiUploadFileRequest, options?: Configuration| Middleware[]): Promise { return this.api.uploadFile(param.petId, param.additionalMetadata, param.file, options).toPromise(); } @@ -336,7 +336,7 @@ export class ObjectStoreApi { * Delete purchase order by ID * @param param the request object */ - public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration | Middleware[]): Promise { + public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration| Middleware[]): Promise { return this.api.deleteOrder(param.orderId, options).toPromise(); } @@ -354,7 +354,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { + public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration| Middleware[]): Promise<{ [key: string]: number; }> { return this.api.getInventory( options).toPromise(); } @@ -372,7 +372,7 @@ export class ObjectStoreApi { * Find purchase order by ID * @param param the request object */ - public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration | Middleware[]): Promise { + public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration| Middleware[]): Promise { return this.api.getOrderById(param.orderId, options).toPromise(); } @@ -390,7 +390,7 @@ export class ObjectStoreApi { * Place an order for a pet * @param param the request object */ - public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration | Middleware[]): Promise { + public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration| Middleware[]): Promise { return this.api.placeOrder(param.order, options).toPromise(); } @@ -503,7 +503,7 @@ export class ObjectUserApi { * Create user * @param param the request object */ - public createUser(param: UserApiCreateUserRequest, options?: Configuration | Middleware[]): Promise { + public createUser(param: UserApiCreateUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.createUser(param.user, options).toPromise(); } @@ -521,7 +521,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration | Middleware[]): Promise { + public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration| Middleware[]): Promise { return this.api.createUsersWithArrayInput(param.user, options).toPromise(); } @@ -539,7 +539,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration | Middleware[]): Promise { + public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration| Middleware[]): Promise { return this.api.createUsersWithListInput(param.user, options).toPromise(); } @@ -557,7 +557,7 @@ export class ObjectUserApi { * Delete user * @param param the request object */ - public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration | Middleware[]): Promise { + public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.deleteUser(param.username, options).toPromise(); } @@ -575,7 +575,7 @@ export class ObjectUserApi { * Get user by user name * @param param the request object */ - public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration | Middleware[]): Promise { + public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration| Middleware[]): Promise { return this.api.getUserByName(param.username, options).toPromise(); } @@ -593,7 +593,7 @@ export class ObjectUserApi { * Logs user into the system * @param param the request object */ - public loginUser(param: UserApiLoginUserRequest, options?: Configuration | Middleware[]): Promise { + public loginUser(param: UserApiLoginUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.loginUser(param.username, param.password, options).toPromise(); } @@ -611,7 +611,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration | Middleware[]): Promise { + public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.logoutUser( options).toPromise(); } @@ -629,7 +629,7 @@ export class ObjectUserApi { * Updated user * @param param the request object */ - public updateUser(param: UserApiUpdateUserRequest, options?: Configuration | Middleware[]): Promise { + public updateUser(param: UserApiUpdateUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.updateUser(param.username, param.user, options).toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/ObservableAPI.ts index 4389e97bfb2b..905d507a360d 100644 --- a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/ObservableAPI.ts @@ -53,7 +53,7 @@ export class ObservableDefaultApi { /** */ - public uniqueItems(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public uniqueItems(_options?: Configuration | Middleware[]): Observable { return this.uniqueItemsWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObservableAPI.ts index 1ec3fc541335..585735aa7842 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/types/ObservableAPI.ts @@ -64,7 +64,7 @@ export class ObservablePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public addPet(pet: Pet, _options?: Configuration | Middleware[]): Observable { return this.addPetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -108,7 +108,7 @@ export class ObservablePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Observable { return this.deletePetWithHttpInfo(petId, apiKey, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -150,7 +150,7 @@ export class ObservablePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Observable> { return this.findPetsByStatusWithHttpInfo(status, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -192,7 +192,7 @@ export class ObservablePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable> { + public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Observable> { return this.findPetsByTagsWithHttpInfo(tags, _options).pipe(map((apiResponse: HttpInfo>) => apiResponse.data)); } @@ -234,7 +234,7 @@ export class ObservablePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public getPetById(petId: number, _options?: Configuration | Middleware[]): Observable { return this.getPetByIdWithHttpInfo(petId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -276,7 +276,7 @@ export class ObservablePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Observable { return this.updatePetWithHttpInfo(pet, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -322,7 +322,7 @@ export class ObservablePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Observable { return this.updatePetWithFormWithHttpInfo(petId, name, status, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -368,7 +368,7 @@ export class ObservablePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Observable { return this.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -428,7 +428,7 @@ export class ObservableStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Observable { return this.deleteOrderWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -468,7 +468,7 @@ export class ObservableStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable<{ [key: string]: number; }> { + public getInventory(_options?: Configuration | Middleware[]): Observable<{ [key: string]: number; }> { return this.getInventoryWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo<{ [key: string]: number; }>) => apiResponse.data)); } @@ -510,7 +510,7 @@ export class ObservableStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Observable { return this.getOrderByIdWithHttpInfo(orderId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -552,7 +552,7 @@ export class ObservableStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public placeOrder(order: Order, _options?: Configuration | Middleware[]): Observable { return this.placeOrderWithHttpInfo(order, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -612,7 +612,7 @@ export class ObservableUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public createUser(user: User, _options?: Configuration | Middleware[]): Observable { return this.createUserWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -654,7 +654,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Observable { return this.createUsersWithArrayInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -696,7 +696,7 @@ export class ObservableUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Observable { return this.createUsersWithListInputWithHttpInfo(user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -738,7 +738,7 @@ export class ObservableUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public deleteUser(username: string, _options?: Configuration | Middleware[]): Observable { return this.deleteUserWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -780,7 +780,7 @@ export class ObservableUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public getUserByName(username: string, _options?: Configuration | Middleware[]): Observable { return this.getUserByNameWithHttpInfo(username, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -824,7 +824,7 @@ export class ObservableUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Observable { return this.loginUserWithHttpInfo(username, password, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -864,7 +864,7 @@ export class ObservableUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public logoutUser(_options?: Configuration | Middleware[]): Observable { return this.logoutUserWithHttpInfo(_options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } @@ -908,7 +908,7 @@ export class ObservableUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration{{^useInversify} | Middleware[]{{/useInversify}): Observable { + public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Observable { return this.updateUserWithHttpInfo(username, user, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } From fc4fd1cfea3dc204d26cf54de73768de46fb0586 Mon Sep 17 00:00:00 2001 From: David Gamero Date: Thu, 9 Jan 2025 15:30:45 -0500 Subject: [PATCH 09/10] import in objectparamapi --- .../typescript/types/ObservableAPI.mustache | 2 - .../build/types/ObjectParamAPI.ts | 64 +++++++------- .../explode-query/types/ObjectParamAPI.ts | 84 +++++++++---------- .../inversify/services/ObservableAPI.ts | 41 +++++---- .../builds/inversify/types/ObservableAPI.ts | 1 + 5 files changed, 95 insertions(+), 97 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript/types/ObservableAPI.mustache b/modules/openapi-generator/src/main/resources/typescript/types/ObservableAPI.mustache index 63db21c589b8..c5594751c5e5 100644 --- a/modules/openapi-generator/src/main/resources/typescript/types/ObservableAPI.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/types/ObservableAPI.mustache @@ -1,8 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http{{importFileExtension}}'; import { Configuration} from '../configuration{{importFileExtension}}' -{{^useInversify}} import type { Middleware } from "../middleware"; -{{/useInversify}} import { Observable, of, from } from {{#useRxJS}}'rxjs'{{/useRxJS}}{{^useRxJS}}'../rxjsStub{{importFileExtension}}'{{/useRxJS}}; import {mergeMap, map} from {{#useRxJS}}'rxjs/operators'{{/useRxJS}}{{^useRxJS}}'../rxjsStub{{importFileExtension}}'{{/useRxJS}}; {{#useInversify}} diff --git a/samples/client/others/typescript/encode-decode/build/types/ObjectParamAPI.ts b/samples/client/others/typescript/encode-decode/build/types/ObjectParamAPI.ts index 61de76de568d..9a3857f0a620 100644 --- a/samples/client/others/typescript/encode-decode/build/types/ObjectParamAPI.ts +++ b/samples/client/others/typescript/encode-decode/build/types/ObjectParamAPI.ts @@ -217,7 +217,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testDecodeArrayOfArraysGet(param: DefaultApiTestDecodeArrayOfArraysGetRequest = {}, options?: Configuration | Middleware[]): Promise>> { + public testDecodeArrayOfArraysGet(param: DefaultApiTestDecodeArrayOfArraysGetRequest = {}, options?: Configuration| Middleware[]): Promise>> { return this.api.testDecodeArrayOfArraysGet( options).toPromise(); } @@ -231,7 +231,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testDecodeArrayOfGet(param: DefaultApiTestDecodeArrayOfGetRequest = {}, options?: Configuration | Middleware[]): Promise> { + public testDecodeArrayOfGet(param: DefaultApiTestDecodeArrayOfGetRequest = {}, options?: Configuration| Middleware[]): Promise> { return this.api.testDecodeArrayOfGet( options).toPromise(); } @@ -245,7 +245,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testDecodeArrayOfMapsOfObjectsGet(param: DefaultApiTestDecodeArrayOfMapsOfObjectsGetRequest = {}, options?: Configuration | Middleware[]): Promise> { + public testDecodeArrayOfMapsOfObjectsGet(param: DefaultApiTestDecodeArrayOfMapsOfObjectsGetRequest = {}, options?: Configuration| Middleware[]): Promise> { return this.api.testDecodeArrayOfMapsOfObjectsGet( options).toPromise(); } @@ -259,7 +259,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testDecodeArrayOfNullableGet(param: DefaultApiTestDecodeArrayOfNullableGetRequest = {}, options?: Configuration | Middleware[]): Promise> { + public testDecodeArrayOfNullableGet(param: DefaultApiTestDecodeArrayOfNullableGetRequest = {}, options?: Configuration| Middleware[]): Promise> { return this.api.testDecodeArrayOfNullableGet( options).toPromise(); } @@ -273,7 +273,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testDecodeArrayOfNullableObjectsGet(param: DefaultApiTestDecodeArrayOfNullableObjectsGetRequest = {}, options?: Configuration | Middleware[]): Promise> { + public testDecodeArrayOfNullableObjectsGet(param: DefaultApiTestDecodeArrayOfNullableObjectsGetRequest = {}, options?: Configuration| Middleware[]): Promise> { return this.api.testDecodeArrayOfNullableObjectsGet( options).toPromise(); } @@ -287,7 +287,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testDecodeCompositeObjectsGet(param: DefaultApiTestDecodeCompositeObjectsGetRequest = {}, options?: Configuration | Middleware[]): Promise { + public testDecodeCompositeObjectsGet(param: DefaultApiTestDecodeCompositeObjectsGetRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.testDecodeCompositeObjectsGet( options).toPromise(); } @@ -301,7 +301,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testDecodeMapOfMapsOfObjectsGet(param: DefaultApiTestDecodeMapOfMapsOfObjectsGetRequest = {}, options?: Configuration | Middleware[]): Promise<{ [key: string]: { [key: string]: ComplexObject; }; }> { + public testDecodeMapOfMapsOfObjectsGet(param: DefaultApiTestDecodeMapOfMapsOfObjectsGetRequest = {}, options?: Configuration| Middleware[]): Promise<{ [key: string]: { [key: string]: ComplexObject; }; }> { return this.api.testDecodeMapOfMapsOfObjectsGet( options).toPromise(); } @@ -315,7 +315,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testDecodeMapOfObjectsGet(param: DefaultApiTestDecodeMapOfObjectsGetRequest = {}, options?: Configuration | Middleware[]): Promise<{ [key: string]: ComplexObject | null; }> { + public testDecodeMapOfObjectsGet(param: DefaultApiTestDecodeMapOfObjectsGetRequest = {}, options?: Configuration| Middleware[]): Promise<{ [key: string]: ComplexObject | null; }> { return this.api.testDecodeMapOfObjectsGet( options).toPromise(); } @@ -329,7 +329,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testDecodeMapOfPrimitiveGet(param: DefaultApiTestDecodeMapOfPrimitiveGetRequest = {}, options?: Configuration | Middleware[]): Promise<{ [key: string]: string; }> { + public testDecodeMapOfPrimitiveGet(param: DefaultApiTestDecodeMapOfPrimitiveGetRequest = {}, options?: Configuration| Middleware[]): Promise<{ [key: string]: string; }> { return this.api.testDecodeMapOfPrimitiveGet( options).toPromise(); } @@ -343,7 +343,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testDecodeNullableArrayGet(param: DefaultApiTestDecodeNullableArrayGetRequest = {}, options?: Configuration | Middleware[]): Promise> { + public testDecodeNullableArrayGet(param: DefaultApiTestDecodeNullableArrayGetRequest = {}, options?: Configuration| Middleware[]): Promise> { return this.api.testDecodeNullableArrayGet( options).toPromise(); } @@ -357,7 +357,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testDecodeNullableGet(param: DefaultApiTestDecodeNullableGetRequest = {}, options?: Configuration | Middleware[]): Promise { + public testDecodeNullableGet(param: DefaultApiTestDecodeNullableGetRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.testDecodeNullableGet( options).toPromise(); } @@ -371,7 +371,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testDecodeObjectGet(param: DefaultApiTestDecodeObjectGetRequest = {}, options?: Configuration | Middleware[]): Promise { + public testDecodeObjectGet(param: DefaultApiTestDecodeObjectGetRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.testDecodeObjectGet( options).toPromise(); } @@ -385,7 +385,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testDecodePrimitiveBooleanGet(param: DefaultApiTestDecodePrimitiveBooleanGetRequest = {}, options?: Configuration | Middleware[]): Promise { + public testDecodePrimitiveBooleanGet(param: DefaultApiTestDecodePrimitiveBooleanGetRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.testDecodePrimitiveBooleanGet( options).toPromise(); } @@ -399,7 +399,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testDecodePrimitiveIntegerGet(param: DefaultApiTestDecodePrimitiveIntegerGetRequest = {}, options?: Configuration | Middleware[]): Promise { + public testDecodePrimitiveIntegerGet(param: DefaultApiTestDecodePrimitiveIntegerGetRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.testDecodePrimitiveIntegerGet( options).toPromise(); } @@ -413,7 +413,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testDecodePrimitiveNumberGet(param: DefaultApiTestDecodePrimitiveNumberGetRequest = {}, options?: Configuration | Middleware[]): Promise { + public testDecodePrimitiveNumberGet(param: DefaultApiTestDecodePrimitiveNumberGetRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.testDecodePrimitiveNumberGet( options).toPromise(); } @@ -427,7 +427,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testDecodePrimitiveStringGet(param: DefaultApiTestDecodePrimitiveStringGetRequest = {}, options?: Configuration | Middleware[]): Promise { + public testDecodePrimitiveStringGet(param: DefaultApiTestDecodePrimitiveStringGetRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.testDecodePrimitiveStringGet( options).toPromise(); } @@ -441,7 +441,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testEncodeArrayOfArraysPost(param: DefaultApiTestEncodeArrayOfArraysPostRequest, options?: Configuration | Middleware[]): Promise { + public testEncodeArrayOfArraysPost(param: DefaultApiTestEncodeArrayOfArraysPostRequest, options?: Configuration| Middleware[]): Promise { return this.api.testEncodeArrayOfArraysPost(param.requestBody, options).toPromise(); } @@ -455,7 +455,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testEncodeArrayOfMapsOfObjectsPost(param: DefaultApiTestEncodeArrayOfMapsOfObjectsPostRequest, options?: Configuration | Middleware[]): Promise { + public testEncodeArrayOfMapsOfObjectsPost(param: DefaultApiTestEncodeArrayOfMapsOfObjectsPostRequest, options?: Configuration| Middleware[]): Promise { return this.api.testEncodeArrayOfMapsOfObjectsPost(param.complexObject, options).toPromise(); } @@ -469,7 +469,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testEncodeArrayOfNullableObjectsPost(param: DefaultApiTestEncodeArrayOfNullableObjectsPostRequest, options?: Configuration | Middleware[]): Promise { + public testEncodeArrayOfNullableObjectsPost(param: DefaultApiTestEncodeArrayOfNullableObjectsPostRequest, options?: Configuration| Middleware[]): Promise { return this.api.testEncodeArrayOfNullableObjectsPost(param.complexObject, options).toPromise(); } @@ -483,7 +483,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testEncodeArrayOfNullablePost(param: DefaultApiTestEncodeArrayOfNullablePostRequest, options?: Configuration | Middleware[]): Promise { + public testEncodeArrayOfNullablePost(param: DefaultApiTestEncodeArrayOfNullablePostRequest, options?: Configuration| Middleware[]): Promise { return this.api.testEncodeArrayOfNullablePost(param.requestBody, options).toPromise(); } @@ -497,7 +497,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testEncodeArrayOfPost(param: DefaultApiTestEncodeArrayOfPostRequest, options?: Configuration | Middleware[]): Promise { + public testEncodeArrayOfPost(param: DefaultApiTestEncodeArrayOfPostRequest, options?: Configuration| Middleware[]): Promise { return this.api.testEncodeArrayOfPost(param.requestBody, options).toPromise(); } @@ -511,7 +511,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testEncodeCompositeObjectsPost(param: DefaultApiTestEncodeCompositeObjectsPostRequest, options?: Configuration | Middleware[]): Promise { + public testEncodeCompositeObjectsPost(param: DefaultApiTestEncodeCompositeObjectsPostRequest, options?: Configuration| Middleware[]): Promise { return this.api.testEncodeCompositeObjectsPost(param.compositeObject, options).toPromise(); } @@ -525,7 +525,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testEncodeMapOfMapsOfObjectsPost(param: DefaultApiTestEncodeMapOfMapsOfObjectsPostRequest, options?: Configuration | Middleware[]): Promise { + public testEncodeMapOfMapsOfObjectsPost(param: DefaultApiTestEncodeMapOfMapsOfObjectsPostRequest, options?: Configuration| Middleware[]): Promise { return this.api.testEncodeMapOfMapsOfObjectsPost(param.requestBody, options).toPromise(); } @@ -539,7 +539,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testEncodeMapOfObjectsPost(param: DefaultApiTestEncodeMapOfObjectsPostRequest, options?: Configuration | Middleware[]): Promise { + public testEncodeMapOfObjectsPost(param: DefaultApiTestEncodeMapOfObjectsPostRequest, options?: Configuration| Middleware[]): Promise { return this.api.testEncodeMapOfObjectsPost(param.requestBody, options).toPromise(); } @@ -553,7 +553,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testEncodeMapOfPrimitivePost(param: DefaultApiTestEncodeMapOfPrimitivePostRequest, options?: Configuration | Middleware[]): Promise { + public testEncodeMapOfPrimitivePost(param: DefaultApiTestEncodeMapOfPrimitivePostRequest, options?: Configuration| Middleware[]): Promise { return this.api.testEncodeMapOfPrimitivePost(param.requestBody, options).toPromise(); } @@ -567,7 +567,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testEncodeNullableArrayPost(param: DefaultApiTestEncodeNullableArrayPostRequest = {}, options?: Configuration | Middleware[]): Promise { + public testEncodeNullableArrayPost(param: DefaultApiTestEncodeNullableArrayPostRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.testEncodeNullableArrayPost(param.requestBody, options).toPromise(); } @@ -581,7 +581,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testEncodeNullablePost(param: DefaultApiTestEncodeNullablePostRequest = {}, options?: Configuration | Middleware[]): Promise { + public testEncodeNullablePost(param: DefaultApiTestEncodeNullablePostRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.testEncodeNullablePost(param.body, options).toPromise(); } @@ -595,7 +595,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testEncodeObjectPost(param: DefaultApiTestEncodeObjectPostRequest, options?: Configuration | Middleware[]): Promise { + public testEncodeObjectPost(param: DefaultApiTestEncodeObjectPostRequest, options?: Configuration| Middleware[]): Promise { return this.api.testEncodeObjectPost(param.complexObject, options).toPromise(); } @@ -609,7 +609,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testEncodePrimitiveBooleanPost(param: DefaultApiTestEncodePrimitiveBooleanPostRequest, options?: Configuration | Middleware[]): Promise { + public testEncodePrimitiveBooleanPost(param: DefaultApiTestEncodePrimitiveBooleanPostRequest, options?: Configuration| Middleware[]): Promise { return this.api.testEncodePrimitiveBooleanPost(param.body, options).toPromise(); } @@ -623,7 +623,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testEncodePrimitiveIntegerPost(param: DefaultApiTestEncodePrimitiveIntegerPostRequest, options?: Configuration | Middleware[]): Promise { + public testEncodePrimitiveIntegerPost(param: DefaultApiTestEncodePrimitiveIntegerPostRequest, options?: Configuration| Middleware[]): Promise { return this.api.testEncodePrimitiveIntegerPost(param.body, options).toPromise(); } @@ -637,7 +637,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testEncodePrimitiveNumberPost(param: DefaultApiTestEncodePrimitiveNumberPostRequest, options?: Configuration | Middleware[]): Promise { + public testEncodePrimitiveNumberPost(param: DefaultApiTestEncodePrimitiveNumberPostRequest, options?: Configuration| Middleware[]): Promise { return this.api.testEncodePrimitiveNumberPost(param.body, options).toPromise(); } @@ -651,7 +651,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public testEncodePrimitiveStringPost(param: DefaultApiTestEncodePrimitiveStringPostRequest, options?: Configuration | Middleware[]): Promise { + public testEncodePrimitiveStringPost(param: DefaultApiTestEncodePrimitiveStringPostRequest, options?: Configuration| Middleware[]): Promise { return this.api.testEncodePrimitiveStringPost(param.body, options).toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/types/ObjectParamAPI.ts b/samples/openapi3/client/petstore/typescript/builds/explode-query/types/ObjectParamAPI.ts index 43dc279321a2..f70053c458fe 100644 --- a/samples/openapi3/client/petstore/typescript/builds/explode-query/types/ObjectParamAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/types/ObjectParamAPI.ts @@ -83,7 +83,7 @@ export class ObjectAnotherFakeApi { * To test special tags * @param param the request object */ - public _123testSpecialTags(param: AnotherFakeApi123testSpecialTagsRequest, options?: Configuration | Middleware[]): Promise { + public _123testSpecialTags(param: AnotherFakeApi123testSpecialTagsRequest, options?: Configuration| Middleware[]): Promise { return this.api._123testSpecialTags(param.client, options).toPromise(); } @@ -112,7 +112,7 @@ export class ObjectDefaultApi { /** * @param param the request object */ - public fooGet(param: DefaultApiFooGetRequest = {}, options?: Configuration | Middleware[]): Promise { + public fooGet(param: DefaultApiFooGetRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.fooGet( options).toPromise(); } @@ -556,7 +556,7 @@ export class ObjectFakeApi { * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys * @param param the request object */ - public fakeBigDecimalMap(param: FakeApiFakeBigDecimalMapRequest = {}, options?: Configuration | Middleware[]): Promise { + public fakeBigDecimalMap(param: FakeApiFakeBigDecimalMapRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.fakeBigDecimalMap( options).toPromise(); } @@ -572,7 +572,7 @@ export class ObjectFakeApi { * Health check endpoint * @param param the request object */ - public fakeHealthGet(param: FakeApiFakeHealthGetRequest = {}, options?: Configuration | Middleware[]): Promise { + public fakeHealthGet(param: FakeApiFakeHealthGetRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.fakeHealthGet( options).toPromise(); } @@ -588,7 +588,7 @@ export class ObjectFakeApi { * test http signature authentication * @param param the request object */ - public fakeHttpSignatureTest(param: FakeApiFakeHttpSignatureTestRequest, options?: Configuration | Middleware[]): Promise { + public fakeHttpSignatureTest(param: FakeApiFakeHttpSignatureTestRequest, options?: Configuration| Middleware[]): Promise { return this.api.fakeHttpSignatureTest(param.pet, param.query1, param.header1, options).toPromise(); } @@ -604,7 +604,7 @@ export class ObjectFakeApi { * Test serialization of outer boolean types * @param param the request object */ - public fakeOuterBooleanSerialize(param: FakeApiFakeOuterBooleanSerializeRequest = {}, options?: Configuration | Middleware[]): Promise { + public fakeOuterBooleanSerialize(param: FakeApiFakeOuterBooleanSerializeRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.fakeOuterBooleanSerialize(param.body, options).toPromise(); } @@ -620,7 +620,7 @@ export class ObjectFakeApi { * Test serialization of object with outer number type * @param param the request object */ - public fakeOuterCompositeSerialize(param: FakeApiFakeOuterCompositeSerializeRequest = {}, options?: Configuration | Middleware[]): Promise { + public fakeOuterCompositeSerialize(param: FakeApiFakeOuterCompositeSerializeRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.fakeOuterCompositeSerialize(param.outerComposite, options).toPromise(); } @@ -636,7 +636,7 @@ export class ObjectFakeApi { * Test serialization of outer number types * @param param the request object */ - public fakeOuterNumberSerialize(param: FakeApiFakeOuterNumberSerializeRequest = {}, options?: Configuration | Middleware[]): Promise { + public fakeOuterNumberSerialize(param: FakeApiFakeOuterNumberSerializeRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.fakeOuterNumberSerialize(param.body, options).toPromise(); } @@ -652,7 +652,7 @@ export class ObjectFakeApi { * Test serialization of outer string types * @param param the request object */ - public fakeOuterStringSerialize(param: FakeApiFakeOuterStringSerializeRequest = {}, options?: Configuration | Middleware[]): Promise { + public fakeOuterStringSerialize(param: FakeApiFakeOuterStringSerializeRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.fakeOuterStringSerialize(param.body, options).toPromise(); } @@ -668,7 +668,7 @@ export class ObjectFakeApi { * Test serialization of enum (int) properties with examples * @param param the request object */ - public fakePropertyEnumIntegerSerialize(param: FakeApiFakePropertyEnumIntegerSerializeRequest, options?: Configuration | Middleware[]): Promise { + public fakePropertyEnumIntegerSerialize(param: FakeApiFakePropertyEnumIntegerSerializeRequest, options?: Configuration| Middleware[]): Promise { return this.api.fakePropertyEnumIntegerSerialize(param.outerObjectWithEnumProperty, options).toPromise(); } @@ -684,7 +684,7 @@ export class ObjectFakeApi { * For this test, the body has to be a binary file. * @param param the request object */ - public testBodyWithBinary(param: FakeApiTestBodyWithBinaryRequest, options?: Configuration | Middleware[]): Promise { + public testBodyWithBinary(param: FakeApiTestBodyWithBinaryRequest, options?: Configuration| Middleware[]): Promise { return this.api.testBodyWithBinary(param.body, options).toPromise(); } @@ -700,7 +700,7 @@ export class ObjectFakeApi { * For this test, the body for this request must reference a schema named `File`. * @param param the request object */ - public testBodyWithFileSchema(param: FakeApiTestBodyWithFileSchemaRequest, options?: Configuration | Middleware[]): Promise { + public testBodyWithFileSchema(param: FakeApiTestBodyWithFileSchemaRequest, options?: Configuration| Middleware[]): Promise { return this.api.testBodyWithFileSchema(param.fileSchemaTestClass, options).toPromise(); } @@ -714,7 +714,7 @@ export class ObjectFakeApi { /** * @param param the request object */ - public testBodyWithQueryParams(param: FakeApiTestBodyWithQueryParamsRequest, options?: Configuration | Middleware[]): Promise { + public testBodyWithQueryParams(param: FakeApiTestBodyWithQueryParamsRequest, options?: Configuration| Middleware[]): Promise { return this.api.testBodyWithQueryParams(param.query, param.user, options).toPromise(); } @@ -732,7 +732,7 @@ export class ObjectFakeApi { * To test \"client\" model * @param param the request object */ - public testClientModel(param: FakeApiTestClientModelRequest, options?: Configuration | Middleware[]): Promise { + public testClientModel(param: FakeApiTestClientModelRequest, options?: Configuration| Middleware[]): Promise { return this.api.testClientModel(param.client, options).toPromise(); } @@ -750,7 +750,7 @@ export class ObjectFakeApi { * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * @param param the request object */ - public testEndpointParameters(param: FakeApiTestEndpointParametersRequest, options?: Configuration | Middleware[]): Promise { + public testEndpointParameters(param: FakeApiTestEndpointParametersRequest, options?: Configuration| Middleware[]): Promise { return this.api.testEndpointParameters(param.number, param._double, param.patternWithoutDelimiter, param._byte, param.integer, param.int32, param.int64, param._float, param.string, param.binary, param.date, param.dateTime, param.password, param.callback, options).toPromise(); } @@ -768,7 +768,7 @@ export class ObjectFakeApi { * To test enum parameters * @param param the request object */ - public testEnumParameters(param: FakeApiTestEnumParametersRequest = {}, options?: Configuration | Middleware[]): Promise { + public testEnumParameters(param: FakeApiTestEnumParametersRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.testEnumParameters(param.enumHeaderStringArray, param.enumHeaderString, param.enumQueryStringArray, param.enumQueryString, param.enumQueryInteger, param.enumQueryDouble, param.enumQueryModelArray, param.enumFormStringArray, param.enumFormString, options).toPromise(); } @@ -786,7 +786,7 @@ export class ObjectFakeApi { * Fake endpoint to test group parameters (optional) * @param param the request object */ - public testGroupParameters(param: FakeApiTestGroupParametersRequest, options?: Configuration | Middleware[]): Promise { + public testGroupParameters(param: FakeApiTestGroupParametersRequest, options?: Configuration| Middleware[]): Promise { return this.api.testGroupParameters(param.requiredStringGroup, param.requiredBooleanGroup, param.requiredInt64Group, param.stringGroup, param.booleanGroup, param.int64Group, options).toPromise(); } @@ -804,7 +804,7 @@ export class ObjectFakeApi { * test inline additionalProperties * @param param the request object */ - public testInlineAdditionalProperties(param: FakeApiTestInlineAdditionalPropertiesRequest, options?: Configuration | Middleware[]): Promise { + public testInlineAdditionalProperties(param: FakeApiTestInlineAdditionalPropertiesRequest, options?: Configuration| Middleware[]): Promise { return this.api.testInlineAdditionalProperties(param.requestBody, options).toPromise(); } @@ -822,7 +822,7 @@ export class ObjectFakeApi { * test json serialization of form data * @param param the request object */ - public testJsonFormData(param: FakeApiTestJsonFormDataRequest, options?: Configuration | Middleware[]): Promise { + public testJsonFormData(param: FakeApiTestJsonFormDataRequest, options?: Configuration| Middleware[]): Promise { return this.api.testJsonFormData(param.param, param.param2, options).toPromise(); } @@ -838,7 +838,7 @@ export class ObjectFakeApi { * To test the collection format in query parameters * @param param the request object */ - public testQueryParameterCollectionFormat(param: FakeApiTestQueryParameterCollectionFormatRequest, options?: Configuration | Middleware[]): Promise { + public testQueryParameterCollectionFormat(param: FakeApiTestQueryParameterCollectionFormatRequest, options?: Configuration| Middleware[]): Promise { return this.api.testQueryParameterCollectionFormat(param.pipe, param.ioutil, param.http, param.url, param.context, param.allowEmpty, param.language, options).toPromise(); } @@ -877,7 +877,7 @@ export class ObjectFakeClassnameTags123Api { * To test class name in snake case * @param param the request object */ - public testClassname(param: FakeClassnameTags123ApiTestClassnameRequest, options?: Configuration | Middleware[]): Promise { + public testClassname(param: FakeClassnameTags123ApiTestClassnameRequest, options?: Configuration| Middleware[]): Promise { return this.api.testClassname(param.client, options).toPromise(); } @@ -1044,7 +1044,7 @@ export class ObjectPetApi { * Add a new pet to the store * @param param the request object */ - public addPet(param: PetApiAddPetRequest, options?: Configuration | Middleware[]): Promise { + public addPet(param: PetApiAddPetRequest, options?: Configuration| Middleware[]): Promise { return this.api.addPet(param.pet, options).toPromise(); } @@ -1062,7 +1062,7 @@ export class ObjectPetApi { * Deletes a pet * @param param the request object */ - public deletePet(param: PetApiDeletePetRequest, options?: Configuration | Middleware[]): Promise { + public deletePet(param: PetApiDeletePetRequest, options?: Configuration| Middleware[]): Promise { return this.api.deletePet(param.petId, param.apiKey, options).toPromise(); } @@ -1080,7 +1080,7 @@ export class ObjectPetApi { * Finds Pets by status * @param param the request object */ - public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration | Middleware[]): Promise> { + public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration| Middleware[]): Promise> { return this.api.findPetsByStatus(param.status, options).toPromise(); } @@ -1098,7 +1098,7 @@ export class ObjectPetApi { * Finds Pets by tags * @param param the request object */ - public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration | Middleware[]): Promise> { + public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration| Middleware[]): Promise> { return this.api.findPetsByTags(param.tags, options).toPromise(); } @@ -1116,7 +1116,7 @@ export class ObjectPetApi { * Find pet by ID * @param param the request object */ - public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration | Middleware[]): Promise { + public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration| Middleware[]): Promise { return this.api.getPetById(param.petId, options).toPromise(); } @@ -1134,7 +1134,7 @@ export class ObjectPetApi { * Update an existing pet * @param param the request object */ - public updatePet(param: PetApiUpdatePetRequest, options?: Configuration | Middleware[]): Promise { + public updatePet(param: PetApiUpdatePetRequest, options?: Configuration| Middleware[]): Promise { return this.api.updatePet(param.pet, options).toPromise(); } @@ -1152,7 +1152,7 @@ export class ObjectPetApi { * Updates a pet in the store with form data * @param param the request object */ - public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration | Middleware[]): Promise { + public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration| Middleware[]): Promise { return this.api.updatePetWithForm(param.petId, param.name, param.status, options).toPromise(); } @@ -1170,7 +1170,7 @@ export class ObjectPetApi { * uploads an image * @param param the request object */ - public uploadFile(param: PetApiUploadFileRequest, options?: Configuration | Middleware[]): Promise { + public uploadFile(param: PetApiUploadFileRequest, options?: Configuration| Middleware[]): Promise { return this.api.uploadFile(param.petId, param.additionalMetadata, param.file, options).toPromise(); } @@ -1188,7 +1188,7 @@ export class ObjectPetApi { * uploads an image (required) * @param param the request object */ - public uploadFileWithRequiredFile(param: PetApiUploadFileWithRequiredFileRequest, options?: Configuration | Middleware[]): Promise { + public uploadFileWithRequiredFile(param: PetApiUploadFileWithRequiredFileRequest, options?: Configuration| Middleware[]): Promise { return this.api.uploadFileWithRequiredFile(param.petId, param.requiredFile, param.additionalMetadata, options).toPromise(); } @@ -1252,7 +1252,7 @@ export class ObjectStoreApi { * Delete purchase order by ID * @param param the request object */ - public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration | Middleware[]): Promise { + public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration| Middleware[]): Promise { return this.api.deleteOrder(param.orderId, options).toPromise(); } @@ -1270,7 +1270,7 @@ export class ObjectStoreApi { * Returns pet inventories by status * @param param the request object */ - public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { + public getInventory(param: StoreApiGetInventoryRequest = {}, options?: Configuration| Middleware[]): Promise<{ [key: string]: number; }> { return this.api.getInventory( options).toPromise(); } @@ -1288,7 +1288,7 @@ export class ObjectStoreApi { * Find purchase order by ID * @param param the request object */ - public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration | Middleware[]): Promise { + public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration| Middleware[]): Promise { return this.api.getOrderById(param.orderId, options).toPromise(); } @@ -1306,7 +1306,7 @@ export class ObjectStoreApi { * Place an order for a pet * @param param the request object */ - public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration | Middleware[]): Promise { + public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration| Middleware[]): Promise { return this.api.placeOrder(param.order, options).toPromise(); } @@ -1419,7 +1419,7 @@ export class ObjectUserApi { * Create user * @param param the request object */ - public createUser(param: UserApiCreateUserRequest, options?: Configuration | Middleware[]): Promise { + public createUser(param: UserApiCreateUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.createUser(param.user, options).toPromise(); } @@ -1437,7 +1437,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration | Middleware[]): Promise { + public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration| Middleware[]): Promise { return this.api.createUsersWithArrayInput(param.user, options).toPromise(); } @@ -1455,7 +1455,7 @@ export class ObjectUserApi { * Creates list of users with given input array * @param param the request object */ - public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration | Middleware[]): Promise { + public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration| Middleware[]): Promise { return this.api.createUsersWithListInput(param.user, options).toPromise(); } @@ -1473,7 +1473,7 @@ export class ObjectUserApi { * Delete user * @param param the request object */ - public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration | Middleware[]): Promise { + public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.deleteUser(param.username, options).toPromise(); } @@ -1491,7 +1491,7 @@ export class ObjectUserApi { * Get user by user name * @param param the request object */ - public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration | Middleware[]): Promise { + public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration| Middleware[]): Promise { return this.api.getUserByName(param.username, options).toPromise(); } @@ -1509,7 +1509,7 @@ export class ObjectUserApi { * Logs user into the system * @param param the request object */ - public loginUser(param: UserApiLoginUserRequest, options?: Configuration | Middleware[]): Promise { + public loginUser(param: UserApiLoginUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.loginUser(param.username, param.password, options).toPromise(); } @@ -1527,7 +1527,7 @@ export class ObjectUserApi { * Logs out current logged in user session * @param param the request object */ - public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration | Middleware[]): Promise { + public logoutUser(param: UserApiLogoutUserRequest = {}, options?: Configuration| Middleware[]): Promise { return this.api.logoutUser( options).toPromise(); } @@ -1545,7 +1545,7 @@ export class ObjectUserApi { * Updated user * @param param the request object */ - public updateUser(param: UserApiUpdateUserRequest, options?: Configuration | Middleware[]): Promise { + public updateUser(param: UserApiUpdateUserRequest, options?: Configuration| Middleware[]): Promise { return this.api.updateUser(param.username, param.user, options).toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/services/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/services/ObservableAPI.ts index e8e3e63f58c2..014636645ab2 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/services/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/services/ObservableAPI.ts @@ -1,7 +1,6 @@ import type { HttpFile } from "../http/http"; import type { Observable } from "../rxjsStub"; import type { Configuration } from "../configuration"; -import type { Middleware } from "../middleware"; import { ApiResponse } from "../models/ApiResponse"; import { Category } from "../models/Category"; @@ -12,52 +11,52 @@ import { User } from "../models/User"; export abstract class AbstractObservablePetApi { - public abstract addPet(pet: Pet, options?: Configuration | Middleware[]): Observable; + public abstract addPet(pet: Pet, options?: Configuration): Observable; - public abstract deletePet(petId: number, apiKey?: string, options?: Configuration | Middleware[]): Observable; + public abstract deletePet(petId: number, apiKey?: string, options?: Configuration): Observable; - public abstract findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: Configuration | Middleware[]): Observable>; + public abstract findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: Configuration): Observable>; - public abstract findPetsByTags(tags: Array, options?: Configuration | Middleware[]): Observable>; + public abstract findPetsByTags(tags: Array, options?: Configuration): Observable>; - public abstract getPetById(petId: number, options?: Configuration | Middleware[]): Observable; + public abstract getPetById(petId: number, options?: Configuration): Observable; - public abstract updatePet(pet: Pet, options?: Configuration | Middleware[]): Observable; + public abstract updatePet(pet: Pet, options?: Configuration): Observable; - public abstract updatePetWithForm(petId: number, name?: string, status?: string, options?: Configuration | Middleware[]): Observable; + public abstract updatePetWithForm(petId: number, name?: string, status?: string, options?: Configuration): Observable; - public abstract uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, options?: Configuration | Middleware[]): Observable; + public abstract uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, options?: Configuration): Observable; } export abstract class AbstractObservableStoreApi { - public abstract deleteOrder(orderId: string, options?: Configuration | Middleware[]): Observable; + public abstract deleteOrder(orderId: string, options?: Configuration): Observable; - public abstract getInventory(options?: Configuration | Middleware[]): Observable<{ [key: string]: number; }>; + public abstract getInventory(options?: Configuration): Observable<{ [key: string]: number; }>; - public abstract getOrderById(orderId: number, options?: Configuration | Middleware[]): Observable; + public abstract getOrderById(orderId: number, options?: Configuration): Observable; - public abstract placeOrder(order: Order, options?: Configuration | Middleware[]): Observable; + public abstract placeOrder(order: Order, options?: Configuration): Observable; } export abstract class AbstractObservableUserApi { - public abstract createUser(user: User, options?: Configuration | Middleware[]): Observable; + public abstract createUser(user: User, options?: Configuration): Observable; - public abstract createUsersWithArrayInput(user: Array, options?: Configuration | Middleware[]): Observable; + public abstract createUsersWithArrayInput(user: Array, options?: Configuration): Observable; - public abstract createUsersWithListInput(user: Array, options?: Configuration | Middleware[]): Observable; + public abstract createUsersWithListInput(user: Array, options?: Configuration): Observable; - public abstract deleteUser(username: string, options?: Configuration | Middleware[]): Observable; + public abstract deleteUser(username: string, options?: Configuration): Observable; - public abstract getUserByName(username: string, options?: Configuration | Middleware[]): Observable; + public abstract getUserByName(username: string, options?: Configuration): Observable; - public abstract loginUser(username: string, password: string, options?: Configuration | Middleware[]): Observable; + public abstract loginUser(username: string, password: string, options?: Configuration): Observable; - public abstract logoutUser(options?: Configuration | Middleware[]): Observable; + public abstract logoutUser(options?: Configuration): Observable; - public abstract updateUser(username: string, user: User, options?: Configuration | Middleware[]): Observable; + public abstract updateUser(username: string, user: User, options?: Configuration): Observable; } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObservableAPI.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObservableAPI.ts index 687865ff2bff..b2b91dc89a33 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObservableAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/types/ObservableAPI.ts @@ -1,5 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' +import type { Middleware } from "../middleware"; import { Observable, of, from } from '../rxjsStub'; import {mergeMap, map} from '../rxjsStub'; import { injectable, inject, optional } from "inversify"; From 80b36292c061213379a070bfad4fa256d491ae2f Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 10 Jan 2025 17:09:33 -0500 Subject: [PATCH 10/10] add integration test for middleware --- .../main/resources/typescript/index.mustache | 1 + .../typescript/types/PromiseAPI.mustache | 32 +- .../typescript/builds/array-of-lists/index.ts | 1 + .../builds/array-of-lists/types/PromiseAPI.ts | 22 +- .../builds/enum-single-value/index.ts | 1 + .../enum-single-value/types/PromiseAPI.ts | 2 +- .../builds/null-types-simple/index.ts | 1 + .../null-types-simple/types/PromiseAPI.ts | 2 +- .../builds/with-unique-items/index.ts | 1 + .../with-unique-items/types/PromiseAPI.ts | 22 +- .../typescript/encode-decode/build/index.ts | 1 + .../encode-decode/build/types/PromiseAPI.ts | 642 ++++++++++--- .../typescript/builds/browser/index.ts | 1 + .../builds/browser/types/PromiseAPI.ts | 402 +++++++-- .../builds/composed-schemas/index.ts | 1 + .../composed-schemas/types/PromiseAPI.ts | 62 +- .../typescript/builds/default/index.ts | 1 + .../builds/default/types/PromiseAPI.ts | 402 +++++++-- .../petstore/typescript/builds/deno/index.ts | 1 + .../builds/deno/types/PromiseAPI.ts | 402 +++++++-- .../builds/deno_object_params/index.ts | 1 + .../deno_object_params/types/PromiseAPI.ts | 402 +++++++-- .../typescript/builds/explode-query/index.ts | 1 + .../builds/explode-query/types/PromiseAPI.ts | 842 ++++++++++++++---- .../typescript/builds/inversify/index.ts | 1 + .../builds/inversify/package-lock.json | 82 +- .../builds/inversify/types/PromiseAPI.ts | 120 ++- .../typescript/builds/jquery/index.ts | 1 + .../builds/jquery/types/PromiseAPI.ts | 402 +++++++-- .../typescript/builds/nullable-enum/index.ts | 1 + .../builds/nullable-enum/types/PromiseAPI.ts | 22 +- .../typescript/builds/object_params/index.ts | 1 + .../builds/object_params/types/PromiseAPI.ts | 402 +++++++-- .../tests/default/test/api/PetApi.test.ts | 229 ++--- .../tests/inversify/package-lock.json | 53 +- 35 files changed, 3491 insertions(+), 1069 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript/index.mustache b/modules/openapi-generator/src/main/resources/typescript/index.mustache index f6703891eb90..51ecdb1f82a2 100644 --- a/modules/openapi-generator/src/main/resources/typescript/index.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/index.mustache @@ -14,6 +14,7 @@ export { Middleware } from './middleware{{importFileExtension}}'; {{/useRxJS}} {{^useRxJS}} export type { PromiseMiddleware as Middleware } from './middleware{{importFileExtension}}'; +export type { Middleware as ObservableMiddleware } from './middleware{{importFileExtension}}'; {{/useRxJS}} {{#useObjectParameters}} export { {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}type {{classname}}{{operationIdCamelCase}}Request, {{/operation}}Object{{classname}} as {{classname}}{{^-last}}, {{/-last}} {{/operations}}{{/apis}}{{/apiInfo}}} from './types/ObjectParamAPI{{importFileExtension}}'; diff --git a/modules/openapi-generator/src/main/resources/typescript/types/PromiseAPI.mustache b/modules/openapi-generator/src/main/resources/typescript/types/PromiseAPI.mustache index a9fbf81850e4..2d4c3fefda89 100644 --- a/modules/openapi-generator/src/main/resources/typescript/types/PromiseAPI.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/types/PromiseAPI.mustache @@ -1,7 +1,7 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http{{importFileExtension}}'; import { Configuration} from '../configuration{{importFileExtension}}' {{^useInversify}} -import type { Middleware } from "../middleware"; +import { PromiseMiddleware, Middleware, PromiseMiddlewareWrapper } from "../middleware"; {{/useInversify}} {{#useInversify}} import { injectable, inject, optional } from "inversify"; @@ -54,8 +54,19 @@ export class Promise{{classname}} { * @param {{#required}}{{paramName}}{{/required}}{{^required}}[{{paramName}}]{{/required}}{{#description}} {{description}}{{/description}} {{/allParams}} */ - public {{nickname}}WithHttpInfo({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration{{^useInversify}} | Middleware[]{{/useInversify}}): Promise> { - const result = this.api.{{nickname}}WithHttpInfo({{#allParams}}{{paramName}}, {{/allParams}}_options); + public {{nickname}}WithHttpInfo({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration{{^useInversify}} | PromiseMiddleware[]{{/useInversify}}): Promise> { + {{^useInversify}} + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + {{/useInversify}} + {{#useInversify}} + const observableOptions = _options + {{/useInversify}} + const result = this.api.{{nickname}}WithHttpInfo({{#allParams}}{{paramName}}, {{/allParams}}observableOptions); return result.toPromise(); } @@ -70,8 +81,19 @@ export class Promise{{classname}} { * @param {{#required}}{{paramName}}{{/required}}{{^required}}[{{paramName}}]{{/required}}{{#description}} {{description}}{{/description}} {{/allParams}} */ - public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration{{^useInversify}} | Middleware[]{{/useInversify}}): Promise<{{{returnType}}}{{^returnType}}void{{/returnType}}> { - const result = this.api.{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}_options); + public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}_options?: Configuration{{^useInversify}} | PromiseMiddleware[]{{/useInversify}}): Promise<{{{returnType}}}{{^returnType}}void{{/returnType}}> { + {{^useInversify}} + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + {{/useInversify}} + {{#useInversify}} + const observableOptions = _options + {{/useInversify}} + const result = this.api.{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}observableOptions); return result.toPromise(); } diff --git a/samples/client/others/typescript/builds/array-of-lists/index.ts b/samples/client/others/typescript/builds/array-of-lists/index.ts index 6d001268247c..ccfbb01e8850 100644 --- a/samples/client/others/typescript/builds/array-of-lists/index.ts +++ b/samples/client/others/typescript/builds/array-of-lists/index.ts @@ -8,5 +8,6 @@ export * from "./servers"; export { RequiredError } from "./apis/baseapi"; export type { PromiseMiddleware as Middleware } from './middleware'; +export type { Middleware as ObservableMiddleware } from './middleware'; export { PromiseDefaultApi as DefaultApi } from './types/PromiseAPI'; diff --git a/samples/client/others/typescript/builds/array-of-lists/types/PromiseAPI.ts b/samples/client/others/typescript/builds/array-of-lists/types/PromiseAPI.ts index 76747740abdc..ea93025c118c 100644 --- a/samples/client/others/typescript/builds/array-of-lists/types/PromiseAPI.ts +++ b/samples/client/others/typescript/builds/array-of-lists/types/PromiseAPI.ts @@ -1,6 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' -import type { Middleware } from "../middleware"; +import { PromiseMiddleware, Middleware, PromiseMiddlewareWrapper } from "../middleware"; import { List } from '../models/List'; import { ListPaged } from '../models/ListPaged'; @@ -20,15 +20,27 @@ export class PromiseDefaultApi { /** */ - public listWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.listWithHttpInfo(_options); + public listWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.listWithHttpInfo(observableOptions); return result.toPromise(); } /** */ - public list(_options?: Configuration | Middleware[]): Promise { - const result = this.api.list(_options); + public list(_options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.list(observableOptions); return result.toPromise(); } diff --git a/samples/client/others/typescript/builds/enum-single-value/index.ts b/samples/client/others/typescript/builds/enum-single-value/index.ts index c5bc5ff26cc0..16f99dcb712e 100644 --- a/samples/client/others/typescript/builds/enum-single-value/index.ts +++ b/samples/client/others/typescript/builds/enum-single-value/index.ts @@ -8,5 +8,6 @@ export * from "./servers"; export { RequiredError } from "./apis/baseapi"; export type { PromiseMiddleware as Middleware } from './middleware'; +export type { Middleware as ObservableMiddleware } from './middleware'; export { } from './types/PromiseAPI'; diff --git a/samples/client/others/typescript/builds/enum-single-value/types/PromiseAPI.ts b/samples/client/others/typescript/builds/enum-single-value/types/PromiseAPI.ts index 6c1d433efb38..a5b0410f4ee7 100644 --- a/samples/client/others/typescript/builds/enum-single-value/types/PromiseAPI.ts +++ b/samples/client/others/typescript/builds/enum-single-value/types/PromiseAPI.ts @@ -1,6 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' -import type { Middleware } from "../middleware"; +import { PromiseMiddleware, Middleware, PromiseMiddlewareWrapper } from "../middleware"; import { SingleValueEnum30 } from '../models/SingleValueEnum30'; import { SingleValueEnum31 } from '../models/SingleValueEnum31'; diff --git a/samples/client/others/typescript/builds/null-types-simple/index.ts b/samples/client/others/typescript/builds/null-types-simple/index.ts index c5bc5ff26cc0..16f99dcb712e 100644 --- a/samples/client/others/typescript/builds/null-types-simple/index.ts +++ b/samples/client/others/typescript/builds/null-types-simple/index.ts @@ -8,5 +8,6 @@ export * from "./servers"; export { RequiredError } from "./apis/baseapi"; export type { PromiseMiddleware as Middleware } from './middleware'; +export type { Middleware as ObservableMiddleware } from './middleware'; export { } from './types/PromiseAPI'; diff --git a/samples/client/others/typescript/builds/null-types-simple/types/PromiseAPI.ts b/samples/client/others/typescript/builds/null-types-simple/types/PromiseAPI.ts index f6e490661b04..2594fa98050c 100644 --- a/samples/client/others/typescript/builds/null-types-simple/types/PromiseAPI.ts +++ b/samples/client/others/typescript/builds/null-types-simple/types/PromiseAPI.ts @@ -1,6 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' -import type { Middleware } from "../middleware"; +import { PromiseMiddleware, Middleware, PromiseMiddlewareWrapper } from "../middleware"; import { SomeObject } from '../models/SomeObject'; import { WithNullableType } from '../models/WithNullableType'; diff --git a/samples/client/others/typescript/builds/with-unique-items/index.ts b/samples/client/others/typescript/builds/with-unique-items/index.ts index 6d001268247c..ccfbb01e8850 100644 --- a/samples/client/others/typescript/builds/with-unique-items/index.ts +++ b/samples/client/others/typescript/builds/with-unique-items/index.ts @@ -8,5 +8,6 @@ export * from "./servers"; export { RequiredError } from "./apis/baseapi"; export type { PromiseMiddleware as Middleware } from './middleware'; +export type { Middleware as ObservableMiddleware } from './middleware'; export { PromiseDefaultApi as DefaultApi } from './types/PromiseAPI'; diff --git a/samples/client/others/typescript/builds/with-unique-items/types/PromiseAPI.ts b/samples/client/others/typescript/builds/with-unique-items/types/PromiseAPI.ts index 418fd986e291..22a0a0de22b2 100644 --- a/samples/client/others/typescript/builds/with-unique-items/types/PromiseAPI.ts +++ b/samples/client/others/typescript/builds/with-unique-items/types/PromiseAPI.ts @@ -1,6 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' -import type { Middleware } from "../middleware"; +import { PromiseMiddleware, Middleware, PromiseMiddlewareWrapper } from "../middleware"; import { Response } from '../models/Response'; import { ObservableDefaultApi } from './ObservableAPI'; @@ -19,15 +19,27 @@ export class PromiseDefaultApi { /** */ - public uniqueItemsWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.uniqueItemsWithHttpInfo(_options); + public uniqueItemsWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.uniqueItemsWithHttpInfo(observableOptions); return result.toPromise(); } /** */ - public uniqueItems(_options?: Configuration | Middleware[]): Promise { - const result = this.api.uniqueItems(_options); + public uniqueItems(_options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.uniqueItems(observableOptions); return result.toPromise(); } diff --git a/samples/client/others/typescript/encode-decode/build/index.ts b/samples/client/others/typescript/encode-decode/build/index.ts index 6d001268247c..ccfbb01e8850 100644 --- a/samples/client/others/typescript/encode-decode/build/index.ts +++ b/samples/client/others/typescript/encode-decode/build/index.ts @@ -8,5 +8,6 @@ export * from "./servers"; export { RequiredError } from "./apis/baseapi"; export type { PromiseMiddleware as Middleware } from './middleware'; +export type { Middleware as ObservableMiddleware } from './middleware'; export { PromiseDefaultApi as DefaultApi } from './types/PromiseAPI'; diff --git a/samples/client/others/typescript/encode-decode/build/types/PromiseAPI.ts b/samples/client/others/typescript/encode-decode/build/types/PromiseAPI.ts index 2ccf864c8913..433121a0c26b 100644 --- a/samples/client/others/typescript/encode-decode/build/types/PromiseAPI.ts +++ b/samples/client/others/typescript/encode-decode/build/types/PromiseAPI.ts @@ -1,6 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' -import type { Middleware } from "../middleware"; +import { PromiseMiddleware, Middleware, PromiseMiddlewareWrapper } from "../middleware"; import { ComplexObject } from '../models/ComplexObject'; import { CompositeObject } from '../models/CompositeObject'; @@ -20,481 +20,865 @@ export class PromiseDefaultApi { /** */ - public testDecodeArrayOfArraysGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise>>> { - const result = this.api.testDecodeArrayOfArraysGetWithHttpInfo(_options); + public testDecodeArrayOfArraysGetWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise>>> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodeArrayOfArraysGetWithHttpInfo(observableOptions); return result.toPromise(); } /** */ - public testDecodeArrayOfArraysGet(_options?: Configuration | Middleware[]): Promise>> { - const result = this.api.testDecodeArrayOfArraysGet(_options); + public testDecodeArrayOfArraysGet(_options?: Configuration | PromiseMiddleware[]): Promise>> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodeArrayOfArraysGet(observableOptions); return result.toPromise(); } /** */ - public testDecodeArrayOfGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise>> { - const result = this.api.testDecodeArrayOfGetWithHttpInfo(_options); + public testDecodeArrayOfGetWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise>> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodeArrayOfGetWithHttpInfo(observableOptions); return result.toPromise(); } /** */ - public testDecodeArrayOfGet(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.testDecodeArrayOfGet(_options); + public testDecodeArrayOfGet(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodeArrayOfGet(observableOptions); return result.toPromise(); } /** */ - public testDecodeArrayOfMapsOfObjectsGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise>> { - const result = this.api.testDecodeArrayOfMapsOfObjectsGetWithHttpInfo(_options); + public testDecodeArrayOfMapsOfObjectsGetWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise>> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodeArrayOfMapsOfObjectsGetWithHttpInfo(observableOptions); return result.toPromise(); } /** */ - public testDecodeArrayOfMapsOfObjectsGet(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.testDecodeArrayOfMapsOfObjectsGet(_options); + public testDecodeArrayOfMapsOfObjectsGet(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodeArrayOfMapsOfObjectsGet(observableOptions); return result.toPromise(); } /** */ - public testDecodeArrayOfNullableGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise>> { - const result = this.api.testDecodeArrayOfNullableGetWithHttpInfo(_options); + public testDecodeArrayOfNullableGetWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise>> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodeArrayOfNullableGetWithHttpInfo(observableOptions); return result.toPromise(); } /** */ - public testDecodeArrayOfNullableGet(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.testDecodeArrayOfNullableGet(_options); + public testDecodeArrayOfNullableGet(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodeArrayOfNullableGet(observableOptions); return result.toPromise(); } /** */ - public testDecodeArrayOfNullableObjectsGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise>> { - const result = this.api.testDecodeArrayOfNullableObjectsGetWithHttpInfo(_options); + public testDecodeArrayOfNullableObjectsGetWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise>> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodeArrayOfNullableObjectsGetWithHttpInfo(observableOptions); return result.toPromise(); } /** */ - public testDecodeArrayOfNullableObjectsGet(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.testDecodeArrayOfNullableObjectsGet(_options); + public testDecodeArrayOfNullableObjectsGet(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodeArrayOfNullableObjectsGet(observableOptions); return result.toPromise(); } /** */ - public testDecodeCompositeObjectsGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.testDecodeCompositeObjectsGetWithHttpInfo(_options); + public testDecodeCompositeObjectsGetWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodeCompositeObjectsGetWithHttpInfo(observableOptions); return result.toPromise(); } /** */ - public testDecodeCompositeObjectsGet(_options?: Configuration | Middleware[]): Promise { - const result = this.api.testDecodeCompositeObjectsGet(_options); + public testDecodeCompositeObjectsGet(_options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodeCompositeObjectsGet(observableOptions); return result.toPromise(); } /** */ - public testDecodeMapOfMapsOfObjectsGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.testDecodeMapOfMapsOfObjectsGetWithHttpInfo(_options); + public testDecodeMapOfMapsOfObjectsGetWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodeMapOfMapsOfObjectsGetWithHttpInfo(observableOptions); return result.toPromise(); } /** */ - public testDecodeMapOfMapsOfObjectsGet(_options?: Configuration | Middleware[]): Promise<{ [key: string]: { [key: string]: ComplexObject; }; }> { - const result = this.api.testDecodeMapOfMapsOfObjectsGet(_options); + public testDecodeMapOfMapsOfObjectsGet(_options?: Configuration | PromiseMiddleware[]): Promise<{ [key: string]: { [key: string]: ComplexObject; }; }> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodeMapOfMapsOfObjectsGet(observableOptions); return result.toPromise(); } /** */ - public testDecodeMapOfObjectsGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.testDecodeMapOfObjectsGetWithHttpInfo(_options); + public testDecodeMapOfObjectsGetWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodeMapOfObjectsGetWithHttpInfo(observableOptions); return result.toPromise(); } /** */ - public testDecodeMapOfObjectsGet(_options?: Configuration | Middleware[]): Promise<{ [key: string]: ComplexObject | null; }> { - const result = this.api.testDecodeMapOfObjectsGet(_options); + public testDecodeMapOfObjectsGet(_options?: Configuration | PromiseMiddleware[]): Promise<{ [key: string]: ComplexObject | null; }> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodeMapOfObjectsGet(observableOptions); return result.toPromise(); } /** */ - public testDecodeMapOfPrimitiveGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.testDecodeMapOfPrimitiveGetWithHttpInfo(_options); + public testDecodeMapOfPrimitiveGetWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodeMapOfPrimitiveGetWithHttpInfo(observableOptions); return result.toPromise(); } /** */ - public testDecodeMapOfPrimitiveGet(_options?: Configuration | Middleware[]): Promise<{ [key: string]: string; }> { - const result = this.api.testDecodeMapOfPrimitiveGet(_options); + public testDecodeMapOfPrimitiveGet(_options?: Configuration | PromiseMiddleware[]): Promise<{ [key: string]: string; }> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodeMapOfPrimitiveGet(observableOptions); return result.toPromise(); } /** */ - public testDecodeNullableArrayGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise>> { - const result = this.api.testDecodeNullableArrayGetWithHttpInfo(_options); + public testDecodeNullableArrayGetWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise>> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodeNullableArrayGetWithHttpInfo(observableOptions); return result.toPromise(); } /** */ - public testDecodeNullableArrayGet(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.testDecodeNullableArrayGet(_options); + public testDecodeNullableArrayGet(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodeNullableArrayGet(observableOptions); return result.toPromise(); } /** */ - public testDecodeNullableGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.testDecodeNullableGetWithHttpInfo(_options); + public testDecodeNullableGetWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodeNullableGetWithHttpInfo(observableOptions); return result.toPromise(); } /** */ - public testDecodeNullableGet(_options?: Configuration | Middleware[]): Promise { - const result = this.api.testDecodeNullableGet(_options); + public testDecodeNullableGet(_options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodeNullableGet(observableOptions); return result.toPromise(); } /** */ - public testDecodeObjectGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.testDecodeObjectGetWithHttpInfo(_options); + public testDecodeObjectGetWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodeObjectGetWithHttpInfo(observableOptions); return result.toPromise(); } /** */ - public testDecodeObjectGet(_options?: Configuration | Middleware[]): Promise { - const result = this.api.testDecodeObjectGet(_options); + public testDecodeObjectGet(_options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodeObjectGet(observableOptions); return result.toPromise(); } /** */ - public testDecodePrimitiveBooleanGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.testDecodePrimitiveBooleanGetWithHttpInfo(_options); + public testDecodePrimitiveBooleanGetWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodePrimitiveBooleanGetWithHttpInfo(observableOptions); return result.toPromise(); } /** */ - public testDecodePrimitiveBooleanGet(_options?: Configuration | Middleware[]): Promise { - const result = this.api.testDecodePrimitiveBooleanGet(_options); + public testDecodePrimitiveBooleanGet(_options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodePrimitiveBooleanGet(observableOptions); return result.toPromise(); } /** */ - public testDecodePrimitiveIntegerGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.testDecodePrimitiveIntegerGetWithHttpInfo(_options); + public testDecodePrimitiveIntegerGetWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodePrimitiveIntegerGetWithHttpInfo(observableOptions); return result.toPromise(); } /** */ - public testDecodePrimitiveIntegerGet(_options?: Configuration | Middleware[]): Promise { - const result = this.api.testDecodePrimitiveIntegerGet(_options); + public testDecodePrimitiveIntegerGet(_options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodePrimitiveIntegerGet(observableOptions); return result.toPromise(); } /** */ - public testDecodePrimitiveNumberGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.testDecodePrimitiveNumberGetWithHttpInfo(_options); + public testDecodePrimitiveNumberGetWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodePrimitiveNumberGetWithHttpInfo(observableOptions); return result.toPromise(); } /** */ - public testDecodePrimitiveNumberGet(_options?: Configuration | Middleware[]): Promise { - const result = this.api.testDecodePrimitiveNumberGet(_options); + public testDecodePrimitiveNumberGet(_options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodePrimitiveNumberGet(observableOptions); return result.toPromise(); } /** */ - public testDecodePrimitiveStringGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.testDecodePrimitiveStringGetWithHttpInfo(_options); + public testDecodePrimitiveStringGetWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodePrimitiveStringGetWithHttpInfo(observableOptions); return result.toPromise(); } /** */ - public testDecodePrimitiveStringGet(_options?: Configuration | Middleware[]): Promise { - const result = this.api.testDecodePrimitiveStringGet(_options); + public testDecodePrimitiveStringGet(_options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testDecodePrimitiveStringGet(observableOptions); return result.toPromise(); } /** * @param requestBody */ - public testEncodeArrayOfArraysPostWithHttpInfo(requestBody: Array>, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testEncodeArrayOfArraysPostWithHttpInfo(requestBody, _options); + public testEncodeArrayOfArraysPostWithHttpInfo(requestBody: Array>, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodeArrayOfArraysPostWithHttpInfo(requestBody, observableOptions); return result.toPromise(); } /** * @param requestBody */ - public testEncodeArrayOfArraysPost(requestBody: Array>, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testEncodeArrayOfArraysPost(requestBody, _options); + public testEncodeArrayOfArraysPost(requestBody: Array>, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodeArrayOfArraysPost(requestBody, observableOptions); return result.toPromise(); } /** * @param complexObject */ - public testEncodeArrayOfMapsOfObjectsPostWithHttpInfo(complexObject: Array<{ [key: string]: ComplexObject; }>, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testEncodeArrayOfMapsOfObjectsPostWithHttpInfo(complexObject, _options); + public testEncodeArrayOfMapsOfObjectsPostWithHttpInfo(complexObject: Array<{ [key: string]: ComplexObject; }>, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodeArrayOfMapsOfObjectsPostWithHttpInfo(complexObject, observableOptions); return result.toPromise(); } /** * @param complexObject */ - public testEncodeArrayOfMapsOfObjectsPost(complexObject: Array<{ [key: string]: ComplexObject; }>, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testEncodeArrayOfMapsOfObjectsPost(complexObject, _options); + public testEncodeArrayOfMapsOfObjectsPost(complexObject: Array<{ [key: string]: ComplexObject; }>, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodeArrayOfMapsOfObjectsPost(complexObject, observableOptions); return result.toPromise(); } /** * @param complexObject */ - public testEncodeArrayOfNullableObjectsPostWithHttpInfo(complexObject: Array, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testEncodeArrayOfNullableObjectsPostWithHttpInfo(complexObject, _options); + public testEncodeArrayOfNullableObjectsPostWithHttpInfo(complexObject: Array, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodeArrayOfNullableObjectsPostWithHttpInfo(complexObject, observableOptions); return result.toPromise(); } /** * @param complexObject */ - public testEncodeArrayOfNullableObjectsPost(complexObject: Array, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testEncodeArrayOfNullableObjectsPost(complexObject, _options); + public testEncodeArrayOfNullableObjectsPost(complexObject: Array, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodeArrayOfNullableObjectsPost(complexObject, observableOptions); return result.toPromise(); } /** * @param requestBody */ - public testEncodeArrayOfNullablePostWithHttpInfo(requestBody: Array, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testEncodeArrayOfNullablePostWithHttpInfo(requestBody, _options); + public testEncodeArrayOfNullablePostWithHttpInfo(requestBody: Array, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodeArrayOfNullablePostWithHttpInfo(requestBody, observableOptions); return result.toPromise(); } /** * @param requestBody */ - public testEncodeArrayOfNullablePost(requestBody: Array, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testEncodeArrayOfNullablePost(requestBody, _options); + public testEncodeArrayOfNullablePost(requestBody: Array, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodeArrayOfNullablePost(requestBody, observableOptions); return result.toPromise(); } /** * @param requestBody */ - public testEncodeArrayOfPostWithHttpInfo(requestBody: Array, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testEncodeArrayOfPostWithHttpInfo(requestBody, _options); + public testEncodeArrayOfPostWithHttpInfo(requestBody: Array, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodeArrayOfPostWithHttpInfo(requestBody, observableOptions); return result.toPromise(); } /** * @param requestBody */ - public testEncodeArrayOfPost(requestBody: Array, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testEncodeArrayOfPost(requestBody, _options); + public testEncodeArrayOfPost(requestBody: Array, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodeArrayOfPost(requestBody, observableOptions); return result.toPromise(); } /** * @param compositeObject */ - public testEncodeCompositeObjectsPostWithHttpInfo(compositeObject: CompositeObject, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testEncodeCompositeObjectsPostWithHttpInfo(compositeObject, _options); + public testEncodeCompositeObjectsPostWithHttpInfo(compositeObject: CompositeObject, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodeCompositeObjectsPostWithHttpInfo(compositeObject, observableOptions); return result.toPromise(); } /** * @param compositeObject */ - public testEncodeCompositeObjectsPost(compositeObject: CompositeObject, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testEncodeCompositeObjectsPost(compositeObject, _options); + public testEncodeCompositeObjectsPost(compositeObject: CompositeObject, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodeCompositeObjectsPost(compositeObject, observableOptions); return result.toPromise(); } /** * @param requestBody */ - public testEncodeMapOfMapsOfObjectsPostWithHttpInfo(requestBody: { [key: string]: { [key: string]: ComplexObject; }; }, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testEncodeMapOfMapsOfObjectsPostWithHttpInfo(requestBody, _options); + public testEncodeMapOfMapsOfObjectsPostWithHttpInfo(requestBody: { [key: string]: { [key: string]: ComplexObject; }; }, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodeMapOfMapsOfObjectsPostWithHttpInfo(requestBody, observableOptions); return result.toPromise(); } /** * @param requestBody */ - public testEncodeMapOfMapsOfObjectsPost(requestBody: { [key: string]: { [key: string]: ComplexObject; }; }, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testEncodeMapOfMapsOfObjectsPost(requestBody, _options); + public testEncodeMapOfMapsOfObjectsPost(requestBody: { [key: string]: { [key: string]: ComplexObject; }; }, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodeMapOfMapsOfObjectsPost(requestBody, observableOptions); return result.toPromise(); } /** * @param requestBody */ - public testEncodeMapOfObjectsPostWithHttpInfo(requestBody: { [key: string]: ComplexObject | null; }, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testEncodeMapOfObjectsPostWithHttpInfo(requestBody, _options); + public testEncodeMapOfObjectsPostWithHttpInfo(requestBody: { [key: string]: ComplexObject | null; }, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodeMapOfObjectsPostWithHttpInfo(requestBody, observableOptions); return result.toPromise(); } /** * @param requestBody */ - public testEncodeMapOfObjectsPost(requestBody: { [key: string]: ComplexObject | null; }, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testEncodeMapOfObjectsPost(requestBody, _options); + public testEncodeMapOfObjectsPost(requestBody: { [key: string]: ComplexObject | null; }, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodeMapOfObjectsPost(requestBody, observableOptions); return result.toPromise(); } /** * @param requestBody */ - public testEncodeMapOfPrimitivePostWithHttpInfo(requestBody: { [key: string]: string; }, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testEncodeMapOfPrimitivePostWithHttpInfo(requestBody, _options); + public testEncodeMapOfPrimitivePostWithHttpInfo(requestBody: { [key: string]: string; }, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodeMapOfPrimitivePostWithHttpInfo(requestBody, observableOptions); return result.toPromise(); } /** * @param requestBody */ - public testEncodeMapOfPrimitivePost(requestBody: { [key: string]: string; }, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testEncodeMapOfPrimitivePost(requestBody, _options); + public testEncodeMapOfPrimitivePost(requestBody: { [key: string]: string; }, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodeMapOfPrimitivePost(requestBody, observableOptions); return result.toPromise(); } /** * @param [requestBody] */ - public testEncodeNullableArrayPostWithHttpInfo(requestBody?: Array, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testEncodeNullableArrayPostWithHttpInfo(requestBody, _options); + public testEncodeNullableArrayPostWithHttpInfo(requestBody?: Array, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodeNullableArrayPostWithHttpInfo(requestBody, observableOptions); return result.toPromise(); } /** * @param [requestBody] */ - public testEncodeNullableArrayPost(requestBody?: Array, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testEncodeNullableArrayPost(requestBody, _options); + public testEncodeNullableArrayPost(requestBody?: Array, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodeNullableArrayPost(requestBody, observableOptions); return result.toPromise(); } /** * @param [body] */ - public testEncodeNullablePostWithHttpInfo(body?: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testEncodeNullablePostWithHttpInfo(body, _options); + public testEncodeNullablePostWithHttpInfo(body?: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodeNullablePostWithHttpInfo(body, observableOptions); return result.toPromise(); } /** * @param [body] */ - public testEncodeNullablePost(body?: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testEncodeNullablePost(body, _options); + public testEncodeNullablePost(body?: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodeNullablePost(body, observableOptions); return result.toPromise(); } /** * @param complexObject */ - public testEncodeObjectPostWithHttpInfo(complexObject: ComplexObject, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testEncodeObjectPostWithHttpInfo(complexObject, _options); + public testEncodeObjectPostWithHttpInfo(complexObject: ComplexObject, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodeObjectPostWithHttpInfo(complexObject, observableOptions); return result.toPromise(); } /** * @param complexObject */ - public testEncodeObjectPost(complexObject: ComplexObject, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testEncodeObjectPost(complexObject, _options); + public testEncodeObjectPost(complexObject: ComplexObject, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodeObjectPost(complexObject, observableOptions); return result.toPromise(); } /** * @param body */ - public testEncodePrimitiveBooleanPostWithHttpInfo(body: boolean, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testEncodePrimitiveBooleanPostWithHttpInfo(body, _options); + public testEncodePrimitiveBooleanPostWithHttpInfo(body: boolean, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodePrimitiveBooleanPostWithHttpInfo(body, observableOptions); return result.toPromise(); } /** * @param body */ - public testEncodePrimitiveBooleanPost(body: boolean, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testEncodePrimitiveBooleanPost(body, _options); + public testEncodePrimitiveBooleanPost(body: boolean, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodePrimitiveBooleanPost(body, observableOptions); return result.toPromise(); } /** * @param body */ - public testEncodePrimitiveIntegerPostWithHttpInfo(body: number, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testEncodePrimitiveIntegerPostWithHttpInfo(body, _options); + public testEncodePrimitiveIntegerPostWithHttpInfo(body: number, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodePrimitiveIntegerPostWithHttpInfo(body, observableOptions); return result.toPromise(); } /** * @param body */ - public testEncodePrimitiveIntegerPost(body: number, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testEncodePrimitiveIntegerPost(body, _options); + public testEncodePrimitiveIntegerPost(body: number, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodePrimitiveIntegerPost(body, observableOptions); return result.toPromise(); } /** * @param body */ - public testEncodePrimitiveNumberPostWithHttpInfo(body: number, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testEncodePrimitiveNumberPostWithHttpInfo(body, _options); + public testEncodePrimitiveNumberPostWithHttpInfo(body: number, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodePrimitiveNumberPostWithHttpInfo(body, observableOptions); return result.toPromise(); } /** * @param body */ - public testEncodePrimitiveNumberPost(body: number, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testEncodePrimitiveNumberPost(body, _options); + public testEncodePrimitiveNumberPost(body: number, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodePrimitiveNumberPost(body, observableOptions); return result.toPromise(); } /** * @param body */ - public testEncodePrimitiveStringPostWithHttpInfo(body: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testEncodePrimitiveStringPostWithHttpInfo(body, _options); + public testEncodePrimitiveStringPostWithHttpInfo(body: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodePrimitiveStringPostWithHttpInfo(body, observableOptions); return result.toPromise(); } /** * @param body */ - public testEncodePrimitiveStringPost(body: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testEncodePrimitiveStringPost(body, _options); + public testEncodePrimitiveStringPost(body: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEncodePrimitiveStringPost(body, observableOptions); return result.toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/browser/index.ts b/samples/openapi3/client/petstore/typescript/builds/browser/index.ts index 8e69260419b8..fa9fc8d0052b 100644 --- a/samples/openapi3/client/petstore/typescript/builds/browser/index.ts +++ b/samples/openapi3/client/petstore/typescript/builds/browser/index.ts @@ -8,5 +8,6 @@ export * from "./servers"; export { RequiredError } from "./apis/baseapi"; export type { PromiseMiddleware as Middleware } from './middleware'; +export type { Middleware as ObservableMiddleware } from './middleware'; export { PromisePetApi as PetApi, PromiseStoreApi as StoreApi, PromiseUserApi as UserApi } from './types/PromiseAPI'; diff --git a/samples/openapi3/client/petstore/typescript/builds/browser/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/browser/types/PromiseAPI.ts index d74bd8f9e572..007a485218f3 100644 --- a/samples/openapi3/client/petstore/typescript/builds/browser/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/browser/types/PromiseAPI.ts @@ -1,6 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' -import type { Middleware } from "../middleware"; +import { PromiseMiddleware, Middleware, PromiseMiddlewareWrapper } from "../middleware"; import { ApiResponse } from '../models/ApiResponse'; import { Category } from '../models/Category'; @@ -27,8 +27,14 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.addPetWithHttpInfo(pet, _options); + public addPetWithHttpInfo(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.addPetWithHttpInfo(pet, observableOptions); return result.toPromise(); } @@ -37,8 +43,14 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration | Middleware[]): Promise { - const result = this.api.addPet(pet, _options); + public addPet(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.addPet(pet, observableOptions); return result.toPromise(); } @@ -48,8 +60,14 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.deletePetWithHttpInfo(petId, apiKey, _options); + public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deletePetWithHttpInfo(petId, apiKey, observableOptions); return result.toPromise(); } @@ -59,8 +77,14 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.deletePet(petId, apiKey, _options); + public deletePet(petId: number, apiKey?: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deletePet(petId, apiKey, observableOptions); return result.toPromise(); } @@ -69,8 +93,14 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise>> { - const result = this.api.findPetsByStatusWithHttpInfo(status, _options); + public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | PromiseMiddleware[]): Promise>> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByStatusWithHttpInfo(status, observableOptions); return result.toPromise(); } @@ -79,8 +109,14 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.findPetsByStatus(status, _options); + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByStatus(status, observableOptions); return result.toPromise(); } @@ -89,8 +125,14 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | Middleware[]): Promise>> { - const result = this.api.findPetsByTagsWithHttpInfo(tags, _options); + public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | PromiseMiddleware[]): Promise>> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByTagsWithHttpInfo(tags, observableOptions); return result.toPromise(); } @@ -99,8 +141,14 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.findPetsByTags(tags, _options); + public findPetsByTags(tags: Array, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByTags(tags, observableOptions); return result.toPromise(); } @@ -109,8 +157,14 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.getPetByIdWithHttpInfo(petId, _options); + public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getPetByIdWithHttpInfo(petId, observableOptions); return result.toPromise(); } @@ -119,8 +173,14 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration | Middleware[]): Promise { - const result = this.api.getPetById(petId, _options); + public getPetById(petId: number, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getPetById(petId, observableOptions); return result.toPromise(); } @@ -129,8 +189,14 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.updatePetWithHttpInfo(pet, _options); + public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePetWithHttpInfo(pet, observableOptions); return result.toPromise(); } @@ -139,8 +205,14 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Promise { - const result = this.api.updatePet(pet, _options); + public updatePet(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePet(pet, observableOptions); return result.toPromise(); } @@ -151,8 +223,14 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.updatePetWithFormWithHttpInfo(petId, name, status, _options); + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePetWithFormWithHttpInfo(petId, name, status, observableOptions); return result.toPromise(); } @@ -163,8 +241,14 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.updatePetWithForm(petId, name, status, _options); + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePetWithForm(petId, name, status, observableOptions); return result.toPromise(); } @@ -175,8 +259,14 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options); + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.uploadFileWithHttpInfo(petId, additionalMetadata, file, observableOptions); return result.toPromise(); } @@ -187,8 +277,14 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise { - const result = this.api.uploadFile(petId, additionalMetadata, file, _options); + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.uploadFile(petId, additionalMetadata, file, observableOptions); return result.toPromise(); } @@ -216,8 +312,14 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.deleteOrderWithHttpInfo(orderId, _options); + public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteOrderWithHttpInfo(orderId, observableOptions); return result.toPromise(); } @@ -226,8 +328,14 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.deleteOrder(orderId, _options); + public deleteOrder(orderId: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteOrder(orderId, observableOptions); return result.toPromise(); } @@ -235,8 +343,14 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventoryWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.getInventoryWithHttpInfo(_options); + public getInventoryWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getInventoryWithHttpInfo(observableOptions); return result.toPromise(); } @@ -244,8 +358,14 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { - const result = this.api.getInventory(_options); + public getInventory(_options?: Configuration | PromiseMiddleware[]): Promise<{ [key: string]: number; }> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getInventory(observableOptions); return result.toPromise(); } @@ -254,8 +374,14 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.getOrderByIdWithHttpInfo(orderId, _options); + public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getOrderByIdWithHttpInfo(orderId, observableOptions); return result.toPromise(); } @@ -264,8 +390,14 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Promise { - const result = this.api.getOrderById(orderId, _options); + public getOrderById(orderId: number, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getOrderById(orderId, observableOptions); return result.toPromise(); } @@ -274,8 +406,14 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(order: Order, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.placeOrderWithHttpInfo(order, _options); + public placeOrderWithHttpInfo(order: Order, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.placeOrderWithHttpInfo(order, observableOptions); return result.toPromise(); } @@ -284,8 +422,14 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration | Middleware[]): Promise { - const result = this.api.placeOrder(order, _options); + public placeOrder(order: Order, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.placeOrder(order, observableOptions); return result.toPromise(); } @@ -313,8 +457,14 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUserWithHttpInfo(user: User, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.createUserWithHttpInfo(user, _options); + public createUserWithHttpInfo(user: User, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUserWithHttpInfo(user, observableOptions); return result.toPromise(); } @@ -323,8 +473,14 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration | Middleware[]): Promise { - const result = this.api.createUser(user, _options); + public createUser(user: User, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUser(user, observableOptions); return result.toPromise(); } @@ -333,8 +489,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.createUsersWithArrayInputWithHttpInfo(user, _options); + public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithArrayInputWithHttpInfo(user, observableOptions); return result.toPromise(); } @@ -343,8 +505,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Promise { - const result = this.api.createUsersWithArrayInput(user, _options); + public createUsersWithArrayInput(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithArrayInput(user, observableOptions); return result.toPromise(); } @@ -353,8 +521,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.createUsersWithListInputWithHttpInfo(user, _options); + public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithListInputWithHttpInfo(user, observableOptions); return result.toPromise(); } @@ -363,8 +537,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Promise { - const result = this.api.createUsersWithListInput(user, _options); + public createUsersWithListInput(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithListInput(user, observableOptions); return result.toPromise(); } @@ -373,8 +553,14 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.deleteUserWithHttpInfo(username, _options); + public deleteUserWithHttpInfo(username: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteUserWithHttpInfo(username, observableOptions); return result.toPromise(); } @@ -383,8 +569,14 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.deleteUser(username, _options); + public deleteUser(username: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteUser(username, observableOptions); return result.toPromise(); } @@ -393,8 +585,14 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.getUserByNameWithHttpInfo(username, _options); + public getUserByNameWithHttpInfo(username: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getUserByNameWithHttpInfo(username, observableOptions); return result.toPromise(); } @@ -403,8 +601,14 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.getUserByName(username, _options); + public getUserByName(username: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getUserByName(username, observableOptions); return result.toPromise(); } @@ -414,8 +618,14 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.loginUserWithHttpInfo(username, password, _options); + public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.loginUserWithHttpInfo(username, password, observableOptions); return result.toPromise(); } @@ -425,8 +635,14 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.loginUser(username, password, _options); + public loginUser(username: string, password: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.loginUser(username, password, observableOptions); return result.toPromise(); } @@ -434,8 +650,14 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUserWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.logoutUserWithHttpInfo(_options); + public logoutUserWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.logoutUserWithHttpInfo(observableOptions); return result.toPromise(); } @@ -443,8 +665,14 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration | Middleware[]): Promise { - const result = this.api.logoutUser(_options); + public logoutUser(_options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.logoutUser(observableOptions); return result.toPromise(); } @@ -454,8 +682,14 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.updateUserWithHttpInfo(username, user, _options); + public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updateUserWithHttpInfo(username, user, observableOptions); return result.toPromise(); } @@ -465,8 +699,14 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Promise { - const result = this.api.updateUser(username, user, _options); + public updateUser(username: string, user: User, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updateUser(username, user, observableOptions); return result.toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/index.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/index.ts index 6d001268247c..ccfbb01e8850 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/index.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/index.ts @@ -8,5 +8,6 @@ export * from "./servers"; export { RequiredError } from "./apis/baseapi"; export type { PromiseMiddleware as Middleware } from './middleware'; +export type { Middleware as ObservableMiddleware } from './middleware'; export { PromiseDefaultApi as DefaultApi } from './types/PromiseAPI'; diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/PromiseAPI.ts index ce68b9a7d35b..81d19d2aaf02 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/types/PromiseAPI.ts @@ -1,6 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' -import type { Middleware } from "../middleware"; +import { PromiseMiddleware, Middleware, PromiseMiddlewareWrapper } from "../middleware"; import { Cat } from '../models/Cat'; import { Dog } from '../models/Dog'; @@ -26,48 +26,84 @@ export class PromiseDefaultApi { /** * @param [filePostRequest] */ - public filePostWithHttpInfo(filePostRequest?: FilePostRequest, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.filePostWithHttpInfo(filePostRequest, _options); + public filePostWithHttpInfo(filePostRequest?: FilePostRequest, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.filePostWithHttpInfo(filePostRequest, observableOptions); return result.toPromise(); } /** * @param [filePostRequest] */ - public filePost(filePostRequest?: FilePostRequest, _options?: Configuration | Middleware[]): Promise { - const result = this.api.filePost(filePostRequest, _options); + public filePost(filePostRequest?: FilePostRequest, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.filePost(filePostRequest, observableOptions); return result.toPromise(); } /** * @param [petsFilteredPatchRequest] */ - public petsFilteredPatchWithHttpInfo(petsFilteredPatchRequest?: PetsFilteredPatchRequest, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.petsFilteredPatchWithHttpInfo(petsFilteredPatchRequest, _options); + public petsFilteredPatchWithHttpInfo(petsFilteredPatchRequest?: PetsFilteredPatchRequest, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.petsFilteredPatchWithHttpInfo(petsFilteredPatchRequest, observableOptions); return result.toPromise(); } /** * @param [petsFilteredPatchRequest] */ - public petsFilteredPatch(petsFilteredPatchRequest?: PetsFilteredPatchRequest, _options?: Configuration | Middleware[]): Promise { - const result = this.api.petsFilteredPatch(petsFilteredPatchRequest, _options); + public petsFilteredPatch(petsFilteredPatchRequest?: PetsFilteredPatchRequest, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.petsFilteredPatch(petsFilteredPatchRequest, observableOptions); return result.toPromise(); } /** * @param [petsPatchRequest] */ - public petsPatchWithHttpInfo(petsPatchRequest?: PetsPatchRequest, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.petsPatchWithHttpInfo(petsPatchRequest, _options); + public petsPatchWithHttpInfo(petsPatchRequest?: PetsPatchRequest, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.petsPatchWithHttpInfo(petsPatchRequest, observableOptions); return result.toPromise(); } /** * @param [petsPatchRequest] */ - public petsPatch(petsPatchRequest?: PetsPatchRequest, _options?: Configuration | Middleware[]): Promise { - const result = this.api.petsPatch(petsPatchRequest, _options); + public petsPatch(petsPatchRequest?: PetsPatchRequest, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.petsPatch(petsPatchRequest, observableOptions); return result.toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/index.ts b/samples/openapi3/client/petstore/typescript/builds/default/index.ts index 8e69260419b8..fa9fc8d0052b 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/index.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/index.ts @@ -8,5 +8,6 @@ export * from "./servers"; export { RequiredError } from "./apis/baseapi"; export type { PromiseMiddleware as Middleware } from './middleware'; +export type { Middleware as ObservableMiddleware } from './middleware'; export { PromisePetApi as PetApi, PromiseStoreApi as StoreApi, PromiseUserApi as UserApi } from './types/PromiseAPI'; diff --git a/samples/openapi3/client/petstore/typescript/builds/default/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/default/types/PromiseAPI.ts index d74bd8f9e572..007a485218f3 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/types/PromiseAPI.ts @@ -1,6 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' -import type { Middleware } from "../middleware"; +import { PromiseMiddleware, Middleware, PromiseMiddlewareWrapper } from "../middleware"; import { ApiResponse } from '../models/ApiResponse'; import { Category } from '../models/Category'; @@ -27,8 +27,14 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.addPetWithHttpInfo(pet, _options); + public addPetWithHttpInfo(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.addPetWithHttpInfo(pet, observableOptions); return result.toPromise(); } @@ -37,8 +43,14 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration | Middleware[]): Promise { - const result = this.api.addPet(pet, _options); + public addPet(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.addPet(pet, observableOptions); return result.toPromise(); } @@ -48,8 +60,14 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.deletePetWithHttpInfo(petId, apiKey, _options); + public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deletePetWithHttpInfo(petId, apiKey, observableOptions); return result.toPromise(); } @@ -59,8 +77,14 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.deletePet(petId, apiKey, _options); + public deletePet(petId: number, apiKey?: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deletePet(petId, apiKey, observableOptions); return result.toPromise(); } @@ -69,8 +93,14 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise>> { - const result = this.api.findPetsByStatusWithHttpInfo(status, _options); + public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | PromiseMiddleware[]): Promise>> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByStatusWithHttpInfo(status, observableOptions); return result.toPromise(); } @@ -79,8 +109,14 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.findPetsByStatus(status, _options); + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByStatus(status, observableOptions); return result.toPromise(); } @@ -89,8 +125,14 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | Middleware[]): Promise>> { - const result = this.api.findPetsByTagsWithHttpInfo(tags, _options); + public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | PromiseMiddleware[]): Promise>> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByTagsWithHttpInfo(tags, observableOptions); return result.toPromise(); } @@ -99,8 +141,14 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.findPetsByTags(tags, _options); + public findPetsByTags(tags: Array, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByTags(tags, observableOptions); return result.toPromise(); } @@ -109,8 +157,14 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.getPetByIdWithHttpInfo(petId, _options); + public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getPetByIdWithHttpInfo(petId, observableOptions); return result.toPromise(); } @@ -119,8 +173,14 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration | Middleware[]): Promise { - const result = this.api.getPetById(petId, _options); + public getPetById(petId: number, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getPetById(petId, observableOptions); return result.toPromise(); } @@ -129,8 +189,14 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.updatePetWithHttpInfo(pet, _options); + public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePetWithHttpInfo(pet, observableOptions); return result.toPromise(); } @@ -139,8 +205,14 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Promise { - const result = this.api.updatePet(pet, _options); + public updatePet(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePet(pet, observableOptions); return result.toPromise(); } @@ -151,8 +223,14 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.updatePetWithFormWithHttpInfo(petId, name, status, _options); + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePetWithFormWithHttpInfo(petId, name, status, observableOptions); return result.toPromise(); } @@ -163,8 +241,14 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.updatePetWithForm(petId, name, status, _options); + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePetWithForm(petId, name, status, observableOptions); return result.toPromise(); } @@ -175,8 +259,14 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options); + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.uploadFileWithHttpInfo(petId, additionalMetadata, file, observableOptions); return result.toPromise(); } @@ -187,8 +277,14 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise { - const result = this.api.uploadFile(petId, additionalMetadata, file, _options); + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.uploadFile(petId, additionalMetadata, file, observableOptions); return result.toPromise(); } @@ -216,8 +312,14 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.deleteOrderWithHttpInfo(orderId, _options); + public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteOrderWithHttpInfo(orderId, observableOptions); return result.toPromise(); } @@ -226,8 +328,14 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.deleteOrder(orderId, _options); + public deleteOrder(orderId: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteOrder(orderId, observableOptions); return result.toPromise(); } @@ -235,8 +343,14 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventoryWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.getInventoryWithHttpInfo(_options); + public getInventoryWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getInventoryWithHttpInfo(observableOptions); return result.toPromise(); } @@ -244,8 +358,14 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { - const result = this.api.getInventory(_options); + public getInventory(_options?: Configuration | PromiseMiddleware[]): Promise<{ [key: string]: number; }> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getInventory(observableOptions); return result.toPromise(); } @@ -254,8 +374,14 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.getOrderByIdWithHttpInfo(orderId, _options); + public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getOrderByIdWithHttpInfo(orderId, observableOptions); return result.toPromise(); } @@ -264,8 +390,14 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Promise { - const result = this.api.getOrderById(orderId, _options); + public getOrderById(orderId: number, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getOrderById(orderId, observableOptions); return result.toPromise(); } @@ -274,8 +406,14 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(order: Order, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.placeOrderWithHttpInfo(order, _options); + public placeOrderWithHttpInfo(order: Order, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.placeOrderWithHttpInfo(order, observableOptions); return result.toPromise(); } @@ -284,8 +422,14 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration | Middleware[]): Promise { - const result = this.api.placeOrder(order, _options); + public placeOrder(order: Order, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.placeOrder(order, observableOptions); return result.toPromise(); } @@ -313,8 +457,14 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUserWithHttpInfo(user: User, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.createUserWithHttpInfo(user, _options); + public createUserWithHttpInfo(user: User, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUserWithHttpInfo(user, observableOptions); return result.toPromise(); } @@ -323,8 +473,14 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration | Middleware[]): Promise { - const result = this.api.createUser(user, _options); + public createUser(user: User, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUser(user, observableOptions); return result.toPromise(); } @@ -333,8 +489,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.createUsersWithArrayInputWithHttpInfo(user, _options); + public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithArrayInputWithHttpInfo(user, observableOptions); return result.toPromise(); } @@ -343,8 +505,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Promise { - const result = this.api.createUsersWithArrayInput(user, _options); + public createUsersWithArrayInput(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithArrayInput(user, observableOptions); return result.toPromise(); } @@ -353,8 +521,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.createUsersWithListInputWithHttpInfo(user, _options); + public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithListInputWithHttpInfo(user, observableOptions); return result.toPromise(); } @@ -363,8 +537,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Promise { - const result = this.api.createUsersWithListInput(user, _options); + public createUsersWithListInput(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithListInput(user, observableOptions); return result.toPromise(); } @@ -373,8 +553,14 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.deleteUserWithHttpInfo(username, _options); + public deleteUserWithHttpInfo(username: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteUserWithHttpInfo(username, observableOptions); return result.toPromise(); } @@ -383,8 +569,14 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.deleteUser(username, _options); + public deleteUser(username: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteUser(username, observableOptions); return result.toPromise(); } @@ -393,8 +585,14 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.getUserByNameWithHttpInfo(username, _options); + public getUserByNameWithHttpInfo(username: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getUserByNameWithHttpInfo(username, observableOptions); return result.toPromise(); } @@ -403,8 +601,14 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.getUserByName(username, _options); + public getUserByName(username: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getUserByName(username, observableOptions); return result.toPromise(); } @@ -414,8 +618,14 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.loginUserWithHttpInfo(username, password, _options); + public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.loginUserWithHttpInfo(username, password, observableOptions); return result.toPromise(); } @@ -425,8 +635,14 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.loginUser(username, password, _options); + public loginUser(username: string, password: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.loginUser(username, password, observableOptions); return result.toPromise(); } @@ -434,8 +650,14 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUserWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.logoutUserWithHttpInfo(_options); + public logoutUserWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.logoutUserWithHttpInfo(observableOptions); return result.toPromise(); } @@ -443,8 +665,14 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration | Middleware[]): Promise { - const result = this.api.logoutUser(_options); + public logoutUser(_options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.logoutUser(observableOptions); return result.toPromise(); } @@ -454,8 +682,14 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.updateUserWithHttpInfo(username, user, _options); + public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updateUserWithHttpInfo(username, user, observableOptions); return result.toPromise(); } @@ -465,8 +699,14 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Promise { - const result = this.api.updateUser(username, user, _options); + public updateUser(username: string, user: User, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updateUser(username, user, observableOptions); return result.toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/index.ts b/samples/openapi3/client/petstore/typescript/builds/deno/index.ts index b73e795b265e..ae1a7c5c5e62 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/index.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/index.ts @@ -8,5 +8,6 @@ export * from "./servers.ts"; export { RequiredError } from "./apis/baseapi.ts"; export type { PromiseMiddleware as Middleware } from './middleware.ts'; +export type { Middleware as ObservableMiddleware } from './middleware.ts'; export { PromisePetApi as PetApi, PromiseStoreApi as StoreApi, PromiseUserApi as UserApi } from './types/PromiseAPI.ts'; diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/deno/types/PromiseAPI.ts index 089425c36809..5300164908ad 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/types/PromiseAPI.ts @@ -1,6 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http.ts'; import { Configuration} from '../configuration.ts' -import type { Middleware } from "../middleware"; +import { PromiseMiddleware, Middleware, PromiseMiddlewareWrapper } from "../middleware"; import { ApiResponse } from '../models/ApiResponse.ts'; import { Category } from '../models/Category.ts'; @@ -27,8 +27,14 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.addPetWithHttpInfo(pet, _options); + public addPetWithHttpInfo(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.addPetWithHttpInfo(pet, observableOptions); return result.toPromise(); } @@ -37,8 +43,14 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration | Middleware[]): Promise { - const result = this.api.addPet(pet, _options); + public addPet(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.addPet(pet, observableOptions); return result.toPromise(); } @@ -48,8 +60,14 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.deletePetWithHttpInfo(petId, apiKey, _options); + public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deletePetWithHttpInfo(petId, apiKey, observableOptions); return result.toPromise(); } @@ -59,8 +77,14 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.deletePet(petId, apiKey, _options); + public deletePet(petId: number, apiKey?: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deletePet(petId, apiKey, observableOptions); return result.toPromise(); } @@ -69,8 +93,14 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise>> { - const result = this.api.findPetsByStatusWithHttpInfo(status, _options); + public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | PromiseMiddleware[]): Promise>> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByStatusWithHttpInfo(status, observableOptions); return result.toPromise(); } @@ -79,8 +109,14 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.findPetsByStatus(status, _options); + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByStatus(status, observableOptions); return result.toPromise(); } @@ -89,8 +125,14 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | Middleware[]): Promise>> { - const result = this.api.findPetsByTagsWithHttpInfo(tags, _options); + public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | PromiseMiddleware[]): Promise>> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByTagsWithHttpInfo(tags, observableOptions); return result.toPromise(); } @@ -99,8 +141,14 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.findPetsByTags(tags, _options); + public findPetsByTags(tags: Array, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByTags(tags, observableOptions); return result.toPromise(); } @@ -109,8 +157,14 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.getPetByIdWithHttpInfo(petId, _options); + public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getPetByIdWithHttpInfo(petId, observableOptions); return result.toPromise(); } @@ -119,8 +173,14 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration | Middleware[]): Promise { - const result = this.api.getPetById(petId, _options); + public getPetById(petId: number, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getPetById(petId, observableOptions); return result.toPromise(); } @@ -129,8 +189,14 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.updatePetWithHttpInfo(pet, _options); + public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePetWithHttpInfo(pet, observableOptions); return result.toPromise(); } @@ -139,8 +205,14 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Promise { - const result = this.api.updatePet(pet, _options); + public updatePet(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePet(pet, observableOptions); return result.toPromise(); } @@ -151,8 +223,14 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.updatePetWithFormWithHttpInfo(petId, name, status, _options); + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePetWithFormWithHttpInfo(petId, name, status, observableOptions); return result.toPromise(); } @@ -163,8 +241,14 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.updatePetWithForm(petId, name, status, _options); + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePetWithForm(petId, name, status, observableOptions); return result.toPromise(); } @@ -175,8 +259,14 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options); + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.uploadFileWithHttpInfo(petId, additionalMetadata, file, observableOptions); return result.toPromise(); } @@ -187,8 +277,14 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise { - const result = this.api.uploadFile(petId, additionalMetadata, file, _options); + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.uploadFile(petId, additionalMetadata, file, observableOptions); return result.toPromise(); } @@ -216,8 +312,14 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.deleteOrderWithHttpInfo(orderId, _options); + public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteOrderWithHttpInfo(orderId, observableOptions); return result.toPromise(); } @@ -226,8 +328,14 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.deleteOrder(orderId, _options); + public deleteOrder(orderId: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteOrder(orderId, observableOptions); return result.toPromise(); } @@ -235,8 +343,14 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventoryWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.getInventoryWithHttpInfo(_options); + public getInventoryWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getInventoryWithHttpInfo(observableOptions); return result.toPromise(); } @@ -244,8 +358,14 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { - const result = this.api.getInventory(_options); + public getInventory(_options?: Configuration | PromiseMiddleware[]): Promise<{ [key: string]: number; }> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getInventory(observableOptions); return result.toPromise(); } @@ -254,8 +374,14 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.getOrderByIdWithHttpInfo(orderId, _options); + public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getOrderByIdWithHttpInfo(orderId, observableOptions); return result.toPromise(); } @@ -264,8 +390,14 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Promise { - const result = this.api.getOrderById(orderId, _options); + public getOrderById(orderId: number, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getOrderById(orderId, observableOptions); return result.toPromise(); } @@ -274,8 +406,14 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(order: Order, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.placeOrderWithHttpInfo(order, _options); + public placeOrderWithHttpInfo(order: Order, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.placeOrderWithHttpInfo(order, observableOptions); return result.toPromise(); } @@ -284,8 +422,14 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration | Middleware[]): Promise { - const result = this.api.placeOrder(order, _options); + public placeOrder(order: Order, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.placeOrder(order, observableOptions); return result.toPromise(); } @@ -313,8 +457,14 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUserWithHttpInfo(user: User, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.createUserWithHttpInfo(user, _options); + public createUserWithHttpInfo(user: User, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUserWithHttpInfo(user, observableOptions); return result.toPromise(); } @@ -323,8 +473,14 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration | Middleware[]): Promise { - const result = this.api.createUser(user, _options); + public createUser(user: User, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUser(user, observableOptions); return result.toPromise(); } @@ -333,8 +489,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.createUsersWithArrayInputWithHttpInfo(user, _options); + public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithArrayInputWithHttpInfo(user, observableOptions); return result.toPromise(); } @@ -343,8 +505,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Promise { - const result = this.api.createUsersWithArrayInput(user, _options); + public createUsersWithArrayInput(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithArrayInput(user, observableOptions); return result.toPromise(); } @@ -353,8 +521,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.createUsersWithListInputWithHttpInfo(user, _options); + public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithListInputWithHttpInfo(user, observableOptions); return result.toPromise(); } @@ -363,8 +537,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Promise { - const result = this.api.createUsersWithListInput(user, _options); + public createUsersWithListInput(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithListInput(user, observableOptions); return result.toPromise(); } @@ -373,8 +553,14 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.deleteUserWithHttpInfo(username, _options); + public deleteUserWithHttpInfo(username: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteUserWithHttpInfo(username, observableOptions); return result.toPromise(); } @@ -383,8 +569,14 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.deleteUser(username, _options); + public deleteUser(username: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteUser(username, observableOptions); return result.toPromise(); } @@ -393,8 +585,14 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.getUserByNameWithHttpInfo(username, _options); + public getUserByNameWithHttpInfo(username: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getUserByNameWithHttpInfo(username, observableOptions); return result.toPromise(); } @@ -403,8 +601,14 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.getUserByName(username, _options); + public getUserByName(username: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getUserByName(username, observableOptions); return result.toPromise(); } @@ -414,8 +618,14 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.loginUserWithHttpInfo(username, password, _options); + public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.loginUserWithHttpInfo(username, password, observableOptions); return result.toPromise(); } @@ -425,8 +635,14 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.loginUser(username, password, _options); + public loginUser(username: string, password: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.loginUser(username, password, observableOptions); return result.toPromise(); } @@ -434,8 +650,14 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUserWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.logoutUserWithHttpInfo(_options); + public logoutUserWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.logoutUserWithHttpInfo(observableOptions); return result.toPromise(); } @@ -443,8 +665,14 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration | Middleware[]): Promise { - const result = this.api.logoutUser(_options); + public logoutUser(_options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.logoutUser(observableOptions); return result.toPromise(); } @@ -454,8 +682,14 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.updateUserWithHttpInfo(username, user, _options); + public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updateUserWithHttpInfo(username, user, observableOptions); return result.toPromise(); } @@ -465,8 +699,14 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Promise { - const result = this.api.updateUser(username, user, _options); + public updateUser(username: string, user: User, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updateUser(username, user, observableOptions); return result.toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/index.ts b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/index.ts index 51e0083b07b3..0f564b62617f 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/index.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/index.ts @@ -8,5 +8,6 @@ export * from "./servers.ts"; export { RequiredError } from "./apis/baseapi.ts"; export type { PromiseMiddleware as Middleware } from './middleware.ts'; +export type { Middleware as ObservableMiddleware } from './middleware.ts'; export { type PetApiAddPetRequest, type PetApiDeletePetRequest, type PetApiFindPetsByStatusRequest, type PetApiFindPetsByTagsRequest, type PetApiGetPetByIdRequest, type PetApiUpdatePetRequest, type PetApiUpdatePetWithFormRequest, type PetApiUploadFileRequest, ObjectPetApi as PetApi, type StoreApiDeleteOrderRequest, type StoreApiGetInventoryRequest, type StoreApiGetOrderByIdRequest, type StoreApiPlaceOrderRequest, ObjectStoreApi as StoreApi, type UserApiCreateUserRequest, type UserApiCreateUsersWithArrayInputRequest, type UserApiCreateUsersWithListInputRequest, type UserApiDeleteUserRequest, type UserApiGetUserByNameRequest, type UserApiLoginUserRequest, type UserApiLogoutUserRequest, type UserApiUpdateUserRequest, ObjectUserApi as UserApi } from './types/ObjectParamAPI.ts'; diff --git a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/PromiseAPI.ts index 089425c36809..5300164908ad 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/types/PromiseAPI.ts @@ -1,6 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http.ts'; import { Configuration} from '../configuration.ts' -import type { Middleware } from "../middleware"; +import { PromiseMiddleware, Middleware, PromiseMiddlewareWrapper } from "../middleware"; import { ApiResponse } from '../models/ApiResponse.ts'; import { Category } from '../models/Category.ts'; @@ -27,8 +27,14 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.addPetWithHttpInfo(pet, _options); + public addPetWithHttpInfo(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.addPetWithHttpInfo(pet, observableOptions); return result.toPromise(); } @@ -37,8 +43,14 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration | Middleware[]): Promise { - const result = this.api.addPet(pet, _options); + public addPet(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.addPet(pet, observableOptions); return result.toPromise(); } @@ -48,8 +60,14 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.deletePetWithHttpInfo(petId, apiKey, _options); + public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deletePetWithHttpInfo(petId, apiKey, observableOptions); return result.toPromise(); } @@ -59,8 +77,14 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.deletePet(petId, apiKey, _options); + public deletePet(petId: number, apiKey?: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deletePet(petId, apiKey, observableOptions); return result.toPromise(); } @@ -69,8 +93,14 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise>> { - const result = this.api.findPetsByStatusWithHttpInfo(status, _options); + public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | PromiseMiddleware[]): Promise>> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByStatusWithHttpInfo(status, observableOptions); return result.toPromise(); } @@ -79,8 +109,14 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.findPetsByStatus(status, _options); + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByStatus(status, observableOptions); return result.toPromise(); } @@ -89,8 +125,14 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | Middleware[]): Promise>> { - const result = this.api.findPetsByTagsWithHttpInfo(tags, _options); + public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | PromiseMiddleware[]): Promise>> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByTagsWithHttpInfo(tags, observableOptions); return result.toPromise(); } @@ -99,8 +141,14 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.findPetsByTags(tags, _options); + public findPetsByTags(tags: Array, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByTags(tags, observableOptions); return result.toPromise(); } @@ -109,8 +157,14 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.getPetByIdWithHttpInfo(petId, _options); + public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getPetByIdWithHttpInfo(petId, observableOptions); return result.toPromise(); } @@ -119,8 +173,14 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration | Middleware[]): Promise { - const result = this.api.getPetById(petId, _options); + public getPetById(petId: number, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getPetById(petId, observableOptions); return result.toPromise(); } @@ -129,8 +189,14 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.updatePetWithHttpInfo(pet, _options); + public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePetWithHttpInfo(pet, observableOptions); return result.toPromise(); } @@ -139,8 +205,14 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Promise { - const result = this.api.updatePet(pet, _options); + public updatePet(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePet(pet, observableOptions); return result.toPromise(); } @@ -151,8 +223,14 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.updatePetWithFormWithHttpInfo(petId, name, status, _options); + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePetWithFormWithHttpInfo(petId, name, status, observableOptions); return result.toPromise(); } @@ -163,8 +241,14 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.updatePetWithForm(petId, name, status, _options); + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePetWithForm(petId, name, status, observableOptions); return result.toPromise(); } @@ -175,8 +259,14 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options); + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.uploadFileWithHttpInfo(petId, additionalMetadata, file, observableOptions); return result.toPromise(); } @@ -187,8 +277,14 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise { - const result = this.api.uploadFile(petId, additionalMetadata, file, _options); + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.uploadFile(petId, additionalMetadata, file, observableOptions); return result.toPromise(); } @@ -216,8 +312,14 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.deleteOrderWithHttpInfo(orderId, _options); + public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteOrderWithHttpInfo(orderId, observableOptions); return result.toPromise(); } @@ -226,8 +328,14 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.deleteOrder(orderId, _options); + public deleteOrder(orderId: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteOrder(orderId, observableOptions); return result.toPromise(); } @@ -235,8 +343,14 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventoryWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.getInventoryWithHttpInfo(_options); + public getInventoryWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getInventoryWithHttpInfo(observableOptions); return result.toPromise(); } @@ -244,8 +358,14 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { - const result = this.api.getInventory(_options); + public getInventory(_options?: Configuration | PromiseMiddleware[]): Promise<{ [key: string]: number; }> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getInventory(observableOptions); return result.toPromise(); } @@ -254,8 +374,14 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.getOrderByIdWithHttpInfo(orderId, _options); + public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getOrderByIdWithHttpInfo(orderId, observableOptions); return result.toPromise(); } @@ -264,8 +390,14 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Promise { - const result = this.api.getOrderById(orderId, _options); + public getOrderById(orderId: number, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getOrderById(orderId, observableOptions); return result.toPromise(); } @@ -274,8 +406,14 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(order: Order, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.placeOrderWithHttpInfo(order, _options); + public placeOrderWithHttpInfo(order: Order, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.placeOrderWithHttpInfo(order, observableOptions); return result.toPromise(); } @@ -284,8 +422,14 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration | Middleware[]): Promise { - const result = this.api.placeOrder(order, _options); + public placeOrder(order: Order, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.placeOrder(order, observableOptions); return result.toPromise(); } @@ -313,8 +457,14 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUserWithHttpInfo(user: User, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.createUserWithHttpInfo(user, _options); + public createUserWithHttpInfo(user: User, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUserWithHttpInfo(user, observableOptions); return result.toPromise(); } @@ -323,8 +473,14 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration | Middleware[]): Promise { - const result = this.api.createUser(user, _options); + public createUser(user: User, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUser(user, observableOptions); return result.toPromise(); } @@ -333,8 +489,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.createUsersWithArrayInputWithHttpInfo(user, _options); + public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithArrayInputWithHttpInfo(user, observableOptions); return result.toPromise(); } @@ -343,8 +505,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Promise { - const result = this.api.createUsersWithArrayInput(user, _options); + public createUsersWithArrayInput(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithArrayInput(user, observableOptions); return result.toPromise(); } @@ -353,8 +521,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.createUsersWithListInputWithHttpInfo(user, _options); + public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithListInputWithHttpInfo(user, observableOptions); return result.toPromise(); } @@ -363,8 +537,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Promise { - const result = this.api.createUsersWithListInput(user, _options); + public createUsersWithListInput(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithListInput(user, observableOptions); return result.toPromise(); } @@ -373,8 +553,14 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.deleteUserWithHttpInfo(username, _options); + public deleteUserWithHttpInfo(username: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteUserWithHttpInfo(username, observableOptions); return result.toPromise(); } @@ -383,8 +569,14 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.deleteUser(username, _options); + public deleteUser(username: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteUser(username, observableOptions); return result.toPromise(); } @@ -393,8 +585,14 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.getUserByNameWithHttpInfo(username, _options); + public getUserByNameWithHttpInfo(username: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getUserByNameWithHttpInfo(username, observableOptions); return result.toPromise(); } @@ -403,8 +601,14 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.getUserByName(username, _options); + public getUserByName(username: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getUserByName(username, observableOptions); return result.toPromise(); } @@ -414,8 +618,14 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.loginUserWithHttpInfo(username, password, _options); + public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.loginUserWithHttpInfo(username, password, observableOptions); return result.toPromise(); } @@ -425,8 +635,14 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.loginUser(username, password, _options); + public loginUser(username: string, password: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.loginUser(username, password, observableOptions); return result.toPromise(); } @@ -434,8 +650,14 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUserWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.logoutUserWithHttpInfo(_options); + public logoutUserWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.logoutUserWithHttpInfo(observableOptions); return result.toPromise(); } @@ -443,8 +665,14 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration | Middleware[]): Promise { - const result = this.api.logoutUser(_options); + public logoutUser(_options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.logoutUser(observableOptions); return result.toPromise(); } @@ -454,8 +682,14 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.updateUserWithHttpInfo(username, user, _options); + public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updateUserWithHttpInfo(username, user, observableOptions); return result.toPromise(); } @@ -465,8 +699,14 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Promise { - const result = this.api.updateUser(username, user, _options); + public updateUser(username: string, user: User, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updateUser(username, user, observableOptions); return result.toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/index.ts b/samples/openapi3/client/petstore/typescript/builds/explode-query/index.ts index 19ef8b964a74..9063ffc172d5 100644 --- a/samples/openapi3/client/petstore/typescript/builds/explode-query/index.ts +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/index.ts @@ -8,5 +8,6 @@ export * from "./servers"; export { RequiredError } from "./apis/baseapi"; export type { PromiseMiddleware as Middleware } from './middleware'; +export type { Middleware as ObservableMiddleware } from './middleware'; export { PromiseAnotherFakeApi as AnotherFakeApi, PromiseDefaultApi as DefaultApi, PromiseFakeApi as FakeApi, PromiseFakeClassnameTags123Api as FakeClassnameTags123Api, PromisePetApi as PetApi, PromiseStoreApi as StoreApi, PromiseUserApi as UserApi } from './types/PromiseAPI'; diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/explode-query/types/PromiseAPI.ts index 05cd2bcdc0b1..809fa3bdba6b 100644 --- a/samples/openapi3/client/petstore/typescript/builds/explode-query/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/types/PromiseAPI.ts @@ -1,6 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' -import type { Middleware } from "../middleware"; +import { PromiseMiddleware, Middleware, PromiseMiddlewareWrapper } from "../middleware"; import { AdditionalPropertiesClass } from '../models/AdditionalPropertiesClass'; import { AllOfWithSingleRef } from '../models/AllOfWithSingleRef'; @@ -68,8 +68,14 @@ export class PromiseAnotherFakeApi { * To test special tags * @param client client model */ - public _123testSpecialTagsWithHttpInfo(client: Client, _options?: Configuration | Middleware[]): Promise> { - const result = this.api._123testSpecialTagsWithHttpInfo(client, _options); + public _123testSpecialTagsWithHttpInfo(client: Client, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api._123testSpecialTagsWithHttpInfo(client, observableOptions); return result.toPromise(); } @@ -78,8 +84,14 @@ export class PromiseAnotherFakeApi { * To test special tags * @param client client model */ - public _123testSpecialTags(client: Client, _options?: Configuration | Middleware[]): Promise { - const result = this.api._123testSpecialTags(client, _options); + public _123testSpecialTags(client: Client, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api._123testSpecialTags(client, observableOptions); return result.toPromise(); } @@ -104,15 +116,27 @@ export class PromiseDefaultApi { /** */ - public fooGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.fooGetWithHttpInfo(_options); + public fooGetWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.fooGetWithHttpInfo(observableOptions); return result.toPromise(); } /** */ - public fooGet(_options?: Configuration | Middleware[]): Promise { - const result = this.api.fooGet(_options); + public fooGet(_options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.fooGet(observableOptions); return result.toPromise(); } @@ -138,32 +162,56 @@ export class PromiseFakeApi { /** * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys */ - public fakeBigDecimalMapWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.fakeBigDecimalMapWithHttpInfo(_options); + public fakeBigDecimalMapWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.fakeBigDecimalMapWithHttpInfo(observableOptions); return result.toPromise(); } /** * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys */ - public fakeBigDecimalMap(_options?: Configuration | Middleware[]): Promise { - const result = this.api.fakeBigDecimalMap(_options); + public fakeBigDecimalMap(_options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.fakeBigDecimalMap(observableOptions); return result.toPromise(); } /** * Health check endpoint */ - public fakeHealthGetWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.fakeHealthGetWithHttpInfo(_options); + public fakeHealthGetWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.fakeHealthGetWithHttpInfo(observableOptions); return result.toPromise(); } /** * Health check endpoint */ - public fakeHealthGet(_options?: Configuration | Middleware[]): Promise { - const result = this.api.fakeHealthGet(_options); + public fakeHealthGet(_options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.fakeHealthGet(observableOptions); return result.toPromise(); } @@ -173,8 +221,14 @@ export class PromiseFakeApi { * @param [query1] query parameter * @param [header1] header parameter */ - public fakeHttpSignatureTestWithHttpInfo(pet: Pet, query1?: string, header1?: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.fakeHttpSignatureTestWithHttpInfo(pet, query1, header1, _options); + public fakeHttpSignatureTestWithHttpInfo(pet: Pet, query1?: string, header1?: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.fakeHttpSignatureTestWithHttpInfo(pet, query1, header1, observableOptions); return result.toPromise(); } @@ -184,8 +238,14 @@ export class PromiseFakeApi { * @param [query1] query parameter * @param [header1] header parameter */ - public fakeHttpSignatureTest(pet: Pet, query1?: string, header1?: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.fakeHttpSignatureTest(pet, query1, header1, _options); + public fakeHttpSignatureTest(pet: Pet, query1?: string, header1?: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.fakeHttpSignatureTest(pet, query1, header1, observableOptions); return result.toPromise(); } @@ -193,8 +253,14 @@ export class PromiseFakeApi { * Test serialization of outer boolean types * @param [body] Input boolean as post body */ - public fakeOuterBooleanSerializeWithHttpInfo(body?: boolean, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.fakeOuterBooleanSerializeWithHttpInfo(body, _options); + public fakeOuterBooleanSerializeWithHttpInfo(body?: boolean, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.fakeOuterBooleanSerializeWithHttpInfo(body, observableOptions); return result.toPromise(); } @@ -202,8 +268,14 @@ export class PromiseFakeApi { * Test serialization of outer boolean types * @param [body] Input boolean as post body */ - public fakeOuterBooleanSerialize(body?: boolean, _options?: Configuration | Middleware[]): Promise { - const result = this.api.fakeOuterBooleanSerialize(body, _options); + public fakeOuterBooleanSerialize(body?: boolean, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.fakeOuterBooleanSerialize(body, observableOptions); return result.toPromise(); } @@ -211,8 +283,14 @@ export class PromiseFakeApi { * Test serialization of object with outer number type * @param [outerComposite] Input composite as post body */ - public fakeOuterCompositeSerializeWithHttpInfo(outerComposite?: OuterComposite, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.fakeOuterCompositeSerializeWithHttpInfo(outerComposite, _options); + public fakeOuterCompositeSerializeWithHttpInfo(outerComposite?: OuterComposite, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.fakeOuterCompositeSerializeWithHttpInfo(outerComposite, observableOptions); return result.toPromise(); } @@ -220,8 +298,14 @@ export class PromiseFakeApi { * Test serialization of object with outer number type * @param [outerComposite] Input composite as post body */ - public fakeOuterCompositeSerialize(outerComposite?: OuterComposite, _options?: Configuration | Middleware[]): Promise { - const result = this.api.fakeOuterCompositeSerialize(outerComposite, _options); + public fakeOuterCompositeSerialize(outerComposite?: OuterComposite, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.fakeOuterCompositeSerialize(outerComposite, observableOptions); return result.toPromise(); } @@ -229,8 +313,14 @@ export class PromiseFakeApi { * Test serialization of outer number types * @param [body] Input number as post body */ - public fakeOuterNumberSerializeWithHttpInfo(body?: number, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.fakeOuterNumberSerializeWithHttpInfo(body, _options); + public fakeOuterNumberSerializeWithHttpInfo(body?: number, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.fakeOuterNumberSerializeWithHttpInfo(body, observableOptions); return result.toPromise(); } @@ -238,8 +328,14 @@ export class PromiseFakeApi { * Test serialization of outer number types * @param [body] Input number as post body */ - public fakeOuterNumberSerialize(body?: number, _options?: Configuration | Middleware[]): Promise { - const result = this.api.fakeOuterNumberSerialize(body, _options); + public fakeOuterNumberSerialize(body?: number, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.fakeOuterNumberSerialize(body, observableOptions); return result.toPromise(); } @@ -247,8 +343,14 @@ export class PromiseFakeApi { * Test serialization of outer string types * @param [body] Input string as post body */ - public fakeOuterStringSerializeWithHttpInfo(body?: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.fakeOuterStringSerializeWithHttpInfo(body, _options); + public fakeOuterStringSerializeWithHttpInfo(body?: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.fakeOuterStringSerializeWithHttpInfo(body, observableOptions); return result.toPromise(); } @@ -256,8 +358,14 @@ export class PromiseFakeApi { * Test serialization of outer string types * @param [body] Input string as post body */ - public fakeOuterStringSerialize(body?: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.fakeOuterStringSerialize(body, _options); + public fakeOuterStringSerialize(body?: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.fakeOuterStringSerialize(body, observableOptions); return result.toPromise(); } @@ -265,8 +373,14 @@ export class PromiseFakeApi { * Test serialization of enum (int) properties with examples * @param outerObjectWithEnumProperty Input enum (int) as post body */ - public fakePropertyEnumIntegerSerializeWithHttpInfo(outerObjectWithEnumProperty: OuterObjectWithEnumProperty, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.fakePropertyEnumIntegerSerializeWithHttpInfo(outerObjectWithEnumProperty, _options); + public fakePropertyEnumIntegerSerializeWithHttpInfo(outerObjectWithEnumProperty: OuterObjectWithEnumProperty, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.fakePropertyEnumIntegerSerializeWithHttpInfo(outerObjectWithEnumProperty, observableOptions); return result.toPromise(); } @@ -274,8 +388,14 @@ export class PromiseFakeApi { * Test serialization of enum (int) properties with examples * @param outerObjectWithEnumProperty Input enum (int) as post body */ - public fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty: OuterObjectWithEnumProperty, _options?: Configuration | Middleware[]): Promise { - const result = this.api.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty, _options); + public fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty: OuterObjectWithEnumProperty, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty, observableOptions); return result.toPromise(); } @@ -283,8 +403,14 @@ export class PromiseFakeApi { * For this test, the body has to be a binary file. * @param body image to upload */ - public testBodyWithBinaryWithHttpInfo(body: HttpFile, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testBodyWithBinaryWithHttpInfo(body, _options); + public testBodyWithBinaryWithHttpInfo(body: HttpFile, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testBodyWithBinaryWithHttpInfo(body, observableOptions); return result.toPromise(); } @@ -292,8 +418,14 @@ export class PromiseFakeApi { * For this test, the body has to be a binary file. * @param body image to upload */ - public testBodyWithBinary(body: HttpFile, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testBodyWithBinary(body, _options); + public testBodyWithBinary(body: HttpFile, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testBodyWithBinary(body, observableOptions); return result.toPromise(); } @@ -301,8 +433,14 @@ export class PromiseFakeApi { * For this test, the body for this request must reference a schema named `File`. * @param fileSchemaTestClass */ - public testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass: FileSchemaTestClass, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass, _options); + public testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass: FileSchemaTestClass, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass, observableOptions); return result.toPromise(); } @@ -310,8 +448,14 @@ export class PromiseFakeApi { * For this test, the body for this request must reference a schema named `File`. * @param fileSchemaTestClass */ - public testBodyWithFileSchema(fileSchemaTestClass: FileSchemaTestClass, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testBodyWithFileSchema(fileSchemaTestClass, _options); + public testBodyWithFileSchema(fileSchemaTestClass: FileSchemaTestClass, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testBodyWithFileSchema(fileSchemaTestClass, observableOptions); return result.toPromise(); } @@ -319,8 +463,14 @@ export class PromiseFakeApi { * @param query * @param user */ - public testBodyWithQueryParamsWithHttpInfo(query: string, user: User, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testBodyWithQueryParamsWithHttpInfo(query, user, _options); + public testBodyWithQueryParamsWithHttpInfo(query: string, user: User, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testBodyWithQueryParamsWithHttpInfo(query, user, observableOptions); return result.toPromise(); } @@ -328,8 +478,14 @@ export class PromiseFakeApi { * @param query * @param user */ - public testBodyWithQueryParams(query: string, user: User, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testBodyWithQueryParams(query, user, _options); + public testBodyWithQueryParams(query: string, user: User, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testBodyWithQueryParams(query, user, observableOptions); return result.toPromise(); } @@ -338,8 +494,14 @@ export class PromiseFakeApi { * To test \"client\" model * @param client client model */ - public testClientModelWithHttpInfo(client: Client, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testClientModelWithHttpInfo(client, _options); + public testClientModelWithHttpInfo(client: Client, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testClientModelWithHttpInfo(client, observableOptions); return result.toPromise(); } @@ -348,8 +510,14 @@ export class PromiseFakeApi { * To test \"client\" model * @param client client model */ - public testClientModel(client: Client, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testClientModel(client, _options); + public testClientModel(client: Client, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testClientModel(client, observableOptions); return result.toPromise(); } @@ -371,8 +539,14 @@ export class PromiseFakeApi { * @param [password] None * @param [callback] None */ - public testEndpointParametersWithHttpInfo(number: number, _double: number, patternWithoutDelimiter: string, _byte: string, integer?: number, int32?: number, int64?: number, _float?: number, string?: string, binary?: HttpFile, date?: string, dateTime?: Date, password?: string, callback?: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, callback, _options); + public testEndpointParametersWithHttpInfo(number: number, _double: number, patternWithoutDelimiter: string, _byte: string, integer?: number, int32?: number, int64?: number, _float?: number, string?: string, binary?: HttpFile, date?: string, dateTime?: Date, password?: string, callback?: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, callback, observableOptions); return result.toPromise(); } @@ -394,8 +568,14 @@ export class PromiseFakeApi { * @param [password] None * @param [callback] None */ - public testEndpointParameters(number: number, _double: number, patternWithoutDelimiter: string, _byte: string, integer?: number, int32?: number, int64?: number, _float?: number, string?: string, binary?: HttpFile, date?: string, dateTime?: Date, password?: string, callback?: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, callback, _options); + public testEndpointParameters(number: number, _double: number, patternWithoutDelimiter: string, _byte: string, integer?: number, int32?: number, int64?: number, _float?: number, string?: string, binary?: HttpFile, date?: string, dateTime?: Date, password?: string, callback?: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, callback, observableOptions); return result.toPromise(); } @@ -412,8 +592,14 @@ export class PromiseFakeApi { * @param [enumFormStringArray] Form parameter enum test (string array) * @param [enumFormString] Form parameter enum test (string) */ - public testEnumParametersWithHttpInfo(enumHeaderStringArray?: Array<'>' | '$'>, enumHeaderString?: '_abc' | '-efg' | '(xyz)', enumQueryStringArray?: Array<'>' | '$'>, enumQueryString?: '_abc' | '-efg' | '(xyz)', enumQueryInteger?: 1 | -2, enumQueryDouble?: 1.1 | -1.2, enumQueryModelArray?: Array, enumFormStringArray?: Array, enumFormString?: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString, _options); + public testEnumParametersWithHttpInfo(enumHeaderStringArray?: Array<'>' | '$'>, enumHeaderString?: '_abc' | '-efg' | '(xyz)', enumQueryStringArray?: Array<'>' | '$'>, enumQueryString?: '_abc' | '-efg' | '(xyz)', enumQueryInteger?: 1 | -2, enumQueryDouble?: 1.1 | -1.2, enumQueryModelArray?: Array, enumFormStringArray?: Array, enumFormString?: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString, observableOptions); return result.toPromise(); } @@ -430,8 +616,14 @@ export class PromiseFakeApi { * @param [enumFormStringArray] Form parameter enum test (string array) * @param [enumFormString] Form parameter enum test (string) */ - public testEnumParameters(enumHeaderStringArray?: Array<'>' | '$'>, enumHeaderString?: '_abc' | '-efg' | '(xyz)', enumQueryStringArray?: Array<'>' | '$'>, enumQueryString?: '_abc' | '-efg' | '(xyz)', enumQueryInteger?: 1 | -2, enumQueryDouble?: 1.1 | -1.2, enumQueryModelArray?: Array, enumFormStringArray?: Array, enumFormString?: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString, _options); + public testEnumParameters(enumHeaderStringArray?: Array<'>' | '$'>, enumHeaderString?: '_abc' | '-efg' | '(xyz)', enumQueryStringArray?: Array<'>' | '$'>, enumQueryString?: '_abc' | '-efg' | '(xyz)', enumQueryInteger?: 1 | -2, enumQueryDouble?: 1.1 | -1.2, enumQueryModelArray?: Array, enumFormStringArray?: Array, enumFormString?: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString, observableOptions); return result.toPromise(); } @@ -445,8 +637,14 @@ export class PromiseFakeApi { * @param [booleanGroup] Boolean in group parameters * @param [int64Group] Integer in group parameters */ - public testGroupParametersWithHttpInfo(requiredStringGroup: number, requiredBooleanGroup: boolean, requiredInt64Group: number, stringGroup?: number, booleanGroup?: boolean, int64Group?: number, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, _options); + public testGroupParametersWithHttpInfo(requiredStringGroup: number, requiredBooleanGroup: boolean, requiredInt64Group: number, stringGroup?: number, booleanGroup?: boolean, int64Group?: number, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, observableOptions); return result.toPromise(); } @@ -460,8 +658,14 @@ export class PromiseFakeApi { * @param [booleanGroup] Boolean in group parameters * @param [int64Group] Integer in group parameters */ - public testGroupParameters(requiredStringGroup: number, requiredBooleanGroup: boolean, requiredInt64Group: number, stringGroup?: number, booleanGroup?: boolean, int64Group?: number, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, _options); + public testGroupParameters(requiredStringGroup: number, requiredBooleanGroup: boolean, requiredInt64Group: number, stringGroup?: number, booleanGroup?: boolean, int64Group?: number, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, observableOptions); return result.toPromise(); } @@ -470,8 +674,14 @@ export class PromiseFakeApi { * test inline additionalProperties * @param requestBody request body */ - public testInlineAdditionalPropertiesWithHttpInfo(requestBody: { [key: string]: string; }, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testInlineAdditionalPropertiesWithHttpInfo(requestBody, _options); + public testInlineAdditionalPropertiesWithHttpInfo(requestBody: { [key: string]: string; }, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testInlineAdditionalPropertiesWithHttpInfo(requestBody, observableOptions); return result.toPromise(); } @@ -480,8 +690,14 @@ export class PromiseFakeApi { * test inline additionalProperties * @param requestBody request body */ - public testInlineAdditionalProperties(requestBody: { [key: string]: string; }, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testInlineAdditionalProperties(requestBody, _options); + public testInlineAdditionalProperties(requestBody: { [key: string]: string; }, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testInlineAdditionalProperties(requestBody, observableOptions); return result.toPromise(); } @@ -491,8 +707,14 @@ export class PromiseFakeApi { * @param param field1 * @param param2 field2 */ - public testJsonFormDataWithHttpInfo(param: string, param2: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testJsonFormDataWithHttpInfo(param, param2, _options); + public testJsonFormDataWithHttpInfo(param: string, param2: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testJsonFormDataWithHttpInfo(param, param2, observableOptions); return result.toPromise(); } @@ -502,8 +724,14 @@ export class PromiseFakeApi { * @param param field1 * @param param2 field2 */ - public testJsonFormData(param: string, param2: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testJsonFormData(param, param2, _options); + public testJsonFormData(param: string, param2: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testJsonFormData(param, param2, observableOptions); return result.toPromise(); } @@ -517,8 +745,14 @@ export class PromiseFakeApi { * @param allowEmpty * @param [language] */ - public testQueryParameterCollectionFormatWithHttpInfo(pipe: Array, ioutil: Array, http: Array, url: Array, context: Array, allowEmpty: string, language?: { [key: string]: string; }, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, allowEmpty, language, _options); + public testQueryParameterCollectionFormatWithHttpInfo(pipe: Array, ioutil: Array, http: Array, url: Array, context: Array, allowEmpty: string, language?: { [key: string]: string; }, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, allowEmpty, language, observableOptions); return result.toPromise(); } @@ -532,8 +766,14 @@ export class PromiseFakeApi { * @param allowEmpty * @param [language] */ - public testQueryParameterCollectionFormat(pipe: Array, ioutil: Array, http: Array, url: Array, context: Array, allowEmpty: string, language?: { [key: string]: string; }, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language, _options); + public testQueryParameterCollectionFormat(pipe: Array, ioutil: Array, http: Array, url: Array, context: Array, allowEmpty: string, language?: { [key: string]: string; }, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language, observableOptions); return result.toPromise(); } @@ -561,8 +801,14 @@ export class PromiseFakeClassnameTags123Api { * To test class name in snake case * @param client client model */ - public testClassnameWithHttpInfo(client: Client, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.testClassnameWithHttpInfo(client, _options); + public testClassnameWithHttpInfo(client: Client, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testClassnameWithHttpInfo(client, observableOptions); return result.toPromise(); } @@ -571,8 +817,14 @@ export class PromiseFakeClassnameTags123Api { * To test class name in snake case * @param client client model */ - public testClassname(client: Client, _options?: Configuration | Middleware[]): Promise { - const result = this.api.testClassname(client, _options); + public testClassname(client: Client, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.testClassname(client, observableOptions); return result.toPromise(); } @@ -600,8 +852,14 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.addPetWithHttpInfo(pet, _options); + public addPetWithHttpInfo(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.addPetWithHttpInfo(pet, observableOptions); return result.toPromise(); } @@ -610,8 +868,14 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration | Middleware[]): Promise { - const result = this.api.addPet(pet, _options); + public addPet(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.addPet(pet, observableOptions); return result.toPromise(); } @@ -621,8 +885,14 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.deletePetWithHttpInfo(petId, apiKey, _options); + public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deletePetWithHttpInfo(petId, apiKey, observableOptions); return result.toPromise(); } @@ -632,8 +902,14 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.deletePet(petId, apiKey, _options); + public deletePet(petId: number, apiKey?: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deletePet(petId, apiKey, observableOptions); return result.toPromise(); } @@ -642,8 +918,14 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise>> { - const result = this.api.findPetsByStatusWithHttpInfo(status, _options); + public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | PromiseMiddleware[]): Promise>> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByStatusWithHttpInfo(status, observableOptions); return result.toPromise(); } @@ -652,8 +934,14 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.findPetsByStatus(status, _options); + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByStatus(status, observableOptions); return result.toPromise(); } @@ -662,8 +950,14 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Set, _options?: Configuration | Middleware[]): Promise>> { - const result = this.api.findPetsByTagsWithHttpInfo(tags, _options); + public findPetsByTagsWithHttpInfo(tags: Set, _options?: Configuration | PromiseMiddleware[]): Promise>> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByTagsWithHttpInfo(tags, observableOptions); return result.toPromise(); } @@ -672,8 +966,14 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Set, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.findPetsByTags(tags, _options); + public findPetsByTags(tags: Set, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByTags(tags, observableOptions); return result.toPromise(); } @@ -682,8 +982,14 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.getPetByIdWithHttpInfo(petId, _options); + public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getPetByIdWithHttpInfo(petId, observableOptions); return result.toPromise(); } @@ -692,8 +998,14 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration | Middleware[]): Promise { - const result = this.api.getPetById(petId, _options); + public getPetById(petId: number, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getPetById(petId, observableOptions); return result.toPromise(); } @@ -702,8 +1014,14 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.updatePetWithHttpInfo(pet, _options); + public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePetWithHttpInfo(pet, observableOptions); return result.toPromise(); } @@ -712,8 +1030,14 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Promise { - const result = this.api.updatePet(pet, _options); + public updatePet(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePet(pet, observableOptions); return result.toPromise(); } @@ -724,8 +1048,14 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.updatePetWithFormWithHttpInfo(petId, name, status, _options); + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePetWithFormWithHttpInfo(petId, name, status, observableOptions); return result.toPromise(); } @@ -736,8 +1066,14 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.updatePetWithForm(petId, name, status, _options); + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePetWithForm(petId, name, status, observableOptions); return result.toPromise(); } @@ -748,8 +1084,14 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options); + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.uploadFileWithHttpInfo(petId, additionalMetadata, file, observableOptions); return result.toPromise(); } @@ -760,8 +1102,14 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise { - const result = this.api.uploadFile(petId, additionalMetadata, file, _options); + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.uploadFile(petId, additionalMetadata, file, observableOptions); return result.toPromise(); } @@ -772,8 +1120,14 @@ export class PromisePetApi { * @param requiredFile file to upload * @param [additionalMetadata] Additional data to pass to server */ - public uploadFileWithRequiredFileWithHttpInfo(petId: number, requiredFile: HttpFile, additionalMetadata?: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata, _options); + public uploadFileWithRequiredFileWithHttpInfo(petId: number, requiredFile: HttpFile, additionalMetadata?: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata, observableOptions); return result.toPromise(); } @@ -784,8 +1138,14 @@ export class PromisePetApi { * @param requiredFile file to upload * @param [additionalMetadata] Additional data to pass to server */ - public uploadFileWithRequiredFile(petId: number, requiredFile: HttpFile, additionalMetadata?: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, _options); + public uploadFileWithRequiredFile(petId: number, requiredFile: HttpFile, additionalMetadata?: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, observableOptions); return result.toPromise(); } @@ -813,8 +1173,14 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.deleteOrderWithHttpInfo(orderId, _options); + public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteOrderWithHttpInfo(orderId, observableOptions); return result.toPromise(); } @@ -823,8 +1189,14 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.deleteOrder(orderId, _options); + public deleteOrder(orderId: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteOrder(orderId, observableOptions); return result.toPromise(); } @@ -832,8 +1204,14 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventoryWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.getInventoryWithHttpInfo(_options); + public getInventoryWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getInventoryWithHttpInfo(observableOptions); return result.toPromise(); } @@ -841,8 +1219,14 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { - const result = this.api.getInventory(_options); + public getInventory(_options?: Configuration | PromiseMiddleware[]): Promise<{ [key: string]: number; }> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getInventory(observableOptions); return result.toPromise(); } @@ -851,8 +1235,14 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.getOrderByIdWithHttpInfo(orderId, _options); + public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getOrderByIdWithHttpInfo(orderId, observableOptions); return result.toPromise(); } @@ -861,8 +1251,14 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Promise { - const result = this.api.getOrderById(orderId, _options); + public getOrderById(orderId: number, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getOrderById(orderId, observableOptions); return result.toPromise(); } @@ -871,8 +1267,14 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(order: Order, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.placeOrderWithHttpInfo(order, _options); + public placeOrderWithHttpInfo(order: Order, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.placeOrderWithHttpInfo(order, observableOptions); return result.toPromise(); } @@ -881,8 +1283,14 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration | Middleware[]): Promise { - const result = this.api.placeOrder(order, _options); + public placeOrder(order: Order, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.placeOrder(order, observableOptions); return result.toPromise(); } @@ -910,8 +1318,14 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUserWithHttpInfo(user: User, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.createUserWithHttpInfo(user, _options); + public createUserWithHttpInfo(user: User, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUserWithHttpInfo(user, observableOptions); return result.toPromise(); } @@ -920,8 +1334,14 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration | Middleware[]): Promise { - const result = this.api.createUser(user, _options); + public createUser(user: User, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUser(user, observableOptions); return result.toPromise(); } @@ -930,8 +1350,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.createUsersWithArrayInputWithHttpInfo(user, _options); + public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithArrayInputWithHttpInfo(user, observableOptions); return result.toPromise(); } @@ -940,8 +1366,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Promise { - const result = this.api.createUsersWithArrayInput(user, _options); + public createUsersWithArrayInput(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithArrayInput(user, observableOptions); return result.toPromise(); } @@ -950,8 +1382,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.createUsersWithListInputWithHttpInfo(user, _options); + public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithListInputWithHttpInfo(user, observableOptions); return result.toPromise(); } @@ -960,8 +1398,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Promise { - const result = this.api.createUsersWithListInput(user, _options); + public createUsersWithListInput(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithListInput(user, observableOptions); return result.toPromise(); } @@ -970,8 +1414,14 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.deleteUserWithHttpInfo(username, _options); + public deleteUserWithHttpInfo(username: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteUserWithHttpInfo(username, observableOptions); return result.toPromise(); } @@ -980,8 +1430,14 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.deleteUser(username, _options); + public deleteUser(username: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteUser(username, observableOptions); return result.toPromise(); } @@ -990,8 +1446,14 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.getUserByNameWithHttpInfo(username, _options); + public getUserByNameWithHttpInfo(username: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getUserByNameWithHttpInfo(username, observableOptions); return result.toPromise(); } @@ -1000,8 +1462,14 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.getUserByName(username, _options); + public getUserByName(username: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getUserByName(username, observableOptions); return result.toPromise(); } @@ -1011,8 +1479,14 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.loginUserWithHttpInfo(username, password, _options); + public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.loginUserWithHttpInfo(username, password, observableOptions); return result.toPromise(); } @@ -1022,8 +1496,14 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.loginUser(username, password, _options); + public loginUser(username: string, password: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.loginUser(username, password, observableOptions); return result.toPromise(); } @@ -1031,8 +1511,14 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUserWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.logoutUserWithHttpInfo(_options); + public logoutUserWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.logoutUserWithHttpInfo(observableOptions); return result.toPromise(); } @@ -1040,8 +1526,14 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration | Middleware[]): Promise { - const result = this.api.logoutUser(_options); + public logoutUser(_options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.logoutUser(observableOptions); return result.toPromise(); } @@ -1051,8 +1543,14 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.updateUserWithHttpInfo(username, user, _options); + public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updateUserWithHttpInfo(username, user, observableOptions); return result.toPromise(); } @@ -1062,8 +1560,14 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Promise { - const result = this.api.updateUser(username, user, _options); + public updateUser(username: string, user: User, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updateUser(username, user, observableOptions); return result.toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/index.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/index.ts index 0097c028ed14..93a627dbfea6 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/index.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/index.ts @@ -8,6 +8,7 @@ export * from "./servers"; export { RequiredError } from "./apis/baseapi"; export type { PromiseMiddleware as Middleware } from './middleware'; +export type { Middleware as ObservableMiddleware } from './middleware'; export { PromisePetApi as PetApi, PromiseStoreApi as StoreApi, PromiseUserApi as UserApi } from './types/PromiseAPI'; export * from "./services/index"; diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/package-lock.json b/samples/openapi3/client/petstore/typescript/builds/inversify/package-lock.json index a3dc1641a005..1cb557a8cd38 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/package-lock.json +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/package-lock.json @@ -9,23 +9,25 @@ "version": "1.0.0", "license": "Unlicense", "dependencies": { - "@types/node": "*", + "@types/node": "^22.10.5", "@types/node-fetch": "^2.5.7", "es6-promise": "^4.2.4", "form-data": "^2.5.0", "inversify": "^6.0.1", - "node-fetch": "^2.6.0", - "url-parse": "^1.4.3" + "node-fetch": "^2.6.0" }, "devDependencies": { - "@types/url-parse": "1.4.4", "typescript": "^4.0" } }, "node_modules/@types/node": { - "version": "14.0.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.11.tgz", - "integrity": "sha512-lCvvI24L21ZVeIiyIUHZ5Oflv1hhHQ5E1S25IRlKIXaRkVgmXpJMI3wUJkmym2bTbCe+WoIibQnMVAU3FguaOg==" + "version": "22.10.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.5.tgz", + "integrity": "sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.20.0" + } }, "node_modules/@types/node-fetch": { "version": "2.5.7", @@ -49,12 +51,6 @@ "node": ">= 6" } }, - "node_modules/@types/url-parse": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/@types/url-parse/-/url-parse-1.4.4.tgz", - "integrity": "sha512-KtQLad12+4T/NfSxpoDhmr22+fig3T7/08QCgmutYA6QSznSRmEtuL95GrhVV40/0otTEdFc+etRcCTqhh1q5Q==", - "dev": true - }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -130,16 +126,6 @@ "node": "4.x || >=6.0.0" } }, - "node_modules/querystringify": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz", - "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==" - }, - "node_modules/requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" - }, "node_modules/typescript": { "version": "4.9.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", @@ -153,21 +139,21 @@ "node": ">=4.2.0" } }, - "node_modules/url-parse": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", - "integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==", - "dependencies": { - "querystringify": "^2.1.1", - "requires-port": "^1.0.0" - } + "node_modules/undici-types": { + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", + "license": "MIT" } }, "dependencies": { "@types/node": { - "version": "14.0.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.11.tgz", - "integrity": "sha512-lCvvI24L21ZVeIiyIUHZ5Oflv1hhHQ5E1S25IRlKIXaRkVgmXpJMI3wUJkmym2bTbCe+WoIibQnMVAU3FguaOg==" + "version": "22.10.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.5.tgz", + "integrity": "sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ==", + "requires": { + "undici-types": "~6.20.0" + } }, "@types/node-fetch": { "version": "2.5.7", @@ -190,12 +176,6 @@ } } }, - "@types/url-parse": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/@types/url-parse/-/url-parse-1.4.4.tgz", - "integrity": "sha512-KtQLad12+4T/NfSxpoDhmr22+fig3T7/08QCgmutYA6QSznSRmEtuL95GrhVV40/0otTEdFc+etRcCTqhh1q5Q==", - "dev": true - }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -252,30 +232,16 @@ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" }, - "querystringify": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz", - "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==" - }, - "requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" - }, "typescript": { "version": "4.9.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true }, - "url-parse": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", - "integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==", - "requires": { - "querystringify": "^2.1.1", - "requires-port": "^1.0.0" - } + "undici-types": { + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==" } } } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/types/PromiseAPI.ts index cd43df466230..756887e5798b 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/types/PromiseAPI.ts @@ -32,7 +32,8 @@ export class PromisePetApi { * @param pet Pet object that needs to be added to the store */ public addPetWithHttpInfo(pet: Pet, _options?: Configuration): Promise> { - const result = this.api.addPetWithHttpInfo(pet, _options); + const observableOptions = _options + const result = this.api.addPetWithHttpInfo(pet, observableOptions); return result.toPromise(); } @@ -42,7 +43,8 @@ export class PromisePetApi { * @param pet Pet object that needs to be added to the store */ public addPet(pet: Pet, _options?: Configuration): Promise { - const result = this.api.addPet(pet, _options); + const observableOptions = _options + const result = this.api.addPet(pet, observableOptions); return result.toPromise(); } @@ -53,7 +55,8 @@ export class PromisePetApi { * @param [apiKey] */ public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration): Promise> { - const result = this.api.deletePetWithHttpInfo(petId, apiKey, _options); + const observableOptions = _options + const result = this.api.deletePetWithHttpInfo(petId, apiKey, observableOptions); return result.toPromise(); } @@ -64,7 +67,8 @@ export class PromisePetApi { * @param [apiKey] */ public deletePet(petId: number, apiKey?: string, _options?: Configuration): Promise { - const result = this.api.deletePet(petId, apiKey, _options); + const observableOptions = _options + const result = this.api.deletePet(petId, apiKey, observableOptions); return result.toPromise(); } @@ -74,7 +78,8 @@ export class PromisePetApi { * @param status Status values that need to be considered for filter */ public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise>> { - const result = this.api.findPetsByStatusWithHttpInfo(status, _options); + const observableOptions = _options + const result = this.api.findPetsByStatusWithHttpInfo(status, observableOptions); return result.toPromise(); } @@ -84,7 +89,8 @@ export class PromisePetApi { * @param status Status values that need to be considered for filter */ public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration): Promise> { - const result = this.api.findPetsByStatus(status, _options); + const observableOptions = _options + const result = this.api.findPetsByStatus(status, observableOptions); return result.toPromise(); } @@ -94,7 +100,8 @@ export class PromisePetApi { * @param tags Tags to filter by */ public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration): Promise>> { - const result = this.api.findPetsByTagsWithHttpInfo(tags, _options); + const observableOptions = _options + const result = this.api.findPetsByTagsWithHttpInfo(tags, observableOptions); return result.toPromise(); } @@ -104,7 +111,8 @@ export class PromisePetApi { * @param tags Tags to filter by */ public findPetsByTags(tags: Array, _options?: Configuration): Promise> { - const result = this.api.findPetsByTags(tags, _options); + const observableOptions = _options + const result = this.api.findPetsByTags(tags, observableOptions); return result.toPromise(); } @@ -114,7 +122,8 @@ export class PromisePetApi { * @param petId ID of pet to return */ public getPetByIdWithHttpInfo(petId: number, _options?: Configuration): Promise> { - const result = this.api.getPetByIdWithHttpInfo(petId, _options); + const observableOptions = _options + const result = this.api.getPetByIdWithHttpInfo(petId, observableOptions); return result.toPromise(); } @@ -124,7 +133,8 @@ export class PromisePetApi { * @param petId ID of pet to return */ public getPetById(petId: number, _options?: Configuration): Promise { - const result = this.api.getPetById(petId, _options); + const observableOptions = _options + const result = this.api.getPetById(petId, observableOptions); return result.toPromise(); } @@ -134,7 +144,8 @@ export class PromisePetApi { * @param pet Pet object that needs to be added to the store */ public updatePetWithHttpInfo(pet: Pet, _options?: Configuration): Promise> { - const result = this.api.updatePetWithHttpInfo(pet, _options); + const observableOptions = _options + const result = this.api.updatePetWithHttpInfo(pet, observableOptions); return result.toPromise(); } @@ -144,7 +155,8 @@ export class PromisePetApi { * @param pet Pet object that needs to be added to the store */ public updatePet(pet: Pet, _options?: Configuration): Promise { - const result = this.api.updatePet(pet, _options); + const observableOptions = _options + const result = this.api.updatePet(pet, observableOptions); return result.toPromise(); } @@ -156,7 +168,8 @@ export class PromisePetApi { * @param [status] Updated status of the pet */ public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration): Promise> { - const result = this.api.updatePetWithFormWithHttpInfo(petId, name, status, _options); + const observableOptions = _options + const result = this.api.updatePetWithFormWithHttpInfo(petId, name, status, observableOptions); return result.toPromise(); } @@ -168,7 +181,8 @@ export class PromisePetApi { * @param [status] Updated status of the pet */ public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration): Promise { - const result = this.api.updatePetWithForm(petId, name, status, _options); + const observableOptions = _options + const result = this.api.updatePetWithForm(petId, name, status, observableOptions); return result.toPromise(); } @@ -180,7 +194,8 @@ export class PromisePetApi { * @param [file] file to upload */ public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise> { - const result = this.api.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options); + const observableOptions = _options + const result = this.api.uploadFileWithHttpInfo(petId, additionalMetadata, file, observableOptions); return result.toPromise(); } @@ -192,7 +207,8 @@ export class PromisePetApi { * @param [file] file to upload */ public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration): Promise { - const result = this.api.uploadFile(petId, additionalMetadata, file, _options); + const observableOptions = _options + const result = this.api.uploadFile(petId, additionalMetadata, file, observableOptions); return result.toPromise(); } @@ -224,7 +240,8 @@ export class PromiseStoreApi { * @param orderId ID of the order that needs to be deleted */ public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration): Promise> { - const result = this.api.deleteOrderWithHttpInfo(orderId, _options); + const observableOptions = _options + const result = this.api.deleteOrderWithHttpInfo(orderId, observableOptions); return result.toPromise(); } @@ -234,7 +251,8 @@ export class PromiseStoreApi { * @param orderId ID of the order that needs to be deleted */ public deleteOrder(orderId: string, _options?: Configuration): Promise { - const result = this.api.deleteOrder(orderId, _options); + const observableOptions = _options + const result = this.api.deleteOrder(orderId, observableOptions); return result.toPromise(); } @@ -243,7 +261,8 @@ export class PromiseStoreApi { * Returns pet inventories by status */ public getInventoryWithHttpInfo(_options?: Configuration): Promise> { - const result = this.api.getInventoryWithHttpInfo(_options); + const observableOptions = _options + const result = this.api.getInventoryWithHttpInfo(observableOptions); return result.toPromise(); } @@ -252,7 +271,8 @@ export class PromiseStoreApi { * Returns pet inventories by status */ public getInventory(_options?: Configuration): Promise<{ [key: string]: number; }> { - const result = this.api.getInventory(_options); + const observableOptions = _options + const result = this.api.getInventory(observableOptions); return result.toPromise(); } @@ -262,7 +282,8 @@ export class PromiseStoreApi { * @param orderId ID of pet that needs to be fetched */ public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration): Promise> { - const result = this.api.getOrderByIdWithHttpInfo(orderId, _options); + const observableOptions = _options + const result = this.api.getOrderByIdWithHttpInfo(orderId, observableOptions); return result.toPromise(); } @@ -272,7 +293,8 @@ export class PromiseStoreApi { * @param orderId ID of pet that needs to be fetched */ public getOrderById(orderId: number, _options?: Configuration): Promise { - const result = this.api.getOrderById(orderId, _options); + const observableOptions = _options + const result = this.api.getOrderById(orderId, observableOptions); return result.toPromise(); } @@ -282,7 +304,8 @@ export class PromiseStoreApi { * @param order order placed for purchasing the pet */ public placeOrderWithHttpInfo(order: Order, _options?: Configuration): Promise> { - const result = this.api.placeOrderWithHttpInfo(order, _options); + const observableOptions = _options + const result = this.api.placeOrderWithHttpInfo(order, observableOptions); return result.toPromise(); } @@ -292,7 +315,8 @@ export class PromiseStoreApi { * @param order order placed for purchasing the pet */ public placeOrder(order: Order, _options?: Configuration): Promise { - const result = this.api.placeOrder(order, _options); + const observableOptions = _options + const result = this.api.placeOrder(order, observableOptions); return result.toPromise(); } @@ -324,7 +348,8 @@ export class PromiseUserApi { * @param user Created user object */ public createUserWithHttpInfo(user: User, _options?: Configuration): Promise> { - const result = this.api.createUserWithHttpInfo(user, _options); + const observableOptions = _options + const result = this.api.createUserWithHttpInfo(user, observableOptions); return result.toPromise(); } @@ -334,7 +359,8 @@ export class PromiseUserApi { * @param user Created user object */ public createUser(user: User, _options?: Configuration): Promise { - const result = this.api.createUser(user, _options); + const observableOptions = _options + const result = this.api.createUser(user, observableOptions); return result.toPromise(); } @@ -344,7 +370,8 @@ export class PromiseUserApi { * @param user List of user object */ public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration): Promise> { - const result = this.api.createUsersWithArrayInputWithHttpInfo(user, _options); + const observableOptions = _options + const result = this.api.createUsersWithArrayInputWithHttpInfo(user, observableOptions); return result.toPromise(); } @@ -354,7 +381,8 @@ export class PromiseUserApi { * @param user List of user object */ public createUsersWithArrayInput(user: Array, _options?: Configuration): Promise { - const result = this.api.createUsersWithArrayInput(user, _options); + const observableOptions = _options + const result = this.api.createUsersWithArrayInput(user, observableOptions); return result.toPromise(); } @@ -364,7 +392,8 @@ export class PromiseUserApi { * @param user List of user object */ public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration): Promise> { - const result = this.api.createUsersWithListInputWithHttpInfo(user, _options); + const observableOptions = _options + const result = this.api.createUsersWithListInputWithHttpInfo(user, observableOptions); return result.toPromise(); } @@ -374,7 +403,8 @@ export class PromiseUserApi { * @param user List of user object */ public createUsersWithListInput(user: Array, _options?: Configuration): Promise { - const result = this.api.createUsersWithListInput(user, _options); + const observableOptions = _options + const result = this.api.createUsersWithListInput(user, observableOptions); return result.toPromise(); } @@ -384,7 +414,8 @@ export class PromiseUserApi { * @param username The name that needs to be deleted */ public deleteUserWithHttpInfo(username: string, _options?: Configuration): Promise> { - const result = this.api.deleteUserWithHttpInfo(username, _options); + const observableOptions = _options + const result = this.api.deleteUserWithHttpInfo(username, observableOptions); return result.toPromise(); } @@ -394,7 +425,8 @@ export class PromiseUserApi { * @param username The name that needs to be deleted */ public deleteUser(username: string, _options?: Configuration): Promise { - const result = this.api.deleteUser(username, _options); + const observableOptions = _options + const result = this.api.deleteUser(username, observableOptions); return result.toPromise(); } @@ -404,7 +436,8 @@ export class PromiseUserApi { * @param username The name that needs to be fetched. Use user1 for testing. */ public getUserByNameWithHttpInfo(username: string, _options?: Configuration): Promise> { - const result = this.api.getUserByNameWithHttpInfo(username, _options); + const observableOptions = _options + const result = this.api.getUserByNameWithHttpInfo(username, observableOptions); return result.toPromise(); } @@ -414,7 +447,8 @@ export class PromiseUserApi { * @param username The name that needs to be fetched. Use user1 for testing. */ public getUserByName(username: string, _options?: Configuration): Promise { - const result = this.api.getUserByName(username, _options); + const observableOptions = _options + const result = this.api.getUserByName(username, observableOptions); return result.toPromise(); } @@ -425,7 +459,8 @@ export class PromiseUserApi { * @param password The password for login in clear text */ public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration): Promise> { - const result = this.api.loginUserWithHttpInfo(username, password, _options); + const observableOptions = _options + const result = this.api.loginUserWithHttpInfo(username, password, observableOptions); return result.toPromise(); } @@ -436,7 +471,8 @@ export class PromiseUserApi { * @param password The password for login in clear text */ public loginUser(username: string, password: string, _options?: Configuration): Promise { - const result = this.api.loginUser(username, password, _options); + const observableOptions = _options + const result = this.api.loginUser(username, password, observableOptions); return result.toPromise(); } @@ -445,7 +481,8 @@ export class PromiseUserApi { * Logs out current logged in user session */ public logoutUserWithHttpInfo(_options?: Configuration): Promise> { - const result = this.api.logoutUserWithHttpInfo(_options); + const observableOptions = _options + const result = this.api.logoutUserWithHttpInfo(observableOptions); return result.toPromise(); } @@ -454,7 +491,8 @@ export class PromiseUserApi { * Logs out current logged in user session */ public logoutUser(_options?: Configuration): Promise { - const result = this.api.logoutUser(_options); + const observableOptions = _options + const result = this.api.logoutUser(observableOptions); return result.toPromise(); } @@ -465,7 +503,8 @@ export class PromiseUserApi { * @param user Updated user object */ public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration): Promise> { - const result = this.api.updateUserWithHttpInfo(username, user, _options); + const observableOptions = _options + const result = this.api.updateUserWithHttpInfo(username, user, observableOptions); return result.toPromise(); } @@ -476,7 +515,8 @@ export class PromiseUserApi { * @param user Updated user object */ public updateUser(username: string, user: User, _options?: Configuration): Promise { - const result = this.api.updateUser(username, user, _options); + const observableOptions = _options + const result = this.api.updateUser(username, user, observableOptions); return result.toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/index.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/index.ts index 8e69260419b8..fa9fc8d0052b 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/index.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/index.ts @@ -8,5 +8,6 @@ export * from "./servers"; export { RequiredError } from "./apis/baseapi"; export type { PromiseMiddleware as Middleware } from './middleware'; +export type { Middleware as ObservableMiddleware } from './middleware'; export { PromisePetApi as PetApi, PromiseStoreApi as StoreApi, PromiseUserApi as UserApi } from './types/PromiseAPI'; diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/types/PromiseAPI.ts index d74bd8f9e572..007a485218f3 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/types/PromiseAPI.ts @@ -1,6 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' -import type { Middleware } from "../middleware"; +import { PromiseMiddleware, Middleware, PromiseMiddlewareWrapper } from "../middleware"; import { ApiResponse } from '../models/ApiResponse'; import { Category } from '../models/Category'; @@ -27,8 +27,14 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.addPetWithHttpInfo(pet, _options); + public addPetWithHttpInfo(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.addPetWithHttpInfo(pet, observableOptions); return result.toPromise(); } @@ -37,8 +43,14 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration | Middleware[]): Promise { - const result = this.api.addPet(pet, _options); + public addPet(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.addPet(pet, observableOptions); return result.toPromise(); } @@ -48,8 +60,14 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.deletePetWithHttpInfo(petId, apiKey, _options); + public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deletePetWithHttpInfo(petId, apiKey, observableOptions); return result.toPromise(); } @@ -59,8 +77,14 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.deletePet(petId, apiKey, _options); + public deletePet(petId: number, apiKey?: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deletePet(petId, apiKey, observableOptions); return result.toPromise(); } @@ -69,8 +93,14 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise>> { - const result = this.api.findPetsByStatusWithHttpInfo(status, _options); + public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | PromiseMiddleware[]): Promise>> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByStatusWithHttpInfo(status, observableOptions); return result.toPromise(); } @@ -79,8 +109,14 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.findPetsByStatus(status, _options); + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByStatus(status, observableOptions); return result.toPromise(); } @@ -89,8 +125,14 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | Middleware[]): Promise>> { - const result = this.api.findPetsByTagsWithHttpInfo(tags, _options); + public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | PromiseMiddleware[]): Promise>> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByTagsWithHttpInfo(tags, observableOptions); return result.toPromise(); } @@ -99,8 +141,14 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.findPetsByTags(tags, _options); + public findPetsByTags(tags: Array, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByTags(tags, observableOptions); return result.toPromise(); } @@ -109,8 +157,14 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.getPetByIdWithHttpInfo(petId, _options); + public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getPetByIdWithHttpInfo(petId, observableOptions); return result.toPromise(); } @@ -119,8 +173,14 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration | Middleware[]): Promise { - const result = this.api.getPetById(petId, _options); + public getPetById(petId: number, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getPetById(petId, observableOptions); return result.toPromise(); } @@ -129,8 +189,14 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.updatePetWithHttpInfo(pet, _options); + public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePetWithHttpInfo(pet, observableOptions); return result.toPromise(); } @@ -139,8 +205,14 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Promise { - const result = this.api.updatePet(pet, _options); + public updatePet(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePet(pet, observableOptions); return result.toPromise(); } @@ -151,8 +223,14 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.updatePetWithFormWithHttpInfo(petId, name, status, _options); + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePetWithFormWithHttpInfo(petId, name, status, observableOptions); return result.toPromise(); } @@ -163,8 +241,14 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.updatePetWithForm(petId, name, status, _options); + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePetWithForm(petId, name, status, observableOptions); return result.toPromise(); } @@ -175,8 +259,14 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options); + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.uploadFileWithHttpInfo(petId, additionalMetadata, file, observableOptions); return result.toPromise(); } @@ -187,8 +277,14 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise { - const result = this.api.uploadFile(petId, additionalMetadata, file, _options); + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.uploadFile(petId, additionalMetadata, file, observableOptions); return result.toPromise(); } @@ -216,8 +312,14 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.deleteOrderWithHttpInfo(orderId, _options); + public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteOrderWithHttpInfo(orderId, observableOptions); return result.toPromise(); } @@ -226,8 +328,14 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.deleteOrder(orderId, _options); + public deleteOrder(orderId: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteOrder(orderId, observableOptions); return result.toPromise(); } @@ -235,8 +343,14 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventoryWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.getInventoryWithHttpInfo(_options); + public getInventoryWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getInventoryWithHttpInfo(observableOptions); return result.toPromise(); } @@ -244,8 +358,14 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { - const result = this.api.getInventory(_options); + public getInventory(_options?: Configuration | PromiseMiddleware[]): Promise<{ [key: string]: number; }> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getInventory(observableOptions); return result.toPromise(); } @@ -254,8 +374,14 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.getOrderByIdWithHttpInfo(orderId, _options); + public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getOrderByIdWithHttpInfo(orderId, observableOptions); return result.toPromise(); } @@ -264,8 +390,14 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Promise { - const result = this.api.getOrderById(orderId, _options); + public getOrderById(orderId: number, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getOrderById(orderId, observableOptions); return result.toPromise(); } @@ -274,8 +406,14 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(order: Order, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.placeOrderWithHttpInfo(order, _options); + public placeOrderWithHttpInfo(order: Order, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.placeOrderWithHttpInfo(order, observableOptions); return result.toPromise(); } @@ -284,8 +422,14 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration | Middleware[]): Promise { - const result = this.api.placeOrder(order, _options); + public placeOrder(order: Order, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.placeOrder(order, observableOptions); return result.toPromise(); } @@ -313,8 +457,14 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUserWithHttpInfo(user: User, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.createUserWithHttpInfo(user, _options); + public createUserWithHttpInfo(user: User, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUserWithHttpInfo(user, observableOptions); return result.toPromise(); } @@ -323,8 +473,14 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration | Middleware[]): Promise { - const result = this.api.createUser(user, _options); + public createUser(user: User, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUser(user, observableOptions); return result.toPromise(); } @@ -333,8 +489,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.createUsersWithArrayInputWithHttpInfo(user, _options); + public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithArrayInputWithHttpInfo(user, observableOptions); return result.toPromise(); } @@ -343,8 +505,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Promise { - const result = this.api.createUsersWithArrayInput(user, _options); + public createUsersWithArrayInput(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithArrayInput(user, observableOptions); return result.toPromise(); } @@ -353,8 +521,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.createUsersWithListInputWithHttpInfo(user, _options); + public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithListInputWithHttpInfo(user, observableOptions); return result.toPromise(); } @@ -363,8 +537,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Promise { - const result = this.api.createUsersWithListInput(user, _options); + public createUsersWithListInput(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithListInput(user, observableOptions); return result.toPromise(); } @@ -373,8 +553,14 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.deleteUserWithHttpInfo(username, _options); + public deleteUserWithHttpInfo(username: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteUserWithHttpInfo(username, observableOptions); return result.toPromise(); } @@ -383,8 +569,14 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.deleteUser(username, _options); + public deleteUser(username: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteUser(username, observableOptions); return result.toPromise(); } @@ -393,8 +585,14 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.getUserByNameWithHttpInfo(username, _options); + public getUserByNameWithHttpInfo(username: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getUserByNameWithHttpInfo(username, observableOptions); return result.toPromise(); } @@ -403,8 +601,14 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.getUserByName(username, _options); + public getUserByName(username: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getUserByName(username, observableOptions); return result.toPromise(); } @@ -414,8 +618,14 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.loginUserWithHttpInfo(username, password, _options); + public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.loginUserWithHttpInfo(username, password, observableOptions); return result.toPromise(); } @@ -425,8 +635,14 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.loginUser(username, password, _options); + public loginUser(username: string, password: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.loginUser(username, password, observableOptions); return result.toPromise(); } @@ -434,8 +650,14 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUserWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.logoutUserWithHttpInfo(_options); + public logoutUserWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.logoutUserWithHttpInfo(observableOptions); return result.toPromise(); } @@ -443,8 +665,14 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration | Middleware[]): Promise { - const result = this.api.logoutUser(_options); + public logoutUser(_options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.logoutUser(observableOptions); return result.toPromise(); } @@ -454,8 +682,14 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.updateUserWithHttpInfo(username, user, _options); + public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updateUserWithHttpInfo(username, user, observableOptions); return result.toPromise(); } @@ -465,8 +699,14 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Promise { - const result = this.api.updateUser(username, user, _options); + public updateUser(username: string, user: User, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updateUser(username, user, observableOptions); return result.toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/index.ts b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/index.ts index 6d001268247c..ccfbb01e8850 100644 --- a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/index.ts +++ b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/index.ts @@ -8,5 +8,6 @@ export * from "./servers"; export { RequiredError } from "./apis/baseapi"; export type { PromiseMiddleware as Middleware } from './middleware'; +export type { Middleware as ObservableMiddleware } from './middleware'; export { PromiseDefaultApi as DefaultApi } from './types/PromiseAPI'; diff --git a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/PromiseAPI.ts index 418fd986e291..22a0a0de22b2 100644 --- a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/types/PromiseAPI.ts @@ -1,6 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' -import type { Middleware } from "../middleware"; +import { PromiseMiddleware, Middleware, PromiseMiddlewareWrapper } from "../middleware"; import { Response } from '../models/Response'; import { ObservableDefaultApi } from './ObservableAPI'; @@ -19,15 +19,27 @@ export class PromiseDefaultApi { /** */ - public uniqueItemsWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.uniqueItemsWithHttpInfo(_options); + public uniqueItemsWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.uniqueItemsWithHttpInfo(observableOptions); return result.toPromise(); } /** */ - public uniqueItems(_options?: Configuration | Middleware[]): Promise { - const result = this.api.uniqueItems(_options); + public uniqueItems(_options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.uniqueItems(observableOptions); return result.toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/index.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/index.ts index f0461a413617..4379e1ab5cd3 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/index.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/index.ts @@ -8,5 +8,6 @@ export * from "./servers"; export { RequiredError } from "./apis/baseapi"; export type { PromiseMiddleware as Middleware } from './middleware'; +export type { Middleware as ObservableMiddleware } from './middleware'; export { type PetApiAddPetRequest, type PetApiDeletePetRequest, type PetApiFindPetsByStatusRequest, type PetApiFindPetsByTagsRequest, type PetApiGetPetByIdRequest, type PetApiUpdatePetRequest, type PetApiUpdatePetWithFormRequest, type PetApiUploadFileRequest, ObjectPetApi as PetApi, type StoreApiDeleteOrderRequest, type StoreApiGetInventoryRequest, type StoreApiGetOrderByIdRequest, type StoreApiPlaceOrderRequest, ObjectStoreApi as StoreApi, type UserApiCreateUserRequest, type UserApiCreateUsersWithArrayInputRequest, type UserApiCreateUsersWithListInputRequest, type UserApiDeleteUserRequest, type UserApiGetUserByNameRequest, type UserApiLoginUserRequest, type UserApiLogoutUserRequest, type UserApiUpdateUserRequest, ObjectUserApi as UserApi } from './types/ObjectParamAPI'; diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/types/PromiseAPI.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/types/PromiseAPI.ts index d74bd8f9e572..007a485218f3 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/types/PromiseAPI.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/types/PromiseAPI.ts @@ -1,6 +1,6 @@ import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; import { Configuration} from '../configuration' -import type { Middleware } from "../middleware"; +import { PromiseMiddleware, Middleware, PromiseMiddlewareWrapper } from "../middleware"; import { ApiResponse } from '../models/ApiResponse'; import { Category } from '../models/Category'; @@ -27,8 +27,14 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.addPetWithHttpInfo(pet, _options); + public addPetWithHttpInfo(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.addPetWithHttpInfo(pet, observableOptions); return result.toPromise(); } @@ -37,8 +43,14 @@ export class PromisePetApi { * Add a new pet to the store * @param pet Pet object that needs to be added to the store */ - public addPet(pet: Pet, _options?: Configuration | Middleware[]): Promise { - const result = this.api.addPet(pet, _options); + public addPet(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.addPet(pet, observableOptions); return result.toPromise(); } @@ -48,8 +60,14 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.deletePetWithHttpInfo(petId, apiKey, _options); + public deletePetWithHttpInfo(petId: number, apiKey?: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deletePetWithHttpInfo(petId, apiKey, observableOptions); return result.toPromise(); } @@ -59,8 +77,14 @@ export class PromisePetApi { * @param petId Pet id to delete * @param [apiKey] */ - public deletePet(petId: number, apiKey?: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.deletePet(petId, apiKey, _options); + public deletePet(petId: number, apiKey?: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deletePet(petId, apiKey, observableOptions); return result.toPromise(); } @@ -69,8 +93,14 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise>> { - const result = this.api.findPetsByStatusWithHttpInfo(status, _options); + public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | PromiseMiddleware[]): Promise>> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByStatusWithHttpInfo(status, observableOptions); return result.toPromise(); } @@ -79,8 +109,14 @@ export class PromisePetApi { * Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.findPetsByStatus(status, _options); + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByStatus(status, observableOptions); return result.toPromise(); } @@ -89,8 +125,14 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | Middleware[]): Promise>> { - const result = this.api.findPetsByTagsWithHttpInfo(tags, _options); + public findPetsByTagsWithHttpInfo(tags: Array, _options?: Configuration | PromiseMiddleware[]): Promise>> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByTagsWithHttpInfo(tags, observableOptions); return result.toPromise(); } @@ -99,8 +141,14 @@ export class PromisePetApi { * Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.findPetsByTags(tags, _options); + public findPetsByTags(tags: Array, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.findPetsByTags(tags, observableOptions); return result.toPromise(); } @@ -109,8 +157,14 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.getPetByIdWithHttpInfo(petId, _options); + public getPetByIdWithHttpInfo(petId: number, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getPetByIdWithHttpInfo(petId, observableOptions); return result.toPromise(); } @@ -119,8 +173,14 @@ export class PromisePetApi { * Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, _options?: Configuration | Middleware[]): Promise { - const result = this.api.getPetById(petId, _options); + public getPetById(petId: number, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getPetById(petId, observableOptions); return result.toPromise(); } @@ -129,8 +189,14 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.updatePetWithHttpInfo(pet, _options); + public updatePetWithHttpInfo(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePetWithHttpInfo(pet, observableOptions); return result.toPromise(); } @@ -139,8 +205,14 @@ export class PromisePetApi { * Update an existing pet * @param pet Pet object that needs to be added to the store */ - public updatePet(pet: Pet, _options?: Configuration | Middleware[]): Promise { - const result = this.api.updatePet(pet, _options); + public updatePet(pet: Pet, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePet(pet, observableOptions); return result.toPromise(); } @@ -151,8 +223,14 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.updatePetWithFormWithHttpInfo(petId, name, status, _options); + public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePetWithFormWithHttpInfo(petId, name, status, observableOptions); return result.toPromise(); } @@ -163,8 +241,14 @@ export class PromisePetApi { * @param [name] Updated name of the pet * @param [status] Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.updatePetWithForm(petId, name, status, _options); + public updatePetWithForm(petId: number, name?: string, status?: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updatePetWithForm(petId, name, status, observableOptions); return result.toPromise(); } @@ -175,8 +259,14 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.uploadFileWithHttpInfo(petId, additionalMetadata, file, _options); + public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.uploadFileWithHttpInfo(petId, additionalMetadata, file, observableOptions); return result.toPromise(); } @@ -187,8 +277,14 @@ export class PromisePetApi { * @param [additionalMetadata] Additional data to pass to server * @param [file] file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | Middleware[]): Promise { - const result = this.api.uploadFile(petId, additionalMetadata, file, _options); + public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.uploadFile(petId, additionalMetadata, file, observableOptions); return result.toPromise(); } @@ -216,8 +312,14 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.deleteOrderWithHttpInfo(orderId, _options); + public deleteOrderWithHttpInfo(orderId: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteOrderWithHttpInfo(orderId, observableOptions); return result.toPromise(); } @@ -226,8 +328,14 @@ export class PromiseStoreApi { * Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.deleteOrder(orderId, _options); + public deleteOrder(orderId: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteOrder(orderId, observableOptions); return result.toPromise(); } @@ -235,8 +343,14 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventoryWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.getInventoryWithHttpInfo(_options); + public getInventoryWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getInventoryWithHttpInfo(observableOptions); return result.toPromise(); } @@ -244,8 +358,14 @@ export class PromiseStoreApi { * Returns a map of status codes to quantities * Returns pet inventories by status */ - public getInventory(_options?: Configuration | Middleware[]): Promise<{ [key: string]: number; }> { - const result = this.api.getInventory(_options); + public getInventory(_options?: Configuration | PromiseMiddleware[]): Promise<{ [key: string]: number; }> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getInventory(observableOptions); return result.toPromise(); } @@ -254,8 +374,14 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.getOrderByIdWithHttpInfo(orderId, _options); + public getOrderByIdWithHttpInfo(orderId: number, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getOrderByIdWithHttpInfo(orderId, observableOptions); return result.toPromise(); } @@ -264,8 +390,14 @@ export class PromiseStoreApi { * Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, _options?: Configuration | Middleware[]): Promise { - const result = this.api.getOrderById(orderId, _options); + public getOrderById(orderId: number, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getOrderById(orderId, observableOptions); return result.toPromise(); } @@ -274,8 +406,14 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrderWithHttpInfo(order: Order, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.placeOrderWithHttpInfo(order, _options); + public placeOrderWithHttpInfo(order: Order, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.placeOrderWithHttpInfo(order, observableOptions); return result.toPromise(); } @@ -284,8 +422,14 @@ export class PromiseStoreApi { * Place an order for a pet * @param order order placed for purchasing the pet */ - public placeOrder(order: Order, _options?: Configuration | Middleware[]): Promise { - const result = this.api.placeOrder(order, _options); + public placeOrder(order: Order, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.placeOrder(order, observableOptions); return result.toPromise(); } @@ -313,8 +457,14 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUserWithHttpInfo(user: User, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.createUserWithHttpInfo(user, _options); + public createUserWithHttpInfo(user: User, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUserWithHttpInfo(user, observableOptions); return result.toPromise(); } @@ -323,8 +473,14 @@ export class PromiseUserApi { * Create user * @param user Created user object */ - public createUser(user: User, _options?: Configuration | Middleware[]): Promise { - const result = this.api.createUser(user, _options); + public createUser(user: User, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUser(user, observableOptions); return result.toPromise(); } @@ -333,8 +489,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.createUsersWithArrayInputWithHttpInfo(user, _options); + public createUsersWithArrayInputWithHttpInfo(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithArrayInputWithHttpInfo(user, observableOptions); return result.toPromise(); } @@ -343,8 +505,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithArrayInput(user: Array, _options?: Configuration | Middleware[]): Promise { - const result = this.api.createUsersWithArrayInput(user, _options); + public createUsersWithArrayInput(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithArrayInput(user, observableOptions); return result.toPromise(); } @@ -353,8 +521,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.createUsersWithListInputWithHttpInfo(user, _options); + public createUsersWithListInputWithHttpInfo(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithListInputWithHttpInfo(user, observableOptions); return result.toPromise(); } @@ -363,8 +537,14 @@ export class PromiseUserApi { * Creates list of users with given input array * @param user List of user object */ - public createUsersWithListInput(user: Array, _options?: Configuration | Middleware[]): Promise { - const result = this.api.createUsersWithListInput(user, _options); + public createUsersWithListInput(user: Array, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.createUsersWithListInput(user, observableOptions); return result.toPromise(); } @@ -373,8 +553,14 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUserWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.deleteUserWithHttpInfo(username, _options); + public deleteUserWithHttpInfo(username: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteUserWithHttpInfo(username, observableOptions); return result.toPromise(); } @@ -383,8 +569,14 @@ export class PromiseUserApi { * Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.deleteUser(username, _options); + public deleteUser(username: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.deleteUser(username, observableOptions); return result.toPromise(); } @@ -393,8 +585,14 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByNameWithHttpInfo(username: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.getUserByNameWithHttpInfo(username, _options); + public getUserByNameWithHttpInfo(username: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getUserByNameWithHttpInfo(username, observableOptions); return result.toPromise(); } @@ -403,8 +601,14 @@ export class PromiseUserApi { * Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.getUserByName(username, _options); + public getUserByName(username: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.getUserByName(username, observableOptions); return result.toPromise(); } @@ -414,8 +618,14 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.loginUserWithHttpInfo(username, password, _options); + public loginUserWithHttpInfo(username: string, password: string, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.loginUserWithHttpInfo(username, password, observableOptions); return result.toPromise(); } @@ -425,8 +635,14 @@ export class PromiseUserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, _options?: Configuration | Middleware[]): Promise { - const result = this.api.loginUser(username, password, _options); + public loginUser(username: string, password: string, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.loginUser(username, password, observableOptions); return result.toPromise(); } @@ -434,8 +650,14 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUserWithHttpInfo(_options?: Configuration | Middleware[]): Promise> { - const result = this.api.logoutUserWithHttpInfo(_options); + public logoutUserWithHttpInfo(_options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.logoutUserWithHttpInfo(observableOptions); return result.toPromise(); } @@ -443,8 +665,14 @@ export class PromiseUserApi { * * Logs out current logged in user session */ - public logoutUser(_options?: Configuration | Middleware[]): Promise { - const result = this.api.logoutUser(_options); + public logoutUser(_options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.logoutUser(observableOptions); return result.toPromise(); } @@ -454,8 +682,14 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | Middleware[]): Promise> { - const result = this.api.updateUserWithHttpInfo(username, user, _options); + public updateUserWithHttpInfo(username: string, user: User, _options?: Configuration | PromiseMiddleware[]): Promise> { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updateUserWithHttpInfo(username, user, observableOptions); return result.toPromise(); } @@ -465,8 +699,14 @@ export class PromiseUserApi { * @param username name that need to be deleted * @param user Updated user object */ - public updateUser(username: string, user: User, _options?: Configuration | Middleware[]): Promise { - const result = this.api.updateUser(username, user, _options); + public updateUser(username: string, user: User, _options?: Configuration | PromiseMiddleware[]): Promise { + let observableOptions: Configuration | undefined | Middleware[] + if (Array.isArray(_options)){ + observableOptions = _options.map(m => new PromiseMiddlewareWrapper(m)) + }else{ + observableOptions = _options + } + const result = this.api.updateUser(username, user, observableOptions); return result.toPromise(); } diff --git a/samples/openapi3/client/petstore/typescript/tests/default/test/api/PetApi.test.ts b/samples/openapi3/client/petstore/typescript/tests/default/test/api/PetApi.test.ts index 2b215ee28aea..e56bc7634d11 100644 --- a/samples/openapi3/client/petstore/typescript/tests/default/test/api/PetApi.test.ts +++ b/samples/openapi3/client/petstore/typescript/tests/default/test/api/PetApi.test.ts @@ -1,4 +1,5 @@ import * as petstore from 'ts-petstore-client' +import {Middleware, RequestContext, ResponseContext} from 'ts-petstore-client' import { expect } from "chai"; import * as fs from 'fs'; @@ -13,107 +14,127 @@ tag.id = Math.floor(Math.random() * 100000) let pet: petstore.Pet; describe("PetApi", () => { - beforeEach(async () => { - pet = new petstore.Pet() - pet.id = Math.floor(Math.random() * 100000) - pet.name = "PetName" - pet.photoUrls = [] - pet.status = petstore.PetStatusEnum.Available - pet.tags = [ tag ] - - await petApi.addPet(pet); - }); - - it("addPet", async () => { - const createdPet = await petApi.getPetById(pet.id) - expect(createdPet).to.deep.equal(pet); - }) - - it("deletePet", async () => { - await petApi.deletePet(pet.id); - let deletedPet; - try { - deletedPet = await petApi.getPetById(pet.id) - } catch (err) { - expect(err.code).to.equal(404); - expect(err.message).to.include("Pet not found"); - return; - } - throw new Error("Pet with id " + deletedPet.id + " was not deleted!"); - }) - - it("deleteNonExistentPet", async () => { - // Use an id that is too big for the server to handle. - const nonExistentId = 100000000000000000000000000; - try { - await petApi.deletePet(nonExistentId) - } catch (err) { - // The 404 response for this endpoint is officially documented, but - // that documentation is not used for generating the client code. - // That means we get an error about the response being undefined - // here. - expect(err.code).to.equal(404); - expect(err.message).to.include("Unknown API Status Code"); - expect(err.body).to.include("404"); - expect(err.body).to.include("message"); - return; - } - throw new Error("Deleted non-existent pet with id " + nonExistentId + "!"); - }) - - it("failRunTimeRequiredParameterCheck", async () => { - try { - await petApi.deletePet(null) - } catch (err) { - expect(err.api).to.equal("PetApi"); - expect(err.message).to.include("PetApi"); - expect(err.method).to.equal("deletePet"); - expect(err.message).to.include("deletePet"); - expect(err.field).to.equal("petId"); - expect(err.message).to.include("petId"); - return; - } - throw new Error("Accepted missing parameter!"); - }) - - it("findPetsByStatus", async () => { - const pets = await petApi.findPetsByStatus(["available"]); - expect(pets.length).to.be.at.least(1); - }) - - it("findPetsByTag", async () => { - const pets = await petApi.findPetsByTags([tag.name]) - expect(pets.length).to.be.at.least(1); - }) - - it("getPetById", async () => { - const returnedPet = await petApi.getPetById(pet.id); - expect(returnedPet).to.deep.equal(pet); - }) - - it("updatePet", async () => { - pet.name = "updated name"; - await petApi.updatePet(pet); - await petApi.updatePet(pet); - - const returnedPet = await petApi.getPetById(pet.id); - expect(returnedPet.id).to.equal(pet.id) - expect(returnedPet.name).to.equal(pet.name); - }) - - it("updatePetWithForm", async () => { - const updatedName = "updated name"; - await petApi.updatePetWithForm(pet.id, updatedName); - - const returnedPet = await petApi.getPetById(pet.id) - expect(returnedPet.id).to.equal(pet.id) - expect(returnedPet.name).to.equal(updatedName); - }) - - it("uploadFile", async () => { - const image = fs.readFileSync(__dirname + "/pet.png") - const response = await petApi.uploadFile(pet.id, "Metadata", { name: "pet.png", data: image}); - expect(response.code).to.be.gte(200).and.lt(300); - expect(response.message).to.contain("pet.png"); - }) -}) \ No newline at end of file + beforeEach(async () => { + pet = new petstore.Pet() + pet.id = Math.floor(Math.random() * 100000) + pet.name = "PetName" + pet.photoUrls = [] + pet.status = petstore.PetStatusEnum.Available + pet.tags = [tag] + + await petApi.addPet(pet); + }); + + it("addPet", async () => { + const createdPet = await petApi.getPetById(pet.id) + expect(createdPet).to.deep.equal(pet); + }) + + it("addPetViaMiddleware", async () => { + const IdOverrideMiddleware: Middleware = { + pre: (c: RequestContext)=> { + return new Promise((resolve)=>{ + const segments = c.getUrl().split('/') + segments[segments.length - 1] = pet.id.toString() + const newURL = segments.join('/') + c.setUrl(newURL) + resolve(c) + })}, + post: (c: ResponseContext)=> { + return new Promise((resolve)=>{ + resolve(c) + })}, + } + const wrongId = pet.id + 1 + const createdPet = await petApi.getPetById(wrongId, [IdOverrideMiddleware]) + expect(createdPet).to.deep.equal(pet); + }) + + it("deletePet", async () => { + await petApi.deletePet(pet.id); + let deletedPet; + try { + deletedPet = await petApi.getPetById(pet.id) + } catch (err) { + expect(err.code).to.equal(404); + expect(err.message).to.include("Pet not found"); + return; + } + throw new Error("Pet with id " + deletedPet.id + " was not deleted!"); + }) + + it("deleteNonExistentPet", async () => { + // Use an id that is too big for the server to handle. + const nonExistentId = 100000000000000000000000000; + try { + await petApi.deletePet(nonExistentId) + } catch (err) { + // The 404 response for this endpoint is officially documented, but + // that documentation is not used for generating the client code. + // That means we get an error about the response being undefined + // here. + expect(err.code).to.equal(404); + expect(err.message).to.include("Unknown API Status Code"); + expect(err.body).to.include("404"); + expect(err.body).to.include("message"); + return; + } + throw new Error("Deleted non-existent pet with id " + nonExistentId + "!"); + }) + + it("failRunTimeRequiredParameterCheck", async () => { + try { + await petApi.deletePet(null) + } catch (err) { + expect(err.api).to.equal("PetApi"); + expect(err.message).to.include("PetApi"); + expect(err.method).to.equal("deletePet"); + expect(err.message).to.include("deletePet"); + expect(err.field).to.equal("petId"); + expect(err.message).to.include("petId"); + return; + } + throw new Error("Accepted missing parameter!"); + }) + + it("findPetsByStatus", async () => { + const pets = await petApi.findPetsByStatus(["available"]); + expect(pets.length).to.be.at.least(1); + }) + + it("findPetsByTag", async () => { + const pets = await petApi.findPetsByTags([tag.name]) + expect(pets.length).to.be.at.least(1); + }) + + it("getPetById", async () => { + const returnedPet = await petApi.getPetById(pet.id); + expect(returnedPet).to.deep.equal(pet); + }) + + it("updatePet", async () => { + pet.name = "updated name"; + await petApi.updatePet(pet); + await petApi.updatePet(pet); + + const returnedPet = await petApi.getPetById(pet.id); + expect(returnedPet.id).to.equal(pet.id) + expect(returnedPet.name).to.equal(pet.name); + }) + + it("updatePetWithForm", async () => { + const updatedName = "updated name"; + await petApi.updatePetWithForm(pet.id, updatedName); + + const returnedPet = await petApi.getPetById(pet.id) + expect(returnedPet.id).to.equal(pet.id) + expect(returnedPet.name).to.equal(updatedName); + }) + + it("uploadFile", async () => { + const image = fs.readFileSync(__dirname + "/pet.png") + const response = await petApi.uploadFile(pet.id, "Metadata", { name: "pet.png", data: image }); + expect(response.code).to.be.gte(200).and.lt(300); + expect(response.message).to.contain("pet.png"); + }) +}) diff --git a/samples/openapi3/client/petstore/typescript/tests/inversify/package-lock.json b/samples/openapi3/client/petstore/typescript/tests/inversify/package-lock.json index f560a8eb10de..9b1648650ef3 100644 --- a/samples/openapi3/client/petstore/typescript/tests/inversify/package-lock.json +++ b/samples/openapi3/client/petstore/typescript/tests/inversify/package-lock.json @@ -37,12 +37,10 @@ "@types/node-fetch": "^2.5.7", "es6-promise": "^4.2.4", "form-data": "^2.5.0", - "inversify": "^5.0.1", - "node-fetch": "^2.6.0", - "url-parse": "^1.4.3" + "inversify": "^6.0.1", + "node-fetch": "^2.6.0" }, "devDependencies": { - "@types/url-parse": "1.4.4", "typescript": "^4.0" } }, @@ -126,31 +124,12 @@ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" }, - "../../builds/inversify/node_modules/querystringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.0.tgz", - "integrity": "sha512-sluvZZ1YiTLD5jsqZcDmFyV2EwToyXZBfpoVOmktMmW+VEnhgakFHnasVph65fOjGPTWN0Nw3+XQaSeMayr0kg==" - }, - "../../builds/inversify/node_modules/requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" - }, "../../builds/inversify/node_modules/typescript": { "version": "2.9.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz", "integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==", "dev": true }, - "../../builds/inversify/node_modules/url-parse": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.3.tgz", - "integrity": "sha512-rh+KuAW36YKo0vClhQzLLveoj8FwPJNu65xLb7Mrt+eZht0IPT0IXgSv8gcMegZ6NvjJUALf6Mf25POlMwD1Fw==", - "dependencies": { - "querystringify": "^2.0.0", - "requires-port": "^1.0.0" - } - }, "node_modules/@types/chai": { "version": "4.1.6", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.6.tgz", @@ -3129,13 +3108,11 @@ "requires": { "@types/node": "*", "@types/node-fetch": "^2.5.7", - "@types/url-parse": "1.4.4", "es6-promise": "^4.2.4", "form-data": "^2.5.0", - "inversify": "^5.0.1", + "inversify": "^6.0.1", "node-fetch": "^2.6.0", - "typescript": "^4.0", - "url-parse": "^1.4.3" + "typescript": "^4.0" }, "dependencies": { "@types/node": { @@ -3198,8 +3175,7 @@ } }, "inversify": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/inversify/-/inversify-5.0.1.tgz", + "version": "https://registry.npmjs.org/inversify/-/inversify-5.0.1.tgz", "integrity": "sha512-Ieh06s48WnEYGcqHepdsJUIJUXpwH5o5vodAX+DK2JA/gjy4EbEcQZxw+uFfzysmKjiLXGYwNG3qDZsKVMcINQ==" }, "mime-db": { @@ -3220,29 +3196,10 @@ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" }, - "querystringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.0.tgz", - "integrity": "sha512-sluvZZ1YiTLD5jsqZcDmFyV2EwToyXZBfpoVOmktMmW+VEnhgakFHnasVph65fOjGPTWN0Nw3+XQaSeMayr0kg==" - }, - "requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" - }, "typescript": { "version": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz", "integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==", "dev": true - }, - "url-parse": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.3.tgz", - "integrity": "sha512-rh+KuAW36YKo0vClhQzLLveoj8FwPJNu65xLb7Mrt+eZht0IPT0IXgSv8gcMegZ6NvjJUALf6Mf25POlMwD1Fw==", - "requires": { - "querystringify": "^2.0.0", - "requires-port": "^1.0.0" - } } } },