diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/tsconfig.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/tsconfig.mustache index 930d40361843..f03a3761c7cc 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/tsconfig.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/tsconfig.mustache @@ -12,7 +12,10 @@ "outDir": "./dist", "noLib": false, "declaration": true, - "lib": [ "es6", "dom" ] + "lib": [ "es6", "dom" ], + "typeRoots": [ + "node_modules/@types" + ] }, "exclude": [ "node_modules", diff --git a/modules/openapi-generator/src/main/resources/typescript-aurelia/tsconfig.json.mustache b/modules/openapi-generator/src/main/resources/typescript-aurelia/tsconfig.json.mustache index 08e2e596dbe2..f835df82f1ea 100644 --- a/modules/openapi-generator/src/main/resources/typescript-aurelia/tsconfig.json.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-aurelia/tsconfig.json.mustache @@ -5,7 +5,10 @@ "module": "commonjs", "noImplicitAny": true, "outDir": "dist", - "rootDir": "." + "rootDir": ".", + "typeRoots": [ + "node_modules/@types" + ] }, "exclude": [ "dist", diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/tsconfig.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/tsconfig.mustache index 6e59886490bc..c4a4cc771e74 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/tsconfig.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/tsconfig.mustache @@ -5,12 +5,16 @@ "module": "commonjs", "noImplicitAny": true, "outDir": "dist", - "rootDir": "."{{^supportsES6}}, + "rootDir": ".", + {{^supportsES6}} "lib": [ "es6", "dom" - ] + ], {{/supportsES6}} + "typeRoots": [ + "node_modules/@types" + ] }, "exclude": [ "dist", 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 33d10cd9f5e0..328c7d4e141a 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/tsconfig.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/tsconfig.mustache @@ -5,12 +5,16 @@ "module": "commonjs", "moduleResolution": "node", "outDir": "dist", - "rootDir": "."{{^supportsES6}}, + "rootDir": ".", + {{^supportsES6}} "lib": [ "es6", "dom" - ] + ], {{/supportsES6}} + "typeRoots": [ + "node_modules/@types" + ] }, "exclude": [ "dist", diff --git a/modules/openapi-generator/src/main/resources/typescript-inversify/tsconfig.mustache b/modules/openapi-generator/src/main/resources/typescript-inversify/tsconfig.mustache index 3ed5f2c0b100..dd4391c668ac 100644 --- a/modules/openapi-generator/src/main/resources/typescript-inversify/tsconfig.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-inversify/tsconfig.mustache @@ -12,7 +12,10 @@ "outDir": "./dist", "noLib": false, "declaration": true, - "lib": [ "es6", "dom" ] + "lib": [ "es6", "dom" ], + "typeRoots": [ + "node_modules/@types" + ] }, "exclude": [ "node_modules", diff --git a/modules/openapi-generator/src/main/resources/typescript-jquery/tsconfig.mustache b/modules/openapi-generator/src/main/resources/typescript-jquery/tsconfig.mustache index c5228429a633..39415409ce65 100644 --- a/modules/openapi-generator/src/main/resources/typescript-jquery/tsconfig.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-jquery/tsconfig.mustache @@ -8,7 +8,10 @@ "removeComments": true, "sourceMap": true, "noLib": false, - "declaration": true + "declaration": true, + "typeRoots": [ + "node_modules/@types" + ] }, "files": [ "index.ts", diff --git a/modules/openapi-generator/src/main/resources/typescript-node/tsconfig.mustache b/modules/openapi-generator/src/main/resources/typescript-node/tsconfig.mustache index 456ee8e6334e..160a99593a7d 100644 --- a/modules/openapi-generator/src/main/resources/typescript-node/tsconfig.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-node/tsconfig.mustache @@ -11,7 +11,10 @@ "noLib": false, "declaration": true, "lib": ["dom", "es6", "es5", "dom.iterable", "scripthost"], - "outDir": "dist" + "outDir": "dist", + "typeRoots": [ + "node_modules/@types" + ] }, "exclude": [ "dist", diff --git a/modules/openapi-generator/src/main/resources/typescript-rxjs/tsconfig.mustache b/modules/openapi-generator/src/main/resources/typescript-rxjs/tsconfig.mustache index 33d10cd9f5e0..328c7d4e141a 100644 --- a/modules/openapi-generator/src/main/resources/typescript-rxjs/tsconfig.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-rxjs/tsconfig.mustache @@ -5,12 +5,16 @@ "module": "commonjs", "moduleResolution": "node", "outDir": "dist", - "rootDir": "."{{^supportsES6}}, + "rootDir": ".", + {{^supportsES6}} "lib": [ "es6", "dom" - ] + ], {{/supportsES6}} + "typeRoots": [ + "node_modules/@types" + ] }, "exclude": [ "dist", diff --git a/samples/client/petstore/typescript-angular-v2/npm/tsconfig.json b/samples/client/petstore/typescript-angular-v2/npm/tsconfig.json index 3983fa8d99c4..cc7ead72600f 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/tsconfig.json +++ b/samples/client/petstore/typescript-angular-v2/npm/tsconfig.json @@ -12,7 +12,10 @@ "outDir": "./dist", "noLib": false, "declaration": true, - "lib": [ "es6", "dom" ] + "lib": [ "es6", "dom" ], + "typeRoots": [ + "node_modules/@types" + ] }, "exclude": [ "node_modules", diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/tsconfig.json b/samples/client/petstore/typescript-angular-v4.3/npm/tsconfig.json index 498ee01e9ddd..c01ebe255d4c 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/tsconfig.json +++ b/samples/client/petstore/typescript-angular-v4.3/npm/tsconfig.json @@ -12,7 +12,10 @@ "outDir": "./dist", "noLib": false, "declaration": true, - "lib": [ "es6", "dom" ] + "lib": [ "es6", "dom" ], + "typeRoots": [ + "node_modules/@types" + ] }, "exclude": [ "node_modules", diff --git a/samples/client/petstore/typescript-angular-v4/npm/tsconfig.json b/samples/client/petstore/typescript-angular-v4/npm/tsconfig.json index 498ee01e9ddd..c01ebe255d4c 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/tsconfig.json +++ b/samples/client/petstore/typescript-angular-v4/npm/tsconfig.json @@ -12,7 +12,10 @@ "outDir": "./dist", "noLib": false, "declaration": true, - "lib": [ "es6", "dom" ] + "lib": [ "es6", "dom" ], + "typeRoots": [ + "node_modules/@types" + ] }, "exclude": [ "node_modules", diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/tsconfig.json b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/tsconfig.json index 498ee01e9ddd..c01ebe255d4c 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/tsconfig.json +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/tsconfig.json @@ -12,7 +12,10 @@ "outDir": "./dist", "noLib": false, "declaration": true, - "lib": [ "es6", "dom" ] + "lib": [ "es6", "dom" ], + "typeRoots": [ + "node_modules/@types" + ] }, "exclude": [ "node_modules", diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/tsconfig.json b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/tsconfig.json index 498ee01e9ddd..c01ebe255d4c 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/tsconfig.json +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/tsconfig.json @@ -12,7 +12,10 @@ "outDir": "./dist", "noLib": false, "declaration": true, - "lib": [ "es6", "dom" ] + "lib": [ "es6", "dom" ], + "typeRoots": [ + "node_modules/@types" + ] }, "exclude": [ "node_modules", diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/tsconfig.json b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/tsconfig.json index 498ee01e9ddd..c01ebe255d4c 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/tsconfig.json +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/tsconfig.json @@ -12,7 +12,10 @@ "outDir": "./dist", "noLib": false, "declaration": true, - "lib": [ "es6", "dom" ] + "lib": [ "es6", "dom" ], + "typeRoots": [ + "node_modules/@types" + ] }, "exclude": [ "node_modules", diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/tsconfig.json b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/tsconfig.json index 498ee01e9ddd..c01ebe255d4c 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/tsconfig.json +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/tsconfig.json @@ -12,7 +12,10 @@ "outDir": "./dist", "noLib": false, "declaration": true, - "lib": [ "es6", "dom" ] + "lib": [ "es6", "dom" ], + "typeRoots": [ + "node_modules/@types" + ] }, "exclude": [ "node_modules", diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/tsconfig.json b/samples/client/petstore/typescript-axios/builds/es6-target/tsconfig.json index 0eb23e488b27..2e9a191f8d32 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/tsconfig.json +++ b/samples/client/petstore/typescript-axios/builds/es6-target/tsconfig.json @@ -5,7 +5,11 @@ "module": "commonjs", "noImplicitAny": true, "outDir": "dist", - "rootDir": "." }, + "rootDir": ".", + "typeRoots": [ + "node_modules/@types" + ] + }, "exclude": [ "dist", "node_modules" diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/tsconfig.json b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/tsconfig.json index 50ab7fa3f2fd..2f27acb9fd94 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/tsconfig.json +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/tsconfig.json @@ -9,6 +9,9 @@ "lib": [ "es6", "dom" + ], + "typeRoots": [ + "node_modules/@types" ] }, "exclude": [ diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/tsconfig.json b/samples/client/petstore/typescript-axios/builds/with-npm-version/tsconfig.json index 50ab7fa3f2fd..2f27acb9fd94 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/tsconfig.json +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/tsconfig.json @@ -9,6 +9,9 @@ "lib": [ "es6", "dom" + ], + "typeRoots": [ + "node_modules/@types" ] }, "exclude": [ diff --git a/samples/client/petstore/typescript-fetch/builds/default/tsconfig.json b/samples/client/petstore/typescript-fetch/builds/default/tsconfig.json index 5de40723aa1a..d65f2a95afc1 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/tsconfig.json +++ b/samples/client/petstore/typescript-fetch/builds/default/tsconfig.json @@ -9,6 +9,9 @@ "lib": [ "es6", "dom" + ], + "typeRoots": [ + "node_modules/@types" ] }, "exclude": [ 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 2e668d3863d6..6cc02878fb79 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,11 @@ "module": "commonjs", "moduleResolution": "node", "outDir": "dist", - "rootDir": "." }, + "rootDir": ".", + "typeRoots": [ + "node_modules/@types" + ] + }, "exclude": [ "dist", "node_modules" 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 5de40723aa1a..d65f2a95afc1 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/tsconfig.json +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/tsconfig.json @@ -9,6 +9,9 @@ "lib": [ "es6", "dom" + ], + "typeRoots": [ + "node_modules/@types" ] }, "exclude": [ 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 5de40723aa1a..d65f2a95afc1 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 @@ -9,6 +9,9 @@ "lib": [ "es6", "dom" + ], + "typeRoots": [ + "node_modules/@types" ] }, "exclude": [ diff --git a/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION index 6d94c9c2e12a..afa636560641 100644 --- a/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.0-SNAPSHOT \ No newline at end of file +4.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-jquery/default/api/PetApi.ts b/samples/client/petstore/typescript-jquery/default/api/PetApi.ts index d025ec3636aa..72648c0e9b33 100644 --- a/samples/client/petstore/typescript-jquery/default/api/PetApi.ts +++ b/samples/client/petstore/typescript-jquery/default/api/PetApi.ts @@ -49,9 +49,9 @@ export class PetApi { /** * * @summary Add a new pet to the store - * @param pet Pet object that needs to be added to the store + * @param body Pet object that needs to be added to the store */ - public addPet(pet: models.Pet, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + public addPet(body: models.Pet, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< { response: JQueryXHR; body?: any; }, { response: JQueryXHR; errorThrown: string } > { @@ -59,9 +59,9 @@ export class PetApi { let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'pet' is not null or undefined - if (pet === null || pet === undefined) { - throw new Error('Required parameter pet was null or undefined when calling addPet.'); + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling addPet.'); } @@ -95,7 +95,7 @@ export class PetApi { processData: false }; - requestOptions.data = JSON.stringify(pet); + requestOptions.data = JSON.stringify(body); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } @@ -415,9 +415,9 @@ export class PetApi { /** * * @summary Update an existing pet - * @param pet Pet object that needs to be added to the store + * @param body Pet object that needs to be added to the store */ - public updatePet(pet: models.Pet, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + public updatePet(body: models.Pet, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< { response: JQueryXHR; body?: any; }, { response: JQueryXHR; errorThrown: string } > { @@ -425,9 +425,9 @@ export class PetApi { let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'pet' is not null or undefined - if (pet === null || pet === undefined) { - throw new Error('Required parameter pet was null or undefined when calling updatePet.'); + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updatePet.'); } @@ -461,7 +461,7 @@ export class PetApi { processData: false }; - requestOptions.data = JSON.stringify(pet); + requestOptions.data = JSON.stringify(body); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } diff --git a/samples/client/petstore/typescript-jquery/default/api/StoreApi.ts b/samples/client/petstore/typescript-jquery/default/api/StoreApi.ts index bce32cef4370..b4ca39af273d 100644 --- a/samples/client/petstore/typescript-jquery/default/api/StoreApi.ts +++ b/samples/client/petstore/typescript-jquery/default/api/StoreApi.ts @@ -234,9 +234,9 @@ export class StoreApi { /** * * @summary Place an order for a pet - * @param order order placed for purchasing the pet + * @param body order placed for purchasing the pet */ - public placeOrder(order: models.Order, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + public placeOrder(body: models.Order, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< { response: JQueryXHR; body: models.Order; }, { response: JQueryXHR; errorThrown: string } > { @@ -244,9 +244,9 @@ export class StoreApi { let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'order' is not null or undefined - if (order === null || order === undefined) { - throw new Error('Required parameter order was null or undefined when calling placeOrder.'); + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } @@ -271,7 +271,7 @@ export class StoreApi { processData: false }; - requestOptions.data = JSON.stringify(order); + requestOptions.data = JSON.stringify(body); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } diff --git a/samples/client/petstore/typescript-jquery/default/api/UserApi.ts b/samples/client/petstore/typescript-jquery/default/api/UserApi.ts index 4c1152bffb2f..22719cd6a371 100644 --- a/samples/client/petstore/typescript-jquery/default/api/UserApi.ts +++ b/samples/client/petstore/typescript-jquery/default/api/UserApi.ts @@ -49,9 +49,9 @@ export class UserApi { /** * This can only be done by the logged in user. * @summary Create user - * @param user Created user object + * @param body Created user object */ - public createUser(user: models.User, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + public createUser(body: models.User, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< { response: JQueryXHR; body?: any; }, { response: JQueryXHR; errorThrown: string } > { @@ -59,9 +59,9 @@ export class UserApi { let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'user' is not null or undefined - if (user === null || user === undefined) { - throw new Error('Required parameter user was null or undefined when calling createUser.'); + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUser.'); } @@ -84,7 +84,7 @@ export class UserApi { processData: false }; - requestOptions.data = JSON.stringify(user); + requestOptions.data = JSON.stringify(body); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } @@ -113,9 +113,9 @@ export class UserApi { /** * * @summary Creates list of users with given input array - * @param modelsUser List of user object + * @param body List of user object */ - public createUsersWithArrayInput(modelsUser: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + public createUsersWithArrayInput(body: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< { response: JQueryXHR; body?: any; }, { response: JQueryXHR; errorThrown: string } > { @@ -123,9 +123,9 @@ export class UserApi { let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'modelsUser' is not null or undefined - if (modelsUser === null || modelsUser === undefined) { - throw new Error('Required parameter modelsUser was null or undefined when calling createUsersWithArrayInput.'); + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } @@ -148,7 +148,7 @@ export class UserApi { processData: false }; - requestOptions.data = JSON.stringify(modelsUser); + requestOptions.data = JSON.stringify(body); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } @@ -177,9 +177,9 @@ export class UserApi { /** * * @summary Creates list of users with given input array - * @param modelsUser List of user object + * @param body List of user object */ - public createUsersWithListInput(modelsUser: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + public createUsersWithListInput(body: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< { response: JQueryXHR; body?: any; }, { response: JQueryXHR; errorThrown: string } > { @@ -187,9 +187,9 @@ export class UserApi { let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'modelsUser' is not null or undefined - if (modelsUser === null || modelsUser === undefined) { - throw new Error('Required parameter modelsUser was null or undefined when calling createUsersWithListInput.'); + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } @@ -212,7 +212,7 @@ export class UserApi { processData: false }; - requestOptions.data = JSON.stringify(modelsUser); + requestOptions.data = JSON.stringify(body); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } @@ -496,9 +496,9 @@ export class UserApi { * This can only be done by the logged in user. * @summary Updated user * @param username name that need to be deleted - * @param user Updated user object + * @param body Updated user object */ - public updateUser(username: string, user: models.User, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + public updateUser(username: string, body: models.User, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< { response: JQueryXHR; body?: any; }, { response: JQueryXHR; errorThrown: string } > { @@ -511,9 +511,9 @@ export class UserApi { throw new Error('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 Error('Required parameter user was null or undefined when calling updateUser.'); + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updateUser.'); } @@ -536,7 +536,7 @@ export class UserApi { processData: false }; - requestOptions.data = JSON.stringify(user); + requestOptions.data = JSON.stringify(body); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } diff --git a/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION index 096bf47efe31..afa636560641 100644 --- a/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +4.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-jquery/npm/README.md b/samples/client/petstore/typescript-jquery/npm/README.md index 6b1105e1d49c..7a4d336b17cd 100644 --- a/samples/client/petstore/typescript-jquery/npm/README.md +++ b/samples/client/petstore/typescript-jquery/npm/README.md @@ -19,7 +19,7 @@ It can be used in both TypeScript and JavaScript. In TypeScript, the definition ### Building -To build an compile the typescript sources to javascript use: +To build and compile the typescript sources to javascript use: ``` npm install npm run build diff --git a/samples/client/petstore/typescript-jquery/npm/api/PetApi.ts b/samples/client/petstore/typescript-jquery/npm/api/PetApi.ts index 8e16438c5e2d..72648c0e9b33 100644 --- a/samples/client/petstore/typescript-jquery/npm/api/PetApi.ts +++ b/samples/client/petstore/typescript-jquery/npm/api/PetApi.ts @@ -49,16 +49,19 @@ export class PetApi { /** * * @summary Add a new pet to the store - * @param pet Pet object that needs to be added to the store + * @param body Pet object that needs to be added to the store */ - public addPet(pet: models.models.Pet, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public addPet(body: models.Pet, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + { response: JQueryXHR; body?: any; }, + { response: JQueryXHR; errorThrown: string } + > { let localVarPath = this.basePath + '/pet'; let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'pet' is not null or undefined - if (pet === null || pet === undefined) { - throw new Error('Required parameter pet was null or undefined when calling addPet.'); + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling addPet.'); } @@ -92,7 +95,7 @@ export class PetApi { processData: false }; - requestOptions.data = JSON.stringify(pet); + requestOptions.data = JSON.stringify(body); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } @@ -105,12 +108,15 @@ export class PetApi { requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); } - let dfd = $.Deferred(); + let dfd = $.Deferred< + { response: JQueryXHR; body?: any; }, + { response: JQueryXHR; errorThrown: string } + >(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve(jqXHR, data), + dfd.resolve({response: jqXHR, body: data}), (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject(xhr, errorThrown) + dfd.reject({response: xhr, errorThrown: errorThrown}) ); return dfd.promise(); } @@ -121,7 +127,10 @@ export class PetApi { * @param petId Pet id to delete * @param apiKey */ - public deletePet(petId: number, apiKey?: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public deletePet(petId: number, apiKey?: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + { response: JQueryXHR; body?: any; }, + { response: JQueryXHR; errorThrown: string } + > { let localVarPath = this.basePath + '/pet/{petId}'.replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; @@ -172,12 +181,15 @@ export class PetApi { requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); } - let dfd = $.Deferred(); + let dfd = $.Deferred< + { response: JQueryXHR; body?: any; }, + { response: JQueryXHR; errorThrown: string } + >(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve(jqXHR, data), + dfd.resolve({response: jqXHR, body: data}), (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject(xhr, errorThrown) + dfd.reject({response: xhr, errorThrown: errorThrown}) ); return dfd.promise(); } @@ -187,7 +199,10 @@ export class PetApi { * @summary Finds Pets by status * @param status Status values that need to be considered for filter */ - public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: Array; }> { + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + { response: JQueryXHR; body: Array; }, + { response: JQueryXHR; errorThrown: string } + > { let localVarPath = this.basePath + '/pet/findByStatus'; let queryParameters: any = {}; @@ -241,12 +256,15 @@ export class PetApi { requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); } - let dfd = $.Deferred(); + let dfd = $.Deferred< + { response: JQueryXHR; body: Array; }, + { response: JQueryXHR; errorThrown: string } + >(); $.ajax(requestOptions).then( (data: Array, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve(jqXHR, data), + dfd.resolve({response: jqXHR, body: data}), (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject(xhr, errorThrown) + dfd.reject({response: xhr, errorThrown: errorThrown}) ); return dfd.promise(); } @@ -256,7 +274,10 @@ export class PetApi { * @summary Finds Pets by tags * @param tags Tags to filter by */ - public findPetsByTags(tags: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: Array; }> { + public findPetsByTags(tags: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + { response: JQueryXHR; body: Array; }, + { response: JQueryXHR; errorThrown: string } + > { let localVarPath = this.basePath + '/pet/findByTags'; let queryParameters: any = {}; @@ -310,12 +331,15 @@ export class PetApi { requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); } - let dfd = $.Deferred(); + let dfd = $.Deferred< + { response: JQueryXHR; body: Array; }, + { response: JQueryXHR; errorThrown: string } + >(); $.ajax(requestOptions).then( (data: Array, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve(jqXHR, data), + dfd.resolve({response: jqXHR, body: data}), (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject(xhr, errorThrown) + dfd.reject({response: xhr, errorThrown: errorThrown}) ); return dfd.promise(); } @@ -325,7 +349,10 @@ export class PetApi { * @summary Find pet by ID * @param petId ID of pet to return */ - public getPetById(petId: number, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: models.Pet; }> { + public getPetById(petId: number, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + { response: JQueryXHR; body: models.Pet; }, + { response: JQueryXHR; errorThrown: string } + > { let localVarPath = this.basePath + '/pet/{petId}'.replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; @@ -372,12 +399,15 @@ export class PetApi { requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); } - let dfd = $.Deferred(); + let dfd = $.Deferred< + { response: JQueryXHR; body: models.Pet; }, + { response: JQueryXHR; errorThrown: string } + >(); $.ajax(requestOptions).then( (data: models.Pet, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve(jqXHR, data), + dfd.resolve({response: jqXHR, body: data}), (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject(xhr, errorThrown) + dfd.reject({response: xhr, errorThrown: errorThrown}) ); return dfd.promise(); } @@ -385,16 +415,19 @@ export class PetApi { /** * * @summary Update an existing pet - * @param pet Pet object that needs to be added to the store + * @param body Pet object that needs to be added to the store */ - public updatePet(pet: models.models.Pet, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public updatePet(body: models.Pet, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + { response: JQueryXHR; body?: any; }, + { response: JQueryXHR; errorThrown: string } + > { let localVarPath = this.basePath + '/pet'; let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'pet' is not null or undefined - if (pet === null || pet === undefined) { - throw new Error('Required parameter pet was null or undefined when calling updatePet.'); + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updatePet.'); } @@ -428,7 +461,7 @@ export class PetApi { processData: false }; - requestOptions.data = JSON.stringify(pet); + requestOptions.data = JSON.stringify(body); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } @@ -441,12 +474,15 @@ export class PetApi { requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); } - let dfd = $.Deferred(); + let dfd = $.Deferred< + { response: JQueryXHR; body?: any; }, + { response: JQueryXHR; errorThrown: string } + >(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve(jqXHR, data), + dfd.resolve({response: jqXHR, body: data}), (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject(xhr, errorThrown) + dfd.reject({response: xhr, errorThrown: errorThrown}) ); return dfd.promise(); } @@ -458,7 +494,10 @@ export class PetApi { * @param name Updated name of the pet * @param status Updated status of the pet */ - public updatePetWithForm(petId: number, name?: string, status?: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public updatePetWithForm(petId: number, name?: string, status?: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + { response: JQueryXHR; body?: any; }, + { response: JQueryXHR; errorThrown: string } + > { let localVarPath = this.basePath + '/pet/{petId}'.replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; @@ -525,12 +564,15 @@ export class PetApi { requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); } - let dfd = $.Deferred(); + let dfd = $.Deferred< + { response: JQueryXHR; body?: any; }, + { response: JQueryXHR; errorThrown: string } + >(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve(jqXHR, data), + dfd.resolve({response: jqXHR, body: data}), (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject(xhr, errorThrown) + dfd.reject({response: xhr, errorThrown: errorThrown}) ); return dfd.promise(); } @@ -542,7 +584,10 @@ export class PetApi { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - public uploadFile(petId: number, additionalMetadata?: string, file?: any, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: models.ApiResponse; }> { + public uploadFile(petId: number, additionalMetadata?: string, file?: any, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + { response: JQueryXHR; body: models.ApiResponse; }, + { response: JQueryXHR; errorThrown: string } + > { let localVarPath = this.basePath + '/pet/{petId}/uploadImage'.replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; @@ -609,12 +654,15 @@ export class PetApi { requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); } - let dfd = $.Deferred(); + let dfd = $.Deferred< + { response: JQueryXHR; body: models.ApiResponse; }, + { response: JQueryXHR; errorThrown: string } + >(); $.ajax(requestOptions).then( (data: models.ApiResponse, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve(jqXHR, data), + dfd.resolve({response: jqXHR, body: data}), (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject(xhr, errorThrown) + dfd.reject({response: xhr, errorThrown: errorThrown}) ); return dfd.promise(); } diff --git a/samples/client/petstore/typescript-jquery/npm/api/StoreApi.ts b/samples/client/petstore/typescript-jquery/npm/api/StoreApi.ts index ed50edd97ab4..b4ca39af273d 100644 --- a/samples/client/petstore/typescript-jquery/npm/api/StoreApi.ts +++ b/samples/client/petstore/typescript-jquery/npm/api/StoreApi.ts @@ -51,7 +51,10 @@ export class StoreApi { * @summary Delete purchase order by ID * @param orderId ID of the order that needs to be deleted */ - public deleteOrder(orderId: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public deleteOrder(orderId: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + { response: JQueryXHR; body?: any; }, + { response: JQueryXHR; errorThrown: string } + > { let localVarPath = this.basePath + '/store/order/{orderId}'.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters: any = {}; @@ -91,12 +94,15 @@ export class StoreApi { requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); } - let dfd = $.Deferred(); + let dfd = $.Deferred< + { response: JQueryXHR; body?: any; }, + { response: JQueryXHR; errorThrown: string } + >(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve(jqXHR, data), + dfd.resolve({response: jqXHR, body: data}), (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject(xhr, errorThrown) + dfd.reject({response: xhr, errorThrown: errorThrown}) ); return dfd.promise(); } @@ -105,7 +111,10 @@ export class StoreApi { * Returns a map of status codes to quantities * @summary Returns pet inventories by status */ - public getInventory(extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: { [key: string]: number; }; }> { + public getInventory(extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + { response: JQueryXHR; body: { [key: string]: number; }; }, + { response: JQueryXHR; errorThrown: string } + > { let localVarPath = this.basePath + '/store/inventory'; let queryParameters: any = {}; @@ -146,12 +155,15 @@ export class StoreApi { requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); } - let dfd = $.Deferred(); + let dfd = $.Deferred< + { response: JQueryXHR; body: { [key: string]: number; }; }, + { response: JQueryXHR; errorThrown: string } + >(); $.ajax(requestOptions).then( (data: { [key: string]: number; }, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve(jqXHR, data), + dfd.resolve({response: jqXHR, body: data}), (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject(xhr, errorThrown) + dfd.reject({response: xhr, errorThrown: errorThrown}) ); return dfd.promise(); } @@ -161,7 +173,10 @@ export class StoreApi { * @summary Find purchase order by ID * @param orderId ID of pet that needs to be fetched */ - public getOrderById(orderId: number, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: models.Order; }> { + public getOrderById(orderId: number, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + { response: JQueryXHR; body: models.Order; }, + { response: JQueryXHR; errorThrown: string } + > { let localVarPath = this.basePath + '/store/order/{orderId}'.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters: any = {}; @@ -203,12 +218,15 @@ export class StoreApi { requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); } - let dfd = $.Deferred(); + let dfd = $.Deferred< + { response: JQueryXHR; body: models.Order; }, + { response: JQueryXHR; errorThrown: string } + >(); $.ajax(requestOptions).then( (data: models.Order, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve(jqXHR, data), + dfd.resolve({response: jqXHR, body: data}), (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject(xhr, errorThrown) + dfd.reject({response: xhr, errorThrown: errorThrown}) ); return dfd.promise(); } @@ -216,16 +234,19 @@ export class StoreApi { /** * * @summary Place an order for a pet - * @param order order placed for purchasing the pet + * @param body order placed for purchasing the pet */ - public placeOrder(order: models.models.Order, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: models.Order; }> { + public placeOrder(body: models.Order, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + { response: JQueryXHR; body: models.Order; }, + { response: JQueryXHR; errorThrown: string } + > { let localVarPath = this.basePath + '/store/order'; let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'order' is not null or undefined - if (order === null || order === undefined) { - throw new Error('Required parameter order was null or undefined when calling placeOrder.'); + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } @@ -250,7 +271,7 @@ export class StoreApi { processData: false }; - requestOptions.data = JSON.stringify(order); + requestOptions.data = JSON.stringify(body); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } @@ -263,12 +284,15 @@ export class StoreApi { requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); } - let dfd = $.Deferred(); + let dfd = $.Deferred< + { response: JQueryXHR; body: models.Order; }, + { response: JQueryXHR; errorThrown: string } + >(); $.ajax(requestOptions).then( (data: models.Order, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve(jqXHR, data), + dfd.resolve({response: jqXHR, body: data}), (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject(xhr, errorThrown) + dfd.reject({response: xhr, errorThrown: errorThrown}) ); return dfd.promise(); } diff --git a/samples/client/petstore/typescript-jquery/npm/api/UserApi.ts b/samples/client/petstore/typescript-jquery/npm/api/UserApi.ts index 044bd54c9c71..22719cd6a371 100644 --- a/samples/client/petstore/typescript-jquery/npm/api/UserApi.ts +++ b/samples/client/petstore/typescript-jquery/npm/api/UserApi.ts @@ -49,16 +49,19 @@ export class UserApi { /** * This can only be done by the logged in user. * @summary Create user - * @param user Created user object + * @param body Created user object */ - public createUser(user: models.models.User, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public createUser(body: models.User, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + { response: JQueryXHR; body?: any; }, + { response: JQueryXHR; errorThrown: string } + > { let localVarPath = this.basePath + '/user'; let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'user' is not null or undefined - if (user === null || user === undefined) { - throw new Error('Required parameter user was null or undefined when calling createUser.'); + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUser.'); } @@ -81,7 +84,7 @@ export class UserApi { processData: false }; - requestOptions.data = JSON.stringify(user); + requestOptions.data = JSON.stringify(body); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } @@ -94,12 +97,15 @@ export class UserApi { requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); } - let dfd = $.Deferred(); + let dfd = $.Deferred< + { response: JQueryXHR; body?: any; }, + { response: JQueryXHR; errorThrown: string } + >(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve(jqXHR, data), + dfd.resolve({response: jqXHR, body: data}), (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject(xhr, errorThrown) + dfd.reject({response: xhr, errorThrown: errorThrown}) ); return dfd.promise(); } @@ -107,16 +113,19 @@ export class UserApi { /** * * @summary Creates list of users with given input array - * @param modelsUser List of user object + * @param body List of user object */ - public createUsersWithArrayInput(modelsUser: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public createUsersWithArrayInput(body: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + { response: JQueryXHR; body?: any; }, + { response: JQueryXHR; errorThrown: string } + > { let localVarPath = this.basePath + '/user/createWithArray'; let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'modelsUser' is not null or undefined - if (modelsUser === null || modelsUser === undefined) { - throw new Error('Required parameter modelsUser was null or undefined when calling createUsersWithArrayInput.'); + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } @@ -139,7 +148,7 @@ export class UserApi { processData: false }; - requestOptions.data = JSON.stringify(modelsUser); + requestOptions.data = JSON.stringify(body); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } @@ -152,12 +161,15 @@ export class UserApi { requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); } - let dfd = $.Deferred(); + let dfd = $.Deferred< + { response: JQueryXHR; body?: any; }, + { response: JQueryXHR; errorThrown: string } + >(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve(jqXHR, data), + dfd.resolve({response: jqXHR, body: data}), (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject(xhr, errorThrown) + dfd.reject({response: xhr, errorThrown: errorThrown}) ); return dfd.promise(); } @@ -165,16 +177,19 @@ export class UserApi { /** * * @summary Creates list of users with given input array - * @param modelsUser List of user object + * @param body List of user object */ - public createUsersWithListInput(modelsUser: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public createUsersWithListInput(body: Array, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + { response: JQueryXHR; body?: any; }, + { response: JQueryXHR; errorThrown: string } + > { let localVarPath = this.basePath + '/user/createWithList'; let queryParameters: any = {}; let headerParams: any = {}; - // verify required parameter 'modelsUser' is not null or undefined - if (modelsUser === null || modelsUser === undefined) { - throw new Error('Required parameter modelsUser was null or undefined when calling createUsersWithListInput.'); + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } @@ -197,7 +212,7 @@ export class UserApi { processData: false }; - requestOptions.data = JSON.stringify(modelsUser); + requestOptions.data = JSON.stringify(body); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } @@ -210,12 +225,15 @@ export class UserApi { requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); } - let dfd = $.Deferred(); + let dfd = $.Deferred< + { response: JQueryXHR; body?: any; }, + { response: JQueryXHR; errorThrown: string } + >(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve(jqXHR, data), + dfd.resolve({response: jqXHR, body: data}), (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject(xhr, errorThrown) + dfd.reject({response: xhr, errorThrown: errorThrown}) ); return dfd.promise(); } @@ -225,7 +243,10 @@ export class UserApi { * @summary Delete user * @param username The name that needs to be deleted */ - public deleteUser(username: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public deleteUser(username: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + { response: JQueryXHR; body?: any; }, + { response: JQueryXHR; errorThrown: string } + > { let localVarPath = this.basePath + '/user/{username}'.replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; @@ -265,12 +286,15 @@ export class UserApi { requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); } - let dfd = $.Deferred(); + let dfd = $.Deferred< + { response: JQueryXHR; body?: any; }, + { response: JQueryXHR; errorThrown: string } + >(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve(jqXHR, data), + dfd.resolve({response: jqXHR, body: data}), (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject(xhr, errorThrown) + dfd.reject({response: xhr, errorThrown: errorThrown}) ); return dfd.promise(); } @@ -280,7 +304,10 @@ export class UserApi { * @summary Get user by user name * @param username The name that needs to be fetched. Use user1 for testing. */ - public getUserByName(username: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: models.User; }> { + public getUserByName(username: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + { response: JQueryXHR; body: models.User; }, + { response: JQueryXHR; errorThrown: string } + > { let localVarPath = this.basePath + '/user/{username}'.replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; @@ -322,12 +349,15 @@ export class UserApi { requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); } - let dfd = $.Deferred(); + let dfd = $.Deferred< + { response: JQueryXHR; body: models.User; }, + { response: JQueryXHR; errorThrown: string } + >(); $.ajax(requestOptions).then( (data: models.User, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve(jqXHR, data), + dfd.resolve({response: jqXHR, body: data}), (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject(xhr, errorThrown) + dfd.reject({response: xhr, errorThrown: errorThrown}) ); return dfd.promise(); } @@ -338,7 +368,10 @@ export class UserApi { * @param username The user name for login * @param password The password for login in clear text */ - public loginUser(username: string, password: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: string; }> { + public loginUser(username: string, password: string, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + { response: JQueryXHR; body: string; }, + { response: JQueryXHR; errorThrown: string } + > { let localVarPath = this.basePath + '/user/login'; let queryParameters: any = {}; @@ -391,12 +424,15 @@ export class UserApi { requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); } - let dfd = $.Deferred(); + let dfd = $.Deferred< + { response: JQueryXHR; body: string; }, + { response: JQueryXHR; errorThrown: string } + >(); $.ajax(requestOptions).then( (data: string, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve(jqXHR, data), + dfd.resolve({response: jqXHR, body: data}), (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject(xhr, errorThrown) + dfd.reject({response: xhr, errorThrown: errorThrown}) ); return dfd.promise(); } @@ -405,7 +441,10 @@ export class UserApi { * * @summary Logs out current logged in user session */ - public logoutUser(extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public logoutUser(extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + { response: JQueryXHR; body?: any; }, + { response: JQueryXHR; errorThrown: string } + > { let localVarPath = this.basePath + '/user/logout'; let queryParameters: any = {}; @@ -440,12 +479,15 @@ export class UserApi { requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); } - let dfd = $.Deferred(); + let dfd = $.Deferred< + { response: JQueryXHR; body?: any; }, + { response: JQueryXHR; errorThrown: string } + >(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve(jqXHR, data), + dfd.resolve({response: jqXHR, body: data}), (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject(xhr, errorThrown) + dfd.reject({response: xhr, errorThrown: errorThrown}) ); return dfd.promise(); } @@ -454,9 +496,12 @@ export class UserApi { * This can only be done by the logged in user. * @summary Updated user * @param username name that need to be deleted - * @param user Updated user object + * @param body Updated user object */ - public updateUser(username: string, user: models.models.User, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> { + public updateUser(username: string, body: models.User, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise< + { response: JQueryXHR; body?: any; }, + { response: JQueryXHR; errorThrown: string } + > { let localVarPath = this.basePath + '/user/{username}'.replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; @@ -466,9 +511,9 @@ export class UserApi { throw new Error('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 Error('Required parameter user was null or undefined when calling updateUser.'); + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling updateUser.'); } @@ -491,7 +536,7 @@ export class UserApi { processData: false }; - requestOptions.data = JSON.stringify(user); + requestOptions.data = JSON.stringify(body); if (headerParams['Content-Type']) { requestOptions.contentType = headerParams['Content-Type']; } @@ -504,12 +549,15 @@ export class UserApi { requestOptions = (Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings); } - let dfd = $.Deferred(); + let dfd = $.Deferred< + { response: JQueryXHR; body?: any; }, + { response: JQueryXHR; errorThrown: string } + >(); $.ajax(requestOptions).then( (data: any, textStatus: string, jqXHR: JQueryXHR) => - dfd.resolve(jqXHR, data), + dfd.resolve({response: jqXHR, body: data}), (xhr: JQueryXHR, textStatus: string, errorThrown: string) => - dfd.reject(xhr, errorThrown) + dfd.reject({response: xhr, errorThrown: errorThrown}) ); return dfd.promise(); } diff --git a/samples/client/petstore/typescript-jquery/npm/tsconfig.json b/samples/client/petstore/typescript-jquery/npm/tsconfig.json index e083415ea55d..c11ec54d7ca9 100644 --- a/samples/client/petstore/typescript-jquery/npm/tsconfig.json +++ b/samples/client/petstore/typescript-jquery/npm/tsconfig.json @@ -8,7 +8,10 @@ "removeComments": true, "sourceMap": true, "noLib": false, - "declaration": true + "declaration": true, + "typeRoots": [ + "node_modules/@types" + ] }, "files": [ "index.ts", diff --git a/samples/client/petstore/typescript-node/npm/tsconfig.json b/samples/client/petstore/typescript-node/npm/tsconfig.json index ba2570a4bee6..d6a89cb7a455 100644 --- a/samples/client/petstore/typescript-node/npm/tsconfig.json +++ b/samples/client/petstore/typescript-node/npm/tsconfig.json @@ -11,7 +11,10 @@ "noLib": false, "declaration": true, "lib": ["dom", "es6", "es5", "dom.iterable", "scripthost"], - "outDir": "dist" + "outDir": "dist", + "typeRoots": [ + "node_modules/@types" + ] }, "exclude": [ "dist", diff --git a/samples/client/petstore/typescript-rxjs/builds/default/tsconfig.json b/samples/client/petstore/typescript-rxjs/builds/default/tsconfig.json index 5de40723aa1a..d65f2a95afc1 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/tsconfig.json +++ b/samples/client/petstore/typescript-rxjs/builds/default/tsconfig.json @@ -9,6 +9,9 @@ "lib": [ "es6", "dom" + ], + "typeRoots": [ + "node_modules/@types" ] }, "exclude": [ diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/tsconfig.json b/samples/client/petstore/typescript-rxjs/builds/es6-target/tsconfig.json index 2e668d3863d6..6cc02878fb79 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/tsconfig.json +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/tsconfig.json @@ -5,7 +5,11 @@ "module": "commonjs", "moduleResolution": "node", "outDir": "dist", - "rootDir": "." }, + "rootDir": ".", + "typeRoots": [ + "node_modules/@types" + ] + }, "exclude": [ "dist", "node_modules" diff --git a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/tsconfig.json b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/tsconfig.json index 5de40723aa1a..d65f2a95afc1 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/tsconfig.json +++ b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/tsconfig.json @@ -9,6 +9,9 @@ "lib": [ "es6", "dom" + ], + "typeRoots": [ + "node_modules/@types" ] }, "exclude": [ diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/tsconfig.json b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/tsconfig.json index 5de40723aa1a..d65f2a95afc1 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/tsconfig.json +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/tsconfig.json @@ -9,6 +9,9 @@ "lib": [ "es6", "dom" + ], + "typeRoots": [ + "node_modules/@types" ] }, "exclude": [