From 2ad05ac2675700b3fdff744eb30f1dc74e8603e6 Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 15 Feb 2017 15:12:31 +0800 Subject: [PATCH] update gitinore to include dist for ts generators --- .../main/resources/TypeScript-Fetch/gitignore | 1 + .../resources/typescript-angular/gitignore | 1 + .../main/resources/typescript-node/gitignore | 1 + .../petstore/typescript-angular/.gitignore | 1 + .../typescript-angular2/default/.gitignore | 1 + .../typescript-angular2/npm/.gitignore | 1 + .../typescript-angular2/npm/README.md | 4 +- .../typescript-angular2/npm/package.json | 2 +- .../builds/default/.gitignore | 1 + .../typescript-fetch/builds/default/api.ts | 80 +++++++++---------- .../builds/es6-target/.gitignore | 1 + .../typescript-fetch/builds/es6-target/api.ts | 80 +++++++++---------- .../builds/with-npm-version/.gitignore | 1 + .../builds/with-npm-version/api.ts | 80 +++++++++---------- .../typescript-node/default/.gitignore | 1 + .../petstore/typescript-node/npm/.gitignore | 1 + 16 files changed, 134 insertions(+), 123 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/gitignore b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/gitignore index 35e2fb2b02e..149b5765472 100644 --- a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/gitignore +++ b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/gitignore @@ -1,3 +1,4 @@ wwwroot/*.js node_modules typings +dist diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/gitignore b/modules/swagger-codegen/src/main/resources/typescript-angular/gitignore index 35e2fb2b02e..149b5765472 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/gitignore +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/gitignore @@ -1,3 +1,4 @@ wwwroot/*.js node_modules typings +dist diff --git a/modules/swagger-codegen/src/main/resources/typescript-node/gitignore b/modules/swagger-codegen/src/main/resources/typescript-node/gitignore index 35e2fb2b02e..149b5765472 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-node/gitignore +++ b/modules/swagger-codegen/src/main/resources/typescript-node/gitignore @@ -1,3 +1,4 @@ wwwroot/*.js node_modules typings +dist diff --git a/samples/client/petstore/typescript-angular/.gitignore b/samples/client/petstore/typescript-angular/.gitignore index 35e2fb2b02e..149b5765472 100644 --- a/samples/client/petstore/typescript-angular/.gitignore +++ b/samples/client/petstore/typescript-angular/.gitignore @@ -1,3 +1,4 @@ wwwroot/*.js node_modules typings +dist diff --git a/samples/client/petstore/typescript-angular2/default/.gitignore b/samples/client/petstore/typescript-angular2/default/.gitignore index 35e2fb2b02e..149b5765472 100644 --- a/samples/client/petstore/typescript-angular2/default/.gitignore +++ b/samples/client/petstore/typescript-angular2/default/.gitignore @@ -1,3 +1,4 @@ wwwroot/*.js node_modules typings +dist diff --git a/samples/client/petstore/typescript-angular2/npm/.gitignore b/samples/client/petstore/typescript-angular2/npm/.gitignore index 35e2fb2b02e..149b5765472 100644 --- a/samples/client/petstore/typescript-angular2/npm/.gitignore +++ b/samples/client/petstore/typescript-angular2/npm/.gitignore @@ -1,3 +1,4 @@ wwwroot/*.js node_modules typings +dist diff --git a/samples/client/petstore/typescript-angular2/npm/README.md b/samples/client/petstore/typescript-angular2/npm/README.md index d5e4636d3c9..bc9ff835f8f 100644 --- a/samples/client/petstore/typescript-angular2/npm/README.md +++ b/samples/client/petstore/typescript-angular2/npm/README.md @@ -1,4 +1,4 @@ -## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201702031824 +## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201702151447 ### Building @@ -19,7 +19,7 @@ navigate to the folder of your consuming project and run one of next commando's. _published:_ ``` -npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201702031824 --save +npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201702151447 --save ``` _unPublished (not recommended):_ diff --git a/samples/client/petstore/typescript-angular2/npm/package.json b/samples/client/petstore/typescript-angular2/npm/package.json index f0a54da13d5..ed30ff89d22 100644 --- a/samples/client/petstore/typescript-angular2/npm/package.json +++ b/samples/client/petstore/typescript-angular2/npm/package.json @@ -1,6 +1,6 @@ { "name": "@swagger/angular2-typescript-petstore", - "version": "0.0.1-SNAPSHOT.201702031824", + "version": "0.0.1-SNAPSHOT.201702151447", "description": "swagger client for @swagger/angular2-typescript-petstore", "author": "Swagger Codegen Contributors", "keywords": [ diff --git a/samples/client/petstore/typescript-fetch/builds/default/.gitignore b/samples/client/petstore/typescript-fetch/builds/default/.gitignore index 35e2fb2b02e..149b5765472 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/.gitignore +++ b/samples/client/petstore/typescript-fetch/builds/default/.gitignore @@ -1,3 +1,4 @@ wwwroot/*.js node_modules typings +dist diff --git a/samples/client/petstore/typescript-fetch/builds/default/api.ts b/samples/client/petstore/typescript-fetch/builds/default/api.ts index 1e821763c07..1ab5a830727 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/api.ts @@ -102,7 +102,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -131,7 +131,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "DELETE" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; fetchOptions.headers = assign({ "api_key": params["apiKey"], }, contentTypeHeader); @@ -153,7 +153,7 @@ export const PetApiFetchParamCreator = { }); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -175,7 +175,7 @@ export const PetApiFetchParamCreator = { }); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -199,7 +199,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -218,7 +218,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "PUT" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -248,7 +248,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; fetchOptions.body = querystring.stringify({ "name": params["name"], @@ -279,7 +279,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; fetchOptions.body = querystring.stringify({ "additionalMetadata": params["additionalMetadata"], @@ -304,7 +304,7 @@ export const PetApiFp = { * * @param body Pet object that needs to be added to the store */ - addPet(params: { "body"?: Pet; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + addPet(params: { "body"?: Pet; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.addPet(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -322,7 +322,7 @@ export const PetApiFp = { * @param petId Pet id to delete * @param apiKey */ - deletePet(params: { "petId": number; "apiKey"?: string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + deletePet(params: { "petId": number; "apiKey"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.deletePet(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -339,7 +339,7 @@ export const PetApiFp = { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter */ - findPetsByStatus(params: { "status"?: Array; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise> { + findPetsByStatus(params: { "status"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { const fetchArgs = PetApiFetchParamCreator.findPetsByStatus(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -356,7 +356,7 @@ export const PetApiFp = { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by */ - findPetsByTags(params: { "tags"?: Array; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise> { + findPetsByTags(params: { "tags"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { const fetchArgs = PetApiFetchParamCreator.findPetsByTags(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -373,7 +373,7 @@ export const PetApiFp = { * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions * @param petId ID of pet that needs to be fetched */ - getPetById(params: { "petId": number; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + getPetById(params: { "petId": number; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.getPetById(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -390,7 +390,7 @@ export const PetApiFp = { * * @param body Pet object that needs to be added to the store */ - updatePet(params: { "body"?: Pet; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + updatePet(params: { "body"?: Pet; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.updatePet(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -409,7 +409,7 @@ export const PetApiFp = { * @param name Updated name of the pet * @param status Updated status of the pet */ - updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.updatePetWithForm(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -428,7 +428,7 @@ export const PetApiFp = { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.uploadFile(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -614,7 +614,7 @@ export const StoreApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "DELETE" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -632,7 +632,7 @@ export const StoreApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -656,7 +656,7 @@ export const StoreApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -675,7 +675,7 @@ export const StoreApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -699,7 +699,7 @@ export const StoreApiFp = { * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted */ - deleteOrder(params: { "orderId": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + deleteOrder(params: { "orderId": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreator.deleteOrder(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -715,7 +715,7 @@ export const StoreApiFp = { * Returns pet inventories by status * Returns a map of status codes to quantities */ - getInventory(options?: any): (fetch: FetchAPI, basePath?: string) => Promise<{ [key: string]: number; }> { + getInventory(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<{ [key: string]: number; }> { const fetchArgs = StoreApiFetchParamCreator.getInventory(options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -732,7 +732,7 @@ export const StoreApiFp = { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched */ - getOrderById(params: { "orderId": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + getOrderById(params: { "orderId": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreator.getOrderById(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -749,7 +749,7 @@ export const StoreApiFp = { * * @param body order placed for purchasing the pet */ - placeOrder(params: { "body"?: Order; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + placeOrder(params: { "body"?: Order; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreator.placeOrder(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -854,7 +854,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -877,7 +877,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -900,7 +900,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -928,7 +928,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "DELETE" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -952,7 +952,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -976,7 +976,7 @@ export const UserApiFetchParamCreator = { }); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -994,7 +994,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -1019,7 +1019,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "PUT" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -1043,7 +1043,7 @@ export const UserApiFp = { * This can only be done by the logged in user. * @param body Created user object */ - createUser(params: { "body"?: User; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + createUser(params: { "body"?: User; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.createUser(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1060,7 +1060,7 @@ export const UserApiFp = { * * @param body List of user object */ - createUsersWithArrayInput(params: { "body"?: Array; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + createUsersWithArrayInput(params: { "body"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.createUsersWithArrayInput(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1077,7 +1077,7 @@ export const UserApiFp = { * * @param body List of user object */ - createUsersWithListInput(params: { "body"?: Array; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + createUsersWithListInput(params: { "body"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.createUsersWithListInput(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1094,7 +1094,7 @@ export const UserApiFp = { * This can only be done by the logged in user. * @param username The name that needs to be deleted */ - deleteUser(params: { "username": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + deleteUser(params: { "username": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.deleteUser(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1111,7 +1111,7 @@ export const UserApiFp = { * * @param username The name that needs to be fetched. Use user1 for testing. */ - getUserByName(params: { "username": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + getUserByName(params: { "username": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.getUserByName(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1129,7 +1129,7 @@ export const UserApiFp = { * @param username The user name for login * @param password The password for login in clear text */ - loginUser(params: { "username"?: string; "password"?: string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + loginUser(params: { "username"?: string; "password"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.loginUser(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1145,7 +1145,7 @@ export const UserApiFp = { * Logs out current logged in user session * */ - logoutUser(options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.logoutUser(options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1163,7 +1163,7 @@ export const UserApiFp = { * @param username name that need to be deleted * @param body Updated user object */ - updateUser(params: { "username": string; "body"?: User; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + updateUser(params: { "username": string; "body"?: User; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.updateUser(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/.gitignore b/samples/client/petstore/typescript-fetch/builds/es6-target/.gitignore index 35e2fb2b02e..149b5765472 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/.gitignore +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/.gitignore @@ -1,3 +1,4 @@ wwwroot/*.js node_modules typings +dist diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts index c5809c95808..5b787dc84bb 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts @@ -101,7 +101,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -130,7 +130,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "DELETE" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; fetchOptions.headers = Object.assign({ "api_key": params["apiKey"], }, contentTypeHeader); @@ -152,7 +152,7 @@ export const PetApiFetchParamCreator = { }); let fetchOptions: RequestInit = Object.assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -174,7 +174,7 @@ export const PetApiFetchParamCreator = { }); let fetchOptions: RequestInit = Object.assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -198,7 +198,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -217,7 +217,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "PUT" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -247,7 +247,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; fetchOptions.body = querystring.stringify({ "name": params["name"], @@ -278,7 +278,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; fetchOptions.body = querystring.stringify({ "additionalMetadata": params["additionalMetadata"], @@ -303,7 +303,7 @@ export const PetApiFp = { * * @param body Pet object that needs to be added to the store */ - addPet(params: { "body"?: Pet; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + addPet(params: { "body"?: Pet; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.addPet(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -321,7 +321,7 @@ export const PetApiFp = { * @param petId Pet id to delete * @param apiKey */ - deletePet(params: { "petId": number; "apiKey"?: string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + deletePet(params: { "petId": number; "apiKey"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.deletePet(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -338,7 +338,7 @@ export const PetApiFp = { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter */ - findPetsByStatus(params: { "status"?: Array; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise> { + findPetsByStatus(params: { "status"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { const fetchArgs = PetApiFetchParamCreator.findPetsByStatus(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -355,7 +355,7 @@ export const PetApiFp = { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by */ - findPetsByTags(params: { "tags"?: Array; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise> { + findPetsByTags(params: { "tags"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { const fetchArgs = PetApiFetchParamCreator.findPetsByTags(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -372,7 +372,7 @@ export const PetApiFp = { * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions * @param petId ID of pet that needs to be fetched */ - getPetById(params: { "petId": number; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + getPetById(params: { "petId": number; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.getPetById(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -389,7 +389,7 @@ export const PetApiFp = { * * @param body Pet object that needs to be added to the store */ - updatePet(params: { "body"?: Pet; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + updatePet(params: { "body"?: Pet; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.updatePet(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -408,7 +408,7 @@ export const PetApiFp = { * @param name Updated name of the pet * @param status Updated status of the pet */ - updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.updatePetWithForm(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -427,7 +427,7 @@ export const PetApiFp = { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.uploadFile(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -613,7 +613,7 @@ export const StoreApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "DELETE" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -631,7 +631,7 @@ export const StoreApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -655,7 +655,7 @@ export const StoreApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -674,7 +674,7 @@ export const StoreApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -698,7 +698,7 @@ export const StoreApiFp = { * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted */ - deleteOrder(params: { "orderId": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + deleteOrder(params: { "orderId": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreator.deleteOrder(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -714,7 +714,7 @@ export const StoreApiFp = { * Returns pet inventories by status * Returns a map of status codes to quantities */ - getInventory(options?: any): (fetch: FetchAPI, basePath?: string) => Promise<{ [key: string]: number; }> { + getInventory(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<{ [key: string]: number; }> { const fetchArgs = StoreApiFetchParamCreator.getInventory(options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -731,7 +731,7 @@ export const StoreApiFp = { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched */ - getOrderById(params: { "orderId": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + getOrderById(params: { "orderId": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreator.getOrderById(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -748,7 +748,7 @@ export const StoreApiFp = { * * @param body order placed for purchasing the pet */ - placeOrder(params: { "body"?: Order; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + placeOrder(params: { "body"?: Order; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreator.placeOrder(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -853,7 +853,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -876,7 +876,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -899,7 +899,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -927,7 +927,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "DELETE" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -951,7 +951,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -975,7 +975,7 @@ export const UserApiFetchParamCreator = { }); let fetchOptions: RequestInit = Object.assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -993,7 +993,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -1018,7 +1018,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = Object.assign({}, { method: "PUT" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -1042,7 +1042,7 @@ export const UserApiFp = { * This can only be done by the logged in user. * @param body Created user object */ - createUser(params: { "body"?: User; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + createUser(params: { "body"?: User; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.createUser(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1059,7 +1059,7 @@ export const UserApiFp = { * * @param body List of user object */ - createUsersWithArrayInput(params: { "body"?: Array; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + createUsersWithArrayInput(params: { "body"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.createUsersWithArrayInput(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1076,7 +1076,7 @@ export const UserApiFp = { * * @param body List of user object */ - createUsersWithListInput(params: { "body"?: Array; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + createUsersWithListInput(params: { "body"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.createUsersWithListInput(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1093,7 +1093,7 @@ export const UserApiFp = { * This can only be done by the logged in user. * @param username The name that needs to be deleted */ - deleteUser(params: { "username": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + deleteUser(params: { "username": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.deleteUser(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1110,7 +1110,7 @@ export const UserApiFp = { * * @param username The name that needs to be fetched. Use user1 for testing. */ - getUserByName(params: { "username": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + getUserByName(params: { "username": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.getUserByName(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1128,7 +1128,7 @@ export const UserApiFp = { * @param username The user name for login * @param password The password for login in clear text */ - loginUser(params: { "username"?: string; "password"?: string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + loginUser(params: { "username"?: string; "password"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.loginUser(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1144,7 +1144,7 @@ export const UserApiFp = { * Logs out current logged in user session * */ - logoutUser(options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.logoutUser(options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1162,7 +1162,7 @@ export const UserApiFp = { * @param username name that need to be deleted * @param body Updated user object */ - updateUser(params: { "username": string; "body"?: User; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + updateUser(params: { "username": string; "body"?: User; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.updateUser(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.gitignore b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.gitignore index 35e2fb2b02e..149b5765472 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.gitignore +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.gitignore @@ -1,3 +1,4 @@ wwwroot/*.js node_modules typings +dist diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts index 1e821763c07..1ab5a830727 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts @@ -102,7 +102,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -131,7 +131,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "DELETE" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; fetchOptions.headers = assign({ "api_key": params["apiKey"], }, contentTypeHeader); @@ -153,7 +153,7 @@ export const PetApiFetchParamCreator = { }); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -175,7 +175,7 @@ export const PetApiFetchParamCreator = { }); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -199,7 +199,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -218,7 +218,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "PUT" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -248,7 +248,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; fetchOptions.body = querystring.stringify({ "name": params["name"], @@ -279,7 +279,7 @@ export const PetApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; fetchOptions.body = querystring.stringify({ "additionalMetadata": params["additionalMetadata"], @@ -304,7 +304,7 @@ export const PetApiFp = { * * @param body Pet object that needs to be added to the store */ - addPet(params: { "body"?: Pet; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + addPet(params: { "body"?: Pet; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.addPet(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -322,7 +322,7 @@ export const PetApiFp = { * @param petId Pet id to delete * @param apiKey */ - deletePet(params: { "petId": number; "apiKey"?: string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + deletePet(params: { "petId": number; "apiKey"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.deletePet(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -339,7 +339,7 @@ export const PetApiFp = { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter */ - findPetsByStatus(params: { "status"?: Array; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise> { + findPetsByStatus(params: { "status"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { const fetchArgs = PetApiFetchParamCreator.findPetsByStatus(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -356,7 +356,7 @@ export const PetApiFp = { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by */ - findPetsByTags(params: { "tags"?: Array; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise> { + findPetsByTags(params: { "tags"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { const fetchArgs = PetApiFetchParamCreator.findPetsByTags(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -373,7 +373,7 @@ export const PetApiFp = { * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions * @param petId ID of pet that needs to be fetched */ - getPetById(params: { "petId": number; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + getPetById(params: { "petId": number; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.getPetById(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -390,7 +390,7 @@ export const PetApiFp = { * * @param body Pet object that needs to be added to the store */ - updatePet(params: { "body"?: Pet; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + updatePet(params: { "body"?: Pet; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.updatePet(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -409,7 +409,7 @@ export const PetApiFp = { * @param name Updated name of the pet * @param status Updated status of the pet */ - updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.updatePetWithForm(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -428,7 +428,7 @@ export const PetApiFp = { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = PetApiFetchParamCreator.uploadFile(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -614,7 +614,7 @@ export const StoreApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "DELETE" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -632,7 +632,7 @@ export const StoreApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -656,7 +656,7 @@ export const StoreApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -675,7 +675,7 @@ export const StoreApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -699,7 +699,7 @@ export const StoreApiFp = { * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted */ - deleteOrder(params: { "orderId": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + deleteOrder(params: { "orderId": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreator.deleteOrder(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -715,7 +715,7 @@ export const StoreApiFp = { * Returns pet inventories by status * Returns a map of status codes to quantities */ - getInventory(options?: any): (fetch: FetchAPI, basePath?: string) => Promise<{ [key: string]: number; }> { + getInventory(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<{ [key: string]: number; }> { const fetchArgs = StoreApiFetchParamCreator.getInventory(options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -732,7 +732,7 @@ export const StoreApiFp = { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched */ - getOrderById(params: { "orderId": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + getOrderById(params: { "orderId": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreator.getOrderById(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -749,7 +749,7 @@ export const StoreApiFp = { * * @param body order placed for purchasing the pet */ - placeOrder(params: { "body"?: Order; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + placeOrder(params: { "body"?: Order; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = StoreApiFetchParamCreator.placeOrder(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -854,7 +854,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -877,7 +877,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -900,7 +900,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -928,7 +928,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "DELETE" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -952,7 +952,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -976,7 +976,7 @@ export const UserApiFetchParamCreator = { }); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -994,7 +994,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; if (contentTypeHeader) { fetchOptions.headers = contentTypeHeader; } @@ -1019,7 +1019,7 @@ export const UserApiFetchParamCreator = { let urlObj = url.parse(baseUrl, true); let fetchOptions: RequestInit = assign({}, { method: "PUT" }, options); - let contentTypeHeader: Dictionary; + let contentTypeHeader: Dictionary = {}; contentTypeHeader = { "Content-Type": "application/json" }; if (params["body"]) { fetchOptions.body = JSON.stringify(params["body"] || {}); @@ -1043,7 +1043,7 @@ export const UserApiFp = { * This can only be done by the logged in user. * @param body Created user object */ - createUser(params: { "body"?: User; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + createUser(params: { "body"?: User; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.createUser(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1060,7 +1060,7 @@ export const UserApiFp = { * * @param body List of user object */ - createUsersWithArrayInput(params: { "body"?: Array; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + createUsersWithArrayInput(params: { "body"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.createUsersWithArrayInput(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1077,7 +1077,7 @@ export const UserApiFp = { * * @param body List of user object */ - createUsersWithListInput(params: { "body"?: Array; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + createUsersWithListInput(params: { "body"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.createUsersWithListInput(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1094,7 +1094,7 @@ export const UserApiFp = { * This can only be done by the logged in user. * @param username The name that needs to be deleted */ - deleteUser(params: { "username": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + deleteUser(params: { "username": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.deleteUser(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1111,7 +1111,7 @@ export const UserApiFp = { * * @param username The name that needs to be fetched. Use user1 for testing. */ - getUserByName(params: { "username": string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + getUserByName(params: { "username": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.getUserByName(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1129,7 +1129,7 @@ export const UserApiFp = { * @param username The user name for login * @param password The password for login in clear text */ - loginUser(params: { "username"?: string; "password"?: string; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + loginUser(params: { "username"?: string; "password"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.loginUser(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1145,7 +1145,7 @@ export const UserApiFp = { * Logs out current logged in user session * */ - logoutUser(options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.logoutUser(options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { @@ -1163,7 +1163,7 @@ export const UserApiFp = { * @param username name that need to be deleted * @param body Updated user object */ - updateUser(params: { "username": string; "body"?: User; }, options?: any): (fetch: FetchAPI, basePath?: string) => Promise { + updateUser(params: { "username": string; "body"?: User; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.updateUser(params, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { diff --git a/samples/client/petstore/typescript-node/default/.gitignore b/samples/client/petstore/typescript-node/default/.gitignore index 35e2fb2b02e..149b5765472 100644 --- a/samples/client/petstore/typescript-node/default/.gitignore +++ b/samples/client/petstore/typescript-node/default/.gitignore @@ -1,3 +1,4 @@ wwwroot/*.js node_modules typings +dist diff --git a/samples/client/petstore/typescript-node/npm/.gitignore b/samples/client/petstore/typescript-node/npm/.gitignore index 35e2fb2b02e..149b5765472 100644 --- a/samples/client/petstore/typescript-node/npm/.gitignore +++ b/samples/client/petstore/typescript-node/npm/.gitignore @@ -1,3 +1,4 @@ wwwroot/*.js node_modules typings +dist