From c9a4b603f99b25d639897e46f560b61e141c16a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20C=C3=B4t=C3=A9?= Date: Tue, 9 Jul 2019 07:41:35 -0400 Subject: [PATCH 1/4] -Fix bug in fetch -> Missing "runtime" -Move fetch files to an "src" folder instead of doing everything at the root which removes the bugs when using the library itself -Fix the distribution of fetch using npm --- .../TypeScriptFetchClientCodegen.java | 13 +- .../resources/typescript-fetch/apis.mustache | 2 +- .../typescript-fetch/npmignore.mustache | 1 + .../typescript-fetch/package.mustache | 2 +- .../typescript-fetch/tsconfig.mustache | 1 - .../typescript-fetch/builds/default/api.ts | 1928 ----------------- .../builds/default/models/ApiResponse.ts | 60 - .../builds/default/models/InlineObject.ts | 52 - .../builds/default/models/InlineObject1.ts | 52 - .../builds/default/{ => src}/apis/PetApi.ts | 0 .../builds/default/{ => src}/apis/StoreApi.ts | 0 .../builds/default/{ => src}/apis/UserApi.ts | 0 .../builds/default/{ => src}/apis/index.ts | 0 .../builds/default/{ => src}/index.ts | 0 .../default/{ => src}/models/Category.ts | 0 .../{ => src}/models/ModelApiResponse.ts | 0 .../builds/default/{ => src}/models/Order.ts | 0 .../builds/default/{ => src}/models/Pet.ts | 0 .../builds/default/{ => src}/models/Tag.ts | 0 .../builds/default/{ => src}/models/User.ts | 0 .../builds/default/{ => src}/models/index.ts | 0 .../builds/default/{ => src}/runtime.ts | 0 .../builds/default/tsconfig.json | 1 - .../builds/es6-target/models/ApiResponse.ts | 60 - .../builds/es6-target/models/InlineObject.ts | 52 - .../builds/es6-target/models/InlineObject1.ts | 52 - .../builds/es6-target/package.json | 2 +- .../es6-target/{ => src}/apis/PetApi.ts | 0 .../es6-target/{ => src}/apis/StoreApi.ts | 0 .../es6-target/{ => src}/apis/UserApi.ts | 0 .../builds/es6-target/{ => src}/apis/index.ts | 0 .../builds/es6-target/{ => src}/index.ts | 0 .../es6-target/{ => src}/models/Category.ts | 0 .../{ => src}/models/ModelApiResponse.ts | 0 .../es6-target/{ => src}/models/Order.ts | 0 .../builds/es6-target/{ => src}/models/Pet.ts | 0 .../builds/es6-target/{ => src}/models/Tag.ts | 0 .../es6-target/{ => src}/models/User.ts | 0 .../es6-target/{ => src}/models/index.ts | 0 .../builds/es6-target/{ => src}/runtime.ts | 0 .../builds/es6-target/tsconfig.json | 1 - .../with-interfaces/models/ApiResponse.ts | 60 - .../with-interfaces/models/InlineObject.ts | 52 - .../with-interfaces/models/InlineObject1.ts | 52 - .../with-interfaces/{ => src}/apis/PetApi.ts | 0 .../{ => src}/apis/StoreApi.ts | 0 .../with-interfaces/{ => src}/apis/UserApi.ts | 0 .../with-interfaces/{ => src}/apis/index.ts | 0 .../builds/with-interfaces/{ => src}/index.ts | 0 .../{ => src}/models/Category.ts | 0 .../{ => src}/models/ModelApiResponse.ts | 0 .../with-interfaces/{ => src}/models/Order.ts | 0 .../with-interfaces/{ => src}/models/Pet.ts | 0 .../with-interfaces/{ => src}/models/Tag.ts | 0 .../with-interfaces/{ => src}/models/User.ts | 0 .../with-interfaces/{ => src}/models/index.ts | 0 .../with-interfaces/{ => src}/runtime.ts | 0 .../builds/with-interfaces/tsconfig.json | 1 - .../with-npm-version/models/ApiResponse.ts | 60 - .../with-npm-version/models/InlineObject.ts | 52 - .../with-npm-version/models/InlineObject1.ts | 52 - .../builds/with-npm-version/package-lock.json | 14 - .../builds/with-npm-version/package.json | 2 +- .../with-npm-version/{ => src}/apis/PetApi.ts | 0 .../{ => src}/apis/StoreApi.ts | 0 .../{ => src}/apis/UserApi.ts | 0 .../with-npm-version/{ => src}/apis/index.ts | 0 .../with-npm-version/{ => src}/index.ts | 0 .../{ => src}/models/Category.ts | 0 .../{ => src}/models/ModelApiResponse.ts | 0 .../{ => src}/models/Order.ts | 0 .../with-npm-version/{ => src}/models/Pet.ts | 0 .../with-npm-version/{ => src}/models/Tag.ts | 0 .../with-npm-version/{ => src}/models/User.ts | 0 .../{ => src}/models/index.ts | 0 .../with-npm-version/{ => src}/runtime.ts | 0 .../builds/with-npm-version/tsconfig.json | 1 - 77 files changed, 13 insertions(+), 2612 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/typescript-fetch/npmignore.mustache delete mode 100644 samples/client/petstore/typescript-fetch/builds/default/api.ts delete mode 100644 samples/client/petstore/typescript-fetch/builds/default/models/ApiResponse.ts delete mode 100644 samples/client/petstore/typescript-fetch/builds/default/models/InlineObject.ts delete mode 100644 samples/client/petstore/typescript-fetch/builds/default/models/InlineObject1.ts rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/apis/PetApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/apis/StoreApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/apis/UserApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/apis/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/models/Category.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/models/ModelApiResponse.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/models/Order.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/models/Pet.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/models/Tag.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/models/User.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/models/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/runtime.ts (100%) delete mode 100644 samples/client/petstore/typescript-fetch/builds/es6-target/models/ApiResponse.ts delete mode 100644 samples/client/petstore/typescript-fetch/builds/es6-target/models/InlineObject.ts delete mode 100644 samples/client/petstore/typescript-fetch/builds/es6-target/models/InlineObject1.ts rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/apis/PetApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/apis/StoreApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/apis/UserApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/apis/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/models/Category.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/models/ModelApiResponse.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/models/Order.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/models/Pet.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/models/Tag.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/models/User.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/models/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/runtime.ts (100%) delete mode 100644 samples/client/petstore/typescript-fetch/builds/with-interfaces/models/ApiResponse.ts delete mode 100644 samples/client/petstore/typescript-fetch/builds/with-interfaces/models/InlineObject.ts delete mode 100644 samples/client/petstore/typescript-fetch/builds/with-interfaces/models/InlineObject1.ts rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/apis/PetApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/apis/StoreApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/apis/UserApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/apis/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/models/Category.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/models/ModelApiResponse.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/models/Order.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/models/Pet.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/models/Tag.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/models/User.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/models/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/runtime.ts (100%) delete mode 100644 samples/client/petstore/typescript-fetch/builds/with-npm-version/models/ApiResponse.ts delete mode 100644 samples/client/petstore/typescript-fetch/builds/with-npm-version/models/InlineObject.ts delete mode 100644 samples/client/petstore/typescript-fetch/builds/with-npm-version/models/InlineObject1.ts delete mode 100644 samples/client/petstore/typescript-fetch/builds/with-npm-version/package-lock.json rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/apis/PetApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/apis/StoreApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/apis/UserApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/apis/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/models/Category.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/models/ModelApiResponse.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/models/Order.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/models/Pet.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/models/Tag.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/models/User.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/models/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/runtime.ts (100%) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java index 4d80efd6a703..c5b6f5e60546 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java @@ -48,9 +48,9 @@ public TypeScriptFetchClientCodegen() { outputFolder = "generated-code/typescript-fetch"; embeddedTemplateDir = templateDir = "typescript-fetch"; - this.apiPackage = "apis"; + this.apiPackage = "src" + File.separator +"apis"; + this.modelPackage = "src" + File.separator + "models"; this.apiTemplateFiles.put("apis.mustache", ".ts"); - this.modelPackage = "models"; this.modelTemplateFiles.put("models.mustache", ".ts"); this.addExtraReservedWords(); @@ -81,12 +81,14 @@ public void processOpts() { super.processOpts(); additionalProperties.put("isOriginalModelPropertyNaming", getModelPropertyNaming().equals("original")); additionalProperties.put("modelPropertyNaming", getModelPropertyNaming()); - supportingFiles.add(new SupportingFile("index.mustache", "", "index.ts")); - supportingFiles.add(new SupportingFile("runtime.mustache", "", "runtime.ts")); + supportingFiles.add(new SupportingFile("index.mustache", "src", "index.ts")); + supportingFiles.add(new SupportingFile("runtime.mustache", "src", "runtime.ts")); supportingFiles.add(new SupportingFile("apis.index.mustache", apiPackage().replace('.', File.separatorChar), "index.ts")); supportingFiles.add(new SupportingFile("models.index.mustache", modelPackage().replace('.', File.separatorChar), "index.ts")); + supportingFiles.add(new SupportingFile("tsconfig.mustache", "", "tsconfig.json")); supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore")); + if (additionalProperties.containsKey(NPM_NAME)) { addNpmPackageGeneration(); } @@ -180,6 +182,7 @@ private void addNpmPackageGeneration() { //Files for building our lib supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); supportingFiles.add(new SupportingFile("package.mustache", "", "package.json")); + supportingFiles.add(new SupportingFile("npmignore", "", ".npmignore")); } @Override @@ -195,7 +198,7 @@ private void addOperationModelImportInfomation(Map operations) { // models for a given operation. List> imports = (List>) operations.get("imports"); for (Map im : imports) { - im.put("className", im.get("import").toString().replace("models.", "")); + im.put("className", im.get("import").toString().replace(modelPackage() + ".", "")); } } diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache index f91cf183d72c..8d0daf61cabd 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache @@ -161,7 +161,7 @@ export class {{classname}} extends runtime.BaseAPI { }) {{/isCollectionFormatMulti}} {{^isCollectionFormatMulti}} - formData.append('{{baseName}}', requestParameters.{{paramName}}.join(COLLECTION_FORMATS["{{collectionFormat}}"])); + formData.append('{{baseName}}', requestParameters.{{paramName}}.join(runtime.COLLECTION_FORMATS["{{collectionFormat}}"])); {{/isCollectionFormatMulti}} } diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/npmignore.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/npmignore.mustache new file mode 100644 index 000000000000..42061c01a1c7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/npmignore.mustache @@ -0,0 +1 @@ +README.md \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/package.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/package.mustache index 5bfbc1a92368..1c9d9e55bbf6 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/package.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/package.mustache @@ -6,7 +6,7 @@ "main": "./dist/index.js", "typings": "./dist/index.d.ts", "scripts" : { - "build": "tsc --outDir dist/", + "build": "tsc", "prepare": "npm run build" }, "devDependencies": { diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/tsconfig.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/tsconfig.mustache index 328c7d4e141a..420c3a44f883 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/tsconfig.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/tsconfig.mustache @@ -5,7 +5,6 @@ "module": "commonjs", "moduleResolution": "node", "outDir": "dist", - "rootDir": ".", {{^supportsES6}} "lib": [ "es6", diff --git a/samples/client/petstore/typescript-fetch/builds/default/api.ts b/samples/client/petstore/typescript-fetch/builds/default/api.ts deleted file mode 100644 index 4a39a9c8b599..000000000000 --- a/samples/client/petstore/typescript-fetch/builds/default/api.ts +++ /dev/null @@ -1,1928 +0,0 @@ -/// -// tslint:disable -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ""); - -/** - * Describes the result of uploading an image resource - * @export - * @interface ApiResponse - */ -export interface ApiResponse { - /** - * - * @type {number} - * @memberof ApiResponse - */ - code?: number; - /** - * - * @type {string} - * @memberof ApiResponse - */ - type?: string; - /** - * - * @type {string} - * @memberof ApiResponse - */ - message?: string; -} - -/** - * A category for a pet - * @export - * @interface Category - */ -export interface Category { - /** - * - * @type {number} - * @memberof Category - */ - id?: number; - /** - * - * @type {string} - * @memberof Category - */ - name?: string; -} - -/** - * An order for a pets from the pet store - * @export - * @interface Order - */ -export interface Order { - /** - * - * @type {number} - * @memberof Order - */ - id?: number; - /** - * - * @type {number} - * @memberof Order - */ - petId?: number; - /** - * - * @type {number} - * @memberof Order - */ - quantity?: number; - /** - * - * @type {Date} - * @memberof Order - */ - shipDate?: Date; - /** - * Order Status - * @type {string} - * @memberof Order - */ - status?: Order.StatusEnum; - /** - * - * @type {boolean} - * @memberof Order - */ - complete?: boolean; -} - -/** - * @export - * @namespace Order - */ -export namespace Order { - /** - * @export - * @enum {string} - */ - export enum StatusEnum { - Placed = 'placed', - Approved = 'approved', - Delivered = 'delivered' - } -} - -/** - * A pet for sale in the pet store - * @export - * @interface Pet - */ -export interface Pet { - /** - * - * @type {number} - * @memberof Pet - */ - id?: number; - /** - * - * @type {Category} - * @memberof Pet - */ - category?: Category; - /** - * - * @type {string} - * @memberof Pet - */ - name: string; - /** - * - * @type {Array} - * @memberof Pet - */ - photoUrls: Array; - /** - * - * @type {Array} - * @memberof Pet - */ - tags?: Array; - /** - * pet status in the store - * @type {string} - * @memberof Pet - */ - status?: Pet.StatusEnum; -} - -/** - * @export - * @namespace Pet - */ -export namespace Pet { - /** - * @export - * @enum {string} - */ - export enum StatusEnum { - Available = 'available', - Pending = 'pending', - Sold = 'sold' - } -} - -/** - * A tag for a pet - * @export - * @interface Tag - */ -export interface Tag { - /** - * - * @type {number} - * @memberof Tag - */ - id?: number; - /** - * - * @type {string} - * @memberof Tag - */ - name?: string; -} - -/** - * A User who is purchasing from the pet store - * @export - * @interface User - */ -export interface User { - /** - * - * @type {number} - * @memberof User - */ - id?: number; - /** - * - * @type {string} - * @memberof User - */ - username?: string; - /** - * - * @type {string} - * @memberof User - */ - firstName?: string; - /** - * - * @type {string} - * @memberof User - */ - lastName?: string; - /** - * - * @type {string} - * @memberof User - */ - email?: string; - /** - * - * @type {string} - * @memberof User - */ - password?: string; - /** - * - * @type {string} - * @memberof User - */ - phone?: string; - /** - * User Status - * @type {number} - * @memberof User - */ - userStatus?: number; -} - - -/** - * PetApi - fetch parameter creator - * @export - */ -export const PetApiFetchParamCreator = function (configuration?: Configuration) { - return { - /** - * - * @summary Add a new pet to the store - * @param {Pet} pet Pet object that needs to be added to the store - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - addPet(pet: Pet, options: any = {}): FetchArgs { - // verify required parameter 'pet' is not null or undefined - if (pet === null || pet === undefined) { - throw new RequiredError('pet','Required parameter pet was null or undefined when calling addPet.'); - } - const localVarPath = `/pet`; - const localVarUrlObj = url.parse(localVarPath, true); - const localVarRequestOptions = Object.assign({ method: 'POST' }, options); - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication petstore_auth required - // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; - localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - const needsSerialization = ("Pet" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; - localVarRequestOptions.body = needsSerialization ? JSON.stringify(pet || {}) : (pet || ""); - - return { - url: url.format(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Deletes a pet - * @param {number} petId Pet id to delete - * @param {string} [apiKey] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deletePet(petId: number, apiKey?: string, options: any = {}): FetchArgs { - // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling deletePet.'); - } - const localVarPath = `/pet/{petId}` - .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = url.parse(localVarPath, true); - const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options); - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication petstore_auth required - // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } - - if (apiKey !== undefined && apiKey !== null) { - localVarHeaderParameter['api_key'] = String(apiKey); - } - - localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; - localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - - return { - url: url.format(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Multiple status values can be provided with comma separated strings - * @summary Finds Pets by status - * @param {Array<'available' | 'pending' | 'sold'>} status Status values that need to be considered for filter - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options: any = {}): FetchArgs { - // verify required parameter 'status' is not null or undefined - if (status === null || status === undefined) { - throw new RequiredError('status','Required parameter status was null or undefined when calling findPetsByStatus.'); - } - const localVarPath = `/pet/findByStatus`; - const localVarUrlObj = url.parse(localVarPath, true); - const localVarRequestOptions = Object.assign({ method: 'GET' }, options); - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication petstore_auth required - // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } - - if (status) { - localVarQueryParameter['status'] = status.join(COLLECTION_FORMATS["csv"]); - } - - localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; - localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - - return { - url: url.format(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @summary Finds Pets by tags - * @param {Array} tags Tags to filter by - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - findPetsByTags(tags: Array, options: any = {}): FetchArgs { - // verify required parameter 'tags' is not null or undefined - if (tags === null || tags === undefined) { - throw new RequiredError('tags','Required parameter tags was null or undefined when calling findPetsByTags.'); - } - const localVarPath = `/pet/findByTags`; - const localVarUrlObj = url.parse(localVarPath, true); - const localVarRequestOptions = Object.assign({ method: 'GET' }, options); - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication petstore_auth required - // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } - - if (tags) { - localVarQueryParameter['tags'] = tags.join(COLLECTION_FORMATS["csv"]); - } - - localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; - localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - - return { - url: url.format(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Returns a single pet - * @summary Find pet by ID - * @param {number} petId ID of pet to return - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getPetById(petId: number, options: any = {}): FetchArgs { - // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling getPetById.'); - } - const localVarPath = `/pet/{petId}` - .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = url.parse(localVarPath, true); - const localVarRequestOptions = Object.assign({ method: 'GET' }, options); - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === 'function' - ? configuration.apiKey("api_key") - : configuration.apiKey; - localVarHeaderParameter["api_key"] = localVarApiKeyValue; - } - - localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; - localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - - return { - url: url.format(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Update an existing pet - * @param {Pet} pet Pet object that needs to be added to the store - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updatePet(pet: Pet, options: any = {}): FetchArgs { - // verify required parameter 'pet' is not null or undefined - if (pet === null || pet === undefined) { - throw new RequiredError('pet','Required parameter pet was null or undefined when calling updatePet.'); - } - const localVarPath = `/pet`; - const localVarUrlObj = url.parse(localVarPath, true); - const localVarRequestOptions = Object.assign({ method: 'PUT' }, options); - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication petstore_auth required - // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; - localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - const needsSerialization = ("Pet" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; - localVarRequestOptions.body = needsSerialization ? JSON.stringify(pet || {}) : (pet || ""); - - return { - url: url.format(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Updates a pet in the store with form data - * @param {number} petId ID of pet that needs to be updated - * @param {string} [name] Updated name of the pet - * @param {string} [status] Updated status of the pet - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updatePetWithForm(petId: number, name?: string, status?: string, options: any = {}): FetchArgs { - // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling updatePetWithForm.'); - } - const localVarPath = `/pet/{petId}` - .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = url.parse(localVarPath, true); - const localVarRequestOptions = Object.assign({ method: 'POST' }, options); - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - const localVarFormParams = new url.URLSearchParams(); - - // authentication petstore_auth required - // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } - - if (name !== undefined) { - localVarFormParams.set('name', name as any); - } - - if (status !== undefined) { - localVarFormParams.set('status', status as any); - } - - localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; - - localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; - localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - localVarRequestOptions.body = localVarFormParams.toString(); - - return { - url: url.format(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary uploads an image - * @param {number} petId ID of pet to update - * @param {string} [additionalMetadata] Additional data to pass to server - * @param {any} [file] file to upload - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - uploadFile(petId: number, additionalMetadata?: string, file?: any, options: any = {}): FetchArgs { - // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling uploadFile.'); - } - const localVarPath = `/pet/{petId}/uploadImage` - .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); - const localVarUrlObj = url.parse(localVarPath, true); - const localVarRequestOptions = Object.assign({ method: 'POST' }, options); - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - const localVarFormParams = new url.URLSearchParams(); - - // authentication petstore_auth required - // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } - - if (additionalMetadata !== undefined) { - localVarFormParams.set('additionalMetadata', additionalMetadata as any); - } - - if (file !== undefined) { - localVarFormParams.set('file', file as any); - } - - localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; - - localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; - localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - localVarRequestOptions.body = localVarFormParams.toString(); - - return { - url: url.format(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * PetApi - functional programming interface - * @export - */ -export const PetApiFp = function(configuration?: Configuration) { - return { - /** - * - * @summary Add a new pet to the store - * @param {Pet} pet Pet object that needs to be added to the store - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - addPet(pet: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const localVarFetchArgs = PetApiFetchParamCreator(configuration).addPet(pet, options); - return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Deletes a pet - * @param {number} petId Pet id to delete - * @param {string} [apiKey] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deletePet(petId: number, apiKey?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const localVarFetchArgs = PetApiFetchParamCreator(configuration).deletePet(petId, apiKey, options); - return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * Multiple status values can be provided with comma separated strings - * @summary Finds Pets by status - * @param {Array<'available' | 'pending' | 'sold'>} status Status values that need to be considered for filter - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { - const localVarFetchArgs = PetApiFetchParamCreator(configuration).findPetsByStatus(status, options); - return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } else { - throw response; - } - }); - }; - }, - /** - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @summary Finds Pets by tags - * @param {Array} tags Tags to filter by - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - findPetsByTags(tags: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { - const localVarFetchArgs = PetApiFetchParamCreator(configuration).findPetsByTags(tags, options); - return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } else { - throw response; - } - }); - }; - }, - /** - * Returns a single pet - * @summary Find pet by ID - * @param {number} petId ID of pet to return - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getPetById(petId: number, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const localVarFetchArgs = PetApiFetchParamCreator(configuration).getPetById(petId, options); - return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Update an existing pet - * @param {Pet} pet Pet object that needs to be added to the store - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updatePet(pet: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const localVarFetchArgs = PetApiFetchParamCreator(configuration).updatePet(pet, options); - return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Updates a pet in the store with form data - * @param {number} petId ID of pet that needs to be updated - * @param {string} [name] Updated name of the pet - * @param {string} [status] Updated status of the pet - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const localVarFetchArgs = PetApiFetchParamCreator(configuration).updatePetWithForm(petId, name, status, options); - return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary uploads an image - * @param {number} petId ID of pet to update - * @param {string} [additionalMetadata] Additional data to pass to server - * @param {any} [file] file to upload - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const localVarFetchArgs = PetApiFetchParamCreator(configuration).uploadFile(petId, additionalMetadata, file, options); - return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } else { - throw response; - } - }); - }; - }, - } -}; - -/** - * PetApi - factory interface - * @export - */ -export const PetApiFactory = function (configuration?: Configuration, fetch?: FetchAPI, basePath?: string) { - return { - /** - * - * @summary Add a new pet to the store - * @param {Pet} pet Pet object that needs to be added to the store - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - addPet(pet: Pet, options?: any) { - return PetApiFp(configuration).addPet(pet, options)(fetch, basePath); - }, - /** - * - * @summary Deletes a pet - * @param {number} petId Pet id to delete - * @param {string} [apiKey] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deletePet(petId: number, apiKey?: string, options?: any) { - return PetApiFp(configuration).deletePet(petId, apiKey, options)(fetch, basePath); - }, - /** - * Multiple status values can be provided with comma separated strings - * @summary Finds Pets by status - * @param {Array<'available' | 'pending' | 'sold'>} status Status values that need to be considered for filter - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any) { - return PetApiFp(configuration).findPetsByStatus(status, options)(fetch, basePath); - }, - /** - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @summary Finds Pets by tags - * @param {Array} tags Tags to filter by - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - findPetsByTags(tags: Array, options?: any) { - return PetApiFp(configuration).findPetsByTags(tags, options)(fetch, basePath); - }, - /** - * Returns a single pet - * @summary Find pet by ID - * @param {number} petId ID of pet to return - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getPetById(petId: number, options?: any) { - return PetApiFp(configuration).getPetById(petId, options)(fetch, basePath); - }, - /** - * - * @summary Update an existing pet - * @param {Pet} pet Pet object that needs to be added to the store - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updatePet(pet: Pet, options?: any) { - return PetApiFp(configuration).updatePet(pet, options)(fetch, basePath); - }, - /** - * - * @summary Updates a pet in the store with form data - * @param {number} petId ID of pet that needs to be updated - * @param {string} [name] Updated name of the pet - * @param {string} [status] Updated status of the pet - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any) { - return PetApiFp(configuration).updatePetWithForm(petId, name, status, options)(fetch, basePath); - }, - /** - * - * @summary uploads an image - * @param {number} petId ID of pet to update - * @param {string} [additionalMetadata] Additional data to pass to server - * @param {any} [file] file to upload - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any) { - return PetApiFp(configuration).uploadFile(petId, additionalMetadata, file, options)(fetch, basePath); - }, - }; -}; - -/** - * PetApi - object-oriented interface - * @export - * @class PetApi - * @extends {BaseAPI} - */ -export class PetApi extends BaseAPI { - /** - * - * @summary Add a new pet to the store - * @param {Pet} pet Pet object that needs to be added to the store - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PetApi - */ - public addPet(pet: Pet, options?: any) { - return PetApiFp(this.configuration).addPet(pet, options)(this.fetch, this.basePath); - } - - /** - * - * @summary Deletes a pet - * @param {number} petId Pet id to delete - * @param {string} [apiKey] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PetApi - */ - public deletePet(petId: number, apiKey?: string, options?: any) { - return PetApiFp(this.configuration).deletePet(petId, apiKey, options)(this.fetch, this.basePath); - } - - /** - * Multiple status values can be provided with comma separated strings - * @summary Finds Pets by status - * @param {Array<'available' | 'pending' | 'sold'>} status Status values that need to be considered for filter - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PetApi - */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any) { - return PetApiFp(this.configuration).findPetsByStatus(status, options)(this.fetch, this.basePath); - } - - /** - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @summary Finds Pets by tags - * @param {Array} tags Tags to filter by - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PetApi - */ - public findPetsByTags(tags: Array, options?: any) { - return PetApiFp(this.configuration).findPetsByTags(tags, options)(this.fetch, this.basePath); - } - - /** - * Returns a single pet - * @summary Find pet by ID - * @param {number} petId ID of pet to return - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PetApi - */ - public getPetById(petId: number, options?: any) { - return PetApiFp(this.configuration).getPetById(petId, options)(this.fetch, this.basePath); - } - - /** - * - * @summary Update an existing pet - * @param {Pet} pet Pet object that needs to be added to the store - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PetApi - */ - public updatePet(pet: Pet, options?: any) { - return PetApiFp(this.configuration).updatePet(pet, options)(this.fetch, this.basePath); - } - - /** - * - * @summary Updates a pet in the store with form data - * @param {number} petId ID of pet that needs to be updated - * @param {string} [name] Updated name of the pet - * @param {string} [status] Updated status of the pet - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PetApi - */ - public updatePetWithForm(petId: number, name?: string, status?: string, options?: any) { - return PetApiFp(this.configuration).updatePetWithForm(petId, name, status, options)(this.fetch, this.basePath); - } - - /** - * - * @summary uploads an image - * @param {number} petId ID of pet to update - * @param {string} [additionalMetadata] Additional data to pass to server - * @param {any} [file] file to upload - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PetApi - */ - public uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any) { - return PetApiFp(this.configuration).uploadFile(petId, additionalMetadata, file, options)(this.fetch, this.basePath); - } - -} - -/** - * StoreApi - fetch parameter creator - * @export - */ -export const StoreApiFetchParamCreator = function (configuration?: Configuration) { - return { - /** - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @summary Delete purchase order by ID - * @param {string} orderId ID of the order that needs to be deleted - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteOrder(orderId: string, options: any = {}): FetchArgs { - // verify required parameter 'orderId' is not null or undefined - if (orderId === null || orderId === undefined) { - throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling deleteOrder.'); - } - const localVarPath = `/store/order/{orderId}` - .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); - const localVarUrlObj = url.parse(localVarPath, true); - const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options); - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; - localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - - return { - url: url.format(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Returns a map of status codes to quantities - * @summary Returns pet inventories by status - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInventory(options: any = {}): FetchArgs { - const localVarPath = `/store/inventory`; - const localVarUrlObj = url.parse(localVarPath, true); - const localVarRequestOptions = Object.assign({ method: 'GET' }, options); - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication api_key required - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === 'function' - ? configuration.apiKey("api_key") - : configuration.apiKey; - localVarHeaderParameter["api_key"] = localVarApiKeyValue; - } - - localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; - localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - - return { - url: url.format(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @summary Find purchase order by ID - * @param {number} orderId ID of pet that needs to be fetched - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getOrderById(orderId: number, options: any = {}): FetchArgs { - // verify required parameter 'orderId' is not null or undefined - if (orderId === null || orderId === undefined) { - throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling getOrderById.'); - } - const localVarPath = `/store/order/{orderId}` - .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); - const localVarUrlObj = url.parse(localVarPath, true); - const localVarRequestOptions = Object.assign({ method: 'GET' }, options); - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; - localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - - return { - url: url.format(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Place an order for a pet - * @param {Order} order order placed for purchasing the pet - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - placeOrder(order: Order, options: any = {}): FetchArgs { - // verify required parameter 'order' is not null or undefined - if (order === null || order === undefined) { - throw new RequiredError('order','Required parameter order was null or undefined when calling placeOrder.'); - } - const localVarPath = `/store/order`; - const localVarUrlObj = url.parse(localVarPath, true); - const localVarRequestOptions = Object.assign({ method: 'POST' }, options); - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; - localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - const needsSerialization = ("Order" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; - localVarRequestOptions.body = needsSerialization ? JSON.stringify(order || {}) : (order || ""); - - return { - url: url.format(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * StoreApi - functional programming interface - * @export - */ -export const StoreApiFp = function(configuration?: Configuration) { - return { - /** - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @summary Delete purchase order by ID - * @param {string} orderId ID of the order that needs to be deleted - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteOrder(orderId: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const localVarFetchArgs = StoreApiFetchParamCreator(configuration).deleteOrder(orderId, options); - return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * Returns a map of status codes to quantities - * @summary Returns pet inventories by status - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInventory(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<{ [key: string]: number; }> { - const localVarFetchArgs = StoreApiFetchParamCreator(configuration).getInventory(options); - return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } else { - throw response; - } - }); - }; - }, - /** - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @summary Find purchase order by ID - * @param {number} orderId ID of pet that needs to be fetched - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getOrderById(orderId: number, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const localVarFetchArgs = StoreApiFetchParamCreator(configuration).getOrderById(orderId, options); - return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Place an order for a pet - * @param {Order} order order placed for purchasing the pet - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - placeOrder(order: Order, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const localVarFetchArgs = StoreApiFetchParamCreator(configuration).placeOrder(order, options); - return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } else { - throw response; - } - }); - }; - }, - } -}; - -/** - * StoreApi - factory interface - * @export - */ -export const StoreApiFactory = function (configuration?: Configuration, fetch?: FetchAPI, basePath?: string) { - return { - /** - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @summary Delete purchase order by ID - * @param {string} orderId ID of the order that needs to be deleted - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteOrder(orderId: string, options?: any) { - return StoreApiFp(configuration).deleteOrder(orderId, options)(fetch, basePath); - }, - /** - * Returns a map of status codes to quantities - * @summary Returns pet inventories by status - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInventory(options?: any) { - return StoreApiFp(configuration).getInventory(options)(fetch, basePath); - }, - /** - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @summary Find purchase order by ID - * @param {number} orderId ID of pet that needs to be fetched - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getOrderById(orderId: number, options?: any) { - return StoreApiFp(configuration).getOrderById(orderId, options)(fetch, basePath); - }, - /** - * - * @summary Place an order for a pet - * @param {Order} order order placed for purchasing the pet - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - placeOrder(order: Order, options?: any) { - return StoreApiFp(configuration).placeOrder(order, options)(fetch, basePath); - }, - }; -}; - -/** - * StoreApi - object-oriented interface - * @export - * @class StoreApi - * @extends {BaseAPI} - */ -export class StoreApi extends BaseAPI { - /** - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @summary Delete purchase order by ID - * @param {string} orderId ID of the order that needs to be deleted - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof StoreApi - */ - public deleteOrder(orderId: string, options?: any) { - return StoreApiFp(this.configuration).deleteOrder(orderId, options)(this.fetch, this.basePath); - } - - /** - * Returns a map of status codes to quantities - * @summary Returns pet inventories by status - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof StoreApi - */ - public getInventory(options?: any) { - return StoreApiFp(this.configuration).getInventory(options)(this.fetch, this.basePath); - } - - /** - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @summary Find purchase order by ID - * @param {number} orderId ID of pet that needs to be fetched - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof StoreApi - */ - public getOrderById(orderId: number, options?: any) { - return StoreApiFp(this.configuration).getOrderById(orderId, options)(this.fetch, this.basePath); - } - - /** - * - * @summary Place an order for a pet - * @param {Order} order order placed for purchasing the pet - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof StoreApi - */ - public placeOrder(order: Order, options?: any) { - return StoreApiFp(this.configuration).placeOrder(order, options)(this.fetch, this.basePath); - } - -} - -/** - * UserApi - fetch parameter creator - * @export - */ -export const UserApiFetchParamCreator = function (configuration?: Configuration) { - return { - /** - * This can only be done by the logged in user. - * @summary Create user - * @param {User} user Created user object - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createUser(user: User, options: any = {}): FetchArgs { - // verify required parameter 'user' is not null or undefined - if (user === null || user === undefined) { - throw new RequiredError('user','Required parameter user was null or undefined when calling createUser.'); - } - const localVarPath = `/user`; - const localVarUrlObj = url.parse(localVarPath, true); - const localVarRequestOptions = Object.assign({ method: 'POST' }, options); - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; - localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - const needsSerialization = ("User" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; - localVarRequestOptions.body = needsSerialization ? JSON.stringify(user || {}) : (user || ""); - - return { - url: url.format(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Creates list of users with given input array - * @param {Array} user List of user object - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createUsersWithArrayInput(user: Array, options: any = {}): FetchArgs { - // verify required parameter 'user' is not null or undefined - if (user === null || user === undefined) { - throw new RequiredError('user','Required parameter user was null or undefined when calling createUsersWithArrayInput.'); - } - const localVarPath = `/user/createWithArray`; - const localVarUrlObj = url.parse(localVarPath, true); - const localVarRequestOptions = Object.assign({ method: 'POST' }, options); - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; - localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - const needsSerialization = ("Array<User>" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; - localVarRequestOptions.body = needsSerialization ? JSON.stringify(user || {}) : (user || ""); - - return { - url: url.format(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Creates list of users with given input array - * @param {Array} user List of user object - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createUsersWithListInput(user: Array, options: any = {}): FetchArgs { - // verify required parameter 'user' is not null or undefined - if (user === null || user === undefined) { - throw new RequiredError('user','Required parameter user was null or undefined when calling createUsersWithListInput.'); - } - const localVarPath = `/user/createWithList`; - const localVarUrlObj = url.parse(localVarPath, true); - const localVarRequestOptions = Object.assign({ method: 'POST' }, options); - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; - localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - const needsSerialization = ("Array<User>" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; - localVarRequestOptions.body = needsSerialization ? JSON.stringify(user || {}) : (user || ""); - - return { - url: url.format(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * This can only be done by the logged in user. - * @summary Delete user - * @param {string} username The name that needs to be deleted - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteUser(username: string, options: any = {}): FetchArgs { - // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling deleteUser.'); - } - const localVarPath = `/user/{username}` - .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const localVarUrlObj = url.parse(localVarPath, true); - const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options); - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; - localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - - return { - url: url.format(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Get user by user name - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getUserByName(username: string, options: any = {}): FetchArgs { - // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling getUserByName.'); - } - const localVarPath = `/user/{username}` - .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const localVarUrlObj = url.parse(localVarPath, true); - const localVarRequestOptions = Object.assign({ method: 'GET' }, options); - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; - localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - - return { - url: url.format(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Logs user into the system - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - loginUser(username: string, password: string, options: any = {}): FetchArgs { - // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling loginUser.'); - } - // verify required parameter 'password' is not null or undefined - if (password === null || password === undefined) { - throw new RequiredError('password','Required parameter password was null or undefined when calling loginUser.'); - } - const localVarPath = `/user/login`; - const localVarUrlObj = url.parse(localVarPath, true); - const localVarRequestOptions = Object.assign({ method: 'GET' }, options); - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - if (username !== undefined) { - localVarQueryParameter['username'] = username; - } - - if (password !== undefined) { - localVarQueryParameter['password'] = password; - } - - localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; - localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - - return { - url: url.format(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Logs out current logged in user session - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - logoutUser(options: any = {}): FetchArgs { - const localVarPath = `/user/logout`; - const localVarUrlObj = url.parse(localVarPath, true); - const localVarRequestOptions = Object.assign({ method: 'GET' }, options); - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; - localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - - return { - url: url.format(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * This can only be done by the logged in user. - * @summary Updated user - * @param {string} username name that need to be deleted - * @param {User} user Updated user object - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateUser(username: string, user: User, options: any = {}): FetchArgs { - // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling updateUser.'); - } - // verify required parameter 'user' is not null or undefined - if (user === null || user === undefined) { - throw new RequiredError('user','Required parameter user was null or undefined when calling updateUser.'); - } - const localVarPath = `/user/{username}` - .replace(`{${"username"}}`, encodeURIComponent(String(username))); - const localVarUrlObj = url.parse(localVarPath, true); - const localVarRequestOptions = Object.assign({ method: 'PUT' }, options); - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query); - // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 - delete localVarUrlObj.search; - localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers); - const needsSerialization = ("User" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; - localVarRequestOptions.body = needsSerialization ? JSON.stringify(user || {}) : (user || ""); - - return { - url: url.format(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * UserApi - functional programming interface - * @export - */ -export const UserApiFp = function(configuration?: Configuration) { - return { - /** - * This can only be done by the logged in user. - * @summary Create user - * @param {User} user Created user object - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createUser(user: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUser(user, options); - return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Creates list of users with given input array - * @param {Array} user List of user object - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createUsersWithArrayInput(user: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUsersWithArrayInput(user, options); - return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Creates list of users with given input array - * @param {Array} user List of user object - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createUsersWithListInput(user: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUsersWithListInput(user, options); - return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * This can only be done by the logged in user. - * @summary Delete user - * @param {string} username The name that needs to be deleted - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteUser(username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const localVarFetchArgs = UserApiFetchParamCreator(configuration).deleteUser(username, options); - return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Get user by user name - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getUserByName(username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const localVarFetchArgs = UserApiFetchParamCreator(configuration).getUserByName(username, options); - return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Logs user into the system - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - loginUser(username: string, password: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const localVarFetchArgs = UserApiFetchParamCreator(configuration).loginUser(username, password, options); - return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Logs out current logged in user session - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const localVarFetchArgs = UserApiFetchParamCreator(configuration).logoutUser(options); - return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * This can only be done by the logged in user. - * @summary Updated user - * @param {string} username name that need to be deleted - * @param {User} user Updated user object - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateUser(username: string, user: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const localVarFetchArgs = UserApiFetchParamCreator(configuration).updateUser(username, user, options); - return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - } -}; - -/** - * UserApi - factory interface - * @export - */ -export const UserApiFactory = function (configuration?: Configuration, fetch?: FetchAPI, basePath?: string) { - return { - /** - * This can only be done by the logged in user. - * @summary Create user - * @param {User} user Created user object - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createUser(user: User, options?: any) { - return UserApiFp(configuration).createUser(user, options)(fetch, basePath); - }, - /** - * - * @summary Creates list of users with given input array - * @param {Array} user List of user object - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createUsersWithArrayInput(user: Array, options?: any) { - return UserApiFp(configuration).createUsersWithArrayInput(user, options)(fetch, basePath); - }, - /** - * - * @summary Creates list of users with given input array - * @param {Array} user List of user object - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createUsersWithListInput(user: Array, options?: any) { - return UserApiFp(configuration).createUsersWithListInput(user, options)(fetch, basePath); - }, - /** - * This can only be done by the logged in user. - * @summary Delete user - * @param {string} username The name that needs to be deleted - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - deleteUser(username: string, options?: any) { - return UserApiFp(configuration).deleteUser(username, options)(fetch, basePath); - }, - /** - * - * @summary Get user by user name - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getUserByName(username: string, options?: any) { - return UserApiFp(configuration).getUserByName(username, options)(fetch, basePath); - }, - /** - * - * @summary Logs user into the system - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - loginUser(username: string, password: string, options?: any) { - return UserApiFp(configuration).loginUser(username, password, options)(fetch, basePath); - }, - /** - * - * @summary Logs out current logged in user session - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - logoutUser(options?: any) { - return UserApiFp(configuration).logoutUser(options)(fetch, basePath); - }, - /** - * This can only be done by the logged in user. - * @summary Updated user - * @param {string} username name that need to be deleted - * @param {User} user Updated user object - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - updateUser(username: string, user: User, options?: any) { - return UserApiFp(configuration).updateUser(username, user, options)(fetch, basePath); - }, - }; -}; - -/** - * UserApi - object-oriented interface - * @export - * @class UserApi - * @extends {BaseAPI} - */ -export class UserApi extends BaseAPI { - /** - * This can only be done by the logged in user. - * @summary Create user - * @param {User} user Created user object - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public createUser(user: User, options?: any) { - return UserApiFp(this.configuration).createUser(user, options)(this.fetch, this.basePath); - } - - /** - * - * @summary Creates list of users with given input array - * @param {Array} user List of user object - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public createUsersWithArrayInput(user: Array, options?: any) { - return UserApiFp(this.configuration).createUsersWithArrayInput(user, options)(this.fetch, this.basePath); - } - - /** - * - * @summary Creates list of users with given input array - * @param {Array} user List of user object - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public createUsersWithListInput(user: Array, options?: any) { - return UserApiFp(this.configuration).createUsersWithListInput(user, options)(this.fetch, this.basePath); - } - - /** - * This can only be done by the logged in user. - * @summary Delete user - * @param {string} username The name that needs to be deleted - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public deleteUser(username: string, options?: any) { - return UserApiFp(this.configuration).deleteUser(username, options)(this.fetch, this.basePath); - } - - /** - * - * @summary Get user by user name - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public getUserByName(username: string, options?: any) { - return UserApiFp(this.configuration).getUserByName(username, options)(this.fetch, this.basePath); - } - - /** - * - * @summary Logs user into the system - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public loginUser(username: string, password: string, options?: any) { - return UserApiFp(this.configuration).loginUser(username, password, options)(this.fetch, this.basePath); - } - - /** - * - * @summary Logs out current logged in user session - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public logoutUser(options?: any) { - return UserApiFp(this.configuration).logoutUser(options)(this.fetch, this.basePath); - } - - /** - * This can only be done by the logged in user. - * @summary Updated user - * @param {string} username name that need to be deleted - * @param {User} user Updated user object - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof UserApi - */ - public updateUser(username: string, user: User, options?: any) { - return UserApiFp(this.configuration).updateUser(username, user, options)(this.fetch, this.basePath); - } - -} - diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/ApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/default/models/ApiResponse.ts deleted file mode 100644 index 2275473e610b..000000000000 --- a/samples/client/petstore/typescript-fetch/builds/default/models/ApiResponse.ts +++ /dev/null @@ -1,60 +0,0 @@ -// tslint:disable -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { exists } from '../runtime'; -/** - * Describes the result of uploading an image resource - * @export - * @interface ApiResponse - */ -export interface ApiResponse { - /** - * - * @type {number} - * @memberof ApiResponse - */ - code?: number; - /** - * - * @type {string} - * @memberof ApiResponse - */ - type?: string; - /** - * - * @type {string} - * @memberof ApiResponse - */ - message?: string; -} - -export function ApiResponseFromJSON(json: any): ApiResponse { - return { - 'code': !exists(json, 'code') ? undefined : json['code'], - 'type': !exists(json, 'type') ? undefined : json['type'], - 'message': !exists(json, 'message') ? undefined : json['message'], - }; -} - -export function ApiResponseToJSON(value?: ApiResponse): any { - if (value === undefined) { - return undefined; - } - return { - 'code': value.code, - 'type': value.type, - 'message': value.message, - }; -} - - diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/InlineObject.ts b/samples/client/petstore/typescript-fetch/builds/default/models/InlineObject.ts deleted file mode 100644 index 2998b1463ce5..000000000000 --- a/samples/client/petstore/typescript-fetch/builds/default/models/InlineObject.ts +++ /dev/null @@ -1,52 +0,0 @@ -// tslint:disable -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { exists, mapValues } from '../runtime'; -/** - * - * @export - * @interface InlineObject - */ -export interface InlineObject { - /** - * Updated name of the pet - * @type {string} - * @memberof InlineObject - */ - name?: string; - /** - * Updated status of the pet - * @type {string} - * @memberof InlineObject - */ - status?: string; -} - -export function InlineObjectFromJSON(json: any): InlineObject { - return { - 'name': !exists(json, 'name') ? undefined : json['name'], - 'status': !exists(json, 'status') ? undefined : json['status'], - }; -} - -export function InlineObjectToJSON(value?: InlineObject): any { - if (value === undefined) { - return undefined; - } - return { - 'name': value.name, - 'status': value.status, - }; -} - - diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/InlineObject1.ts b/samples/client/petstore/typescript-fetch/builds/default/models/InlineObject1.ts deleted file mode 100644 index 4cd90b137959..000000000000 --- a/samples/client/petstore/typescript-fetch/builds/default/models/InlineObject1.ts +++ /dev/null @@ -1,52 +0,0 @@ -// tslint:disable -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { exists, mapValues } from '../runtime'; -/** - * - * @export - * @interface InlineObject1 - */ -export interface InlineObject1 { - /** - * Additional data to pass to server - * @type {string} - * @memberof InlineObject1 - */ - additionalMetadata?: string; - /** - * file to upload - * @type {Blob} - * @memberof InlineObject1 - */ - file?: Blob; -} - -export function InlineObject1FromJSON(json: any): InlineObject1 { - return { - 'additionalMetadata': !exists(json, 'additionalMetadata') ? undefined : json['additionalMetadata'], - 'file': !exists(json, 'file') ? undefined : json['file'], - }; -} - -export function InlineObject1ToJSON(value?: InlineObject1): any { - if (value === undefined) { - return undefined; - } - return { - 'additionalMetadata': value.additionalMetadata, - 'file': value.file, - }; -} - - diff --git a/samples/client/petstore/typescript-fetch/builds/default/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/default/src/apis/PetApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/apis/PetApi.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/apis/PetApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/default/src/apis/StoreApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/apis/StoreApi.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/apis/StoreApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/default/src/apis/UserApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/apis/UserApi.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/apis/UserApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/apis/index.ts b/samples/client/petstore/typescript-fetch/builds/default/src/apis/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/apis/index.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/apis/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/index.ts b/samples/client/petstore/typescript-fetch/builds/default/src/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/index.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/Category.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/models/Category.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/models/Category.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/ModelApiResponse.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/models/ModelApiResponse.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/models/ModelApiResponse.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/Order.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/models/Order.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/models/Order.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/Pet.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/models/Pet.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/models/Pet.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/Tag.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/models/Tag.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/models/Tag.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/User.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/User.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/models/User.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/models/User.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/index.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/models/index.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/models/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/runtime.ts b/samples/client/petstore/typescript-fetch/builds/default/src/runtime.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/runtime.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/runtime.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/tsconfig.json b/samples/client/petstore/typescript-fetch/builds/default/tsconfig.json index d65f2a95afc1..4567ec19899a 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/tsconfig.json +++ b/samples/client/petstore/typescript-fetch/builds/default/tsconfig.json @@ -5,7 +5,6 @@ "module": "commonjs", "moduleResolution": "node", "outDir": "dist", - "rootDir": ".", "lib": [ "es6", "dom" diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/ApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/models/ApiResponse.ts deleted file mode 100644 index 2275473e610b..000000000000 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/models/ApiResponse.ts +++ /dev/null @@ -1,60 +0,0 @@ -// tslint:disable -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { exists } from '../runtime'; -/** - * Describes the result of uploading an image resource - * @export - * @interface ApiResponse - */ -export interface ApiResponse { - /** - * - * @type {number} - * @memberof ApiResponse - */ - code?: number; - /** - * - * @type {string} - * @memberof ApiResponse - */ - type?: string; - /** - * - * @type {string} - * @memberof ApiResponse - */ - message?: string; -} - -export function ApiResponseFromJSON(json: any): ApiResponse { - return { - 'code': !exists(json, 'code') ? undefined : json['code'], - 'type': !exists(json, 'type') ? undefined : json['type'], - 'message': !exists(json, 'message') ? undefined : json['message'], - }; -} - -export function ApiResponseToJSON(value?: ApiResponse): any { - if (value === undefined) { - return undefined; - } - return { - 'code': value.code, - 'type': value.type, - 'message': value.message, - }; -} - - diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/InlineObject.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/models/InlineObject.ts deleted file mode 100644 index 2998b1463ce5..000000000000 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/models/InlineObject.ts +++ /dev/null @@ -1,52 +0,0 @@ -// tslint:disable -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { exists, mapValues } from '../runtime'; -/** - * - * @export - * @interface InlineObject - */ -export interface InlineObject { - /** - * Updated name of the pet - * @type {string} - * @memberof InlineObject - */ - name?: string; - /** - * Updated status of the pet - * @type {string} - * @memberof InlineObject - */ - status?: string; -} - -export function InlineObjectFromJSON(json: any): InlineObject { - return { - 'name': !exists(json, 'name') ? undefined : json['name'], - 'status': !exists(json, 'status') ? undefined : json['status'], - }; -} - -export function InlineObjectToJSON(value?: InlineObject): any { - if (value === undefined) { - return undefined; - } - return { - 'name': value.name, - 'status': value.status, - }; -} - - diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/InlineObject1.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/models/InlineObject1.ts deleted file mode 100644 index 4cd90b137959..000000000000 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/models/InlineObject1.ts +++ /dev/null @@ -1,52 +0,0 @@ -// tslint:disable -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { exists, mapValues } from '../runtime'; -/** - * - * @export - * @interface InlineObject1 - */ -export interface InlineObject1 { - /** - * Additional data to pass to server - * @type {string} - * @memberof InlineObject1 - */ - additionalMetadata?: string; - /** - * file to upload - * @type {Blob} - * @memberof InlineObject1 - */ - file?: Blob; -} - -export function InlineObject1FromJSON(json: any): InlineObject1 { - return { - 'additionalMetadata': !exists(json, 'additionalMetadata') ? undefined : json['additionalMetadata'], - 'file': !exists(json, 'file') ? undefined : json['file'], - }; -} - -export function InlineObject1ToJSON(value?: InlineObject1): any { - if (value === undefined) { - return undefined; - } - return { - 'additionalMetadata': value.additionalMetadata, - 'file': value.file, - }; -} - - diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/package.json b/samples/client/petstore/typescript-fetch/builds/es6-target/package.json index 84e82f3f158d..3ea8a1ec7069 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/package.json +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/package.json @@ -6,7 +6,7 @@ "main": "./dist/index.js", "typings": "./dist/index.d.ts", "scripts" : { - "build": "tsc --outDir dist/", + "build": "tsc", "prepare": "npm run build" }, "devDependencies": { diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/PetApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/apis/PetApi.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/PetApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/StoreApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/apis/StoreApi.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/StoreApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/UserApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/apis/UserApi.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/UserApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/apis/index.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/apis/index.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/index.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/index.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Category.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/models/Category.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Category.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/ModelApiResponse.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/models/ModelApiResponse.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/models/ModelApiResponse.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Order.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/models/Order.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Order.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Pet.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/models/Pet.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Pet.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Tag.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/models/Tag.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Tag.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/User.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/User.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/models/User.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/models/User.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/index.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/models/index.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/models/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/runtime.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/runtime.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/tsconfig.json b/samples/client/petstore/typescript-fetch/builds/es6-target/tsconfig.json index 6cc02878fb79..250280d9ab0e 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/tsconfig.json +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/tsconfig.json @@ -5,7 +5,6 @@ "module": "commonjs", "moduleResolution": "node", "outDir": "dist", - "rootDir": ".", "typeRoots": [ "node_modules/@types" ] diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/ApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/ApiResponse.ts deleted file mode 100644 index 2275473e610b..000000000000 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/ApiResponse.ts +++ /dev/null @@ -1,60 +0,0 @@ -// tslint:disable -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { exists } from '../runtime'; -/** - * Describes the result of uploading an image resource - * @export - * @interface ApiResponse - */ -export interface ApiResponse { - /** - * - * @type {number} - * @memberof ApiResponse - */ - code?: number; - /** - * - * @type {string} - * @memberof ApiResponse - */ - type?: string; - /** - * - * @type {string} - * @memberof ApiResponse - */ - message?: string; -} - -export function ApiResponseFromJSON(json: any): ApiResponse { - return { - 'code': !exists(json, 'code') ? undefined : json['code'], - 'type': !exists(json, 'type') ? undefined : json['type'], - 'message': !exists(json, 'message') ? undefined : json['message'], - }; -} - -export function ApiResponseToJSON(value?: ApiResponse): any { - if (value === undefined) { - return undefined; - } - return { - 'code': value.code, - 'type': value.type, - 'message': value.message, - }; -} - - diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/InlineObject.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/InlineObject.ts deleted file mode 100644 index 2998b1463ce5..000000000000 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/InlineObject.ts +++ /dev/null @@ -1,52 +0,0 @@ -// tslint:disable -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { exists, mapValues } from '../runtime'; -/** - * - * @export - * @interface InlineObject - */ -export interface InlineObject { - /** - * Updated name of the pet - * @type {string} - * @memberof InlineObject - */ - name?: string; - /** - * Updated status of the pet - * @type {string} - * @memberof InlineObject - */ - status?: string; -} - -export function InlineObjectFromJSON(json: any): InlineObject { - return { - 'name': !exists(json, 'name') ? undefined : json['name'], - 'status': !exists(json, 'status') ? undefined : json['status'], - }; -} - -export function InlineObjectToJSON(value?: InlineObject): any { - if (value === undefined) { - return undefined; - } - return { - 'name': value.name, - 'status': value.status, - }; -} - - diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/InlineObject1.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/InlineObject1.ts deleted file mode 100644 index 4cd90b137959..000000000000 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/InlineObject1.ts +++ /dev/null @@ -1,52 +0,0 @@ -// tslint:disable -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { exists, mapValues } from '../runtime'; -/** - * - * @export - * @interface InlineObject1 - */ -export interface InlineObject1 { - /** - * Additional data to pass to server - * @type {string} - * @memberof InlineObject1 - */ - additionalMetadata?: string; - /** - * file to upload - * @type {Blob} - * @memberof InlineObject1 - */ - file?: Blob; -} - -export function InlineObject1FromJSON(json: any): InlineObject1 { - return { - 'additionalMetadata': !exists(json, 'additionalMetadata') ? undefined : json['additionalMetadata'], - 'file': !exists(json, 'file') ? undefined : json['file'], - }; -} - -export function InlineObject1ToJSON(value?: InlineObject1): any { - if (value === undefined) { - return undefined; - } - return { - 'additionalMetadata': value.additionalMetadata, - 'file': value.file, - }; -} - - diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/PetApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/PetApi.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/PetApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/StoreApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/StoreApi.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/StoreApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/UserApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/UserApi.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/UserApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/index.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/index.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/index.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/index.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Category.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Category.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Category.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/ModelApiResponse.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/models/ModelApiResponse.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/ModelApiResponse.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Order.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Order.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Order.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Pet.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Pet.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Pet.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Tag.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Tag.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Tag.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/User.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/User.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/models/User.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/User.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/index.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/models/index.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/runtime.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/runtime.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/tsconfig.json b/samples/client/petstore/typescript-fetch/builds/with-interfaces/tsconfig.json index d65f2a95afc1..4567ec19899a 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/tsconfig.json +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/tsconfig.json @@ -5,7 +5,6 @@ "module": "commonjs", "moduleResolution": "node", "outDir": "dist", - "rootDir": ".", "lib": [ "es6", "dom" diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/ApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/ApiResponse.ts deleted file mode 100644 index 2275473e610b..000000000000 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/ApiResponse.ts +++ /dev/null @@ -1,60 +0,0 @@ -// tslint:disable -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { exists } from '../runtime'; -/** - * Describes the result of uploading an image resource - * @export - * @interface ApiResponse - */ -export interface ApiResponse { - /** - * - * @type {number} - * @memberof ApiResponse - */ - code?: number; - /** - * - * @type {string} - * @memberof ApiResponse - */ - type?: string; - /** - * - * @type {string} - * @memberof ApiResponse - */ - message?: string; -} - -export function ApiResponseFromJSON(json: any): ApiResponse { - return { - 'code': !exists(json, 'code') ? undefined : json['code'], - 'type': !exists(json, 'type') ? undefined : json['type'], - 'message': !exists(json, 'message') ? undefined : json['message'], - }; -} - -export function ApiResponseToJSON(value?: ApiResponse): any { - if (value === undefined) { - return undefined; - } - return { - 'code': value.code, - 'type': value.type, - 'message': value.message, - }; -} - - diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/InlineObject.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/InlineObject.ts deleted file mode 100644 index 2998b1463ce5..000000000000 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/InlineObject.ts +++ /dev/null @@ -1,52 +0,0 @@ -// tslint:disable -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { exists, mapValues } from '../runtime'; -/** - * - * @export - * @interface InlineObject - */ -export interface InlineObject { - /** - * Updated name of the pet - * @type {string} - * @memberof InlineObject - */ - name?: string; - /** - * Updated status of the pet - * @type {string} - * @memberof InlineObject - */ - status?: string; -} - -export function InlineObjectFromJSON(json: any): InlineObject { - return { - 'name': !exists(json, 'name') ? undefined : json['name'], - 'status': !exists(json, 'status') ? undefined : json['status'], - }; -} - -export function InlineObjectToJSON(value?: InlineObject): any { - if (value === undefined) { - return undefined; - } - return { - 'name': value.name, - 'status': value.status, - }; -} - - diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/InlineObject1.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/InlineObject1.ts deleted file mode 100644 index 4cd90b137959..000000000000 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/InlineObject1.ts +++ /dev/null @@ -1,52 +0,0 @@ -// tslint:disable -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { exists, mapValues } from '../runtime'; -/** - * - * @export - * @interface InlineObject1 - */ -export interface InlineObject1 { - /** - * Additional data to pass to server - * @type {string} - * @memberof InlineObject1 - */ - additionalMetadata?: string; - /** - * file to upload - * @type {Blob} - * @memberof InlineObject1 - */ - file?: Blob; -} - -export function InlineObject1FromJSON(json: any): InlineObject1 { - return { - 'additionalMetadata': !exists(json, 'additionalMetadata') ? undefined : json['additionalMetadata'], - 'file': !exists(json, 'file') ? undefined : json['file'], - }; -} - -export function InlineObject1ToJSON(value?: InlineObject1): any { - if (value === undefined) { - return undefined; - } - return { - 'additionalMetadata': value.additionalMetadata, - 'file': value.file, - }; -} - - diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/package-lock.json b/samples/client/petstore/typescript-fetch/builds/with-npm-version/package-lock.json deleted file mode 100644 index e8dc0d00b2f3..000000000000 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/package-lock.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "@swagger/typescript-fetch-petstore", - "version": "1.0.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "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 - } - } -} diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json b/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json index 84e82f3f158d..3ea8a1ec7069 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json @@ -6,7 +6,7 @@ "main": "./dist/index.js", "typings": "./dist/index.d.ts", "scripts" : { - "build": "tsc --outDir dist/", + "build": "tsc", "prepare": "npm run build" }, "devDependencies": { diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/PetApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/PetApi.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/PetApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/StoreApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/StoreApi.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/StoreApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/UserApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/UserApi.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/UserApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/index.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/index.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/index.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/index.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Category.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/models/Category.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Category.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/ModelApiResponse.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/models/ModelApiResponse.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/ModelApiResponse.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Order.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/models/Order.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Order.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Pet.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/models/Pet.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Pet.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Tag.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/models/Tag.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Tag.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/User.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/User.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/models/User.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/User.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/index.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/models/index.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/runtime.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/tsconfig.json b/samples/client/petstore/typescript-fetch/builds/with-npm-version/tsconfig.json index d65f2a95afc1..4567ec19899a 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/tsconfig.json +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/tsconfig.json @@ -5,7 +5,6 @@ "module": "commonjs", "moduleResolution": "node", "outDir": "dist", - "rootDir": ".", "lib": [ "es6", "dom" From 5ea2593601fee7ceeb265272a6734ca27ee665c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20C=C3=B4t=C3=A9?= Date: Fri, 19 Jul 2019 07:38:56 -0400 Subject: [PATCH 2/4] Move the .ts files to an `src` folder which is more common in npm package --- .../builds/multiple-parameters/{ => src}/apis/PetApi.ts | 0 .../builds/multiple-parameters/{ => src}/apis/StoreApi.ts | 0 .../builds/multiple-parameters/{ => src}/apis/UserApi.ts | 0 .../builds/multiple-parameters/{ => src}/apis/index.ts | 0 .../builds/multiple-parameters/{ => src}/index.ts | 0 .../builds/multiple-parameters/{ => src}/models/Category.ts | 0 .../multiple-parameters/{ => src}/models/ModelApiResponse.ts | 0 .../builds/multiple-parameters/{ => src}/models/Order.ts | 0 .../builds/multiple-parameters/{ => src}/models/Pet.ts | 0 .../builds/multiple-parameters/{ => src}/models/Tag.ts | 0 .../builds/multiple-parameters/{ => src}/models/User.ts | 0 .../builds/multiple-parameters/{ => src}/models/index.ts | 0 .../builds/multiple-parameters/{ => src}/runtime.ts | 0 .../typescript-fetch/builds/multiple-parameters/tsconfig.json | 1 - 14 files changed, 1 deletion(-) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/apis/PetApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/apis/StoreApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/apis/UserApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/apis/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/models/Category.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/models/ModelApiResponse.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/models/Order.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/models/Pet.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/models/Tag.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/models/User.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/models/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/runtime.ts (100%) diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/PetApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/PetApi.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/PetApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/StoreApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/StoreApi.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/StoreApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/UserApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/UserApi.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/UserApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/index.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/index.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/index.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/index.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Category.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Category.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Category.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/ModelApiResponse.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/ModelApiResponse.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/ModelApiResponse.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Order.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Order.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Order.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Pet.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Pet.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Pet.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Tag.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Tag.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Tag.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/User.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/User.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/User.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/User.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/index.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/index.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/runtime.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/runtime.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/tsconfig.json b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/tsconfig.json index d65f2a95afc1..4567ec19899a 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/tsconfig.json +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/tsconfig.json @@ -5,7 +5,6 @@ "module": "commonjs", "moduleResolution": "node", "outDir": "dist", - "rootDir": ".", "lib": [ "es6", "dom" From 8a6ad76d63b80b618b14c5d6e25704e9dfa35e3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20C=C3=B4t=C3=A9?= Date: Fri, 19 Jul 2019 09:42:48 -0400 Subject: [PATCH 3/4] Add missing mustache --- .../codegen/languages/TypeScriptFetchClientCodegen.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java index d3b6f4eeea93..41986aa24fc1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java @@ -188,7 +188,7 @@ private void addNpmPackageGeneration() { //Files for building our lib supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); supportingFiles.add(new SupportingFile("package.mustache", "", "package.json")); - supportingFiles.add(new SupportingFile("npmignore", "", ".npmignore")); + supportingFiles.add(new SupportingFile("npmignore.mustache", "", ".npmignore")); } @Override From 8434df832f1c3a50eebb0f3afea4cd31bc772d3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20C=C3=B4t=C3=A9?= Date: Mon, 5 Aug 2019 15:45:48 -0400 Subject: [PATCH 4/4] Add missing .npmignore --- .../petstore/typescript-fetch/builds/es6-target/.npmignore | 1 + .../petstore/typescript-fetch/builds/with-npm-version/.npmignore | 1 + 2 files changed, 2 insertions(+) create mode 100644 samples/client/petstore/typescript-fetch/builds/es6-target/.npmignore create mode 100644 samples/client/petstore/typescript-fetch/builds/with-npm-version/.npmignore diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/.npmignore b/samples/client/petstore/typescript-fetch/builds/es6-target/.npmignore new file mode 100644 index 000000000000..42061c01a1c7 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/.npmignore @@ -0,0 +1 @@ +README.md \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.npmignore b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.npmignore new file mode 100644 index 000000000000..42061c01a1c7 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.npmignore @@ -0,0 +1 @@ +README.md \ No newline at end of file