forked from loafle/openapi-generator-original
TypeScript: add typeRoots to tsconfig (#2395)
* TypeScript: add typeRoots to tsconfig This avoids typescript looking in parent directories to find type definitions. We don’t _need_ this behaviour from typescript, as this module is self-contained. If we don’t block this behaviour from typescript, and you put the generated source inside a project that already has a node_modules/@types directory, you can run into conflicts when some types require newer versions of TypeScript than is used by this module. * Update petstore examples for all TypeScript variants
This commit is contained in:
committed by
William Cheng
parent
22d21afceb
commit
28ddad44e5
@@ -12,7 +12,10 @@
|
||||
"outDir": "./dist",
|
||||
"noLib": false,
|
||||
"declaration": true,
|
||||
"lib": [ "es6", "dom" ]
|
||||
"lib": [ "es6", "dom" ],
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
|
||||
@@ -5,7 +5,10 @@
|
||||
"module": "commonjs",
|
||||
"noImplicitAny": true,
|
||||
"outDir": "dist",
|
||||
"rootDir": "."
|
||||
"rootDir": ".",
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
"dist",
|
||||
|
||||
@@ -5,12 +5,16 @@
|
||||
"module": "commonjs",
|
||||
"noImplicitAny": true,
|
||||
"outDir": "dist",
|
||||
"rootDir": "."{{^supportsES6}},
|
||||
"rootDir": ".",
|
||||
{{^supportsES6}}
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
]
|
||||
],
|
||||
{{/supportsES6}}
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
"dist",
|
||||
|
||||
@@ -5,12 +5,16 @@
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"outDir": "dist",
|
||||
"rootDir": "."{{^supportsES6}},
|
||||
"rootDir": ".",
|
||||
{{^supportsES6}}
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
]
|
||||
],
|
||||
{{/supportsES6}}
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
"dist",
|
||||
|
||||
@@ -12,7 +12,10 @@
|
||||
"outDir": "./dist",
|
||||
"noLib": false,
|
||||
"declaration": true,
|
||||
"lib": [ "es6", "dom" ]
|
||||
"lib": [ "es6", "dom" ],
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
|
||||
@@ -8,7 +8,10 @@
|
||||
"removeComments": true,
|
||||
"sourceMap": true,
|
||||
"noLib": false,
|
||||
"declaration": true
|
||||
"declaration": true,
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"files": [
|
||||
"index.ts",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -5,12 +5,16 @@
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"outDir": "dist",
|
||||
"rootDir": "."{{^supportsES6}},
|
||||
"rootDir": ".",
|
||||
{{^supportsES6}}
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
]
|
||||
],
|
||||
{{/supportsES6}}
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
"dist",
|
||||
|
||||
@@ -12,7 +12,10 @@
|
||||
"outDir": "./dist",
|
||||
"noLib": false,
|
||||
"declaration": true,
|
||||
"lib": [ "es6", "dom" ]
|
||||
"lib": [ "es6", "dom" ],
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
|
||||
@@ -12,7 +12,10 @@
|
||||
"outDir": "./dist",
|
||||
"noLib": false,
|
||||
"declaration": true,
|
||||
"lib": [ "es6", "dom" ]
|
||||
"lib": [ "es6", "dom" ],
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
|
||||
@@ -12,7 +12,10 @@
|
||||
"outDir": "./dist",
|
||||
"noLib": false,
|
||||
"declaration": true,
|
||||
"lib": [ "es6", "dom" ]
|
||||
"lib": [ "es6", "dom" ],
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
|
||||
@@ -12,7 +12,10 @@
|
||||
"outDir": "./dist",
|
||||
"noLib": false,
|
||||
"declaration": true,
|
||||
"lib": [ "es6", "dom" ]
|
||||
"lib": [ "es6", "dom" ],
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
|
||||
@@ -12,7 +12,10 @@
|
||||
"outDir": "./dist",
|
||||
"noLib": false,
|
||||
"declaration": true,
|
||||
"lib": [ "es6", "dom" ]
|
||||
"lib": [ "es6", "dom" ],
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
|
||||
@@ -12,7 +12,10 @@
|
||||
"outDir": "./dist",
|
||||
"noLib": false,
|
||||
"declaration": true,
|
||||
"lib": [ "es6", "dom" ]
|
||||
"lib": [ "es6", "dom" ],
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
|
||||
@@ -12,7 +12,10 @@
|
||||
"outDir": "./dist",
|
||||
"noLib": false,
|
||||
"declaration": true,
|
||||
"lib": [ "es6", "dom" ]
|
||||
"lib": [ "es6", "dom" ],
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
|
||||
@@ -5,7 +5,11 @@
|
||||
"module": "commonjs",
|
||||
"noImplicitAny": true,
|
||||
"outDir": "dist",
|
||||
"rootDir": "." },
|
||||
"rootDir": ".",
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
"dist",
|
||||
"node_modules"
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
|
||||
@@ -5,7 +5,11 @@
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"outDir": "dist",
|
||||
"rootDir": "." },
|
||||
"rootDir": ".",
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
"dist",
|
||||
"node_modules"
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
|
||||
@@ -1 +1 @@
|
||||
3.3.0-SNAPSHOT
|
||||
4.0.0-SNAPSHOT
|
||||
@@ -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'];
|
||||
}
|
||||
|
||||
@@ -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'];
|
||||
}
|
||||
|
||||
@@ -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<models.User>, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise<
|
||||
public createUsersWithArrayInput(body: Array<models.User>, 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<models.User>, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise<
|
||||
public createUsersWithListInput(body: Array<models.User>, 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'];
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
3.0.0-SNAPSHOT
|
||||
4.0.0-SNAPSHOT
|
||||
@@ -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
|
||||
|
||||
@@ -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 = (<any>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 = (<any>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<models.Pet>; }> {
|
||||
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise<
|
||||
{ response: JQueryXHR; body: Array<models.Pet>; },
|
||||
{ response: JQueryXHR; errorThrown: string }
|
||||
> {
|
||||
let localVarPath = this.basePath + '/pet/findByStatus';
|
||||
|
||||
let queryParameters: any = {};
|
||||
@@ -241,12 +256,15 @@ export class PetApi {
|
||||
requestOptions = (<any>Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings);
|
||||
}
|
||||
|
||||
let dfd = $.Deferred();
|
||||
let dfd = $.Deferred<
|
||||
{ response: JQueryXHR; body: Array<models.Pet>; },
|
||||
{ response: JQueryXHR; errorThrown: string }
|
||||
>();
|
||||
$.ajax(requestOptions).then(
|
||||
(data: Array<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();
|
||||
}
|
||||
@@ -256,7 +274,10 @@ export class PetApi {
|
||||
* @summary Finds Pets by tags
|
||||
* @param tags Tags to filter by
|
||||
*/
|
||||
public findPetsByTags(tags: Array<string>, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body: Array<models.Pet>; }> {
|
||||
public findPetsByTags(tags: Array<string>, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQuery.Promise<
|
||||
{ response: JQueryXHR; body: Array<models.Pet>; },
|
||||
{ response: JQueryXHR; errorThrown: string }
|
||||
> {
|
||||
let localVarPath = this.basePath + '/pet/findByTags';
|
||||
|
||||
let queryParameters: any = {};
|
||||
@@ -310,12 +331,15 @@ export class PetApi {
|
||||
requestOptions = (<any>Object).assign(requestOptions, this.defaultExtraJQueryAjaxSettings);
|
||||
}
|
||||
|
||||
let dfd = $.Deferred();
|
||||
let dfd = $.Deferred<
|
||||
{ response: JQueryXHR; body: Array<models.Pet>; },
|
||||
{ response: JQueryXHR; errorThrown: string }
|
||||
>();
|
||||
$.ajax(requestOptions).then(
|
||||
(data: Array<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();
|
||||
}
|
||||
@@ -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 = (<any>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 = (<any>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 = (<any>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 = (<any>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();
|
||||
}
|
||||
|
||||
@@ -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 = (<any>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 = (<any>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 = (<any>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 = (<any>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();
|
||||
}
|
||||
|
||||
@@ -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 = (<any>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<models.User>, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> {
|
||||
public createUsersWithArrayInput(body: Array<models.User>, 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 = (<any>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<models.User>, extraJQueryAjaxSettings?: JQueryAjaxSettings): JQueryPromise<{ response: JQueryXHR; body?: any; }> {
|
||||
public createUsersWithListInput(body: Array<models.User>, 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 = (<any>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 = (<any>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 = (<any>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 = (<any>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 = (<any>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 = (<any>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();
|
||||
}
|
||||
|
||||
@@ -8,7 +8,10 @@
|
||||
"removeComments": true,
|
||||
"sourceMap": true,
|
||||
"noLib": false,
|
||||
"declaration": true
|
||||
"declaration": true,
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"files": [
|
||||
"index.ts",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
|
||||
@@ -5,7 +5,11 @@
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"outDir": "dist",
|
||||
"rootDir": "." },
|
||||
"rootDir": ".",
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
"dist",
|
||||
"node_modules"
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
|
||||
Reference in New Issue
Block a user