[TypeScript-jquery] set default return type as any (#5630)

* [TypeScript-jquery] fix bug of empty returnType appearing if returnType is not provided

* chore: add security sample for typescript-jquery
This commit is contained in:
Takuro Wada 2017-05-14 12:36:09 +09:00 committed by wing328
parent fe1fa188da
commit 11baad6e4b
18 changed files with 580 additions and 30 deletions

View File

@ -0,0 +1,36 @@
#!/bin/sh
SCRIPT="$0"
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done
if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
echo "Typescript jquery Petstore API client (default setting)"
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-security-test.yaml -l typescript-jquery -o samples/client/petstore-security-test/typescript-jquery/default"
java $JAVA_OPTS -jar $executable $ags
echo "Typescript jquery Petstore API client with npm setting"
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-security-test.yaml -l typescript-jquery -c bin/typescript-petstore-npm.json -o samples/client/petstore-security-test/typescript-jquery/npm"
java $JAVA_OPTS -jar $executable $ags

View File

@ -255,7 +255,7 @@ export class {{classname}} {
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: {{{returnType}}}, textStatus: string, jqXHR: JQueryXHR) =>
(data: {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}any{{/returnType}}, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })

View File

@ -0,0 +1,23 @@
# Swagger Codegen Ignore
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

@ -0,0 +1,155 @@
import * as $ from 'jquery';
let defaultBasePath = 'https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r';
// ===============================================
// This file is autogenerated - Please do not edit
// ===============================================
/* tslint:disable:no-unused-variable */
/**
* Model for testing reserved words *_/ ' \" =end -- \\r\\n \\n \\r
*/
export class ModelReturn {
/**
* property description *_/ ' \" =end -- \\r\\n \\n \\r
*/
'return': number;
}
export interface Authentication {
/**
* Apply authentication settings to header and query params.
*/
applyToRequest(requestOptions: JQueryAjaxSettings): void;
}
export class HttpBasicAuth implements Authentication {
public username: string;
public password: string;
applyToRequest(requestOptions: any): void {
requestOptions.username = this.username;
requestOptions.password = this.password;
}
}
export class ApiKeyAuth implements Authentication {
public apiKey: string;
constructor(private location: string, private paramName: string) {
}
applyToRequest(requestOptions: JQueryAjaxSettings): void {
requestOptions.headers[this.paramName] = this.apiKey;
}
}
export class OAuth implements Authentication {
public accessToken: string;
applyToRequest(requestOptions: JQueryAjaxSettings): void {
requestOptions.headers["Authorization"] = "Bearer " + this.accessToken;
}
}
export class VoidAuth implements Authentication {
public username: string;
public password: string;
applyToRequest(requestOptions: JQueryAjaxSettings): void {
// Do nothing
}
}
export enum FakeApiApiKeys {
api_key,
}
export class FakeApi {
protected basePath = defaultBasePath;
protected defaultHeaders : any = {};
protected authentications = {
'default': <Authentication>new VoidAuth(),
'api_key': new ApiKeyAuth('header', 'api_key */ &#39; &quot; &#x3D;end -- \r\n \n \r'),
'petstore_auth': new OAuth(),
}
constructor(basePath?: string);
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
if (password) {
if (basePath) {
this.basePath = basePath;
}
} else {
if (basePathOrUsername) {
this.basePath = basePathOrUsername
}
}
}
public setApiKey(key: FakeApiApiKeys, value: string) {
this.authentications[FakeApiApiKeys[key]].apiKey = value;
}
set accessToken(token: string) {
this.authentications.petstore_auth.accessToken = token;
}
private extendObj<T1, T2 extends T1>(objA: T2, objB: T2): T1|T2 {
for(let key in objB){
if(objB.hasOwnProperty(key)){
objA[key] = objB[key];
}
}
return objA;
}
/**
* To test code injection *_/ &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r
*
* @param test code inject * &#39; &quot; &#x3D;end rn n r To test code injection *_/ &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r
*/
public testCodeInjectEndRnNR (test code inject * &#39; &quot; &#x3D;end rn n r?: string) : JQueryPromise<{ response: JQueryXHR; body?: any; }> {
let localVarPath = this.basePath + '/fake';
let queryParameters: any = {};
let headerParams: any = this.extendObj({}, this.defaultHeaders);
localVarPath = localVarPath + "?" + $.param(queryParameters);
let reqHasFile = false;
let reqDict = {};
let reqFormData = new FormData();
if (test code inject * &#39; &quot; &#x3D;end rn n r !== undefined) {
reqFormData.append('test code inject */ &#39; &quot; &#x3D;end -- \r\n \n \r', test code inject * &#39; &quot; &#x3D;end rn n r);
reqDict['test code inject */ &#39; &quot; &#x3D;end -- \r\n \n \r'] = test code inject * &#39; &quot; &#x3D;end rn n r;
}
let requestOptions: JQueryAjaxSettings = {
url: localVarPath,
type: 'PUT',
headers: headerParams,
processData: false
};
if (Object.keys(reqDict).length) {
requestOptions.data = reqHasFile ? reqFormData : JSON.stringify(reqDict);
requestOptions.contentType = reqHasFile ? false : 'application/json; charset=utf-8';
}
this.authentications.default.applyToRequest(requestOptions);
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: any, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })
);
return dfd.promise();
}
}

View File

@ -0,0 +1,52 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
git_user_id=$1
git_repo_id=$2
release_note=$3
if [ "$git_user_id" = "" ]; then
git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi
# Initialize the local directory as a Git repository
git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=`git remote`
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
fi
fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'

View File

@ -0,0 +1,23 @@
# Swagger Codegen Ignore
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

@ -0,0 +1,155 @@
import * as $ from 'jquery';
let defaultBasePath = 'https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r';
// ===============================================
// This file is autogenerated - Please do not edit
// ===============================================
/* tslint:disable:no-unused-variable */
/**
* Model for testing reserved words *_/ ' \" =end -- \\r\\n \\n \\r
*/
export class ModelReturn {
/**
* property description *_/ ' \" =end -- \\r\\n \\n \\r
*/
'return': number;
}
export interface Authentication {
/**
* Apply authentication settings to header and query params.
*/
applyToRequest(requestOptions: JQueryAjaxSettings): void;
}
export class HttpBasicAuth implements Authentication {
public username: string;
public password: string;
applyToRequest(requestOptions: any): void {
requestOptions.username = this.username;
requestOptions.password = this.password;
}
}
export class ApiKeyAuth implements Authentication {
public apiKey: string;
constructor(private location: string, private paramName: string) {
}
applyToRequest(requestOptions: JQueryAjaxSettings): void {
requestOptions.headers[this.paramName] = this.apiKey;
}
}
export class OAuth implements Authentication {
public accessToken: string;
applyToRequest(requestOptions: JQueryAjaxSettings): void {
requestOptions.headers["Authorization"] = "Bearer " + this.accessToken;
}
}
export class VoidAuth implements Authentication {
public username: string;
public password: string;
applyToRequest(requestOptions: JQueryAjaxSettings): void {
// Do nothing
}
}
export enum FakeApiApiKeys {
api_key,
}
export class FakeApi {
protected basePath = defaultBasePath;
protected defaultHeaders : any = {};
protected authentications = {
'default': <Authentication>new VoidAuth(),
'api_key': new ApiKeyAuth('header', 'api_key */ &#39; &quot; &#x3D;end -- \r\n \n \r'),
'petstore_auth': new OAuth(),
}
constructor(basePath?: string);
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
if (password) {
if (basePath) {
this.basePath = basePath;
}
} else {
if (basePathOrUsername) {
this.basePath = basePathOrUsername
}
}
}
public setApiKey(key: FakeApiApiKeys, value: string) {
this.authentications[FakeApiApiKeys[key]].apiKey = value;
}
set accessToken(token: string) {
this.authentications.petstore_auth.accessToken = token;
}
private extendObj<T1, T2 extends T1>(objA: T2, objB: T2): T1|T2 {
for(let key in objB){
if(objB.hasOwnProperty(key)){
objA[key] = objB[key];
}
}
return objA;
}
/**
* To test code injection *_/ &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r
*
* @param test code inject * &#39; &quot; &#x3D;end rn n r To test code injection *_/ &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r
*/
public testCodeInjectEndRnNR (test code inject * &#39; &quot; &#x3D;end rn n r?: string) : JQueryPromise<{ response: JQueryXHR; body?: any; }> {
let localVarPath = this.basePath + '/fake';
let queryParameters: any = {};
let headerParams: any = this.extendObj({}, this.defaultHeaders);
localVarPath = localVarPath + "?" + $.param(queryParameters);
let reqHasFile = false;
let reqDict = {};
let reqFormData = new FormData();
if (test code inject * &#39; &quot; &#x3D;end rn n r !== undefined) {
reqFormData.append('test code inject */ &#39; &quot; &#x3D;end -- \r\n \n \r', test code inject * &#39; &quot; &#x3D;end rn n r);
reqDict['test code inject */ &#39; &quot; &#x3D;end -- \r\n \n \r'] = test code inject * &#39; &quot; &#x3D;end rn n r;
}
let requestOptions: JQueryAjaxSettings = {
url: localVarPath,
type: 'PUT',
headers: headerParams,
processData: false
};
if (Object.keys(reqDict).length) {
requestOptions.data = reqHasFile ? reqFormData : JSON.stringify(reqDict);
requestOptions.contentType = reqHasFile ? false : 'application/json; charset=utf-8';
}
this.authentications.default.applyToRequest(requestOptions);
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: any, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })
);
return dfd.promise();
}
}

View File

@ -0,0 +1,52 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
git_user_id=$1
git_repo_id=$2
release_note=$3
if [ "$git_user_id" = "" ]; then
git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi
# Initialize the local directory as a Git repository
git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=`git remote`
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
fi
fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'

View File

@ -0,0 +1,22 @@
{
"name": "@swagger/angular2-typescript-petstore",
"version": "0.0.1",
"description": "JQuery client for @swagger/angular2-typescript-petstore",
"main": "api.js",
"scripts": {
"build": "tsc"
},
"author": "Swagger Codegen Contributors",
"license": "MIT",
"dependencies": {
"bluebird": "^3.3.5",
"request": "^2.72.0"
},
"devDependencies": {
"typescript": "^1.8.10",
"typings": "^0.8.1"
},
"publishConfig":{
"registry":"https://skimdb.npmjs.com/registry"
}
}

View File

@ -0,0 +1,18 @@
{
"compilerOptions": {
"module": "commonjs",
"noImplicitAny": false,
"suppressImplicitAnyIndexErrors": true,
"target": "ES5",
"moduleResolution": "node",
"removeComments": true,
"sourceMap": true,
"noLib": false,
"declaration": true
},
"files": [
"api.ts",
"typings/main.d.ts"
]
}

View File

@ -0,0 +1,10 @@
{
"ambientDependencies": {
"bluebird": "registry:dt/bluebird#2.0.0+20160319051630",
"core-js": "registry:dt/core-js#0.0.0+20160317120654",
"node": "registry:dt/node#4.0.0+20160423143914"
},
"dependencies": {
"request": "registry:npm/request#2.69.0+20160304121250"
}
}

View File

@ -0,0 +1 @@
2.2.3-SNAPSHOT

View File

@ -195,7 +195,7 @@ export class PetApi {
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: , textStatus: string, jqXHR: JQueryXHR) =>
(data: any, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })
@ -248,7 +248,7 @@ export class PetApi {
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: , textStatus: string, jqXHR: JQueryXHR) =>
(data: any, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })
@ -388,10 +388,10 @@ export class PetApi {
requestOptions.contentType = reqHasFile ? false : 'application/json; charset=utf-8';
}
this.authentications.petstore_auth.applyToRequest(requestOptions);
this.authentications.api_key.applyToRequest(requestOptions);
this.authentications.petstore_auth.applyToRequest(requestOptions);
this.authentications.default.applyToRequest(requestOptions);
let dfd = $.Deferred();
@ -441,7 +441,7 @@ export class PetApi {
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: , textStatus: string, jqXHR: JQueryXHR) =>
(data: any, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })
@ -503,7 +503,7 @@ export class PetApi {
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: , textStatus: string, jqXHR: JQueryXHR) =>
(data: any, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })
@ -566,7 +566,7 @@ export class PetApi {
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: , textStatus: string, jqXHR: JQueryXHR) =>
(data: any, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })
@ -658,7 +658,7 @@ export class StoreApi {
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: , textStatus: string, jqXHR: JQueryXHR) =>
(data: any, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })
@ -879,7 +879,7 @@ export class UserApi {
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: , textStatus: string, jqXHR: JQueryXHR) =>
(data: any, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })
@ -922,7 +922,7 @@ export class UserApi {
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: , textStatus: string, jqXHR: JQueryXHR) =>
(data: any, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })
@ -965,7 +965,7 @@ export class UserApi {
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: , textStatus: string, jqXHR: JQueryXHR) =>
(data: any, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })
@ -1013,7 +1013,7 @@ export class UserApi {
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: , textStatus: string, jqXHR: JQueryXHR) =>
(data: any, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })
@ -1153,7 +1153,7 @@ export class UserApi {
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: , textStatus: string, jqXHR: JQueryXHR) =>
(data: any, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })
@ -1203,7 +1203,7 @@ export class UserApi {
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: , textStatus: string, jqXHR: JQueryXHR) =>
(data: any, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })

View File

@ -0,0 +1 @@
2.2.3-SNAPSHOT

View File

@ -195,7 +195,7 @@ export class PetApi {
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: , textStatus: string, jqXHR: JQueryXHR) =>
(data: any, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })
@ -248,7 +248,7 @@ export class PetApi {
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: , textStatus: string, jqXHR: JQueryXHR) =>
(data: any, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })
@ -388,10 +388,10 @@ export class PetApi {
requestOptions.contentType = reqHasFile ? false : 'application/json; charset=utf-8';
}
this.authentications.petstore_auth.applyToRequest(requestOptions);
this.authentications.api_key.applyToRequest(requestOptions);
this.authentications.petstore_auth.applyToRequest(requestOptions);
this.authentications.default.applyToRequest(requestOptions);
let dfd = $.Deferred();
@ -441,7 +441,7 @@ export class PetApi {
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: , textStatus: string, jqXHR: JQueryXHR) =>
(data: any, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })
@ -503,7 +503,7 @@ export class PetApi {
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: , textStatus: string, jqXHR: JQueryXHR) =>
(data: any, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })
@ -566,7 +566,7 @@ export class PetApi {
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: , textStatus: string, jqXHR: JQueryXHR) =>
(data: any, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })
@ -658,7 +658,7 @@ export class StoreApi {
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: , textStatus: string, jqXHR: JQueryXHR) =>
(data: any, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })
@ -879,7 +879,7 @@ export class UserApi {
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: , textStatus: string, jqXHR: JQueryXHR) =>
(data: any, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })
@ -922,7 +922,7 @@ export class UserApi {
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: , textStatus: string, jqXHR: JQueryXHR) =>
(data: any, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })
@ -965,7 +965,7 @@ export class UserApi {
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: , textStatus: string, jqXHR: JQueryXHR) =>
(data: any, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })
@ -1013,7 +1013,7 @@ export class UserApi {
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: , textStatus: string, jqXHR: JQueryXHR) =>
(data: any, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })
@ -1153,7 +1153,7 @@ export class UserApi {
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: , textStatus: string, jqXHR: JQueryXHR) =>
(data: any, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })
@ -1203,7 +1203,7 @@ export class UserApi {
let dfd = $.Deferred();
$.ajax(requestOptions).then(
(data: , textStatus: string, jqXHR: JQueryXHR) =>
(data: any, textStatus: string, jqXHR: JQueryXHR) =>
dfd.resolve({ response: jqXHR, body: data }),
(xhr: JQueryXHR, textStatus: string, errorThrown: string) =>
dfd.reject({ response: xhr, body: errorThrown })

View File

@ -1,6 +1,6 @@
{
"name": "@swagger/angular2-typescript-petstore",
"version": "0.0.1-SNAPSHOT.201704021610",
"version": "0.0.1",
"description": "JQuery client for @swagger/angular2-typescript-petstore",
"main": "api.js",
"scripts": {