From 8b16e71edfbe58c05e0bf30cc2596921cc0b4483 Mon Sep 17 00:00:00 2001 From: Isman Usoh Date: Mon, 17 Jul 2017 20:12:16 +0700 Subject: [PATCH 1/8] Update and new typescript-fetch bin - Update typescript-fetch bin for linux - Create typescript-fetch bin for windows --- bin/typescript-fetch-petstore-all.sh | 5 --- bin/typescript-fetch-petstore-default.sh | 33 +++++++++++++++++++ bin/typescript-fetch-petstore-es6.json | 7 ++++ ...on.sh => typescript-fetch-petstore-es6.sh} | 4 ++- bin/typescript-fetch-petstore-npm.json | 6 ++++ ...s6.sh => typescript-fetch-petstore-npm.sh} | 4 ++- bin/typescript-fetch-petstore-target-es6.json | 3 -- ...cript-fetch-petstore-with-npm-version.json | 4 --- bin/typescript-fetch-petstore.sh | 31 ++--------------- ... => typescript-fetch-petstore-default.bat} | 4 ++- bin/windows/typescript-fetch-petstore-es6.bat | 12 +++++++ bin/windows/typescript-fetch-petstore-npm.bat | 12 +++++++ bin/windows/typescript-fetch-petstore.bat | 5 +++ 13 files changed, 87 insertions(+), 43 deletions(-) delete mode 100755 bin/typescript-fetch-petstore-all.sh create mode 100644 bin/typescript-fetch-petstore-default.sh create mode 100644 bin/typescript-fetch-petstore-es6.json rename bin/{typescript-fetch-petstore-with-npm-version.sh => typescript-fetch-petstore-es6.sh} (86%) mode change 100755 => 100644 create mode 100644 bin/typescript-fetch-petstore-npm.json rename bin/{typescript-fetch-petstore-target-es6.sh => typescript-fetch-petstore-npm.sh} (86%) mode change 100755 => 100644 delete mode 100644 bin/typescript-fetch-petstore-target-es6.json delete mode 100644 bin/typescript-fetch-petstore-with-npm-version.json rename bin/windows/{typescript-fetch.bat => typescript-fetch-petstore-default.bat} (79%) mode change 100755 => 100644 create mode 100644 bin/windows/typescript-fetch-petstore-es6.bat create mode 100644 bin/windows/typescript-fetch-petstore-npm.bat create mode 100644 bin/windows/typescript-fetch-petstore.bat diff --git a/bin/typescript-fetch-petstore-all.sh b/bin/typescript-fetch-petstore-all.sh deleted file mode 100755 index 6365b9032a6..00000000000 --- a/bin/typescript-fetch-petstore-all.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -./bin/typescript-fetch-petstore-target-es6.sh -./bin/typescript-fetch-petstore-with-npm-version.sh -./bin/typescript-fetch-petstore.sh diff --git a/bin/typescript-fetch-petstore-default.sh b/bin/typescript-fetch-petstore-default.sh new file mode 100644 index 00000000000..4c7fef3c1c2 --- /dev/null +++ b/bin/typescript-fetch-petstore-default.sh @@ -0,0 +1,33 @@ +#!/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-Fetch Petstore API client (default)" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l typescript-fetch -o samples/client/petstore/typescript-fetch/builds/default" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-fetch-petstore-es6.json b/bin/typescript-fetch-petstore-es6.json new file mode 100644 index 00000000000..b341515be1b --- /dev/null +++ b/bin/typescript-fetch-petstore-es6.json @@ -0,0 +1,7 @@ +{ + "npmName": "@swagger/typescript-fetch-petstore", + "npmVersion": "0.0.1", + "npmRepository" : "https://skimdb.npmjs.com/registry", + "snapshot" : false, + "supportsES6": true +} diff --git a/bin/typescript-fetch-petstore-with-npm-version.sh b/bin/typescript-fetch-petstore-es6.sh old mode 100755 new mode 100644 similarity index 86% rename from bin/typescript-fetch-petstore-with-npm-version.sh rename to bin/typescript-fetch-petstore-es6.sh index fd9225f0e72..9035e157024 --- a/bin/typescript-fetch-petstore-with-npm-version.sh +++ b/bin/typescript-fetch-petstore-es6.sh @@ -26,6 +26,8 @@ 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" -ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l typescript-fetch -c bin/typescript-fetch-petstore-with-npm-version.json -o samples/client/petstore/typescript-fetch/builds/with-npm-version" + +echo "Typescript-Fetch Petstore API client (ES6)" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l typescript-fetch -c bin/typescript-fetch-petstore-es6.json -o samples/client/petstore/typescript-fetch/builds/es6" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-fetch-petstore-npm.json b/bin/typescript-fetch-petstore-npm.json new file mode 100644 index 00000000000..141e376d408 --- /dev/null +++ b/bin/typescript-fetch-petstore-npm.json @@ -0,0 +1,6 @@ +{ + "npmName": "@swagger/typescript-fetch-petstore", + "npmVersion": "0.0.1", + "npmRepository" : "https://skimdb.npmjs.com/registry", + "snapshot" : false +} diff --git a/bin/typescript-fetch-petstore-target-es6.sh b/bin/typescript-fetch-petstore-npm.sh old mode 100755 new mode 100644 similarity index 86% rename from bin/typescript-fetch-petstore-target-es6.sh rename to bin/typescript-fetch-petstore-npm.sh index 84a6562eeb6..08af3fc702f --- a/bin/typescript-fetch-petstore-target-es6.sh +++ b/bin/typescript-fetch-petstore-npm.sh @@ -26,6 +26,8 @@ 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" -ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l typescript-fetch -c bin/typescript-fetch-petstore-target-es6.json -o samples/client/petstore/typescript-fetch/builds/es6-target" + +echo "Typescript-Fetch Petstore API client (NPM version)" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l typescript-fetch -c bin/typescript-fetch-petstore-npm.json -o samples/client/petstore/typescript-fetch/builds/npm" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-fetch-petstore-target-es6.json b/bin/typescript-fetch-petstore-target-es6.json deleted file mode 100644 index 83914bd569c..00000000000 --- a/bin/typescript-fetch-petstore-target-es6.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "supportsES6": true -} diff --git a/bin/typescript-fetch-petstore-with-npm-version.json b/bin/typescript-fetch-petstore-with-npm-version.json deleted file mode 100644 index b8193c8fa74..00000000000 --- a/bin/typescript-fetch-petstore-with-npm-version.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "npmName": "@swagger/typescript-fetch-petstore", - "npmVersion": "0.0.1" -} diff --git a/bin/typescript-fetch-petstore.sh b/bin/typescript-fetch-petstore.sh index 50d56f34609..30963fc4691 100755 --- a/bin/typescript-fetch-petstore.sh +++ b/bin/typescript-fetch-petstore.sh @@ -1,31 +1,6 @@ #!/bin/sh -SCRIPT="$0" +./bin/typescript-fetch-petstore-default.sh +./bin/typescript-fetch-petstore-es6.sh +./bin/typescript-fetch-petstore-npm.sh -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" -ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l typescript-fetch -o samples/client/petstore/typescript-fetch/builds/default" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/typescript-fetch.bat b/bin/windows/typescript-fetch-petstore-default.bat old mode 100755 new mode 100644 similarity index 79% rename from bin/windows/typescript-fetch.bat rename to bin/windows/typescript-fetch-petstore-default.bat index a2b45b39901..67631ff3ae8 --- a/bin/windows/typescript-fetch.bat +++ b/bin/windows/typescript-fetch-petstore-default.bat @@ -5,6 +5,8 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l typescript-fetch -o samples\client\petstore\typescript-fetch + +echo Typescript-Fetch Petstore API client (default) +set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l typescript-fetch -o samples\client\petstore\typescript-fetch\builds\default java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-fetch-petstore-es6.bat b/bin/windows/typescript-fetch-petstore-es6.bat new file mode 100644 index 00000000000..133a58c955f --- /dev/null +++ b/bin/windows/typescript-fetch-petstore-es6.bat @@ -0,0 +1,12 @@ +set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M + +echo Typescript-Fetch Petstore API client (ES6) +set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l typescript-fetch -c bin\typescript-fetch-petstore-es6.json -o samples\client\petstore\typescript-fetch\builds\es6 + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-fetch-petstore-npm.bat b/bin/windows/typescript-fetch-petstore-npm.bat new file mode 100644 index 00000000000..019eb82dfa8 --- /dev/null +++ b/bin/windows/typescript-fetch-petstore-npm.bat @@ -0,0 +1,12 @@ +set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M + +echo Typescript-Fetch Petstore API client (NPM version) +set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l typescript-fetch -c bin/typescript-fetch-petstore-npm.json -o samples\client\petstore\typescript-fetch\builds\npm + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-fetch-petstore.bat b/bin/windows/typescript-fetch-petstore.bat new file mode 100644 index 00000000000..80ab7ef7507 --- /dev/null +++ b/bin/windows/typescript-fetch-petstore.bat @@ -0,0 +1,5 @@ +@ECHO OFF + +call bin\windows\typescript-fetch-petstore-default.bat +call bin\windows\typescript-fetch-petstore-es6.bat +call bin\windows\typescript-fetch-petstore-npm.bat \ No newline at end of file From 9d8db27f45fe5ae1eecd4440dbc27cee5ea03f56 Mon Sep 17 00:00:00 2001 From: Isman Usoh Date: Mon, 17 Jul 2017 20:54:27 +0700 Subject: [PATCH 2/8] set .bat Echo off --- bin/windows/typescript-fetch-petstore-default.bat | 1 + bin/windows/typescript-fetch-petstore-es6.bat | 1 + bin/windows/typescript-fetch-petstore-npm.bat | 1 + 3 files changed, 3 insertions(+) diff --git a/bin/windows/typescript-fetch-petstore-default.bat b/bin/windows/typescript-fetch-petstore-default.bat index 67631ff3ae8..80f036b4bfe 100644 --- a/bin/windows/typescript-fetch-petstore-default.bat +++ b/bin/windows/typescript-fetch-petstore-default.bat @@ -1,3 +1,4 @@ +@ECHO OFF set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar If Not Exist %executable% ( diff --git a/bin/windows/typescript-fetch-petstore-es6.bat b/bin/windows/typescript-fetch-petstore-es6.bat index 133a58c955f..a87850e5dcc 100644 --- a/bin/windows/typescript-fetch-petstore-es6.bat +++ b/bin/windows/typescript-fetch-petstore-es6.bat @@ -1,3 +1,4 @@ +@ECHO OFF set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar If Not Exist %executable% ( diff --git a/bin/windows/typescript-fetch-petstore-npm.bat b/bin/windows/typescript-fetch-petstore-npm.bat index 019eb82dfa8..25b6188bc16 100644 --- a/bin/windows/typescript-fetch-petstore-npm.bat +++ b/bin/windows/typescript-fetch-petstore-npm.bat @@ -1,3 +1,4 @@ +@ECHO OFF set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar If Not Exist %executable% ( From b0c83f7fb1745c01d6717d262ae7baf0c8ca9abd Mon Sep 17 00:00:00 2001 From: Isman Usoh Date: Tue, 18 Jul 2017 02:15:21 +0700 Subject: [PATCH 3/8] Update typescript-fetch - Upgrade to TypeScript 2 - Use type definition from npm Instead of from Typings - Use Enum Instead of String Literal Types - Use typescript es6 lib for target es5 - Support additionalproperties - Support JSDoc --- .../TypeScriptFetchClientCodegen.java | 101 ++++--- .../main/resources/TypeScript-Fetch/README.md | 54 ---- .../TypeScript-Fetch/README.md.mustache | 45 ++++ .../resources/TypeScript-Fetch/api.mustache | 249 +++++++++++------- .../TypeScript-Fetch/modelEnum.mustache | 12 + .../TypeScript-Fetch/modelGeneric.mustache | 41 +++ .../TypeScript-Fetch/package.json.mustache | 35 ++- .../TypeScript-Fetch/tsconfig.json.mustache | 11 +- .../TypeScript-Fetch/tslint.json.mustache | 101 ------- .../TypeScript-Fetch/typings.json.mustache | 9 - .../TypeScriptFetchClientOptionsProvider.java | 3 + 11 files changed, 356 insertions(+), 305 deletions(-) delete mode 100644 modules/swagger-codegen/src/main/resources/TypeScript-Fetch/README.md create mode 100644 modules/swagger-codegen/src/main/resources/TypeScript-Fetch/README.md.mustache create mode 100644 modules/swagger-codegen/src/main/resources/TypeScript-Fetch/modelEnum.mustache create mode 100644 modules/swagger-codegen/src/main/resources/TypeScript-Fetch/modelGeneric.mustache delete mode 100644 modules/swagger-codegen/src/main/resources/TypeScript-Fetch/tslint.json.mustache delete mode 100644 modules/swagger-codegen/src/main/resources/TypeScript-Fetch/typings.json.mustache diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptFetchClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptFetchClientCodegen.java index a6449587ac3..895f5110630 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptFetchClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptFetchClientCodegen.java @@ -1,22 +1,37 @@ package io.swagger.codegen.languages; -import io.swagger.codegen.CliOption; -import io.swagger.codegen.CodegenModel; -import io.swagger.codegen.CodegenProperty; -import io.swagger.codegen.SupportingFile; - import java.io.File; +import java.text.SimpleDateFormat; +import java.util.Date; import java.util.List; import java.util.Map; import java.util.TreeSet; +import io.swagger.codegen.CliOption; +import io.swagger.codegen.CodegenModel; +import io.swagger.codegen.CodegenOperation; +import io.swagger.codegen.SupportingFile; +import io.swagger.models.ModelImpl; +import io.swagger.models.properties.RefProperty; +import io.swagger.models.properties.ArrayProperty; +import io.swagger.models.properties.BooleanProperty; +import io.swagger.models.properties.FileProperty; +import io.swagger.models.properties.MapProperty; +import io.swagger.models.properties.ObjectProperty; +import io.swagger.models.properties.Property; +import sun.rmi.runtime.Log; + public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodegen { + private static final SimpleDateFormat SNAPSHOT_SUFFIX_FORMAT = new SimpleDateFormat("yyyyMMddHHmm"); public static final String NPM_NAME = "npmName"; public static final String NPM_VERSION = "npmVersion"; + public static final String NPM_REPOSITORY = "npmRepository"; + public static final String SNAPSHOT = "snapshot"; protected String npmName = null; protected String npmVersion = "1.0.0"; + protected String npmRepository = null; public TypeScriptFetchClientCodegen() { super(); @@ -29,20 +44,26 @@ public TypeScriptFetchClientCodegen() { embeddedTemplateDir = templateDir = "TypeScript-Fetch"; this.cliOptions.add(new CliOption(NPM_NAME, "The name under which you want to publish generated npm package")); this.cliOptions.add(new CliOption(NPM_VERSION, "The version of your npm package")); + this.cliOptions.add(new CliOption(NPM_REPOSITORY, "Use this property to set an url your private npmRepo in the package.json")); + this.cliOptions.add(new CliOption(SNAPSHOT, "When setting this property to true the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm", BooleanProperty.TYPE).defaultValue(Boolean.FALSE.toString())); + } + + @Override + protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, ModelImpl swaggerModel) { + codegenModel.additionalPropertiesType = getTypeDeclaration(swaggerModel.getAdditionalProperties()); + addImport(codegenModel, codegenModel.additionalPropertiesType); } @Override public void processOpts() { super.processOpts(); supportingFiles.add(new SupportingFile("api.mustache", "", "api.ts")); - supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); - supportingFiles.add(new SupportingFile("README.md", "", "README.md")); - supportingFiles.add(new SupportingFile("package.json.mustache", "", "package.json")); - supportingFiles.add(new SupportingFile("typings.json.mustache", "", "typings.json")); - supportingFiles.add(new SupportingFile("tsconfig.json.mustache", "", "tsconfig.json")); - supportingFiles.add(new SupportingFile("tslint.json.mustache", "", "tslint.json")); - supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore")); + if(additionalProperties.containsKey(NPM_NAME)) { + addNpmPackageGeneration(); + } + } + private void addNpmPackageGeneration() { if(additionalProperties.containsKey(NPM_NAME)) { this.setNpmName(additionalProperties.get(NPM_NAME).toString()); } @@ -50,6 +71,39 @@ public void processOpts() { if (additionalProperties.containsKey(NPM_VERSION)) { this.setNpmVersion(additionalProperties.get(NPM_VERSION).toString()); } + + if (additionalProperties.containsKey(SNAPSHOT) && Boolean.valueOf(additionalProperties.get(SNAPSHOT).toString())) { + this.setNpmVersion(npmVersion + "-SNAPSHOT." + SNAPSHOT_SUFFIX_FORMAT.format(new Date())); + } + additionalProperties.put(NPM_VERSION, npmVersion); + + if (additionalProperties.containsKey(NPM_REPOSITORY)) { + this.setNpmRepository(additionalProperties.get(NPM_REPOSITORY).toString()); + } + + //Files for building our lib + supportingFiles.add(new SupportingFile("README.md.mustache", "", "README.md")); + supportingFiles.add(new SupportingFile("package.json.mustache", "", "package.json")); + supportingFiles.add(new SupportingFile("tsconfig.json.mustache", "", "tsconfig.json")); + supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore")); + supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); + } + + @Override + public String getTypeDeclaration(Property p) { + if (p instanceof ArrayProperty) { + ArrayProperty ap = (ArrayProperty) p; + Property inner = ap.getItems(); + return this.getSwaggerType(p) + "<" + this.getTypeDeclaration(inner) + ">"; + } else if (p instanceof MapProperty) { + MapProperty mp = (MapProperty) p; + Property inner = mp.getAdditionalProperties(); + return "{ [key: string]: " + this.getTypeDeclaration(inner) + "; }"; + } else if (p instanceof FileProperty || p instanceof ObjectProperty) { + return "any"; + } else { + return super.getTypeDeclaration(p); + } } @Override @@ -78,24 +132,11 @@ public void setNpmVersion(String npmVersion) { this.npmVersion = npmVersion; } - @Override - public Map postProcessModels(Map objs) { - // process enum in models - List models = (List) postProcessModelsEnum(objs).get("models"); - for (Object _mo : models) { - Map mo = (Map) _mo; - CodegenModel cm = (CodegenModel) mo.get("model"); - cm.imports = new TreeSet(cm.imports); - for (CodegenProperty var : cm.vars) { - // name enum with model name, e.g. StatuEnum => PetStatusEnum - if (Boolean.TRUE.equals(var.isEnum)) { - var.datatypeWithEnum = var.datatypeWithEnum.replace(var.enumName, cm.classname + var.enumName); - var.enumName = cm.classname + var.enumName; - } - } - } - - return objs; + public String getNpmRepository() { + return npmRepository; } + public void setNpmRepository(String npmRepository) { + this.npmRepository = npmRepository; + } } diff --git a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/README.md b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/README.md deleted file mode 100644 index 664e1755933..00000000000 --- a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# TypeScript-Fetch - -This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: - -Environment -* Node.js -* Webpack -* Browserify - -Language level -* ES5 - you must have a Promises/A+ library installed -* ES6 - -Module system -* CommonJS -* ES6 module system - -It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html)) - -### Installation ### - -`swagger-codegen` does not generate JavaScript directly. The generated Node module comes with `package.json` that bundles `typescript` and `typings` so it can self-compile during `prepublish` stage. The should be run automatically during `npm install` or `npm publish`. - -CAVEAT: Due to [privilege implications](https://docs.npmjs.com/misc/scripts#user), `npm` would skip all scripts if the user is `root`. You would need to manually run it with `npm run prepublish` or run `npm install --unsafe-perm`. - -#### NPM #### -You may publish the module to NPM. In this case, you would be able to install the module as any other NPM module. It maybe useful to use [scoped packages](https://docs.npmjs.com/misc/scope). - -You can also use `npm link` to link the module. However, this would not modify `package.json` of the installing project, as such you would need to relink every time you deploy that project. - -You can also directly install the module using `npm install file_path`. If you do `npm install file_path --save`, NPM will save relative path to `package.json`. In this case, `npm install` and `npm shrinkwrap` may misbehave. You would need to manually edit `package.json` and replace it with absolute path. - -Regardless of which method you deployed your NPM module, the ES6 module syntaxes are as follows: -``` -import * as localName from 'npmName'; -import {operationId} from 'npmName'; -``` -The CommonJS syntax is as follows: -``` -import localName = require('npmName'); -``` - -#### Direct copy/symlink #### -You may also simply copy or symlink the generated module into a directory under your project. The syntax of this is as follows: - -With ES6 module syntax, the following syntaxes are supported: -``` -import * as localName from './symlinkDir'; -import {operationId} from './symlinkDir'; -``` -The CommonJS syntax is as follows: -``` -import localName = require('./symlinkDir')'; -``` diff --git a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/README.md.mustache b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/README.md.mustache new file mode 100644 index 00000000000..edc73942542 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/README.md.mustache @@ -0,0 +1,45 @@ +## {{npmName}}@{{npmVersion}} + +This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: + +Environment +* Node.js +* Webpack +* Browserify + +Language level +* ES5 - you must have a Promises/A+ library installed +* ES6 + +Module system +* CommonJS +* ES6 module system + +It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html)) + +### Building + +To build an compile the typescript sources to javascript use: +``` +npm install +npm run build +``` + +### publishing + +First build the package than run ```npm publish``` + +### consuming + +navigate to the folder of your consuming project and run one of next commando's. + +_published:_ + +``` +npm install {{npmName}}@{{npmVersion}} --save +``` + +_unPublished (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE --save \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/api.mustache b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/api.mustache index 23be9a91356..a1fa7faee07 100644 --- a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/api.mustache +++ b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/api.mustache @@ -1,67 +1,59 @@ +// tslint:disable {{>licenseInfo}} -import * as querystring from "querystring"; -import * as url from "url"; -import * as isomorphicFetch from "isomorphic-fetch"; -{{^supportsES6}} -import * as assign from "core-js/library/fn/object/assign"; -{{/supportsES6}} - -interface Dictionary { [index: string]: T; } -export interface FetchAPI { (url: string, init?: any): Promise; } +import * as url from "url"; +import * as isomorphicFetch from "isomorphic-fetch"; const BASE_PATH = "{{{basePath}}}".replace(/\/+$/, ""); +/** + * + * @export + * @interface FetchAPI + */ +export interface FetchAPI { + (url: string, init?: any): Promise; +} + +/** + * + * @export + * @interface FetchArgs + */ export interface FetchArgs { url: string; options: any; } +/** + * + * @export + * @class BaseAPI + */ export class BaseAPI { - basePath: string; - fetch: FetchAPI; - - constructor(fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) { - this.basePath = basePath; - this.fetch = fetch; + constructor(public basePath: string = BASE_PATH, public fetch: FetchAPI = isomorphicFetch) { } }; -{{#models}} -{{#model}} -{{#description}} /** - * {{{description}}} + * + * @export + * @class RequiredError + * @extends {Error} */ -{{/description}} -{{^isEnum}} -export interface {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{ -{{/isEnum}} -{{#isEnum}} -export type {{{classname}}} = {{#allowableValues}}{{#values}}"{{{.}}}"{{^-last}} | {{/-last}}{{/values}}{{/allowableValues}}; -{{/isEnum}} -{{#vars}} -{{#description}} - /** - * {{{description}}} - */ -{{/description}} - "{{name}}"{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{datatype}}}{{/isEnum}}; -{{/vars}} -{{^isEnum}} +export class RequiredError extends Error { + name: "RequiredError" + constructor(public field: string, msg?: string) { + super(msg); + } } -{{/isEnum}} - -{{#hasEnums}} -{{#vars}} -{{#isEnum}} -export type {{{enumName}}} = {{#allowableValues}}{{#values}}"{{{.}}}"{{^-last}} | {{/-last}}{{/values}}{{/allowableValues}}; -{{/isEnum}} -{{/vars}} -{{/hasEnums}} + +{{#models}} +{{#model}} +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{>modelGeneric}}{{/isEnum}} {{/model}} -{{/models}} +{{/models}} {{#apiInfo}} {{#apis}} {{#operations}} @@ -78,58 +70,117 @@ export const {{classname}}FetchParamCreator = { * @summary {{&summary}} {{/summary}} {{#allParams}} - * @param {{paramName}} {{description}} + * @param {{=<% %>=}}{<%dataType%>}<%={{ }}=%> {{^required}}[{{/required}}{{paramName}}{{^required}}]{{/required}} {{description}} {{/allParams}} + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - {{nickname}}({{#hasParams}}params: { {{#allParams}} "{{paramName}}"{{^required}}?{{/required}}: {{{dataType}}};{{/allParams}} }, {{/hasParams}}options?: any): FetchArgs { + {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any): FetchArgs { {{#allParams}} {{#required}} - // verify required parameter "{{paramName}}" is set - if (params["{{paramName}}"] == null) { - throw new Error("Missing required parameter {{paramName}} when calling {{nickname}}"); + // verify required parameter '{{paramName}}' is not null or undefined + if ({{paramName}} === null || {{paramName}} === undefined) { + throw new RequiredError('{{paramName}}','Required parameter {{paramName}} was null or undefined when calling {{nickname}}.'); } {{/required}} {{/allParams}} - const baseUrl = `{{{path}}}`{{#pathParams}} - .replace(`{${"{{baseName}}"}}`, `${ params["{{paramName}}"] }`){{/pathParams}}; - let urlObj = url.parse(baseUrl, true); + const path = `{{{path}}}`{{#pathParams}} + .replace(`{${"{{baseName}}"}}`, String({{paramName}})){{/pathParams}}; + const urlObj = url.parse(path, true); + const headers = {} as any; {{#hasQueryParams}} - urlObj.query = {{#supportsES6}}Object.{{/supportsES6}}assign({}, urlObj.query, { - {{#queryParams}} - "{{baseName}}": params["{{paramName}}"], - {{/queryParams}} - }); + const queryParameters = {} as any; {{/hasQueryParams}} - let fetchOptions: RequestInit = {{#supportsES6}}Object.{{/supportsES6}}assign({}, { method: "{{httpMethod}}" }, options); +{{#hasFormParams}} + const formParams = new url.URLSearchParams(); +{{/hasFormParams}} + +{{#queryParams}} + {{#isListContainer}} + if ({{paramName}}) { + {{#isCollectionFormatMulti}} + queryParameters['{{baseName}}'] = {{paramName}} as any; + {{/isCollectionFormatMulti}} + {{^isCollectionFormatMulti}} + queryParameters['{{baseName}}'] = {{paramName}}.join(','); + {{/isCollectionFormatMulti}} + } + {{/isListContainer}} + {{^isListContainer}} + if ({{paramName}} !== undefined) { + {{#isDateTime}} + queryParameters['{{baseName}}'] = ({{paramName}} as any).toISOString(); + {{/isDateTime}} + {{^isDateTime}} + {{#isDate}} + queryParameters['{{baseName}}'] = ({{paramName}} as any).toISOString(); + {{/isDate}} + {{^isDate}} + queryParameters['{{baseName}}'] = {{paramName}} as any; + {{/isDate}} + {{/isDateTime}} + } + {{/isListContainer}} +{{/queryParams}} +{{#hasQueryParams}} + urlObj.query = Object.assign({}, urlObj.query, queryParameters); +{{/hasQueryParams}} +{{#headerParams}} + {{#isListContainer}} + if ({{paramName}}) { + headers['{{baseName}}'] = {{paramName}}.join(','); + } + {{/isListContainer}} + {{^isListContainer}} + if ({{paramName}} !== undefined && {{paramName}} !== null) { + headers['{{baseName}}'] = String({{paramName}}); + } + {{/isListContainer}} +{{/headerParams}} +{{#formParams}} + {{#isListContainer}} + if ({{paramName}}) { + {{#isCollectionFormatMulti}} + {{paramName}}.forEach((element) => { + formParams.append('{{baseName}}', element); + }) + {{/isCollectionFormatMulti}} + {{^isCollectionFormatMulti}} + formParams.set('{{baseName}}', {{paramName}}.join(',')); + {{/isCollectionFormatMulti}} + } + {{/isListContainer}} + {{^isListContainer}} + if ({{paramName}} !== undefined) { + formParams.set('{{baseName}}', {{paramName}}); + } + {{/isListContainer}} - let contentTypeHeader: Dictionary = {}; +{{/formParams}} {{#hasFormParams}} - contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; - fetchOptions.body = querystring.stringify({ - {{#formParams}} - "{{baseName}}": params["{{paramName}}"], - {{/formParams}} - }); + headers['Content-Type'] = 'application/x-www-form-urlencoded'; {{/hasFormParams}} -{{#hasBodyParam}} - contentTypeHeader = { "Content-Type": "application/json" };{{#bodyParam}} - if (params["{{paramName}}"]) { - fetchOptions.body = JSON.stringify(params["{{paramName}}"] || {}); - }{{/bodyParam}} -{{/hasBodyParam}} -{{#hasHeaderParams}} - fetchOptions.headers = {{#supportsES6}}Object.{{/supportsES6}}assign({ - {{#headerParams}}"{{baseName}}": params["{{paramName}}"],{{/headerParams}} - }, contentTypeHeader, fetchOptions.headers); -{{/hasHeaderParams}} -{{^hasHeaderParams}} - if (contentTypeHeader) { - fetchOptions.headers = {{#supportsES6}}Object.{{/supportsES6}}assign({}, contentTypeHeader, fetchOptions.headers); +{{#bodyParam}} + headers['Content-Type'] = 'application/json'; +{{/bodyParam}} + + let requestOptions = { + method: '{{httpMethod}}', + headers: headers, +{{#bodyParam}} + body: {{paramName}} === null ? '' : JSON.stringify({{paramName}}), +{{/bodyParam}} +{{#hasFormParams}} + body: formParams.toString(), +{{/hasFormParams}} + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); } -{{/hasHeaderParams}} + return { url: url.format(urlObj), - options: fetchOptions, + options: requestOptions, }; }, {{/operation}} @@ -137,7 +188,7 @@ export const {{classname}}FetchParamCreator = { /** * {{classname}} - functional programming interface{{#description}} - * {{&description}}{{/description}} + * {{{description}}}{{/description}} */ export const {{classname}}Fp = { {{#operation}} @@ -147,11 +198,13 @@ export const {{classname}}Fp = { * @summary {{&summary}} {{/summary}} {{#allParams}} - * @param {{paramName}} {{description}} + * @param {{=<% %>=}}{<%dataType%>}<%={{ }}=%> {{^required}}[{{/required}}{{paramName}}{{^required}}]{{/required}} {{description}} {{/allParams}} + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - {{nickname}}({{#hasParams}}params: { {{#allParams}}"{{paramName}}"{{^required}}?{{/required}}: {{{dataType}}}; {{/allParams}} }, {{/hasParams}}options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}any{{/returnType}}> { - const fetchArgs = {{classname}}FetchParamCreator.{{nickname}}({{#hasParams}}params, {{/hasParams}}options); + {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}any{{/returnType}}> { + const fetchArgs = {{classname}}FetchParamCreator.{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { @@ -167,7 +220,10 @@ export const {{classname}}Fp = { /** * {{classname}} - object-oriented interface{{#description}} - * {{&description}}{{/description}} + * {{{description}}}{{/description}} + * @export + * @class {{classname}} + * @extends {BaseAPI} */ export class {{classname}} extends BaseAPI { {{#operation}} @@ -177,11 +233,14 @@ export class {{classname}} extends BaseAPI { * @summary {{&summary}} {{/summary}} {{#allParams}} - * @param {{paramName}} {{description}} + * @param {{=<% %>=}}{<%dataType%>}<%={{ }}=%> {{^required}}[{{/required}}{{paramName}}{{^required}}]{{/required}} {{description}} {{/allParams}} + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof {{classname}} */ - {{nickname}}({{#hasParams}}params: { {{#allParams}} "{{paramName}}"{{^required}}?{{/required}}: {{{dataType}}};{{/allParams}} }, {{/hasParams}}options?: any) { - return {{classname}}Fp.{{nickname}}({{#hasParams}}params, {{/hasParams}}options)(this.fetch, this.basePath); + public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any) { + return {{classname}}Fp.{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options)(this.fetch, this.basePath); } {{/operation}} }; @@ -199,11 +258,13 @@ export const {{classname}}Factory = function (fetch?: FetchAPI, basePath?: strin * @summary {{&summary}} {{/summary}} {{#allParams}} - * @param {{paramName}} {{description}} + * @param {{=<% %>=}}{<%dataType%>}<%={{ }}=%> {{^required}}[{{/required}}{{paramName}}{{^required}}]{{/required}} {{description}} {{/allParams}} + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - {{nickname}}({{#hasParams}}params: { {{#allParams}} "{{paramName}}"{{^required}}?{{/required}}: {{{dataType}}};{{/allParams}} }, {{/hasParams}}options?: any) { - return {{classname}}Fp.{{nickname}}({{#hasParams}}params, {{/hasParams}}options)(fetch, basePath); + {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any) { + return {{classname}}Fp.{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options)(fetch, basePath); }, {{/operation}} }; @@ -211,4 +272,4 @@ export const {{classname}}Factory = function (fetch?: FetchAPI, basePath?: strin {{/operations}} {{/apis}} -{{/apiInfo}} +{{/apiInfo}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/modelEnum.mustache b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/modelEnum.mustache new file mode 100644 index 00000000000..dca2746d79b --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/modelEnum.mustache @@ -0,0 +1,12 @@ +/** + * {{{description}}} + * @export + * @enum {string} + */ +export enum {{classname}} { +{{#allowableValues}} +{{#enumVars}} + {{{name}}} = {{{value}}}{{^-last}},{{/-last}} +{{/enumVars}} +{{/allowableValues}} +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/modelGeneric.mustache b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/modelGeneric.mustache new file mode 100644 index 00000000000..b1937f66c86 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/modelGeneric.mustache @@ -0,0 +1,41 @@ +/** + * {{{description}}} + * @export + * @interface {{classname}} + */ +export interface {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{ +{{#additionalPropertiesType}} + [key: string]: {{{additionalPropertiesType}}}{{#hasVars}} | any{{/hasVars}}; + +{{/additionalPropertiesType}} +{{#vars}} + /** + * {{{description}}} + * @type {{=<% %>=}}{<%datatype%>}<%={{ }}=%> + * @memberof {{classname}} + */ + {{name}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{datatype}}}{{/isEnum}}; +{{/vars}} +}{{#hasEnums}} + +/** + * @export + * @namespace {{classname}} + */ +export namespace {{classname}} { +{{#vars}} + {{#isEnum}} + /** + * @export + * @enum {string} + */ + export enum {{enumName}} { + {{#allowableValues}} + {{#enumVars}} + {{{name}}} = {{{value}}}{{^-last}},{{/-last}} + {{/enumVars}} + {{/allowableValues}} + } + {{/isEnum}} +{{/vars}} +}{{/hasEnums}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/package.json.mustache b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/package.json.mustache index 05aec69d7ec..46d99b4c92f 100644 --- a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/package.json.mustache +++ b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/package.json.mustache @@ -1,21 +1,32 @@ { - "name": "{{#npmName}}{{{npmName}}}{{/npmName}}{{^npmName}}typescript-fetch-api{{/npmName}}", - "version": "{{#npmVersion}}{{{npmVersion}}}{{/npmVersion}}{{^npmVersion}}0.0.0{{/npmVersion}}", + "name": "{{npmName}}", + "version": "{{npmVersion}}", + "description": "swagger client for {{npmName}}", + "author": "Swagger Codegen Contributors", + "keywords": [ + "fetch", + "typescript", + "swagger-client", + "{{npmName}}" + ], "license": "Unlicense", "main": "./dist/api.js", - "browser": "./dist/api.js", "typings": "./dist/api.d.ts", - "dependencies": { - {{^supportsES6}}"core-js": "^2.4.0", - {{/supportsES6}}"isomorphic-fetch": "^2.2.1" - }, "scripts" : { - "prepublish" : "typings install && tsc", - "test": "tslint api.ts" + "build": "tsc --outDir dist/", + "postinstall": "npm run build" + }, + "dependencies": { + "isomorphic-fetch": "^2.2.1", + "@types/isomorphic-fetch": "0.0.33", + "@types/node": "^8.0.9" }, "devDependencies": { - "tslint": "^3.15.1", - "typescript": "^1.8.10", - "typings": "^1.0.4" + "typescript": "^2.0" + }{{#npmRepository}},{{/npmRepository}} +{{#npmRepository}} + "publishConfig":{ + "registry":"{{npmRepository}}" } +{{/npmRepository}} } diff --git a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/tsconfig.json.mustache b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/tsconfig.json.mustache index 25f414e9840..347fffb1288 100644 --- a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/tsconfig.json.mustache +++ b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/tsconfig.json.mustache @@ -5,13 +5,14 @@ "module": "commonjs", "noImplicitAny": true, "outDir": "dist", - "rootDir": "." + "rootDir": "."{{^supportsES6}}, + "lib": [ + "es6" + ] + {{/supportsES6}} }, "exclude": [ "dist", - "node_modules", - "typings/browser", - "typings/main", - "typings/main.d.ts" + "node_modules" ] } diff --git a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/tslint.json.mustache b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/tslint.json.mustache deleted file mode 100644 index 6eb02acec8c..00000000000 --- a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/tslint.json.mustache +++ /dev/null @@ -1,101 +0,0 @@ -{ - "jsRules": { - "class-name": true, - "comment-format": [ - true, - "check-space" - ], - "indent": [ - true, - "spaces" - ], - "no-duplicate-variable": true, - "no-eval": true, - "no-trailing-whitespace": true, - "no-unsafe-finally": true, - "one-line": [ - true, - "check-open-brace", - "check-whitespace" - ], - "quotemark": [ - true, - "double" - ], - "semicolon": [ - true, - "always" - ], - "triple-equals": [ - true, - "allow-null-check" - ], - "variable-name": [ - true, - "ban-keywords" - ], - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type" - ] - }, - "rules": { - "class-name": true, - "comment-format": [ - true, - "check-space" - ], - "indent": [ - true, - "spaces" - ], - "no-eval": true, - "no-internal-module": true, - "no-trailing-whitespace": true, - "no-unsafe-finally": true, - "no-var-keyword": true, - "one-line": [ - true, - "check-open-brace", - "check-whitespace" - ], - "quotemark": [ - true, - "double" - ], - "semicolon": [ - true, - "always" - ], - "triple-equals": [ - true, - "allow-null-check" - ], - "typedef-whitespace": [ - true, - { - "call-signature": "nospace", - "index-signature": "nospace", - "parameter": "nospace", - "property-declaration": "nospace", - "variable-declaration": "nospace" - } - ], - "variable-name": [ - true, - "ban-keywords" - ], - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type" - ] - } -} diff --git a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/typings.json.mustache b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/typings.json.mustache deleted file mode 100644 index e5bd78f06fe..00000000000 --- a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/typings.json.mustache +++ /dev/null @@ -1,9 +0,0 @@ -{ - "version": false, - "dependencies": {}, - "globalDependencies": { {{^supportsES6}} - "core-js": "registry:dt/core-js#0.0.0+20160317120654",{{/supportsES6}} - "node": "registry:dt/node#4.0.0+20160423143914", - "isomorphic-fetch": "registry:dt/isomorphic-fetch#0.0.0+20160505171433" - } -} diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/TypeScriptFetchClientOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/TypeScriptFetchClientOptionsProvider.java index f7c222c1e06..014a1b12cb7 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/TypeScriptFetchClientOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/TypeScriptFetchClientOptionsProvider.java @@ -13,6 +13,7 @@ public class TypeScriptFetchClientOptionsProvider implements OptionsProvider { public static final String MODEL_PROPERTY_NAMING_VALUE = "camelCase"; private static final String NMP_NAME = "npmName"; private static final String NMP_VERSION = "1.0.0"; + private static final String NPM_REPOSITORY = "https://registry.npmjs.org"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; @@ -30,6 +31,8 @@ public Map createOptions() { .put(CodegenConstants.SUPPORTS_ES6, String.valueOf(SUPPORTS_ES6_VALUE)) .put(TypeScriptFetchClientCodegen.NPM_NAME, NMP_NAME) .put(TypeScriptFetchClientCodegen.NPM_VERSION, NMP_VERSION) + .put(TypeScriptFetchClientCodegen.NPM_REPOSITORY, NPM_REPOSITORY) + .put(TypeScriptFetchClientCodegen.SNAPSHOT, Boolean.FALSE.toString()) .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .build(); } From 6c96766586ca46b4df1a44a3da9fb7d6de8e69cd Mon Sep 17 00:00:00 2001 From: Isman Usoh Date: Tue, 18 Jul 2017 02:45:27 +0700 Subject: [PATCH 4/8] Update sample project --- .../src/test/resources/2_0/swagger.json | 2521 +++++++++++++++++ .../typescript-fetch/.swagger-codegen/VERSION | 1 + .../typescript-fetch/LICENSE | 201 -- .../typescript-fetch/README.md | 54 - .../typescript-fetch/api.ts | 142 +- .../typescript-fetch/package.json | 21 - .../typescript-fetch/tsconfig.json | 17 - .../typescript-fetch/tslint.json | 101 - .../typescript-fetch/typings.json | 9 - .../builds/default/.swagger-codegen/VERSION | 2 +- .../typescript-fetch/builds/default/README.md | 54 - .../typescript-fetch/builds/default/api.ts | 1588 +++++++---- .../builds/default/package.json | 21 - .../typescript-fetch/builds/default/pom.xml | 59 - .../builds/default/tslint.json | 101 - .../builds/default/typings.json | 9 - .../builds/es6-target/.gitignore | 3 - .../es6-target/.swagger-codegen/VERSION | 1 - .../builds/es6-target/README.md | 54 - .../typescript-fetch/builds/es6-target/api.ts | 1322 --------- .../builds/es6-target/git_push.sh | 52 - .../builds/es6-target/package.json | 20 - .../builds/es6-target/tslint.json | 101 - .../builds/es6-target/typings.json | 8 - .../typescript-fetch/builds/es6}/.gitignore | 0 .../.swagger-codegen-ignore | 0 .../builds/es6/.swagger-codegen/VERSION | 1 + .../typescript-fetch/builds/es6/README.md | 45 + .../typescript-fetch/builds/es6/api.ts | 1879 ++++++++++++ .../typescript-fetch/builds/es6}/git_push.sh | 0 .../typescript-fetch/builds/es6/package.json | 30 + .../builds/{es6-target => es6}/pom.xml | 0 .../builds/{es6-target => es6}/tsconfig.json | 8 +- .../builds/{default => npm}/.gitignore | 0 .../.swagger-codegen-ignore | 0 .../builds/npm/.swagger-codegen/VERSION | 1 + .../typescript-fetch/builds/npm/README.md | 45 + .../typescript-fetch/builds/npm/api.ts | 1879 ++++++++++++ .../builds/{default => npm}/git_push.sh | 0 .../typescript-fetch/builds/npm/package.json | 30 + .../builds/{with-npm-version => npm}/pom.xml | 0 .../builds/{default => npm}/tsconfig.json | 10 +- .../typescript-fetch/builds/npm/yarn.lock | 47 + .../builds/with-npm-version/.gitignore | 3 - .../with-npm-version/.swagger-codegen/VERSION | 1 - .../builds/with-npm-version/README.md | 54 - .../builds/with-npm-version/api.ts | 1323 --------- .../builds/with-npm-version/git_push.sh | 52 - .../builds/with-npm-version/package.json | 21 - .../builds/with-npm-version/tsconfig.json | 17 - .../builds/with-npm-version/tslint.json | 101 - .../builds/with-npm-version/typings.json | 9 - .../tests/default/typings.json | 9 - .../tests/{default => npm}/package.json | 10 +- .../tests/{default => npm}/pom.xml | 0 .../run_tests_via_browserify.html | 0 .../run_tests_via_webpack.html | 0 .../{default => npm}/scripts/prepublish.sh | 3 +- .../tests/{default => npm}/test/PetApi.ts | 18 +- .../{default => npm}/test/PetApiFactory.ts | 18 +- .../tests/{default => npm}/test/StoreApi.ts | 2 +- .../{default => npm}/test/StoreApiFactory.ts | 2 +- .../tests/{default => npm}/test/index.ts | 0 .../tests/{default => npm}/test/mocha.opts | 0 .../tests/{default => npm}/tsconfig.json | 14 +- .../tests/{default => npm}/webpack.config.js | 0 .../typescript-fetch/tests/npm/yarn.lock | 1971 +++++++++++++ 67 files changed, 9661 insertions(+), 4404 deletions(-) create mode 100644 modules/swagger-codegen/src/test/resources/2_0/swagger.json create mode 100644 samples/client/petstore-security-test/typescript-fetch/.swagger-codegen/VERSION delete mode 100644 samples/client/petstore-security-test/typescript-fetch/LICENSE delete mode 100644 samples/client/petstore-security-test/typescript-fetch/README.md delete mode 100644 samples/client/petstore-security-test/typescript-fetch/package.json delete mode 100644 samples/client/petstore-security-test/typescript-fetch/tsconfig.json delete mode 100644 samples/client/petstore-security-test/typescript-fetch/tslint.json delete mode 100644 samples/client/petstore-security-test/typescript-fetch/typings.json delete mode 100644 samples/client/petstore/typescript-fetch/builds/default/README.md delete mode 100644 samples/client/petstore/typescript-fetch/builds/default/package.json delete mode 100644 samples/client/petstore/typescript-fetch/builds/default/pom.xml delete mode 100644 samples/client/petstore/typescript-fetch/builds/default/tslint.json delete mode 100644 samples/client/petstore/typescript-fetch/builds/default/typings.json delete mode 100644 samples/client/petstore/typescript-fetch/builds/es6-target/.gitignore delete mode 100644 samples/client/petstore/typescript-fetch/builds/es6-target/.swagger-codegen/VERSION delete mode 100644 samples/client/petstore/typescript-fetch/builds/es6-target/README.md delete mode 100644 samples/client/petstore/typescript-fetch/builds/es6-target/api.ts delete mode 100644 samples/client/petstore/typescript-fetch/builds/es6-target/git_push.sh delete mode 100644 samples/client/petstore/typescript-fetch/builds/es6-target/package.json delete mode 100644 samples/client/petstore/typescript-fetch/builds/es6-target/tslint.json delete mode 100644 samples/client/petstore/typescript-fetch/builds/es6-target/typings.json rename samples/client/{petstore-security-test/typescript-fetch => petstore/typescript-fetch/builds/es6}/.gitignore (100%) rename samples/client/petstore/typescript-fetch/builds/{es6-target => es6}/.swagger-codegen-ignore (100%) create mode 100644 samples/client/petstore/typescript-fetch/builds/es6/.swagger-codegen/VERSION create mode 100644 samples/client/petstore/typescript-fetch/builds/es6/README.md create mode 100644 samples/client/petstore/typescript-fetch/builds/es6/api.ts rename samples/client/{petstore-security-test/typescript-fetch => petstore/typescript-fetch/builds/es6}/git_push.sh (100%) create mode 100644 samples/client/petstore/typescript-fetch/builds/es6/package.json rename samples/client/petstore/typescript-fetch/builds/{es6-target => es6}/pom.xml (100%) rename samples/client/petstore/typescript-fetch/builds/{es6-target => es6}/tsconfig.json (61%) rename samples/client/petstore/typescript-fetch/builds/{default => npm}/.gitignore (100%) rename samples/client/petstore/typescript-fetch/builds/{with-npm-version => npm}/.swagger-codegen-ignore (100%) create mode 100644 samples/client/petstore/typescript-fetch/builds/npm/.swagger-codegen/VERSION create mode 100644 samples/client/petstore/typescript-fetch/builds/npm/README.md create mode 100644 samples/client/petstore/typescript-fetch/builds/npm/api.ts rename samples/client/petstore/typescript-fetch/builds/{default => npm}/git_push.sh (100%) create mode 100644 samples/client/petstore/typescript-fetch/builds/npm/package.json rename samples/client/petstore/typescript-fetch/builds/{with-npm-version => npm}/pom.xml (100%) rename samples/client/petstore/typescript-fetch/builds/{default => npm}/tsconfig.json (63%) create mode 100644 samples/client/petstore/typescript-fetch/builds/npm/yarn.lock delete mode 100644 samples/client/petstore/typescript-fetch/builds/with-npm-version/.gitignore delete mode 100644 samples/client/petstore/typescript-fetch/builds/with-npm-version/.swagger-codegen/VERSION delete mode 100644 samples/client/petstore/typescript-fetch/builds/with-npm-version/README.md delete mode 100644 samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts delete mode 100644 samples/client/petstore/typescript-fetch/builds/with-npm-version/git_push.sh delete mode 100644 samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json delete mode 100644 samples/client/petstore/typescript-fetch/builds/with-npm-version/tsconfig.json delete mode 100644 samples/client/petstore/typescript-fetch/builds/with-npm-version/tslint.json delete mode 100644 samples/client/petstore/typescript-fetch/builds/with-npm-version/typings.json delete mode 100644 samples/client/petstore/typescript-fetch/tests/default/typings.json rename samples/client/petstore/typescript-fetch/tests/{default => npm}/package.json (70%) rename samples/client/petstore/typescript-fetch/tests/{default => npm}/pom.xml (100%) rename samples/client/petstore/typescript-fetch/tests/{default => npm}/run_tests_via_browserify.html (100%) rename samples/client/petstore/typescript-fetch/tests/{default => npm}/run_tests_via_webpack.html (100%) rename samples/client/petstore/typescript-fetch/tests/{default => npm}/scripts/prepublish.sh (74%) mode change 100755 => 100644 rename samples/client/petstore/typescript-fetch/tests/{default => npm}/test/PetApi.ts (67%) rename samples/client/petstore/typescript-fetch/tests/{default => npm}/test/PetApiFactory.ts (63%) rename samples/client/petstore/typescript-fetch/tests/{default => npm}/test/StoreApi.ts (91%) rename samples/client/petstore/typescript-fetch/tests/{default => npm}/test/StoreApiFactory.ts (90%) rename samples/client/petstore/typescript-fetch/tests/{default => npm}/test/index.ts (100%) rename samples/client/petstore/typescript-fetch/tests/{default => npm}/test/mocha.opts (100%) rename samples/client/petstore/typescript-fetch/tests/{default => npm}/tsconfig.json (55%) rename samples/client/petstore/typescript-fetch/tests/{default => npm}/webpack.config.js (100%) create mode 100644 samples/client/petstore/typescript-fetch/tests/npm/yarn.lock diff --git a/modules/swagger-codegen/src/test/resources/2_0/swagger.json b/modules/swagger-codegen/src/test/resources/2_0/swagger.json new file mode 100644 index 00000000000..d9abd230b88 --- /dev/null +++ b/modules/swagger-codegen/src/test/resources/2_0/swagger.json @@ -0,0 +1,2521 @@ +{ + "basePath": "/v1", + "consumes": [ + "application/json" + ], + "definitions": { + "EnumIndexValue": { + "description": "EnumIndexValue.", + "enum": [ + "0", + "1" + ], + "type": "string" + }, + "EnumNumberValue": { + "description": "EnumNumberValue.", + "enum": [ + "2", + "5" + ], + "type": "string" + }, + "EnumStringValue": { + "description": "EnumStringValue.", + "enum": [ + "VALUE_1", + "VALUE_2" + ], + "type": "string" + }, + "TestModel": { + "description": "This is a description of a model", + "properties": { + "numberValue": { + "type": "number", + "format": "double", + "description": "This is a description of this model property, numberValue" + }, + "numberArray": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + "stringValue": { + "type": "string" + }, + "stringArray": { + "type": "array", + "items": { + "type": "string" + } + }, + "boolValue": { + "type": "boolean" + }, + "boolArray": { + "type": "array", + "items": { + "type": "boolean" + } + }, + "enumValue": { + "$ref": "#/definitions/EnumIndexValue" + }, + "enumArray": { + "type": "array", + "items": { + "$ref": "#/definitions/EnumIndexValue" + } + }, + "enumNumberValue": { + "$ref": "#/definitions/EnumNumberValue" + }, + "enumNumberArray": { + "type": "array", + "items": { + "$ref": "#/definitions/EnumNumberValue" + } + }, + "enumStringValue": { + "$ref": "#/definitions/EnumStringValue" + }, + "enumStringArray": { + "type": "array", + "items": { + "$ref": "#/definitions/EnumStringValue" + } + }, + "modelValue": { + "$ref": "#/definitions/TestSubModel" + }, + "modelsArray": { + "type": "array", + "items": { + "$ref": "#/definitions/TestSubModel" + } + }, + "strLiteralVal": { + "type": "string", + "enum": [ + "Foo", + "Bar" + ] + }, + "strLiteralArr": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "Foo", + "Bar" + ] + } + }, + "dateValue": { + "type": "string", + "format": "date-time" + }, + "optionalString": { + "type": "string" + }, + "modelsObjectIndirect": { + "$ref": "#/definitions/TestSubModelContainer" + }, + "modelsObjectIndirectNS": { + "$ref": "#/definitions/TestSubModelContainerNamespace.TestSubModelContainer" + }, + "modelsObjectIndirectNS2": { + "$ref": "#/definitions/TestSubModelContainerNamespace.InnerNamespace.TestSubModelContainer2" + }, + "modelsObjectIndirectNS_Alias": { + "$ref": "#/definitions/TestSubModelContainerNamespace_TestSubModelContainer" + }, + "modelsObjectIndirectNS2_Alias": { + "$ref": "#/definitions/TestSubModelContainerNamespace_InnerNamespace_TestSubModelContainer2" + }, + "modelsArrayIndirect": { + "$ref": "#/definitions/TestSubArrayModelContainer" + }, + "modelsEnumIndirect": { + "$ref": "#/definitions/TestSubEnumModelContainer" + }, + "typeAliasCase1": { + "$ref": "#/definitions/TypeAliasModelCase1" + }, + "TypeAliasCase2": { + "$ref": "#/definitions/TypeAliasModelCase2" + }, + "id": { + "type": "number", + "format": "double" + } + }, + "required": [ + "numberValue", + "numberArray", + "stringValue", + "stringArray", + "boolValue", + "boolArray", + "modelValue", + "modelsArray", + "strLiteralVal", + "strLiteralArr", + "id" + ], + "type": "object" + }, + "TestSubModel": { + "properties": { + "email": { + "type": "string" + }, + "circular": { + "$ref": "#/definitions/TestModel" + }, + "id": { + "type": "number", + "format": "double" + } + }, + "required": [ + "email", + "id" + ], + "type": "object" + }, + "TestSubModel2": { + "properties": { + "testSubModel2": { + "type": "boolean" + }, + "email": { + "type": "string" + }, + "circular": { + "$ref": "#/definitions/TestModel" + }, + "id": { + "type": "number", + "format": "double" + } + }, + "required": [ + "testSubModel2", + "email", + "id" + ], + "type": "object" + }, + "TestSubModelContainer": { + "properties": {}, + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/TestSubModel2" + } + }, + "TestSubModelNamespace.TestSubModelNS": { + "properties": { + "testSubModelNS": { + "type": "boolean" + }, + "email": { + "type": "string" + }, + "circular": { + "$ref": "#/definitions/TestModel" + }, + "id": { + "type": "number", + "format": "double" + } + }, + "required": [ + "testSubModelNS", + "email", + "id" + ], + "type": "object" + }, + "TestSubModelContainerNamespace.TestSubModelContainer": { + "properties": {}, + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/TestSubModelNamespace.TestSubModelNS" + } + }, + "TestSubModelContainerNamespace.InnerNamespace.TestSubModelContainer2": { + "properties": {}, + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/TestSubModelNamespace.TestSubModelNS" + } + }, + "TestSubModelContainerNamespace_TestSubModelContainer": { + "properties": {}, + "type": "object" + }, + "TestSubModelContainerNamespace_InnerNamespace_TestSubModelContainer2": { + "properties": {}, + "type": "object" + }, + "TestSubArrayModelContainer": { + "properties": {}, + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/definitions/TestSubModel2" + } + } + }, + "TestSubEnumModelContainer": { + "properties": {}, + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/EnumStringValue" + } + }, + "TypeAliasModelCase1": { + "properties": { + "value1": { + "type": "string" + }, + "value2": { + "type": "string" + } + }, + "required": [ + "value1", + "value2" + ], + "type": "object" + }, + "TypeAliasModelCase2": { + "properties": { + "value1": { + "type": "string" + }, + "value2": { + "type": "string" + }, + "value3": { + "type": "string" + } + }, + "required": [ + "value1", + "value2", + "value3" + ], + "type": "object" + }, + "TestClassModel": { + "description": "This is a description of TestClassModel", + "properties": { + "publicStringProperty": { + "type": "string", + "description": "This is a description of a public string property", + "minLength": 3, + "maxLength": 20, + "pattern": "^[a-zA-Z]+$" + }, + "optionalPublicStringProperty": { + "type": "string", + "minLength": 0, + "maxLength": 10 + }, + "stringProperty": { + "type": "string" + }, + "publicConstructorVar": { + "type": "string", + "description": "This is a description for publicConstructorVar" + }, + "optionalPublicConstructorVar": { + "type": "string" + }, + "id": { + "type": "number", + "format": "double" + } + }, + "required": [ + "publicStringProperty", + "stringProperty", + "publicConstructorVar", + "id" + ], + "type": "object" + }, + "GenericRequestTestModel": { + "properties": { + "name": { + "type": "string" + }, + "value": { + "$ref": "#/definitions/TestModel" + } + }, + "required": [ + "name", + "value" + ], + "type": "object" + }, + "Result": { + "properties": { + "value": { + "type": "object" + } + }, + "required": [ + "value" + ], + "type": "object" + }, + "GenericModelTestModel": { + "properties": { + "result": { + "$ref": "#/definitions/TestModel" + } + }, + "required": [ + "result" + ], + "type": "object" + }, + "GenericModelTestModel[]": { + "properties": { + "result": { + "type": "array", + "items": { + "$ref": "#/definitions/TestModel" + } + } + }, + "required": [ + "result" + ], + "type": "object" + }, + "GenericModelstring": { + "properties": { + "result": { + "type": "string" + } + }, + "required": [ + "result" + ], + "type": "object" + }, + "GenericModelstring[]": { + "properties": { + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "result" + ], + "type": "object" + }, + "ErrorResponseModel": { + "properties": { + "status": { + "type": "number", + "format": "double" + }, + "message": { + "type": "string" + } + }, + "required": [ + "status", + "message" + ], + "type": "object" + }, + "Gender": { + "enum": [ + "MALE", + "FEMALE" + ], + "type": "string" + }, + "ParameterTestModel": { + "properties": { + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + }, + "age": { + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 100 + }, + "weight": { + "type": "number", + "format": "float" + }, + "human": { + "type": "boolean" + }, + "gender": { + "$ref": "#/definitions/Gender" + } + }, + "required": [ + "firstname", + "lastname", + "age", + "weight", + "human", + "gender" + ], + "type": "object" + }, + "UserResponseModel": { + "properties": { + "id": { + "type": "number", + "format": "double" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "type": "object" + }, + "ValidateDateResponse": { + "properties": { + "minDateValue": { + "type": "string", + "format": "date-time" + }, + "maxDateValue": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "minDateValue", + "maxDateValue" + ], + "type": "object" + }, + "ValidateNumberResponse": { + "properties": { + "minValue": { + "type": "number", + "format": "double" + }, + "maxValue": { + "type": "number", + "format": "double" + } + }, + "required": [ + "minValue", + "maxValue" + ], + "type": "object" + }, + "ValidateBooleanResponse": { + "properties": { + "boolValue": { + "type": "boolean" + } + }, + "required": [ + "boolValue" + ], + "type": "object" + }, + "ValidateStringResponse": { + "properties": { + "minLength": { + "type": "string" + }, + "maxLength": { + "type": "string" + }, + "patternValue": { + "type": "string" + } + }, + "required": [ + "minLength", + "maxLength", + "patternValue" + ], + "type": "object" + }, + "ValidateModel": { + "properties": { + "floatValue": { + "type": "number", + "format": "float" + }, + "doubleValue": { + "type": "number", + "format": "double" + }, + "intValue": { + "type": "integer", + "format": "int32" + }, + "longValue": { + "type": "integer", + "format": "int64" + }, + "booleanValue": { + "type": "boolean" + }, + "arrayValue": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + }, + "dateValue": { + "type": "string", + "format": "date" + }, + "datetimeValue": { + "type": "string", + "format": "date-time" + }, + "numberMax10": { + "type": "number", + "format": "double", + "maximum": 10 + }, + "numberMin5": { + "type": "number", + "format": "double", + "minimum": 5 + }, + "stringMax10Lenght": { + "type": "string", + "maxLength": 10 + }, + "stringMin5Lenght": { + "type": "string", + "minLength": 5 + }, + "stringPatternAZaz": { + "type": "string", + "pattern": "^[a-zA-Z]+$" + }, + "arrayMax5Item": { + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 5 + }, + "arrayMin2Item": { + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "minItems": 2 + }, + "arrayUniqueItem": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + } + }, + "required": [ + "floatValue", + "doubleValue", + "intValue", + "longValue", + "booleanValue", + "arrayValue", + "dateValue", + "datetimeValue", + "numberMax10", + "numberMin5", + "stringMax10Lenght", + "stringMin5Lenght", + "stringPatternAZaz", + "arrayMax5Item", + "arrayMin2Item", + "arrayUniqueItem" + ], + "type": "object" + } + }, + "info": { + "title": "tsoa app", + "description": "a description", + "license": { + "name": "MIT" + }, + "version": "1.0" + }, + "paths": { + "/PutTest": { + "put": { + "operationId": "PutTestPutModel", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "parameters": [ + { + "in": "body", + "name": "model", + "required": true, + "schema": { + "$ref": "#/definitions/TestModel" + } + } + ] + } + }, + "/PutTest/Location": { + "put": { + "operationId": "PutTestPutModelAtLocation", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "parameters": [] + } + }, + "/PutTest/Multi": { + "put": { + "operationId": "PutTestPutWithMultiReturn", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TestModel" + } + } + } + }, + "parameters": [] + } + }, + "/PutTest/WithId/{id}": { + "put": { + "operationId": "PutTestPutWithId", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "type": "number", + "format": "double" + } + ] + } + }, + "/PostTest": { + "post": { + "operationId": "PostTestPostModel", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "parameters": [ + { + "in": "body", + "name": "model", + "required": true, + "schema": { + "$ref": "#/definitions/TestModel" + } + } + ] + }, + "patch": { + "operationId": "PostTestUpdateModel", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "parameters": [ + { + "in": "body", + "name": "model", + "required": true, + "schema": { + "$ref": "#/definitions/TestModel" + } + } + ] + } + }, + "/PostTest/WithClassModel": { + "post": { + "operationId": "PostTestPostClassModel", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestClassModel" + } + } + }, + "parameters": [ + { + "in": "body", + "name": "model", + "required": true, + "schema": { + "$ref": "#/definitions/TestClassModel" + } + } + ] + } + }, + "/PostTest/Location": { + "post": { + "operationId": "PostTestPostModelAtLocation", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "parameters": [] + } + }, + "/PostTest/Multi": { + "post": { + "operationId": "PostTestPostWithMultiReturn", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TestModel" + } + } + } + }, + "parameters": [] + } + }, + "/PostTest/WithId/{id}": { + "post": { + "operationId": "PostTestPostWithId", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "type": "number", + "format": "double" + } + ] + } + }, + "/PostTest/WithBodyAndQueryParams": { + "post": { + "operationId": "PostTestPostWithBodyAndQueryParams", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "parameters": [ + { + "in": "body", + "name": "model", + "required": true, + "schema": { + "$ref": "#/definitions/TestModel" + } + }, + { + "in": "query", + "name": "query", + "required": true, + "type": "string" + } + ] + } + }, + "/PostTest/GenericBody": { + "post": { + "operationId": "PostTestGetGenericRequest", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "parameters": [ + { + "in": "body", + "name": "genericReq", + "required": true, + "schema": { + "$ref": "#/definitions/GenericRequestTestModel" + } + } + ] + } + }, + "/PatchTest": { + "patch": { + "operationId": "PatchTestPatchModel", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "parameters": [ + { + "in": "body", + "name": "model", + "required": true, + "schema": { + "$ref": "#/definitions/TestModel" + } + } + ] + } + }, + "/PatchTest/Location": { + "patch": { + "operationId": "PatchTestPatchModelAtLocation", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "parameters": [] + } + }, + "/PatchTest/Multi": { + "patch": { + "operationId": "PatchTestPatchWithMultiReturn", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TestModel" + } + } + } + }, + "parameters": [] + } + }, + "/PatchTest/WithId/{id}": { + "patch": { + "operationId": "PatchTestPatchWithId", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "type": "number", + "format": "double" + } + ] + } + }, + "/GetTest": { + "get": { + "operationId": "GetTestGetModel", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + }, + "examples": { + "application/json": { + "boolArray": [ + true, + false + ], + "boolValue": true, + "id": 1, + "modelValue": { + "email": "test@test.com", + "id": 100 + }, + "numberArray": [ + 1, + 2, + 3 + ], + "numberValue": 1, + "optionalString": "optional string", + "strLiteralArr": [ + "Foo", + "Bar" + ], + "strLiteralVal": "Foo", + "stringArray": [ + "string one", + "string two" + ], + "stringValue": "a string" + } + } + } + }, + "description": "This is a description of the getModel method\r\nthis is some more text on another line", + "parameters": [] + } + }, + "/GetTest/Current": { + "get": { + "operationId": "GetTestGetCurrentModel", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "parameters": [] + } + }, + "/GetTest/ClassModel": { + "get": { + "operationId": "GetTestGetClassModel", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestClassModel" + } + } + }, + "parameters": [] + } + }, + "/GetTest/Multi": { + "get": { + "operationId": "GetTestGetMultipleModels", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TestModel" + } + } + } + }, + "parameters": [] + } + }, + "/GetTest/{numberPathParam}/{booleanPathParam}/{stringPathParam}": { + "get": { + "operationId": "GetTestGetModelByParams", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "parameters": [ + { + "description": "This is a description for numberPathParam", + "in": "path", + "name": "numberPathParam", + "required": true, + "type": "number", + "format": "double", + "minimum": 1, + "maximum": 10 + }, + { + "in": "path", + "name": "stringPathParam", + "required": true, + "type": "string", + "minLength": 1, + "maxLength": 10 + }, + { + "in": "path", + "name": "booleanPathParam", + "required": true, + "type": "boolean" + }, + { + "in": "query", + "name": "booleanParam", + "required": true, + "type": "boolean" + }, + { + "in": "query", + "name": "stringParam", + "required": true, + "type": "string", + "minLength": 3, + "maxLength": 10 + }, + { + "description": "This is a description for numberParam", + "in": "query", + "name": "numberParam", + "required": true, + "type": "number", + "format": "double" + }, + { + "in": "query", + "name": "optionalStringParam", + "required": false, + "type": "string" + } + ] + } + }, + "/GetTest/ResponseWithUnionTypeProperty": { + "get": { + "operationId": "GetTestGetResponseWithUnionTypeProperty", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/Result" + } + } + }, + "parameters": [] + } + }, + "/GetTest/UnionTypeResponse": { + "get": { + "operationId": "GetTestGetUnionTypeResponse", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "type": "object" + } + } + }, + "parameters": [] + } + }, + "/GetTest/Request": { + "get": { + "operationId": "GetTestGetRequest", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "parameters": [] + } + }, + "/GetTest/DateParam": { + "get": { + "operationId": "GetTestGetByDataParam", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "parameters": [ + { + "in": "query", + "name": "date", + "required": true, + "type": "string", + "format": "date-time" + } + ] + } + }, + "/GetTest/ThrowsError": { + "get": { + "operationId": "GetTestGetThrowsError", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "parameters": [] + } + }, + "/GetTest/GeneratesTags": { + "get": { + "operationId": "GetTestGetGeneratesTags", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "tags": [ + "test", + "test-two" + ], + "parameters": [] + } + }, + "/GetTest/HandleBufferType": { + "get": { + "operationId": "GetTestGetBuffer", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "type": "string", + "format": "byte" + } + } + }, + "parameters": [ + { + "in": "query", + "name": "buffer", + "required": true, + "type": "string", + "format": "byte" + } + ] + } + }, + "/GetTest/GenericModel": { + "get": { + "operationId": "GetTestGetGenericModel", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/GenericModelTestModel" + } + } + }, + "parameters": [] + } + }, + "/GetTest/GenericModelArray": { + "get": { + "operationId": "GetTestGetGenericModelArray", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/GenericModelTestModel[]" + } + } + }, + "parameters": [] + } + }, + "/GetTest/GenericPrimitive": { + "get": { + "operationId": "GetTestGetGenericPrimitive", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/GenericModelstring" + } + } + }, + "parameters": [] + } + }, + "/GetTest/GenericPrimitiveArray": { + "get": { + "operationId": "GetTestGetGenericPrimitiveArray", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/GenericModelstring[]" + } + } + }, + "parameters": [] + } + }, + "/DeleteTest": { + "delete": { + "operationId": "DeleteTestDeleteWithReturnValue", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "parameters": [] + } + }, + "/DeleteTest/Current": { + "delete": { + "operationId": "DeleteTestDeleteCurrent", + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "No content" + } + }, + "parameters": [] + } + }, + "/DeleteTest/{numberPathParam}/{booleanPathParam}/{stringPathParam}": { + "delete": { + "operationId": "DeleteTestGetModelByParams", + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "No content" + } + }, + "parameters": [ + { + "in": "path", + "name": "numberPathParam", + "required": true, + "type": "number", + "format": "double" + }, + { + "in": "path", + "name": "stringPathParam", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "booleanPathParam", + "required": true, + "type": "boolean" + }, + { + "in": "query", + "name": "booleanParam", + "required": true, + "type": "boolean" + }, + { + "in": "query", + "name": "stringParam", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "numberParam", + "required": true, + "type": "number", + "format": "double" + } + ] + } + }, + "/MethodTest/Get": { + "get": { + "operationId": "MethodGetMethod", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "parameters": [] + } + }, + "/MethodTest/Post": { + "post": { + "operationId": "MethodPostMethod", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "parameters": [] + } + }, + "/MethodTest/Patch": { + "patch": { + "operationId": "MethodPatchMethod", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "parameters": [] + } + }, + "/MethodTest/Put": { + "put": { + "operationId": "MethodPutMethod", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "parameters": [] + } + }, + "/MethodTest/Delete": { + "delete": { + "operationId": "MethodDeleteMethod", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "parameters": [] + } + }, + "/MethodTest/Description": { + "get": { + "operationId": "MethodDescription", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "description": "method description", + "parameters": [] + } + }, + "/MethodTest/Tags": { + "get": { + "operationId": "MethodTags", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "tags": [ + "Tag1", + "Tag2", + "Tag3" + ], + "parameters": [] + } + }, + "/MethodTest/MultiResponse": { + "get": { + "operationId": "MethodMultiResponse", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/ErrorResponseModel" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/ErrorResponseModel" + } + }, + "default": { + "description": "Unexpected error", + "schema": { + "$ref": "#/definitions/ErrorResponseModel" + } + } + }, + "parameters": [] + } + }, + "/MethodTest/SuccessResponse": { + "get": { + "operationId": "MethodSuccessResponse", + "produces": [ + "application/json" + ], + "responses": { + "201": { + "description": "Created" + } + }, + "parameters": [] + } + }, + "/MethodTest/ApiSecurity": { + "get": { + "operationId": "MethodApiSecurity", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "security": [ + { + "api_key": [] + } + ], + "parameters": [] + } + }, + "/MethodTest/OauthSecurity": { + "get": { + "operationId": "MethodOauthSecurity", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "security": [ + { + "tsoa_auth": [ + "write:pets", + "read:pets" + ] + } + ], + "parameters": [] + } + }, + "/MethodTest/DeprecatedMethod": { + "get": { + "operationId": "MethodDeprecatedMethod", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "deprecated": true, + "parameters": [] + } + }, + "/MethodTest/SummaryMethod": { + "get": { + "operationId": "MethodSummaryMethod", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "summary": "simple summary", + "parameters": [] + } + }, + "/ParameterTest/Query": { + "get": { + "operationId": "ParameterGetQuery", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/ParameterTestModel" + } + } + }, + "description": "Get test paramater", + "parameters": [ + { + "description": "Firstname description", + "in": "query", + "name": "firstname", + "required": true, + "type": "string" + }, + { + "description": "Lastname description", + "in": "query", + "name": "last_name", + "required": true, + "type": "string" + }, + { + "description": "Age description", + "in": "query", + "name": "age", + "required": true, + "type": "integer", + "format": "int32" + }, + { + "description": "Weight description", + "in": "query", + "name": "weight", + "required": true, + "type": "number", + "format": "float" + }, + { + "description": "Human description", + "in": "query", + "name": "human", + "required": true, + "type": "boolean" + }, + { + "description": "Gender description", + "in": "query", + "name": "gender", + "required": true, + "schema": { + "$ref": "#/definitions/Gender" + } + } + ] + } + }, + "/ParameterTest/Path/{firstname}/{last_name}/{age}/{weight}/{human}/{gender}": { + "get": { + "operationId": "ParameterGetPath", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/ParameterTestModel" + } + } + }, + "description": "Path test paramater", + "parameters": [ + { + "description": "Firstname description", + "in": "path", + "name": "firstname", + "required": true, + "type": "string" + }, + { + "description": "Lastname description", + "in": "path", + "name": "last_name", + "required": true, + "type": "string" + }, + { + "description": "Age description", + "in": "path", + "name": "age", + "required": true, + "type": "integer", + "format": "int32" + }, + { + "description": "Weight description", + "in": "path", + "name": "weight", + "required": true, + "type": "number", + "format": "float" + }, + { + "description": "Human description", + "in": "path", + "name": "human", + "required": true, + "type": "boolean" + }, + { + "description": "Gender description", + "in": "path", + "name": "gender", + "required": true, + "schema": { + "$ref": "#/definitions/Gender" + } + } + ] + } + }, + "/ParameterTest/Header": { + "get": { + "operationId": "ParameterGetHeader", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/ParameterTestModel" + } + } + }, + "description": "Header test paramater", + "parameters": [ + { + "description": "Firstname description", + "in": "header", + "name": "firstname", + "required": true, + "type": "string" + }, + { + "description": "Lastname description", + "in": "header", + "name": "last_name", + "required": true, + "type": "string" + }, + { + "description": "Age description", + "in": "header", + "name": "age", + "required": true, + "type": "integer", + "format": "int32" + }, + { + "description": "Weight description", + "in": "header", + "name": "weight", + "required": true, + "type": "number", + "format": "float" + }, + { + "description": "Human description", + "in": "header", + "name": "human", + "required": true, + "type": "boolean" + }, + { + "description": "Gender description", + "in": "header", + "name": "gender", + "required": true, + "schema": { + "$ref": "#/definitions/Gender" + } + } + ] + } + }, + "/ParameterTest/Request": { + "get": { + "operationId": "ParameterGetRequest", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/ParameterTestModel" + } + } + }, + "description": "Request test paramater", + "parameters": [] + } + }, + "/ParameterTest/Body": { + "post": { + "operationId": "ParameterGetBody", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/ParameterTestModel" + } + } + }, + "description": "Body test paramater", + "parameters": [ + { + "description": "Body description", + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ParameterTestModel" + } + } + ] + } + }, + "/ParameterTest/BodyProps": { + "post": { + "operationId": "ParameterGetBodyProps", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/ParameterTestModel" + } + } + }, + "parameters": [ + { + "in": "body", + "name": "body", + "schema": { + "properties": { + "firstname": { + "type": "string" + }, + "lastname": { + "type": "string" + }, + "age": { + "type": "integer", + "format": "int32" + }, + "weight": { + "type": "number", + "format": "float" + }, + "human": { + "type": "boolean" + }, + "gender": { + "$ref": "#/definitions/Gender" + } + }, + "title": "ParameterGetBodyPropsBody", + "type": "object", + "required": [ + "firstname", + "lastname", + "age", + "weight", + "human", + "gender" + ] + } + } + ] + } + }, + "/SecurityTest": { + "get": { + "operationId": "SecurityTestGetWithApi", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/UserResponseModel" + } + }, + "default": { + "description": "Unexpected error", + "schema": { + "$ref": "#/definitions/ErrorResponseModel" + } + } + }, + "security": [ + { + "api_key": [] + } + ], + "parameters": [] + } + }, + "/SecurityTest/Koa": { + "get": { + "operationId": "SecurityTestGetWithApiForKoa", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/UserResponseModel" + } + }, + "default": { + "description": "Unexpected error", + "schema": { + "$ref": "#/definitions/ErrorResponseModel" + } + } + }, + "security": [ + { + "api_key": [] + } + ], + "parameters": [] + } + }, + "/SecurityTest/Oauth": { + "get": { + "operationId": "SecurityTestGetWithSecurity", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/UserResponseModel" + } + }, + "404": { + "description": "Not Fount", + "schema": { + "$ref": "#/definitions/ErrorResponseModel" + } + } + }, + "security": [ + { + "tsoa_auth": [ + "write:pets", + "read:pets" + ] + } + ], + "parameters": [] + } + }, + "/Validate/parameter/date": { + "get": { + "operationId": "ValidateDateValidate", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/ValidateDateResponse" + } + } + }, + "parameters": [ + { + "in": "query", + "name": "minDateValue", + "required": true, + "type": "string", + "format": "date" + }, + { + "in": "query", + "name": "maxDateValue", + "required": true, + "type": "string", + "format": "date" + } + ] + } + }, + "/Validate/parameter/datetime": { + "get": { + "operationId": "ValidateDateTimeValidate", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/ValidateDateResponse" + } + } + }, + "parameters": [ + { + "in": "query", + "name": "minDateValue", + "required": true, + "type": "string", + "format": "date-time" + }, + { + "in": "query", + "name": "maxDateValue", + "required": true, + "type": "string", + "format": "date-time" + } + ] + } + }, + "/Validate/parameter/integer": { + "get": { + "operationId": "ValidateLongValidate", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/ValidateNumberResponse" + } + } + }, + "parameters": [ + { + "in": "query", + "name": "minValue", + "required": true, + "type": "integer", + "format": "int32", + "minimum": 5 + }, + { + "in": "query", + "name": "maxValue", + "required": true, + "type": "integer", + "format": "int32", + "maximum": 3 + } + ] + } + }, + "/Validate/parameter/float": { + "get": { + "operationId": "ValidateDoubleValidate", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/ValidateNumberResponse" + } + } + }, + "parameters": [ + { + "in": "query", + "name": "minValue", + "required": true, + "type": "number", + "format": "float", + "minimum": 5.5 + }, + { + "in": "query", + "name": "maxValue", + "required": true, + "type": "number", + "format": "float", + "maximum": 3.5 + } + ] + } + }, + "/Validate/parameter/boolean": { + "get": { + "operationId": "ValidateBooleanValidate", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/ValidateBooleanResponse" + } + } + }, + "parameters": [ + { + "in": "query", + "name": "boolValue", + "required": true, + "type": "boolean" + } + ] + } + }, + "/Validate/parameter/string": { + "get": { + "operationId": "ValidateStringValidate", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/ValidateStringResponse" + } + } + }, + "parameters": [ + { + "in": "query", + "name": "minLength", + "required": true, + "type": "string", + "minLength": 5 + }, + { + "in": "query", + "name": "maxLength", + "required": true, + "type": "string", + "maxLength": 3 + }, + { + "in": "query", + "name": "patternValue", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z]+$" + } + ] + } + }, + "/Validate/parameter/customRequiredErrorMsg": { + "get": { + "operationId": "ValidateCustomRequiredErrorMsg", + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "No content" + } + }, + "parameters": [ + { + "in": "query", + "name": "longValue", + "required": true, + "type": "integer", + "format": "int64" + } + ] + } + }, + "/Validate/parameter/customInvalidErrorMsg": { + "get": { + "operationId": "ValidateCustomInvalidErrorMsg", + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "No content" + } + }, + "parameters": [ + { + "in": "query", + "name": "longValue", + "required": true, + "type": "integer", + "format": "int64" + } + ] + } + }, + "/Validate/body": { + "post": { + "operationId": "ValidateBodyValidate", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/ValidateModel" + } + } + }, + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ValidateModel" + } + } + ] + } + }, + "/Controller/normalStatusCode": { + "get": { + "operationId": "TestNormalStatusCode", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "parameters": [] + } + }, + "/Controller/customNomalStatusCode": { + "get": { + "operationId": "TestCustomNomalStatusCode", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Ok", + "schema": { + "$ref": "#/definitions/TestModel" + } + } + }, + "parameters": [] + } + }, + "/Controller/noContentStatusCode": { + "get": { + "operationId": "TestNoContentStatusCode", + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "No content" + } + }, + "parameters": [] + } + }, + "/Controller/customNoContentStatusCode": { + "get": { + "operationId": "TestCustomNoContentStatusCode", + "produces": [ + "application/json" + ], + "responses": { + "204": { + "description": "No content" + } + }, + "parameters": [] + } + } + }, + "produces": [ + "application/json" + ], + "swagger": "2.0", + "securityDefinitions": { + "api_key": { + "type": "apiKey", + "name": "access_token", + "in": "query" + }, + "tsoa_auth": { + "type": "oauth2", + "authorizationUrl": "http://swagger.io/api/oauth/dialog", + "flow": "implicit", + "scopes": { + "write:pets": "modify things", + "read:pets": "read things" + } + } + }, + "host": "localhost:3000", + "api_key": { + "type": "apiKey", + "name": "api_key", + "in": "header" + }, + "tsoa_auth": { + "type": "oauth2", + "authorizationUrl": "http://swagger.io/api/oauth/dialog", + "flow": "implicit", + "scopes": { + "write:pets": "modify things", + "read:pets": "read things" + } + } +} \ No newline at end of file diff --git a/samples/client/petstore-security-test/typescript-fetch/.swagger-codegen/VERSION b/samples/client/petstore-security-test/typescript-fetch/.swagger-codegen/VERSION new file mode 100644 index 00000000000..6b4d1577382 --- /dev/null +++ b/samples/client/petstore-security-test/typescript-fetch/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.2.3 \ No newline at end of file diff --git a/samples/client/petstore-security-test/typescript-fetch/LICENSE b/samples/client/petstore-security-test/typescript-fetch/LICENSE deleted file mode 100644 index 8dada3edaf5..00000000000 --- a/samples/client/petstore-security-test/typescript-fetch/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/samples/client/petstore-security-test/typescript-fetch/README.md b/samples/client/petstore-security-test/typescript-fetch/README.md deleted file mode 100644 index 664e1755933..00000000000 --- a/samples/client/petstore-security-test/typescript-fetch/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# TypeScript-Fetch - -This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: - -Environment -* Node.js -* Webpack -* Browserify - -Language level -* ES5 - you must have a Promises/A+ library installed -* ES6 - -Module system -* CommonJS -* ES6 module system - -It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html)) - -### Installation ### - -`swagger-codegen` does not generate JavaScript directly. The generated Node module comes with `package.json` that bundles `typescript` and `typings` so it can self-compile during `prepublish` stage. The should be run automatically during `npm install` or `npm publish`. - -CAVEAT: Due to [privilege implications](https://docs.npmjs.com/misc/scripts#user), `npm` would skip all scripts if the user is `root`. You would need to manually run it with `npm run prepublish` or run `npm install --unsafe-perm`. - -#### NPM #### -You may publish the module to NPM. In this case, you would be able to install the module as any other NPM module. It maybe useful to use [scoped packages](https://docs.npmjs.com/misc/scope). - -You can also use `npm link` to link the module. However, this would not modify `package.json` of the installing project, as such you would need to relink every time you deploy that project. - -You can also directly install the module using `npm install file_path`. If you do `npm install file_path --save`, NPM will save relative path to `package.json`. In this case, `npm install` and `npm shrinkwrap` may misbehave. You would need to manually edit `package.json` and replace it with absolute path. - -Regardless of which method you deployed your NPM module, the ES6 module syntaxes are as follows: -``` -import * as localName from 'npmName'; -import {operationId} from 'npmName'; -``` -The CommonJS syntax is as follows: -``` -import localName = require('npmName'); -``` - -#### Direct copy/symlink #### -You may also simply copy or symlink the generated module into a directory under your project. The syntax of this is as follows: - -With ES6 module syntax, the following syntaxes are supported: -``` -import * as localName from './symlinkDir'; -import {operationId} from './symlinkDir'; -``` -The CommonJS syntax is as follows: -``` -import localName = require('./symlinkDir')'; -``` diff --git a/samples/client/petstore-security-test/typescript-fetch/api.ts b/samples/client/petstore-security-test/typescript-fetch/api.ts index adff476ae84..5c8ff83c2fd 100644 --- a/samples/client/petstore-security-test/typescript-fetch/api.ts +++ b/samples/client/petstore-security-test/typescript-fetch/api.ts @@ -1,3 +1,4 @@ +// tslint:disable /** * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- @@ -10,68 +11,104 @@ * Do not edit the class manually. */ -import * as querystring from "querystring"; -import * as url from "url"; -import * as isomorphicFetch from "isomorphic-fetch"; -import * as assign from "core-js/library/fn/object/assign"; - -interface Dictionary { [index: string]: T; } -export interface FetchAPI { (url: string, init?: any): Promise; } +import * as url from "url"; +import * as isomorphicFetch from "isomorphic-fetch"; const BASE_PATH = "https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r".replace(/\/+$/, ""); +/** + * + * @export + * @interface FetchAPI + */ +export interface FetchAPI { + (url: string, init?: any): Promise; +} + +/** + * + * @export + * @interface FetchArgs + */ export interface FetchArgs { url: string; options: any; } +/** + * + * @export + * @class BaseAPI + */ export class BaseAPI { - basePath: string; - fetch: FetchAPI; - - constructor(fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) { - this.basePath = basePath; - this.fetch = fetch; + constructor(public basePath: string = BASE_PATH, public fetch: FetchAPI = isomorphicFetch) { } }; +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + name: "RequiredError" + constructor(public field: string, msg?: string) { + super(msg); + } +} + /** * Model for testing reserved words *_/ ' \" =end -- \\r\\n \\n \\r + * @export + * @interface ModelReturn */ export interface ModelReturn { /** * property description *_/ ' \" =end -- \\r\\n \\n \\r + * @type {number} + * @memberof ModelReturn */ - "return"?: number; + return?: number; } - /** * FakeApi - fetch parameter creator */ export const FakeApiFetchParamCreator = { - /** - * To test code injection *_/ ' \" =end -- \\r\\n \\n \\r - * @param test code inject * ' " =end rn n r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r + /** + * + * @summary To test code injection *_/ ' \" =end -- \\r\\n \\n \\r + * @param {string} [test code inject * ' " =end rn n r] To test code injection *_/ ' \" =end -- \\r\\n \\n \\r + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - testCodeInjectEndRnNR(params: { "test code inject * ' " =end rn n r"?: string; }, options?: any): FetchArgs { - const baseUrl = `/fake`; - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "PUT" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; - fetchOptions.body = querystring.stringify({ - "test code inject */ ' " =end -- \r\n \n \r": params["test code inject * ' " =end rn n r"], - }); - if (contentTypeHeader) { - fetchOptions.headers = contentTypeHeader; + testCodeInjectEndRnNR(test code inject * ' " =end rn n r?: string, options?: any): FetchArgs { + const path = `/fake`; + const urlObj = url.parse(path, true); + const headers = {} as any; + const formParams = new url.URLSearchParams(); + + if (test code inject * ' " =end rn n r !== undefined) { + formParams.set('test code inject */ ' " =end -- \r\n \n \r', test code inject * ' " =end rn n r); } + + headers['Content-Type'] = 'application/x-www-form-urlencoded'; + + let requestOptions = { + method: 'PUT', + headers: headers, + body: formParams.toString(), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + return { url: url.format(urlObj), - options: fetchOptions, + options: requestOptions, }; }, }; @@ -80,12 +117,15 @@ export const FakeApiFetchParamCreator = { * FakeApi - functional programming interface */ export const FakeApiFp = { - /** - * To test code injection *_/ ' \" =end -- \\r\\n \\n \\r - * @param test code inject * ' " =end rn n r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r + /** + * + * @summary To test code injection *_/ ' \" =end -- \\r\\n \\n \\r + * @param {string} [test code inject * ' " =end rn n r] To test code injection *_/ ' \" =end -- \\r\\n \\n \\r + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - testCodeInjectEndRnNR(params: { "test code inject * ' " =end rn n r"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = FakeApiFetchParamCreator.testCodeInjectEndRnNR(params, options); + testCodeInjectEndRnNR(test code inject * ' " =end rn n r?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = FakeApiFetchParamCreator.testCodeInjectEndRnNR(test code inject * ' " =end rn n r, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { @@ -100,14 +140,21 @@ export const FakeApiFp = { /** * FakeApi - object-oriented interface + * @export + * @class FakeApi + * @extends {BaseAPI} */ export class FakeApi extends BaseAPI { - /** - * To test code injection *_/ ' \" =end -- \\r\\n \\n \\r - * @param test code inject * ' " =end rn n r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r + /** + * + * @summary To test code injection *_/ ' \" =end -- \\r\\n \\n \\r + * @param {string} [test code inject * ' " =end rn n r] To test code injection *_/ ' \" =end -- \\r\\n \\n \\r + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FakeApi */ - testCodeInjectEndRnNR(params: { "test code inject * ' " =end rn n r"?: string; }, options?: any) { - return FakeApiFp.testCodeInjectEndRnNR(params, options)(this.fetch, this.basePath); + public testCodeInjectEndRnNR(test code inject * ' " =end rn n r?: string, options?: any) { + return FakeApiFp.testCodeInjectEndRnNR(test code inject * ' " =end rn n r, options)(this.fetch, this.basePath); } }; @@ -116,12 +163,15 @@ export class FakeApi extends BaseAPI { */ export const FakeApiFactory = function (fetch?: FetchAPI, basePath?: string) { return { - /** - * To test code injection *_/ ' \" =end -- \\r\\n \\n \\r - * @param test code inject * ' " =end rn n r To test code injection *_/ ' \" =end -- \\r\\n \\n \\r + /** + * + * @summary To test code injection *_/ ' \" =end -- \\r\\n \\n \\r + * @param {string} [test code inject * ' " =end rn n r] To test code injection *_/ ' \" =end -- \\r\\n \\n \\r + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - testCodeInjectEndRnNR(params: { "test code inject * ' " =end rn n r"?: string; }, options?: any) { - return FakeApiFp.testCodeInjectEndRnNR(params, options)(fetch, basePath); + testCodeInjectEndRnNR(test code inject * ' " =end rn n r?: string, options?: any) { + return FakeApiFp.testCodeInjectEndRnNR(test code inject * ' " =end rn n r, options)(fetch, basePath); }, }; }; diff --git a/samples/client/petstore-security-test/typescript-fetch/package.json b/samples/client/petstore-security-test/typescript-fetch/package.json deleted file mode 100644 index 0204e3c39c9..00000000000 --- a/samples/client/petstore-security-test/typescript-fetch/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "typescript-fetch-api", - "version": "0.0.0", - "license": "Unlicense", - "main": "./dist/api.js", - "browser": "./dist/api.js", - "typings": "./dist/api.d.ts", - "dependencies": { - "core-js": "^2.4.0", - "isomorphic-fetch": "^2.2.1" - }, - "scripts" : { - "prepublish" : "typings install && tsc", - "test": "tslint api.ts" - }, - "devDependencies": { - "tslint": "^3.15.1", - "typescript": "^1.8.10", - "typings": "^1.0.4" - } -} diff --git a/samples/client/petstore-security-test/typescript-fetch/tsconfig.json b/samples/client/petstore-security-test/typescript-fetch/tsconfig.json deleted file mode 100644 index 72ff2567206..00000000000 --- a/samples/client/petstore-security-test/typescript-fetch/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "declaration": true, - "target": "es5", - "module": "commonjs", - "noImplicitAny": true, - "outDir": "dist", - "rootDir": "." - }, - "exclude": [ - "dist", - "node_modules", - "typings/browser", - "typings/main", - "typings/main.d.ts" - ] -} diff --git a/samples/client/petstore-security-test/typescript-fetch/tslint.json b/samples/client/petstore-security-test/typescript-fetch/tslint.json deleted file mode 100644 index 6eb02acec8c..00000000000 --- a/samples/client/petstore-security-test/typescript-fetch/tslint.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "jsRules": { - "class-name": true, - "comment-format": [ - true, - "check-space" - ], - "indent": [ - true, - "spaces" - ], - "no-duplicate-variable": true, - "no-eval": true, - "no-trailing-whitespace": true, - "no-unsafe-finally": true, - "one-line": [ - true, - "check-open-brace", - "check-whitespace" - ], - "quotemark": [ - true, - "double" - ], - "semicolon": [ - true, - "always" - ], - "triple-equals": [ - true, - "allow-null-check" - ], - "variable-name": [ - true, - "ban-keywords" - ], - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type" - ] - }, - "rules": { - "class-name": true, - "comment-format": [ - true, - "check-space" - ], - "indent": [ - true, - "spaces" - ], - "no-eval": true, - "no-internal-module": true, - "no-trailing-whitespace": true, - "no-unsafe-finally": true, - "no-var-keyword": true, - "one-line": [ - true, - "check-open-brace", - "check-whitespace" - ], - "quotemark": [ - true, - "double" - ], - "semicolon": [ - true, - "always" - ], - "triple-equals": [ - true, - "allow-null-check" - ], - "typedef-whitespace": [ - true, - { - "call-signature": "nospace", - "index-signature": "nospace", - "parameter": "nospace", - "property-declaration": "nospace", - "variable-declaration": "nospace" - } - ], - "variable-name": [ - true, - "ban-keywords" - ], - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type" - ] - } -} diff --git a/samples/client/petstore-security-test/typescript-fetch/typings.json b/samples/client/petstore-security-test/typescript-fetch/typings.json deleted file mode 100644 index a82ea152b4a..00000000000 --- a/samples/client/petstore-security-test/typescript-fetch/typings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "version": false, - "dependencies": {}, - "globalDependencies": { - "core-js": "registry:dt/core-js#0.0.0+20160317120654", - "node": "registry:dt/node#4.0.0+20160423143914", - "isomorphic-fetch": "registry:dt/isomorphic-fetch#0.0.0+20160505171433" - } -} diff --git a/samples/client/petstore/typescript-fetch/builds/default/.swagger-codegen/VERSION b/samples/client/petstore/typescript-fetch/builds/default/.swagger-codegen/VERSION index 7fea99011a6..6b4d1577382 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/default/.swagger-codegen/VERSION @@ -1 +1 @@ -2.2.3-SNAPSHOT \ No newline at end of file +2.2.3 \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/default/README.md b/samples/client/petstore/typescript-fetch/builds/default/README.md deleted file mode 100644 index 664e1755933..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/default/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# TypeScript-Fetch - -This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: - -Environment -* Node.js -* Webpack -* Browserify - -Language level -* ES5 - you must have a Promises/A+ library installed -* ES6 - -Module system -* CommonJS -* ES6 module system - -It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html)) - -### Installation ### - -`swagger-codegen` does not generate JavaScript directly. The generated Node module comes with `package.json` that bundles `typescript` and `typings` so it can self-compile during `prepublish` stage. The should be run automatically during `npm install` or `npm publish`. - -CAVEAT: Due to [privilege implications](https://docs.npmjs.com/misc/scripts#user), `npm` would skip all scripts if the user is `root`. You would need to manually run it with `npm run prepublish` or run `npm install --unsafe-perm`. - -#### NPM #### -You may publish the module to NPM. In this case, you would be able to install the module as any other NPM module. It maybe useful to use [scoped packages](https://docs.npmjs.com/misc/scope). - -You can also use `npm link` to link the module. However, this would not modify `package.json` of the installing project, as such you would need to relink every time you deploy that project. - -You can also directly install the module using `npm install file_path`. If you do `npm install file_path --save`, NPM will save relative path to `package.json`. In this case, `npm install` and `npm shrinkwrap` may misbehave. You would need to manually edit `package.json` and replace it with absolute path. - -Regardless of which method you deployed your NPM module, the ES6 module syntaxes are as follows: -``` -import * as localName from 'npmName'; -import {operationId} from 'npmName'; -``` -The CommonJS syntax is as follows: -``` -import localName = require('npmName'); -``` - -#### Direct copy/symlink #### -You may also simply copy or symlink the generated module into a directory under your project. The syntax of this is as follows: - -With ES6 module syntax, the following syntaxes are supported: -``` -import * as localName from './symlinkDir'; -import {operationId} from './symlinkDir'; -``` -The CommonJS syntax is as follows: -``` -import localName = require('./symlinkDir')'; -``` diff --git a/samples/client/petstore/typescript-fetch/builds/default/api.ts b/samples/client/petstore/typescript-fetch/builds/default/api.ts index 34271f7c8fb..0e01c3ca21c 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/api.ts @@ -1,93 +1,307 @@ +// tslint:disable /** * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * * OpenAPI spec version: 1.0.0 - * Contact: apiteam@wordnik.com + * Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ -import * as querystring from "querystring"; -import * as url from "url"; -import * as isomorphicFetch from "isomorphic-fetch"; -import * as assign from "core-js/library/fn/object/assign"; - -interface Dictionary { [index: string]: T; } -export interface FetchAPI { (url: string, init?: any): Promise; } +import * as url from "url"; +import * as isomorphicFetch from "isomorphic-fetch"; const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ""); +/** + * + * @export + * @interface FetchAPI + */ +export interface FetchAPI { + (url: string, init?: any): Promise; +} + +/** + * + * @export + * @interface FetchArgs + */ export interface FetchArgs { url: string; options: any; } +/** + * + * @export + * @class BaseAPI + */ export class BaseAPI { - basePath: string; - fetch: FetchAPI; - - constructor(fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) { - this.basePath = basePath; - this.fetch = fetch; + constructor(public basePath: string = BASE_PATH, public fetch: FetchAPI = isomorphicFetch) { } }; +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + name: "RequiredError" + constructor(public field: string, msg?: string) { + super(msg); + } +} + +/** + * Describes the result of uploading an image resource + * @export + * @interface ApiResponse + */ +export interface ApiResponse { + /** + * + * @type {number} + * @memberof ApiResponse + */ + code?: number; + /** + * + * @type {string} + * @memberof ApiResponse + */ + type?: string; + /** + * + * @type {string} + * @memberof ApiResponse + */ + message?: string; +} + +/** + * A category for a pet + * @export + * @interface Category + */ export interface Category { - "id"?: number; - "name"?: string; + /** + * + * @type {number} + * @memberof Category + */ + id?: number; + /** + * + * @type {string} + * @memberof Category + */ + name?: string; } +/** + * An order for a pets from the pet store + * @export + * @interface Order + */ export interface Order { - "id"?: number; - "petId"?: number; - "quantity"?: number; - "shipDate"?: Date; + /** + * + * @type {number} + * @memberof Order + */ + id?: number; + /** + * + * @type {number} + * @memberof Order + */ + petId?: number; + /** + * + * @type {number} + * @memberof Order + */ + quantity?: number; + /** + * + * @type {Date} + * @memberof Order + */ + shipDate?: Date; /** * Order Status + * @type {string} + * @memberof Order */ - "status"?: OrderStatusEnum; - "complete"?: boolean; + status?: Order.StatusEnum; + /** + * + * @type {boolean} + * @memberof Order + */ + complete?: boolean; } -export type OrderStatusEnum = "placed" | "approved" | "delivered"; +/** + * @export + * @namespace Order + */ +export namespace Order { + /** + * @export + * @enum {string} + */ + export enum StatusEnum { + Placed = 'placed', + Approved = 'approved', + Delivered = 'delivered' + } +} + +/** + * A pet for sale in the pet store + * @export + * @interface Pet + */ export interface Pet { - "id"?: number; - "category"?: Category; - "name": string; - "photoUrls": Array; - "tags"?: Array; + /** + * + * @type {number} + * @memberof Pet + */ + id?: number; + /** + * + * @type {Category} + * @memberof Pet + */ + category?: Category; + /** + * + * @type {string} + * @memberof Pet + */ + name: string; + /** + * + * @type {Array<string>} + * @memberof Pet + */ + photoUrls: Array; + /** + * + * @type {Array<Tag>} + * @memberof Pet + */ + tags?: Array; /** * pet status in the store + * @type {string} + * @memberof Pet */ - "status"?: PetStatusEnum; + status?: Pet.StatusEnum; } -export type PetStatusEnum = "available" | "pending" | "sold"; +/** + * @export + * @namespace Pet + */ +export namespace Pet { + /** + * @export + * @enum {string} + */ + export enum StatusEnum { + Available = 'available', + Pending = 'pending', + Sold = 'sold' + } +} + +/** + * A tag for a pet + * @export + * @interface Tag + */ export interface Tag { - "id"?: number; - "name"?: string; + /** + * + * @type {number} + * @memberof Tag + */ + id?: number; + /** + * + * @type {string} + * @memberof Tag + */ + name?: string; } +/** + * A User who is purchasing from the pet store + * @export + * @interface User + */ export interface User { - "id"?: number; - "username"?: string; - "firstName"?: string; - "lastName"?: string; - "email"?: string; - "password"?: string; - "phone"?: string; + /** + * + * @type {number} + * @memberof User + */ + id?: number; + /** + * + * @type {string} + * @memberof User + */ + username?: string; + /** + * + * @type {string} + * @memberof User + */ + firstName?: string; + /** + * + * @type {string} + * @memberof User + */ + lastName?: string; + /** + * + * @type {string} + * @memberof User + */ + email?: string; + /** + * + * @type {string} + * @memberof User + */ + password?: string; + /** + * + * @type {string} + * @memberof User + */ + phone?: string; /** * User Status + * @type {number} + * @memberof User */ - "userStatus"?: number; + userStatus?: number; } - /** * PetApi - fetch parameter creator */ @@ -95,202 +309,289 @@ export const PetApiFetchParamCreator = { /** * * @summary Add a new pet to the store - * @param body Pet object that needs to be added to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - addPet(params: { "body"?: Pet; }, options?: any): FetchArgs { - const baseUrl = `/pet`; - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/json" }; - if (params["body"]) { - fetchOptions.body = JSON.stringify(params["body"] || {}); + addPet(body: Pet, options?: any): FetchArgs { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling addPet.'); } - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); + const path = `/pet`; + const urlObj = url.parse(path, true); + const headers = {} as any; + + headers['Content-Type'] = 'application/json'; + + let requestOptions = { + method: 'POST', + headers: headers, + body: body === null ? '' : JSON.stringify(body), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); } + return { url: url.format(urlObj), - options: fetchOptions, + options: requestOptions, }; }, /** * * @summary Deletes a pet - * @param petId Pet id to delete - * @param apiKey + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - deletePet(params: { "petId": number; "apiKey"?: string; }, options?: any): FetchArgs { - // verify required parameter "petId" is set - if (params["petId"] == null) { - throw new Error("Missing required parameter petId when calling deletePet"); + deletePet(petId: number, apiKey?: string, options?: any): FetchArgs { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling deletePet.'); + } + const path = `/pet/{petId}` + .replace(`{${"petId"}}`, String(petId)); + const urlObj = url.parse(path, true); + const headers = {} as any; + + if (apiKey !== undefined && apiKey !== null) { + headers['api_key'] = String(apiKey); } - const baseUrl = `/pet/{petId}` - .replace(`{${"petId"}}`, `${ params["petId"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "DELETE" }, options); - - let contentTypeHeader: Dictionary = {}; - fetchOptions.headers = assign({ - "api_key": params["apiKey"], - }, contentTypeHeader, fetchOptions.headers); + + let requestOptions = { + method: 'DELETE', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + return { url: url.format(urlObj), - options: fetchOptions, + options: requestOptions, }; }, /** * Multiple status values can be provided with comma separated strings * @summary Finds Pets by status - * @param status Status values that need to be considered for filter - */ - findPetsByStatus(params: { "status"?: Array; }, options?: any): FetchArgs { - const baseUrl = `/pet/findByStatus`; - let urlObj = url.parse(baseUrl, true); - urlObj.query = assign({}, urlObj.query, { - "status": params["status"], - }); - let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); + * @param {Array<string>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByStatus(status: Array, options?: any): FetchArgs { + // verify required parameter 'status' is not null or undefined + if (status === null || status === undefined) { + throw new RequiredError('status','Required parameter status was null or undefined when calling findPetsByStatus.'); + } + const path = `/pet/findByStatus`; + const urlObj = url.parse(path, true); + const headers = {} as any; + const queryParameters = {} as any; + + if (status) { + queryParameters['status'] = status.join(','); } + urlObj.query = Object.assign({}, urlObj.query, queryParameters); + + let requestOptions = { + method: 'GET', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + return { url: url.format(urlObj), - options: fetchOptions, + options: requestOptions, }; }, /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @summary Finds Pets by tags - * @param tags Tags to filter by - */ - findPetsByTags(params: { "tags"?: Array; }, options?: any): FetchArgs { - const baseUrl = `/pet/findByTags`; - let urlObj = url.parse(baseUrl, true); - urlObj.query = assign({}, urlObj.query, { - "tags": params["tags"], - }); - let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); + * @param {Array<string>} tags Tags to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByTags(tags: Array, options?: any): FetchArgs { + // verify required parameter 'tags' is not null or undefined + if (tags === null || tags === undefined) { + throw new RequiredError('tags','Required parameter tags was null or undefined when calling findPetsByTags.'); } + const path = `/pet/findByTags`; + const urlObj = url.parse(path, true); + const headers = {} as any; + const queryParameters = {} as any; + + if (tags) { + queryParameters['tags'] = tags.join(','); + } + urlObj.query = Object.assign({}, urlObj.query, queryParameters); + + let requestOptions = { + method: 'GET', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + return { url: url.format(urlObj), - options: fetchOptions, + options: requestOptions, }; }, /** - * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + * Returns a single pet * @summary Find pet by ID - * @param petId ID of pet that needs to be fetched + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - getPetById(params: { "petId": number; }, options?: any): FetchArgs { - // verify required parameter "petId" is set - if (params["petId"] == null) { - throw new Error("Missing required parameter petId when calling getPetById"); + getPetById(petId: number, options?: any): FetchArgs { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling getPetById.'); } - const baseUrl = `/pet/{petId}` - .replace(`{${"petId"}}`, `${ params["petId"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); + const path = `/pet/{petId}` + .replace(`{${"petId"}}`, String(petId)); + const urlObj = url.parse(path, true); + const headers = {} as any; + + + let requestOptions = { + method: 'GET', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); } + return { url: url.format(urlObj), - options: fetchOptions, + options: requestOptions, }; }, /** * * @summary Update an existing pet - * @param body Pet object that needs to be added to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - updatePet(params: { "body"?: Pet; }, options?: any): FetchArgs { - const baseUrl = `/pet`; - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "PUT" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/json" }; - if (params["body"]) { - fetchOptions.body = JSON.stringify(params["body"] || {}); + updatePet(body: Pet, options?: any): FetchArgs { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling updatePet.'); } - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); + const path = `/pet`; + const urlObj = url.parse(path, true); + const headers = {} as any; + + headers['Content-Type'] = 'application/json'; + + let requestOptions = { + method: 'PUT', + headers: headers, + body: body === null ? '' : JSON.stringify(body), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); } + return { url: url.format(urlObj), - options: fetchOptions, + options: requestOptions, }; }, /** * * @summary Updates a pet in the store with form data - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet - * @param status Updated status of the pet - */ - updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }, options?: any): FetchArgs { - // verify required parameter "petId" is set - if (params["petId"] == null) { - throw new Error("Missing required parameter petId when calling updatePetWithForm"); + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): FetchArgs { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling updatePetWithForm.'); } - const baseUrl = `/pet/{petId}` - .replace(`{${"petId"}}`, `${ params["petId"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; - fetchOptions.body = querystring.stringify({ - "name": params["name"], - "status": params["status"], - }); - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); + const path = `/pet/{petId}` + .replace(`{${"petId"}}`, String(petId)); + const urlObj = url.parse(path, true); + const headers = {} as any; + const formParams = new url.URLSearchParams(); + + if (name !== undefined) { + formParams.set('name', name); + } + + if (status !== undefined) { + formParams.set('status', status); } + + headers['Content-Type'] = 'application/x-www-form-urlencoded'; + + let requestOptions = { + method: 'POST', + headers: headers, + body: formParams.toString(), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + return { url: url.format(urlObj), - options: fetchOptions, + options: requestOptions, }; }, /** * * @summary uploads an image - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload - */ - uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }, options?: any): FetchArgs { - // verify required parameter "petId" is set - if (params["petId"] == null) { - throw new Error("Missing required parameter petId when calling uploadFile"); + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): FetchArgs { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling uploadFile.'); } - const baseUrl = `/pet/{petId}/uploadImage` - .replace(`{${"petId"}}`, `${ params["petId"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; - fetchOptions.body = querystring.stringify({ - "additionalMetadata": params["additionalMetadata"], - "file": params["file"], - }); - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); + const path = `/pet/{petId}/uploadImage` + .replace(`{${"petId"}}`, String(petId)); + const urlObj = url.parse(path, true); + const headers = {} as any; + const formParams = new url.URLSearchParams(); + + if (additionalMetadata !== undefined) { + formParams.set('additionalMetadata', additionalMetadata); } + + if (file !== undefined) { + formParams.set('file', file); + } + + headers['Content-Type'] = 'application/x-www-form-urlencoded'; + + let requestOptions = { + method: 'POST', + headers: headers, + body: formParams.toString(), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + return { url: url.format(urlObj), - options: fetchOptions, + options: requestOptions, }; }, }; @@ -302,10 +603,12 @@ export const PetApiFp = { /** * * @summary Add a new pet to the store - * @param body Pet object that needs to be added to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - addPet(params: { "body"?: Pet; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator.addPet(params, options); + addPet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = PetApiFetchParamCreator.addPet(body, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { @@ -319,11 +622,13 @@ export const PetApiFp = { /** * * @summary Deletes a pet - * @param petId Pet id to delete - * @param apiKey + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - deletePet(params: { "petId": number; "apiKey"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator.deletePet(params, options); + deletePet(petId: number, apiKey?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = PetApiFetchParamCreator.deletePet(petId, apiKey, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { @@ -337,10 +642,12 @@ export const PetApiFp = { /** * Multiple status values can be provided with comma separated strings * @summary Finds Pets by status - * @param status Status values that need to be considered for filter + * @param {Array<string>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - findPetsByStatus(params: { "status"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { - const fetchArgs = PetApiFetchParamCreator.findPetsByStatus(params, options); + findPetsByStatus(status: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { + const fetchArgs = PetApiFetchParamCreator.findPetsByStatus(status, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { @@ -354,10 +661,12 @@ export const PetApiFp = { /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @summary Finds Pets by tags - * @param tags Tags to filter by + * @param {Array<string>} tags Tags to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - findPetsByTags(params: { "tags"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { - const fetchArgs = PetApiFetchParamCreator.findPetsByTags(params, options); + findPetsByTags(tags: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { + const fetchArgs = PetApiFetchParamCreator.findPetsByTags(tags, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { @@ -369,12 +678,14 @@ export const PetApiFp = { }; }, /** - * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + * Returns a single pet * @summary Find pet by ID - * @param petId ID of pet that needs to be fetched + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - getPetById(params: { "petId": number; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator.getPetById(params, options); + getPetById(petId: number, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = PetApiFetchParamCreator.getPetById(petId, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { @@ -388,10 +699,12 @@ export const PetApiFp = { /** * * @summary Update an existing pet - * @param body Pet object that needs to be added to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - updatePet(params: { "body"?: Pet; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator.updatePet(params, options); + updatePet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = PetApiFetchParamCreator.updatePet(body, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { @@ -405,12 +718,14 @@ export const PetApiFp = { /** * * @summary Updates a pet in the store with form data - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet - * @param status Updated status of the pet + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator.updatePetWithForm(params, options); + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = PetApiFetchParamCreator.updatePetWithForm(petId, name, status, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { @@ -424,16 +739,18 @@ export const PetApiFp = { /** * * @summary uploads an image - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator.uploadFile(params, options); + uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = PetApiFetchParamCreator.uploadFile(petId, additionalMetadata, file, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { - return response; + return response.json(); } else { throw response; } @@ -444,76 +761,103 @@ export const PetApiFp = { /** * PetApi - object-oriented interface + * @export + * @class PetApi + * @extends {BaseAPI} */ export class PetApi extends BaseAPI { /** * * @summary Add a new pet to the store - * @param body Pet object that needs to be added to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi */ - addPet(params: { "body"?: Pet; }, options?: any) { - return PetApiFp.addPet(params, options)(this.fetch, this.basePath); + public addPet(body: Pet, options?: any) { + return PetApiFp.addPet(body, options)(this.fetch, this.basePath); } /** * * @summary Deletes a pet - * @param petId Pet id to delete - * @param apiKey + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi */ - deletePet(params: { "petId": number; "apiKey"?: string; }, options?: any) { - return PetApiFp.deletePet(params, options)(this.fetch, this.basePath); + public deletePet(petId: number, apiKey?: string, options?: any) { + return PetApiFp.deletePet(petId, apiKey, options)(this.fetch, this.basePath); } /** * Multiple status values can be provided with comma separated strings * @summary Finds Pets by status - * @param status Status values that need to be considered for filter + * @param {Array<string>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi */ - findPetsByStatus(params: { "status"?: Array; }, options?: any) { - return PetApiFp.findPetsByStatus(params, options)(this.fetch, this.basePath); + public findPetsByStatus(status: Array, options?: any) { + return PetApiFp.findPetsByStatus(status, options)(this.fetch, this.basePath); } /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @summary Finds Pets by tags - * @param tags Tags to filter by + * @param {Array<string>} tags Tags to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi */ - findPetsByTags(params: { "tags"?: Array; }, options?: any) { - return PetApiFp.findPetsByTags(params, options)(this.fetch, this.basePath); + public findPetsByTags(tags: Array, options?: any) { + return PetApiFp.findPetsByTags(tags, options)(this.fetch, this.basePath); } /** - * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + * Returns a single pet * @summary Find pet by ID - * @param petId ID of pet that needs to be fetched + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi */ - getPetById(params: { "petId": number; }, options?: any) { - return PetApiFp.getPetById(params, options)(this.fetch, this.basePath); + public getPetById(petId: number, options?: any) { + return PetApiFp.getPetById(petId, options)(this.fetch, this.basePath); } /** * * @summary Update an existing pet - * @param body Pet object that needs to be added to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi */ - updatePet(params: { "body"?: Pet; }, options?: any) { - return PetApiFp.updatePet(params, options)(this.fetch, this.basePath); + public updatePet(body: Pet, options?: any) { + return PetApiFp.updatePet(body, options)(this.fetch, this.basePath); } /** * * @summary Updates a pet in the store with form data - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet - * @param status Updated status of the pet + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi */ - updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }, options?: any) { - return PetApiFp.updatePetWithForm(params, options)(this.fetch, this.basePath); + public updatePetWithForm(petId: number, name?: string, status?: string, options?: any) { + return PetApiFp.updatePetWithForm(petId, name, status, options)(this.fetch, this.basePath); } /** * * @summary uploads an image - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi */ - uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }, options?: any) { - return PetApiFp.uploadFile(params, options)(this.fetch, this.basePath); + public uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any) { + return PetApiFp.uploadFile(petId, additionalMetadata, file, options)(this.fetch, this.basePath); } }; @@ -525,71 +869,87 @@ export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { /** * * @summary Add a new pet to the store - * @param body Pet object that needs to be added to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - addPet(params: { "body"?: Pet; }, options?: any) { - return PetApiFp.addPet(params, options)(fetch, basePath); + addPet(body: Pet, options?: any) { + return PetApiFp.addPet(body, options)(fetch, basePath); }, /** * * @summary Deletes a pet - * @param petId Pet id to delete - * @param apiKey + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - deletePet(params: { "petId": number; "apiKey"?: string; }, options?: any) { - return PetApiFp.deletePet(params, options)(fetch, basePath); + deletePet(petId: number, apiKey?: string, options?: any) { + return PetApiFp.deletePet(petId, apiKey, options)(fetch, basePath); }, /** * Multiple status values can be provided with comma separated strings * @summary Finds Pets by status - * @param status Status values that need to be considered for filter + * @param {Array<string>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - findPetsByStatus(params: { "status"?: Array; }, options?: any) { - return PetApiFp.findPetsByStatus(params, options)(fetch, basePath); + findPetsByStatus(status: Array, options?: any) { + return PetApiFp.findPetsByStatus(status, options)(fetch, basePath); }, /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @summary Finds Pets by tags - * @param tags Tags to filter by + * @param {Array<string>} tags Tags to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - findPetsByTags(params: { "tags"?: Array; }, options?: any) { - return PetApiFp.findPetsByTags(params, options)(fetch, basePath); + findPetsByTags(tags: Array, options?: any) { + return PetApiFp.findPetsByTags(tags, options)(fetch, basePath); }, /** - * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + * Returns a single pet * @summary Find pet by ID - * @param petId ID of pet that needs to be fetched + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - getPetById(params: { "petId": number; }, options?: any) { - return PetApiFp.getPetById(params, options)(fetch, basePath); + getPetById(petId: number, options?: any) { + return PetApiFp.getPetById(petId, options)(fetch, basePath); }, /** * * @summary Update an existing pet - * @param body Pet object that needs to be added to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - updatePet(params: { "body"?: Pet; }, options?: any) { - return PetApiFp.updatePet(params, options)(fetch, basePath); + updatePet(body: Pet, options?: any) { + return PetApiFp.updatePet(body, options)(fetch, basePath); }, /** * * @summary Updates a pet in the store with form data - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet - * @param status Updated status of the pet + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }, options?: any) { - return PetApiFp.updatePetWithForm(params, options)(fetch, basePath); + updatePetWithForm(petId: number, name?: string, status?: string, options?: any) { + return PetApiFp.updatePetWithForm(petId, name, status, options)(fetch, basePath); }, /** * * @summary uploads an image - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }, options?: any) { - return PetApiFp.uploadFile(params, options)(fetch, basePath); + uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any) { + return PetApiFp.uploadFile(petId, additionalMetadata, file, options)(fetch, basePath); }, }; }; @@ -602,90 +962,120 @@ export const StoreApiFetchParamCreator = { /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @summary Delete purchase order by ID - * @param orderId ID of the order that needs to be deleted + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - deleteOrder(params: { "orderId": string; }, options?: any): FetchArgs { - // verify required parameter "orderId" is set - if (params["orderId"] == null) { - throw new Error("Missing required parameter orderId when calling deleteOrder"); + deleteOrder(orderId: string, options?: any): FetchArgs { + // verify required parameter 'orderId' is not null or undefined + if (orderId === null || orderId === undefined) { + throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling deleteOrder.'); } - const baseUrl = `/store/order/{orderId}` - .replace(`{${"orderId"}}`, `${ params["orderId"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "DELETE" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); + const path = `/store/order/{orderId}` + .replace(`{${"orderId"}}`, String(orderId)); + const urlObj = url.parse(path, true); + const headers = {} as any; + + + let requestOptions = { + method: 'DELETE', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); } + return { url: url.format(urlObj), - options: fetchOptions, + options: requestOptions, }; }, /** * Returns a map of status codes to quantities * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ getInventory(options?: any): FetchArgs { - const baseUrl = `/store/inventory`; - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); + const path = `/store/inventory`; + const urlObj = url.parse(path, true); + const headers = {} as any; + - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); + let requestOptions = { + method: 'GET', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); } + return { url: url.format(urlObj), - options: fetchOptions, + options: requestOptions, }; }, /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @summary Find purchase order by ID - * @param orderId ID of pet that needs to be fetched + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - getOrderById(params: { "orderId": string; }, options?: any): FetchArgs { - // verify required parameter "orderId" is set - if (params["orderId"] == null) { - throw new Error("Missing required parameter orderId when calling getOrderById"); + getOrderById(orderId: number, options?: any): FetchArgs { + // verify required parameter 'orderId' is not null or undefined + if (orderId === null || orderId === undefined) { + throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling getOrderById.'); } - const baseUrl = `/store/order/{orderId}` - .replace(`{${"orderId"}}`, `${ params["orderId"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); + const path = `/store/order/{orderId}` + .replace(`{${"orderId"}}`, String(orderId)); + const urlObj = url.parse(path, true); + const headers = {} as any; + + + let requestOptions = { + method: 'GET', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); } + return { url: url.format(urlObj), - options: fetchOptions, + options: requestOptions, }; }, /** * * @summary Place an order for a pet - * @param body order placed for purchasing the pet + * @param {Order} body order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - placeOrder(params: { "body"?: Order; }, options?: any): FetchArgs { - const baseUrl = `/store/order`; - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/json" }; - if (params["body"]) { - fetchOptions.body = JSON.stringify(params["body"] || {}); + placeOrder(body: Order, options?: any): FetchArgs { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling placeOrder.'); } - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); + const path = `/store/order`; + const urlObj = url.parse(path, true); + const headers = {} as any; + + headers['Content-Type'] = 'application/json'; + + let requestOptions = { + method: 'POST', + headers: headers, + body: body === null ? '' : JSON.stringify(body), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); } + return { url: url.format(urlObj), - options: fetchOptions, + options: requestOptions, }; }, }; @@ -697,10 +1087,12 @@ export const StoreApiFp = { /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @summary Delete purchase order by ID - * @param orderId ID of the order that needs to be deleted + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - deleteOrder(params: { "orderId": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = StoreApiFetchParamCreator.deleteOrder(params, options); + deleteOrder(orderId: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = StoreApiFetchParamCreator.deleteOrder(orderId, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { @@ -714,6 +1106,8 @@ export const StoreApiFp = { /** * Returns a map of status codes to quantities * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ getInventory(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<{ [key: string]: number; }> { const fetchArgs = StoreApiFetchParamCreator.getInventory(options); @@ -730,10 +1124,12 @@ export const StoreApiFp = { /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @summary Find purchase order by ID - * @param orderId ID of pet that needs to be fetched + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - getOrderById(params: { "orderId": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = StoreApiFetchParamCreator.getOrderById(params, options); + getOrderById(orderId: number, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = StoreApiFetchParamCreator.getOrderById(orderId, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { @@ -747,10 +1143,12 @@ export const StoreApiFp = { /** * * @summary Place an order for a pet - * @param body order placed for purchasing the pet + * @param {Order} body order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - placeOrder(params: { "body"?: Order; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = StoreApiFetchParamCreator.placeOrder(params, options); + placeOrder(body: Order, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = StoreApiFetchParamCreator.placeOrder(body, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { @@ -765,38 +1163,53 @@ export const StoreApiFp = { /** * StoreApi - object-oriented interface + * @export + * @class StoreApi + * @extends {BaseAPI} */ export class StoreApi extends BaseAPI { /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @summary Delete purchase order by ID - * @param orderId ID of the order that needs to be deleted + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi */ - deleteOrder(params: { "orderId": string; }, options?: any) { - return StoreApiFp.deleteOrder(params, options)(this.fetch, this.basePath); + public deleteOrder(orderId: string, options?: any) { + return StoreApiFp.deleteOrder(orderId, options)(this.fetch, this.basePath); } /** * Returns a map of status codes to quantities * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi */ - getInventory(options?: any) { + public getInventory(options?: any) { return StoreApiFp.getInventory(options)(this.fetch, this.basePath); } /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @summary Find purchase order by ID - * @param orderId ID of pet that needs to be fetched + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi */ - getOrderById(params: { "orderId": string; }, options?: any) { - return StoreApiFp.getOrderById(params, options)(this.fetch, this.basePath); + public getOrderById(orderId: number, options?: any) { + return StoreApiFp.getOrderById(orderId, options)(this.fetch, this.basePath); } /** * * @summary Place an order for a pet - * @param body order placed for purchasing the pet + * @param {Order} body order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi */ - placeOrder(params: { "body"?: Order; }, options?: any) { - return StoreApiFp.placeOrder(params, options)(this.fetch, this.basePath); + public placeOrder(body: Order, options?: any) { + return StoreApiFp.placeOrder(body, options)(this.fetch, this.basePath); } }; @@ -808,14 +1221,18 @@ export const StoreApiFactory = function (fetch?: FetchAPI, basePath?: string) { /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @summary Delete purchase order by ID - * @param orderId ID of the order that needs to be deleted + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - deleteOrder(params: { "orderId": string; }, options?: any) { - return StoreApiFp.deleteOrder(params, options)(fetch, basePath); + deleteOrder(orderId: string, options?: any) { + return StoreApiFp.deleteOrder(orderId, options)(fetch, basePath); }, /** * Returns a map of status codes to quantities * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ getInventory(options?: any) { return StoreApiFp.getInventory(options)(fetch, basePath); @@ -823,18 +1240,22 @@ export const StoreApiFactory = function (fetch?: FetchAPI, basePath?: string) { /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @summary Find purchase order by ID - * @param orderId ID of pet that needs to be fetched + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - getOrderById(params: { "orderId": string; }, options?: any) { - return StoreApiFp.getOrderById(params, options)(fetch, basePath); + getOrderById(orderId: number, options?: any) { + return StoreApiFp.getOrderById(orderId, options)(fetch, basePath); }, /** * * @summary Place an order for a pet - * @param body order placed for purchasing the pet + * @param {Order} body order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - placeOrder(params: { "body"?: Order; }, options?: any) { - return StoreApiFp.placeOrder(params, options)(fetch, basePath); + placeOrder(body: Order, options?: any) { + return StoreApiFp.placeOrder(body, options)(fetch, basePath); }, }; }; @@ -847,189 +1268,265 @@ export const UserApiFetchParamCreator = { /** * This can only be done by the logged in user. * @summary Create user - * @param body Created user object + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - createUser(params: { "body"?: User; }, options?: any): FetchArgs { - const baseUrl = `/user`; - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/json" }; - if (params["body"]) { - fetchOptions.body = JSON.stringify(params["body"] || {}); + createUser(body: User, options?: any): FetchArgs { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling createUser.'); } - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); + const path = `/user`; + const urlObj = url.parse(path, true); + const headers = {} as any; + + headers['Content-Type'] = 'application/json'; + + let requestOptions = { + method: 'POST', + headers: headers, + body: body === null ? '' : JSON.stringify(body), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); } + return { url: url.format(urlObj), - options: fetchOptions, + options: requestOptions, }; }, /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param {Array<User>} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - createUsersWithArrayInput(params: { "body"?: Array; }, options?: any): FetchArgs { - const baseUrl = `/user/createWithArray`; - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/json" }; - if (params["body"]) { - fetchOptions.body = JSON.stringify(params["body"] || {}); + createUsersWithArrayInput(body: Array, options?: any): FetchArgs { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); + const path = `/user/createWithArray`; + const urlObj = url.parse(path, true); + const headers = {} as any; + + headers['Content-Type'] = 'application/json'; + + let requestOptions = { + method: 'POST', + headers: headers, + body: body === null ? '' : JSON.stringify(body), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); } + return { url: url.format(urlObj), - options: fetchOptions, + options: requestOptions, }; }, /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param {Array<User>} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - createUsersWithListInput(params: { "body"?: Array; }, options?: any): FetchArgs { - const baseUrl = `/user/createWithList`; - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/json" }; - if (params["body"]) { - fetchOptions.body = JSON.stringify(params["body"] || {}); + createUsersWithListInput(body: Array, options?: any): FetchArgs { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithListInput.'); } - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); + const path = `/user/createWithList`; + const urlObj = url.parse(path, true); + const headers = {} as any; + + headers['Content-Type'] = 'application/json'; + + let requestOptions = { + method: 'POST', + headers: headers, + body: body === null ? '' : JSON.stringify(body), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); } + return { url: url.format(urlObj), - options: fetchOptions, + options: requestOptions, }; }, /** * This can only be done by the logged in user. * @summary Delete user - * @param username The name that needs to be deleted + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - deleteUser(params: { "username": string; }, options?: any): FetchArgs { - // verify required parameter "username" is set - if (params["username"] == null) { - throw new Error("Missing required parameter username when calling deleteUser"); + deleteUser(username: string, options?: any): FetchArgs { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling deleteUser.'); } - const baseUrl = `/user/{username}` - .replace(`{${"username"}}`, `${ params["username"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "DELETE" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); + const path = `/user/{username}` + .replace(`{${"username"}}`, String(username)); + const urlObj = url.parse(path, true); + const headers = {} as any; + + + let requestOptions = { + method: 'DELETE', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); } + return { url: url.format(urlObj), - options: fetchOptions, + options: requestOptions, }; }, /** * * @summary Get user by user name - * @param username The name that needs to be fetched. Use user1 for testing. + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - getUserByName(params: { "username": string; }, options?: any): FetchArgs { - // verify required parameter "username" is set - if (params["username"] == null) { - throw new Error("Missing required parameter username when calling getUserByName"); + getUserByName(username: string, options?: any): FetchArgs { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling getUserByName.'); } - const baseUrl = `/user/{username}` - .replace(`{${"username"}}`, `${ params["username"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); + const path = `/user/{username}` + .replace(`{${"username"}}`, String(username)); + const urlObj = url.parse(path, true); + const headers = {} as any; + + + let requestOptions = { + method: 'GET', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); } + return { url: url.format(urlObj), - options: fetchOptions, + options: requestOptions, }; }, /** * * @summary Logs user into the system - * @param username The user name for login - * @param password The password for login in clear text - */ - loginUser(params: { "username"?: string; "password"?: string; }, options?: any): FetchArgs { - const baseUrl = `/user/login`; - let urlObj = url.parse(baseUrl, true); - urlObj.query = assign({}, urlObj.query, { - "username": params["username"], - "password": params["password"], - }); - let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + loginUser(username: string, password: string, options?: any): FetchArgs { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling loginUser.'); } + // verify required parameter 'password' is not null or undefined + if (password === null || password === undefined) { + throw new RequiredError('password','Required parameter password was null or undefined when calling loginUser.'); + } + const path = `/user/login`; + const urlObj = url.parse(path, true); + const headers = {} as any; + const queryParameters = {} as any; + + if (username !== undefined) { + queryParameters['username'] = username as any; + } + if (password !== undefined) { + queryParameters['password'] = password as any; + } + urlObj.query = Object.assign({}, urlObj.query, queryParameters); + + let requestOptions = { + method: 'GET', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + return { url: url.format(urlObj), - options: fetchOptions, + options: requestOptions, }; }, /** * * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ logoutUser(options?: any): FetchArgs { - const baseUrl = `/user/logout`; - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); + const path = `/user/logout`; + const urlObj = url.parse(path, true); + const headers = {} as any; + - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); + let requestOptions = { + method: 'GET', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); } + return { url: url.format(urlObj), - options: fetchOptions, + options: requestOptions, }; }, /** * This can only be done by the logged in user. * @summary Updated user - * @param username name that need to be deleted - * @param body Updated user object + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - updateUser(params: { "username": string; "body"?: User; }, options?: any): FetchArgs { - // verify required parameter "username" is set - if (params["username"] == null) { - throw new Error("Missing required parameter username when calling updateUser"); + updateUser(username: string, body: User, options?: any): FetchArgs { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling updateUser.'); } - const baseUrl = `/user/{username}` - .replace(`{${"username"}}`, `${ params["username"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "PUT" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/json" }; - if (params["body"]) { - fetchOptions.body = JSON.stringify(params["body"] || {}); + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling updateUser.'); } - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); + const path = `/user/{username}` + .replace(`{${"username"}}`, String(username)); + const urlObj = url.parse(path, true); + const headers = {} as any; + + headers['Content-Type'] = 'application/json'; + + let requestOptions = { + method: 'PUT', + headers: headers, + body: body === null ? '' : JSON.stringify(body), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); } + return { url: url.format(urlObj), - options: fetchOptions, + options: requestOptions, }; }, }; @@ -1041,10 +1538,12 @@ export const UserApiFp = { /** * This can only be done by the logged in user. * @summary Create user - * @param body Created user object + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - createUser(params: { "body"?: User; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator.createUser(params, options); + createUser(body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = UserApiFetchParamCreator.createUser(body, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { @@ -1058,10 +1557,12 @@ export const UserApiFp = { /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param {Array<User>} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - createUsersWithArrayInput(params: { "body"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator.createUsersWithArrayInput(params, options); + createUsersWithArrayInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = UserApiFetchParamCreator.createUsersWithArrayInput(body, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { @@ -1075,10 +1576,12 @@ export const UserApiFp = { /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param {Array<User>} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - createUsersWithListInput(params: { "body"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator.createUsersWithListInput(params, options); + createUsersWithListInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = UserApiFetchParamCreator.createUsersWithListInput(body, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { @@ -1092,10 +1595,12 @@ export const UserApiFp = { /** * This can only be done by the logged in user. * @summary Delete user - * @param username The name that needs to be deleted + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - deleteUser(params: { "username": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator.deleteUser(params, options); + deleteUser(username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = UserApiFetchParamCreator.deleteUser(username, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { @@ -1109,10 +1614,12 @@ export const UserApiFp = { /** * * @summary Get user by user name - * @param username The name that needs to be fetched. Use user1 for testing. + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - getUserByName(params: { "username": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator.getUserByName(params, options); + getUserByName(username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = UserApiFetchParamCreator.getUserByName(username, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { @@ -1126,11 +1633,13 @@ export const UserApiFp = { /** * * @summary Logs user into the system - * @param username The user name for login - * @param password The password for login in clear text + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - loginUser(params: { "username"?: string; "password"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator.loginUser(params, options); + loginUser(username: string, password: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = UserApiFetchParamCreator.loginUser(username, password, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { @@ -1144,6 +1653,8 @@ export const UserApiFp = { /** * * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { const fetchArgs = UserApiFetchParamCreator.logoutUser(options); @@ -1160,11 +1671,13 @@ export const UserApiFp = { /** * This can only be done by the logged in user. * @summary Updated user - * @param username name that need to be deleted - * @param body Updated user object + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - updateUser(params: { "username": string; "body"?: User; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator.updateUser(params, options); + updateUser(username: string, body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = UserApiFetchParamCreator.updateUser(username, body, options); return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { @@ -1179,72 +1692,99 @@ export const UserApiFp = { /** * UserApi - object-oriented interface + * @export + * @class UserApi + * @extends {BaseAPI} */ export class UserApi extends BaseAPI { /** * This can only be done by the logged in user. * @summary Create user - * @param body Created user object + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi */ - createUser(params: { "body"?: User; }, options?: any) { - return UserApiFp.createUser(params, options)(this.fetch, this.basePath); + public createUser(body: User, options?: any) { + return UserApiFp.createUser(body, options)(this.fetch, this.basePath); } /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param {Array<User>} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi */ - createUsersWithArrayInput(params: { "body"?: Array; }, options?: any) { - return UserApiFp.createUsersWithArrayInput(params, options)(this.fetch, this.basePath); + public createUsersWithArrayInput(body: Array, options?: any) { + return UserApiFp.createUsersWithArrayInput(body, options)(this.fetch, this.basePath); } /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param {Array<User>} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi */ - createUsersWithListInput(params: { "body"?: Array; }, options?: any) { - return UserApiFp.createUsersWithListInput(params, options)(this.fetch, this.basePath); + public createUsersWithListInput(body: Array, options?: any) { + return UserApiFp.createUsersWithListInput(body, options)(this.fetch, this.basePath); } /** * This can only be done by the logged in user. * @summary Delete user - * @param username The name that needs to be deleted + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi */ - deleteUser(params: { "username": string; }, options?: any) { - return UserApiFp.deleteUser(params, options)(this.fetch, this.basePath); + public deleteUser(username: string, options?: any) { + return UserApiFp.deleteUser(username, options)(this.fetch, this.basePath); } /** * * @summary Get user by user name - * @param username The name that needs to be fetched. Use user1 for testing. + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi */ - getUserByName(params: { "username": string; }, options?: any) { - return UserApiFp.getUserByName(params, options)(this.fetch, this.basePath); + public getUserByName(username: string, options?: any) { + return UserApiFp.getUserByName(username, options)(this.fetch, this.basePath); } /** * * @summary Logs user into the system - * @param username The user name for login - * @param password The password for login in clear text + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi */ - loginUser(params: { "username"?: string; "password"?: string; }, options?: any) { - return UserApiFp.loginUser(params, options)(this.fetch, this.basePath); + public loginUser(username: string, password: string, options?: any) { + return UserApiFp.loginUser(username, password, options)(this.fetch, this.basePath); } /** * * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi */ - logoutUser(options?: any) { + public logoutUser(options?: any) { return UserApiFp.logoutUser(options)(this.fetch, this.basePath); } /** * This can only be done by the logged in user. * @summary Updated user - * @param username name that need to be deleted - * @param body Updated user object + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi */ - updateUser(params: { "username": string; "body"?: User; }, options?: any) { - return UserApiFp.updateUser(params, options)(this.fetch, this.basePath); + public updateUser(username: string, body: User, options?: any) { + return UserApiFp.updateUser(username, body, options)(this.fetch, this.basePath); } }; @@ -1256,55 +1796,69 @@ export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { /** * This can only be done by the logged in user. * @summary Create user - * @param body Created user object + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - createUser(params: { "body"?: User; }, options?: any) { - return UserApiFp.createUser(params, options)(fetch, basePath); + createUser(body: User, options?: any) { + return UserApiFp.createUser(body, options)(fetch, basePath); }, /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param {Array<User>} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - createUsersWithArrayInput(params: { "body"?: Array; }, options?: any) { - return UserApiFp.createUsersWithArrayInput(params, options)(fetch, basePath); + createUsersWithArrayInput(body: Array, options?: any) { + return UserApiFp.createUsersWithArrayInput(body, options)(fetch, basePath); }, /** * * @summary Creates list of users with given input array - * @param body List of user object + * @param {Array<User>} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - createUsersWithListInput(params: { "body"?: Array; }, options?: any) { - return UserApiFp.createUsersWithListInput(params, options)(fetch, basePath); + createUsersWithListInput(body: Array, options?: any) { + return UserApiFp.createUsersWithListInput(body, options)(fetch, basePath); }, /** * This can only be done by the logged in user. * @summary Delete user - * @param username The name that needs to be deleted + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - deleteUser(params: { "username": string; }, options?: any) { - return UserApiFp.deleteUser(params, options)(fetch, basePath); + deleteUser(username: string, options?: any) { + return UserApiFp.deleteUser(username, options)(fetch, basePath); }, /** * * @summary Get user by user name - * @param username The name that needs to be fetched. Use user1 for testing. + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - getUserByName(params: { "username": string; }, options?: any) { - return UserApiFp.getUserByName(params, options)(fetch, basePath); + getUserByName(username: string, options?: any) { + return UserApiFp.getUserByName(username, options)(fetch, basePath); }, /** * * @summary Logs user into the system - * @param username The user name for login - * @param password The password for login in clear text + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - loginUser(params: { "username"?: string; "password"?: string; }, options?: any) { - return UserApiFp.loginUser(params, options)(fetch, basePath); + loginUser(username: string, password: string, options?: any) { + return UserApiFp.loginUser(username, password, options)(fetch, basePath); }, /** * * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ logoutUser(options?: any) { return UserApiFp.logoutUser(options)(fetch, basePath); @@ -1312,11 +1866,13 @@ export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { /** * This can only be done by the logged in user. * @summary Updated user - * @param username name that need to be deleted - * @param body Updated user object + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} */ - updateUser(params: { "username": string; "body"?: User; }, options?: any) { - return UserApiFp.updateUser(params, options)(fetch, basePath); + updateUser(username: string, body: User, options?: any) { + return UserApiFp.updateUser(username, body, options)(fetch, basePath); }, }; }; diff --git a/samples/client/petstore/typescript-fetch/builds/default/package.json b/samples/client/petstore/typescript-fetch/builds/default/package.json deleted file mode 100644 index 0204e3c39c9..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/default/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "typescript-fetch-api", - "version": "0.0.0", - "license": "Unlicense", - "main": "./dist/api.js", - "browser": "./dist/api.js", - "typings": "./dist/api.d.ts", - "dependencies": { - "core-js": "^2.4.0", - "isomorphic-fetch": "^2.2.1" - }, - "scripts" : { - "prepublish" : "typings install && tsc", - "test": "tslint api.ts" - }, - "devDependencies": { - "tslint": "^3.15.1", - "typescript": "^1.8.10", - "typings": "^1.0.4" - } -} diff --git a/samples/client/petstore/typescript-fetch/builds/default/pom.xml b/samples/client/petstore/typescript-fetch/builds/default/pom.xml deleted file mode 100644 index f7886b3f9aa..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/default/pom.xml +++ /dev/null @@ -1,59 +0,0 @@ - - 4.0.0 - com.wordnik - TypeScriptAngularBuildPestoreClientTests - pom - 1.0-SNAPSHOT - TS Fetch Default Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - npm-install - integration-test - - exec - - - npm - - install - - - - - npm-test - integration-test - - exec - - - npm - - test - - - - - - - - diff --git a/samples/client/petstore/typescript-fetch/builds/default/tslint.json b/samples/client/petstore/typescript-fetch/builds/default/tslint.json deleted file mode 100644 index 6eb02acec8c..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/default/tslint.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "jsRules": { - "class-name": true, - "comment-format": [ - true, - "check-space" - ], - "indent": [ - true, - "spaces" - ], - "no-duplicate-variable": true, - "no-eval": true, - "no-trailing-whitespace": true, - "no-unsafe-finally": true, - "one-line": [ - true, - "check-open-brace", - "check-whitespace" - ], - "quotemark": [ - true, - "double" - ], - "semicolon": [ - true, - "always" - ], - "triple-equals": [ - true, - "allow-null-check" - ], - "variable-name": [ - true, - "ban-keywords" - ], - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type" - ] - }, - "rules": { - "class-name": true, - "comment-format": [ - true, - "check-space" - ], - "indent": [ - true, - "spaces" - ], - "no-eval": true, - "no-internal-module": true, - "no-trailing-whitespace": true, - "no-unsafe-finally": true, - "no-var-keyword": true, - "one-line": [ - true, - "check-open-brace", - "check-whitespace" - ], - "quotemark": [ - true, - "double" - ], - "semicolon": [ - true, - "always" - ], - "triple-equals": [ - true, - "allow-null-check" - ], - "typedef-whitespace": [ - true, - { - "call-signature": "nospace", - "index-signature": "nospace", - "parameter": "nospace", - "property-declaration": "nospace", - "variable-declaration": "nospace" - } - ], - "variable-name": [ - true, - "ban-keywords" - ], - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type" - ] - } -} diff --git a/samples/client/petstore/typescript-fetch/builds/default/typings.json b/samples/client/petstore/typescript-fetch/builds/default/typings.json deleted file mode 100644 index a82ea152b4a..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/default/typings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "version": false, - "dependencies": {}, - "globalDependencies": { - "core-js": "registry:dt/core-js#0.0.0+20160317120654", - "node": "registry:dt/node#4.0.0+20160423143914", - "isomorphic-fetch": "registry:dt/isomorphic-fetch#0.0.0+20160505171433" - } -} diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/.gitignore b/samples/client/petstore/typescript-fetch/builds/es6-target/.gitignore deleted file mode 100644 index 35e2fb2b02e..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -wwwroot/*.js -node_modules -typings diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/.swagger-codegen/VERSION b/samples/client/petstore/typescript-fetch/builds/es6-target/.swagger-codegen/VERSION deleted file mode 100644 index 7fea99011a6..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -2.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/README.md b/samples/client/petstore/typescript-fetch/builds/es6-target/README.md deleted file mode 100644 index 664e1755933..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# TypeScript-Fetch - -This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: - -Environment -* Node.js -* Webpack -* Browserify - -Language level -* ES5 - you must have a Promises/A+ library installed -* ES6 - -Module system -* CommonJS -* ES6 module system - -It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html)) - -### Installation ### - -`swagger-codegen` does not generate JavaScript directly. The generated Node module comes with `package.json` that bundles `typescript` and `typings` so it can self-compile during `prepublish` stage. The should be run automatically during `npm install` or `npm publish`. - -CAVEAT: Due to [privilege implications](https://docs.npmjs.com/misc/scripts#user), `npm` would skip all scripts if the user is `root`. You would need to manually run it with `npm run prepublish` or run `npm install --unsafe-perm`. - -#### NPM #### -You may publish the module to NPM. In this case, you would be able to install the module as any other NPM module. It maybe useful to use [scoped packages](https://docs.npmjs.com/misc/scope). - -You can also use `npm link` to link the module. However, this would not modify `package.json` of the installing project, as such you would need to relink every time you deploy that project. - -You can also directly install the module using `npm install file_path`. If you do `npm install file_path --save`, NPM will save relative path to `package.json`. In this case, `npm install` and `npm shrinkwrap` may misbehave. You would need to manually edit `package.json` and replace it with absolute path. - -Regardless of which method you deployed your NPM module, the ES6 module syntaxes are as follows: -``` -import * as localName from 'npmName'; -import {operationId} from 'npmName'; -``` -The CommonJS syntax is as follows: -``` -import localName = require('npmName'); -``` - -#### Direct copy/symlink #### -You may also simply copy or symlink the generated module into a directory under your project. The syntax of this is as follows: - -With ES6 module syntax, the following syntaxes are supported: -``` -import * as localName from './symlinkDir'; -import {operationId} from './symlinkDir'; -``` -The CommonJS syntax is as follows: -``` -import localName = require('./symlinkDir')'; -``` diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts deleted file mode 100644 index 8e4b73e6c83..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts +++ /dev/null @@ -1,1322 +0,0 @@ -/** - * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@wordnik.com - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -import * as querystring from "querystring"; -import * as url from "url"; - -import * as isomorphicFetch from "isomorphic-fetch"; - -interface Dictionary { [index: string]: T; } -export interface FetchAPI { (url: string, init?: any): Promise; } - -const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ""); - -export interface FetchArgs { - url: string; - options: any; -} - -export class BaseAPI { - basePath: string; - fetch: FetchAPI; - - constructor(fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) { - this.basePath = basePath; - this.fetch = fetch; - } -}; - -export interface Category { - "id"?: number; - "name"?: string; -} - -export interface Order { - "id"?: number; - "petId"?: number; - "quantity"?: number; - "shipDate"?: Date; - /** - * Order Status - */ - "status"?: OrderStatusEnum; - "complete"?: boolean; -} - -export type OrderStatusEnum = "placed" | "approved" | "delivered"; -export interface Pet { - "id"?: number; - "category"?: Category; - "name": string; - "photoUrls": Array; - "tags"?: Array; - /** - * pet status in the store - */ - "status"?: PetStatusEnum; -} - -export type PetStatusEnum = "available" | "pending" | "sold"; -export interface Tag { - "id"?: number; - "name"?: string; -} - -export interface User { - "id"?: number; - "username"?: string; - "firstName"?: string; - "lastName"?: string; - "email"?: string; - "password"?: string; - "phone"?: string; - /** - * User Status - */ - "userStatus"?: number; -} - - - -/** - * PetApi - fetch parameter creator - */ -export const PetApiFetchParamCreator = { - /** - * - * @summary Add a new pet to the store - * @param body Pet object that needs to be added to the store - */ - addPet(params: { "body"?: Pet; }, options?: any): FetchArgs { - const baseUrl = `/pet`; - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = Object.assign({}, { method: "POST" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/json" }; - if (params["body"]) { - fetchOptions.body = JSON.stringify(params["body"] || {}); - } - if (contentTypeHeader) { - fetchOptions.headers = Object.assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * - * @summary Deletes a pet - * @param petId Pet id to delete - * @param apiKey - */ - deletePet(params: { "petId": number; "apiKey"?: string; }, options?: any): FetchArgs { - // verify required parameter "petId" is set - if (params["petId"] == null) { - throw new Error("Missing required parameter petId when calling deletePet"); - } - const baseUrl = `/pet/{petId}` - .replace(`{${"petId"}}`, `${ params["petId"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = Object.assign({}, { method: "DELETE" }, options); - - let contentTypeHeader: Dictionary = {}; - fetchOptions.headers = Object.assign({ - "api_key": params["apiKey"], - }, contentTypeHeader, fetchOptions.headers); - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * Multiple status values can be provided with comma separated strings - * @summary Finds Pets by status - * @param status Status values that need to be considered for filter - */ - findPetsByStatus(params: { "status"?: Array; }, options?: any): FetchArgs { - const baseUrl = `/pet/findByStatus`; - let urlObj = url.parse(baseUrl, true); - urlObj.query = Object.assign({}, urlObj.query, { - "status": params["status"], - }); - let fetchOptions: RequestInit = Object.assign({}, { method: "GET" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = Object.assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @summary Finds Pets by tags - * @param tags Tags to filter by - */ - findPetsByTags(params: { "tags"?: Array; }, options?: any): FetchArgs { - const baseUrl = `/pet/findByTags`; - let urlObj = url.parse(baseUrl, true); - urlObj.query = Object.assign({}, urlObj.query, { - "tags": params["tags"], - }); - let fetchOptions: RequestInit = Object.assign({}, { method: "GET" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = Object.assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @summary Find pet by ID - * @param petId ID of pet that needs to be fetched - */ - getPetById(params: { "petId": number; }, options?: any): FetchArgs { - // verify required parameter "petId" is set - if (params["petId"] == null) { - throw new Error("Missing required parameter petId when calling getPetById"); - } - const baseUrl = `/pet/{petId}` - .replace(`{${"petId"}}`, `${ params["petId"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = Object.assign({}, { method: "GET" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = Object.assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * - * @summary Update an existing pet - * @param body Pet object that needs to be added to the store - */ - updatePet(params: { "body"?: Pet; }, options?: any): FetchArgs { - const baseUrl = `/pet`; - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = Object.assign({}, { method: "PUT" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/json" }; - if (params["body"]) { - fetchOptions.body = JSON.stringify(params["body"] || {}); - } - if (contentTypeHeader) { - fetchOptions.headers = Object.assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * - * @summary Updates a pet in the store with form data - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet - * @param status Updated status of the pet - */ - updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }, options?: any): FetchArgs { - // verify required parameter "petId" is set - if (params["petId"] == null) { - throw new Error("Missing required parameter petId when calling updatePetWithForm"); - } - const baseUrl = `/pet/{petId}` - .replace(`{${"petId"}}`, `${ params["petId"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = Object.assign({}, { method: "POST" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; - fetchOptions.body = querystring.stringify({ - "name": params["name"], - "status": params["status"], - }); - if (contentTypeHeader) { - fetchOptions.headers = Object.assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * - * @summary uploads an image - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload - */ - uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }, options?: any): FetchArgs { - // verify required parameter "petId" is set - if (params["petId"] == null) { - throw new Error("Missing required parameter petId when calling uploadFile"); - } - const baseUrl = `/pet/{petId}/uploadImage` - .replace(`{${"petId"}}`, `${ params["petId"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = Object.assign({}, { method: "POST" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; - fetchOptions.body = querystring.stringify({ - "additionalMetadata": params["additionalMetadata"], - "file": params["file"], - }); - if (contentTypeHeader) { - fetchOptions.headers = Object.assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, -}; - -/** - * PetApi - functional programming interface - */ -export const PetApiFp = { - /** - * - * @summary Add a new pet to the store - * @param body Pet object that needs to be added to the store - */ - addPet(params: { "body"?: Pet; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator.addPet(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Deletes a pet - * @param petId Pet id to delete - * @param apiKey - */ - deletePet(params: { "petId": number; "apiKey"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator.deletePet(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * Multiple status values can be provided with comma separated strings - * @summary Finds Pets by status - * @param status Status values that need to be considered for filter - */ - findPetsByStatus(params: { "status"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { - const fetchArgs = PetApiFetchParamCreator.findPetsByStatus(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } else { - throw response; - } - }); - }; - }, - /** - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @summary Finds Pets by tags - * @param tags Tags to filter by - */ - findPetsByTags(params: { "tags"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { - const fetchArgs = PetApiFetchParamCreator.findPetsByTags(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } else { - throw response; - } - }); - }; - }, - /** - * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @summary Find pet by ID - * @param petId ID of pet that needs to be fetched - */ - getPetById(params: { "petId": number; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator.getPetById(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Update an existing pet - * @param body Pet object that needs to be added to the store - */ - updatePet(params: { "body"?: Pet; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator.updatePet(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Updates a pet in the store with form data - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet - * @param status Updated status of the pet - */ - updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator.updatePetWithForm(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary uploads an image - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload - */ - uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator.uploadFile(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, -}; - -/** - * PetApi - object-oriented interface - */ -export class PetApi extends BaseAPI { - /** - * - * @summary Add a new pet to the store - * @param body Pet object that needs to be added to the store - */ - addPet(params: { "body"?: Pet; }, options?: any) { - return PetApiFp.addPet(params, options)(this.fetch, this.basePath); - } - /** - * - * @summary Deletes a pet - * @param petId Pet id to delete - * @param apiKey - */ - deletePet(params: { "petId": number; "apiKey"?: string; }, options?: any) { - return PetApiFp.deletePet(params, options)(this.fetch, this.basePath); - } - /** - * Multiple status values can be provided with comma separated strings - * @summary Finds Pets by status - * @param status Status values that need to be considered for filter - */ - findPetsByStatus(params: { "status"?: Array; }, options?: any) { - return PetApiFp.findPetsByStatus(params, options)(this.fetch, this.basePath); - } - /** - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @summary Finds Pets by tags - * @param tags Tags to filter by - */ - findPetsByTags(params: { "tags"?: Array; }, options?: any) { - return PetApiFp.findPetsByTags(params, options)(this.fetch, this.basePath); - } - /** - * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @summary Find pet by ID - * @param petId ID of pet that needs to be fetched - */ - getPetById(params: { "petId": number; }, options?: any) { - return PetApiFp.getPetById(params, options)(this.fetch, this.basePath); - } - /** - * - * @summary Update an existing pet - * @param body Pet object that needs to be added to the store - */ - updatePet(params: { "body"?: Pet; }, options?: any) { - return PetApiFp.updatePet(params, options)(this.fetch, this.basePath); - } - /** - * - * @summary Updates a pet in the store with form data - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet - * @param status Updated status of the pet - */ - updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }, options?: any) { - return PetApiFp.updatePetWithForm(params, options)(this.fetch, this.basePath); - } - /** - * - * @summary uploads an image - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload - */ - uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }, options?: any) { - return PetApiFp.uploadFile(params, options)(this.fetch, this.basePath); - } -}; - -/** - * PetApi - factory interface - */ -export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { - return { - /** - * - * @summary Add a new pet to the store - * @param body Pet object that needs to be added to the store - */ - addPet(params: { "body"?: Pet; }, options?: any) { - return PetApiFp.addPet(params, options)(fetch, basePath); - }, - /** - * - * @summary Deletes a pet - * @param petId Pet id to delete - * @param apiKey - */ - deletePet(params: { "petId": number; "apiKey"?: string; }, options?: any) { - return PetApiFp.deletePet(params, options)(fetch, basePath); - }, - /** - * Multiple status values can be provided with comma separated strings - * @summary Finds Pets by status - * @param status Status values that need to be considered for filter - */ - findPetsByStatus(params: { "status"?: Array; }, options?: any) { - return PetApiFp.findPetsByStatus(params, options)(fetch, basePath); - }, - /** - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @summary Finds Pets by tags - * @param tags Tags to filter by - */ - findPetsByTags(params: { "tags"?: Array; }, options?: any) { - return PetApiFp.findPetsByTags(params, options)(fetch, basePath); - }, - /** - * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @summary Find pet by ID - * @param petId ID of pet that needs to be fetched - */ - getPetById(params: { "petId": number; }, options?: any) { - return PetApiFp.getPetById(params, options)(fetch, basePath); - }, - /** - * - * @summary Update an existing pet - * @param body Pet object that needs to be added to the store - */ - updatePet(params: { "body"?: Pet; }, options?: any) { - return PetApiFp.updatePet(params, options)(fetch, basePath); - }, - /** - * - * @summary Updates a pet in the store with form data - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet - * @param status Updated status of the pet - */ - updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }, options?: any) { - return PetApiFp.updatePetWithForm(params, options)(fetch, basePath); - }, - /** - * - * @summary uploads an image - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload - */ - uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }, options?: any) { - return PetApiFp.uploadFile(params, options)(fetch, basePath); - }, - }; -}; - - -/** - * StoreApi - fetch parameter creator - */ -export const StoreApiFetchParamCreator = { - /** - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @summary Delete purchase order by ID - * @param orderId ID of the order that needs to be deleted - */ - deleteOrder(params: { "orderId": string; }, options?: any): FetchArgs { - // verify required parameter "orderId" is set - if (params["orderId"] == null) { - throw new Error("Missing required parameter orderId when calling deleteOrder"); - } - const baseUrl = `/store/order/{orderId}` - .replace(`{${"orderId"}}`, `${ params["orderId"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = Object.assign({}, { method: "DELETE" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = Object.assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * Returns a map of status codes to quantities - * @summary Returns pet inventories by status - */ - getInventory(options?: any): FetchArgs { - const baseUrl = `/store/inventory`; - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = Object.assign({}, { method: "GET" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = Object.assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @summary Find purchase order by ID - * @param orderId ID of pet that needs to be fetched - */ - getOrderById(params: { "orderId": string; }, options?: any): FetchArgs { - // verify required parameter "orderId" is set - if (params["orderId"] == null) { - throw new Error("Missing required parameter orderId when calling getOrderById"); - } - const baseUrl = `/store/order/{orderId}` - .replace(`{${"orderId"}}`, `${ params["orderId"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = Object.assign({}, { method: "GET" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = Object.assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * - * @summary Place an order for a pet - * @param body order placed for purchasing the pet - */ - placeOrder(params: { "body"?: Order; }, options?: any): FetchArgs { - const baseUrl = `/store/order`; - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = Object.assign({}, { method: "POST" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/json" }; - if (params["body"]) { - fetchOptions.body = JSON.stringify(params["body"] || {}); - } - if (contentTypeHeader) { - fetchOptions.headers = Object.assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, -}; - -/** - * StoreApi - functional programming interface - */ -export const StoreApiFp = { - /** - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @summary Delete purchase order by ID - * @param orderId ID of the order that needs to be deleted - */ - deleteOrder(params: { "orderId": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = StoreApiFetchParamCreator.deleteOrder(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * Returns a map of status codes to quantities - * @summary Returns pet inventories by status - */ - getInventory(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<{ [key: string]: number; }> { - const fetchArgs = StoreApiFetchParamCreator.getInventory(options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } else { - throw response; - } - }); - }; - }, - /** - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @summary Find purchase order by ID - * @param orderId ID of pet that needs to be fetched - */ - getOrderById(params: { "orderId": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = StoreApiFetchParamCreator.getOrderById(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Place an order for a pet - * @param body order placed for purchasing the pet - */ - placeOrder(params: { "body"?: Order; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = StoreApiFetchParamCreator.placeOrder(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } else { - throw response; - } - }); - }; - }, -}; - -/** - * StoreApi - object-oriented interface - */ -export class StoreApi extends BaseAPI { - /** - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @summary Delete purchase order by ID - * @param orderId ID of the order that needs to be deleted - */ - deleteOrder(params: { "orderId": string; }, options?: any) { - return StoreApiFp.deleteOrder(params, options)(this.fetch, this.basePath); - } - /** - * Returns a map of status codes to quantities - * @summary Returns pet inventories by status - */ - getInventory(options?: any) { - return StoreApiFp.getInventory(options)(this.fetch, this.basePath); - } - /** - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @summary Find purchase order by ID - * @param orderId ID of pet that needs to be fetched - */ - getOrderById(params: { "orderId": string; }, options?: any) { - return StoreApiFp.getOrderById(params, options)(this.fetch, this.basePath); - } - /** - * - * @summary Place an order for a pet - * @param body order placed for purchasing the pet - */ - placeOrder(params: { "body"?: Order; }, options?: any) { - return StoreApiFp.placeOrder(params, options)(this.fetch, this.basePath); - } -}; - -/** - * StoreApi - factory interface - */ -export const StoreApiFactory = function (fetch?: FetchAPI, basePath?: string) { - return { - /** - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @summary Delete purchase order by ID - * @param orderId ID of the order that needs to be deleted - */ - deleteOrder(params: { "orderId": string; }, options?: any) { - return StoreApiFp.deleteOrder(params, options)(fetch, basePath); - }, - /** - * Returns a map of status codes to quantities - * @summary Returns pet inventories by status - */ - getInventory(options?: any) { - return StoreApiFp.getInventory(options)(fetch, basePath); - }, - /** - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @summary Find purchase order by ID - * @param orderId ID of pet that needs to be fetched - */ - getOrderById(params: { "orderId": string; }, options?: any) { - return StoreApiFp.getOrderById(params, options)(fetch, basePath); - }, - /** - * - * @summary Place an order for a pet - * @param body order placed for purchasing the pet - */ - placeOrder(params: { "body"?: Order; }, options?: any) { - return StoreApiFp.placeOrder(params, options)(fetch, basePath); - }, - }; -}; - - -/** - * UserApi - fetch parameter creator - */ -export const UserApiFetchParamCreator = { - /** - * This can only be done by the logged in user. - * @summary Create user - * @param body Created user object - */ - createUser(params: { "body"?: User; }, options?: any): FetchArgs { - const baseUrl = `/user`; - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = Object.assign({}, { method: "POST" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/json" }; - if (params["body"]) { - fetchOptions.body = JSON.stringify(params["body"] || {}); - } - if (contentTypeHeader) { - fetchOptions.headers = Object.assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * - * @summary Creates list of users with given input array - * @param body List of user object - */ - createUsersWithArrayInput(params: { "body"?: Array; }, options?: any): FetchArgs { - const baseUrl = `/user/createWithArray`; - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = Object.assign({}, { method: "POST" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/json" }; - if (params["body"]) { - fetchOptions.body = JSON.stringify(params["body"] || {}); - } - if (contentTypeHeader) { - fetchOptions.headers = Object.assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * - * @summary Creates list of users with given input array - * @param body List of user object - */ - createUsersWithListInput(params: { "body"?: Array; }, options?: any): FetchArgs { - const baseUrl = `/user/createWithList`; - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = Object.assign({}, { method: "POST" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/json" }; - if (params["body"]) { - fetchOptions.body = JSON.stringify(params["body"] || {}); - } - if (contentTypeHeader) { - fetchOptions.headers = Object.assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * This can only be done by the logged in user. - * @summary Delete user - * @param username The name that needs to be deleted - */ - deleteUser(params: { "username": string; }, options?: any): FetchArgs { - // verify required parameter "username" is set - if (params["username"] == null) { - throw new Error("Missing required parameter username when calling deleteUser"); - } - const baseUrl = `/user/{username}` - .replace(`{${"username"}}`, `${ params["username"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = Object.assign({}, { method: "DELETE" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = Object.assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * - * @summary Get user by user name - * @param username The name that needs to be fetched. Use user1 for testing. - */ - getUserByName(params: { "username": string; }, options?: any): FetchArgs { - // verify required parameter "username" is set - if (params["username"] == null) { - throw new Error("Missing required parameter username when calling getUserByName"); - } - const baseUrl = `/user/{username}` - .replace(`{${"username"}}`, `${ params["username"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = Object.assign({}, { method: "GET" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = Object.assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * - * @summary Logs user into the system - * @param username The user name for login - * @param password The password for login in clear text - */ - loginUser(params: { "username"?: string; "password"?: string; }, options?: any): FetchArgs { - const baseUrl = `/user/login`; - let urlObj = url.parse(baseUrl, true); - urlObj.query = Object.assign({}, urlObj.query, { - "username": params["username"], - "password": params["password"], - }); - let fetchOptions: RequestInit = Object.assign({}, { method: "GET" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = Object.assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * - * @summary Logs out current logged in user session - */ - logoutUser(options?: any): FetchArgs { - const baseUrl = `/user/logout`; - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = Object.assign({}, { method: "GET" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = Object.assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * This can only be done by the logged in user. - * @summary Updated user - * @param username name that need to be deleted - * @param body Updated user object - */ - updateUser(params: { "username": string; "body"?: User; }, options?: any): FetchArgs { - // verify required parameter "username" is set - if (params["username"] == null) { - throw new Error("Missing required parameter username when calling updateUser"); - } - const baseUrl = `/user/{username}` - .replace(`{${"username"}}`, `${ params["username"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = Object.assign({}, { method: "PUT" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/json" }; - if (params["body"]) { - fetchOptions.body = JSON.stringify(params["body"] || {}); - } - if (contentTypeHeader) { - fetchOptions.headers = Object.assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, -}; - -/** - * UserApi - functional programming interface - */ -export const UserApiFp = { - /** - * This can only be done by the logged in user. - * @summary Create user - * @param body Created user object - */ - createUser(params: { "body"?: User; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator.createUser(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Creates list of users with given input array - * @param body List of user object - */ - createUsersWithArrayInput(params: { "body"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator.createUsersWithArrayInput(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Creates list of users with given input array - * @param body List of user object - */ - createUsersWithListInput(params: { "body"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator.createUsersWithListInput(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * This can only be done by the logged in user. - * @summary Delete user - * @param username The name that needs to be deleted - */ - deleteUser(params: { "username": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator.deleteUser(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Get user by user name - * @param username The name that needs to be fetched. Use user1 for testing. - */ - getUserByName(params: { "username": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator.getUserByName(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Logs user into the system - * @param username The user name for login - * @param password The password for login in clear text - */ - loginUser(params: { "username"?: string; "password"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator.loginUser(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Logs out current logged in user session - */ - logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator.logoutUser(options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * This can only be done by the logged in user. - * @summary Updated user - * @param username name that need to be deleted - * @param body Updated user object - */ - updateUser(params: { "username": string; "body"?: User; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator.updateUser(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, -}; - -/** - * UserApi - object-oriented interface - */ -export class UserApi extends BaseAPI { - /** - * This can only be done by the logged in user. - * @summary Create user - * @param body Created user object - */ - createUser(params: { "body"?: User; }, options?: any) { - return UserApiFp.createUser(params, options)(this.fetch, this.basePath); - } - /** - * - * @summary Creates list of users with given input array - * @param body List of user object - */ - createUsersWithArrayInput(params: { "body"?: Array; }, options?: any) { - return UserApiFp.createUsersWithArrayInput(params, options)(this.fetch, this.basePath); - } - /** - * - * @summary Creates list of users with given input array - * @param body List of user object - */ - createUsersWithListInput(params: { "body"?: Array; }, options?: any) { - return UserApiFp.createUsersWithListInput(params, options)(this.fetch, this.basePath); - } - /** - * This can only be done by the logged in user. - * @summary Delete user - * @param username The name that needs to be deleted - */ - deleteUser(params: { "username": string; }, options?: any) { - return UserApiFp.deleteUser(params, options)(this.fetch, this.basePath); - } - /** - * - * @summary Get user by user name - * @param username The name that needs to be fetched. Use user1 for testing. - */ - getUserByName(params: { "username": string; }, options?: any) { - return UserApiFp.getUserByName(params, options)(this.fetch, this.basePath); - } - /** - * - * @summary Logs user into the system - * @param username The user name for login - * @param password The password for login in clear text - */ - loginUser(params: { "username"?: string; "password"?: string; }, options?: any) { - return UserApiFp.loginUser(params, options)(this.fetch, this.basePath); - } - /** - * - * @summary Logs out current logged in user session - */ - logoutUser(options?: any) { - return UserApiFp.logoutUser(options)(this.fetch, this.basePath); - } - /** - * This can only be done by the logged in user. - * @summary Updated user - * @param username name that need to be deleted - * @param body Updated user object - */ - updateUser(params: { "username": string; "body"?: User; }, options?: any) { - return UserApiFp.updateUser(params, options)(this.fetch, this.basePath); - } -}; - -/** - * UserApi - factory interface - */ -export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { - return { - /** - * This can only be done by the logged in user. - * @summary Create user - * @param body Created user object - */ - createUser(params: { "body"?: User; }, options?: any) { - return UserApiFp.createUser(params, options)(fetch, basePath); - }, - /** - * - * @summary Creates list of users with given input array - * @param body List of user object - */ - createUsersWithArrayInput(params: { "body"?: Array; }, options?: any) { - return UserApiFp.createUsersWithArrayInput(params, options)(fetch, basePath); - }, - /** - * - * @summary Creates list of users with given input array - * @param body List of user object - */ - createUsersWithListInput(params: { "body"?: Array; }, options?: any) { - return UserApiFp.createUsersWithListInput(params, options)(fetch, basePath); - }, - /** - * This can only be done by the logged in user. - * @summary Delete user - * @param username The name that needs to be deleted - */ - deleteUser(params: { "username": string; }, options?: any) { - return UserApiFp.deleteUser(params, options)(fetch, basePath); - }, - /** - * - * @summary Get user by user name - * @param username The name that needs to be fetched. Use user1 for testing. - */ - getUserByName(params: { "username": string; }, options?: any) { - return UserApiFp.getUserByName(params, options)(fetch, basePath); - }, - /** - * - * @summary Logs user into the system - * @param username The user name for login - * @param password The password for login in clear text - */ - loginUser(params: { "username"?: string; "password"?: string; }, options?: any) { - return UserApiFp.loginUser(params, options)(fetch, basePath); - }, - /** - * - * @summary Logs out current logged in user session - */ - logoutUser(options?: any) { - return UserApiFp.logoutUser(options)(fetch, basePath); - }, - /** - * This can only be done by the logged in user. - * @summary Updated user - * @param username name that need to be deleted - * @param body Updated user object - */ - updateUser(params: { "username": string; "body"?: User; }, options?: any) { - return UserApiFp.updateUser(params, options)(fetch, basePath); - }, - }; -}; - diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/git_push.sh b/samples/client/petstore/typescript-fetch/builds/es6-target/git_push.sh deleted file mode 100644 index ed374619b13..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/git_push.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/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' - diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/package.json b/samples/client/petstore/typescript-fetch/builds/es6-target/package.json deleted file mode 100644 index 9797e3483f9..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "typescript-fetch-api", - "version": "0.0.0", - "license": "Unlicense", - "main": "./dist/api.js", - "browser": "./dist/api.js", - "typings": "./dist/api.d.ts", - "dependencies": { - "isomorphic-fetch": "^2.2.1" - }, - "scripts" : { - "prepublish" : "typings install && tsc", - "test": "tslint api.ts" - }, - "devDependencies": { - "tslint": "^3.15.1", - "typescript": "^1.8.10", - "typings": "^1.0.4" - } -} diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/tslint.json b/samples/client/petstore/typescript-fetch/builds/es6-target/tslint.json deleted file mode 100644 index 6eb02acec8c..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/tslint.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "jsRules": { - "class-name": true, - "comment-format": [ - true, - "check-space" - ], - "indent": [ - true, - "spaces" - ], - "no-duplicate-variable": true, - "no-eval": true, - "no-trailing-whitespace": true, - "no-unsafe-finally": true, - "one-line": [ - true, - "check-open-brace", - "check-whitespace" - ], - "quotemark": [ - true, - "double" - ], - "semicolon": [ - true, - "always" - ], - "triple-equals": [ - true, - "allow-null-check" - ], - "variable-name": [ - true, - "ban-keywords" - ], - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type" - ] - }, - "rules": { - "class-name": true, - "comment-format": [ - true, - "check-space" - ], - "indent": [ - true, - "spaces" - ], - "no-eval": true, - "no-internal-module": true, - "no-trailing-whitespace": true, - "no-unsafe-finally": true, - "no-var-keyword": true, - "one-line": [ - true, - "check-open-brace", - "check-whitespace" - ], - "quotemark": [ - true, - "double" - ], - "semicolon": [ - true, - "always" - ], - "triple-equals": [ - true, - "allow-null-check" - ], - "typedef-whitespace": [ - true, - { - "call-signature": "nospace", - "index-signature": "nospace", - "parameter": "nospace", - "property-declaration": "nospace", - "variable-declaration": "nospace" - } - ], - "variable-name": [ - true, - "ban-keywords" - ], - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type" - ] - } -} diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/typings.json b/samples/client/petstore/typescript-fetch/builds/es6-target/typings.json deleted file mode 100644 index 2ec50862694..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/typings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "version": false, - "dependencies": {}, - "globalDependencies": { - "node": "registry:dt/node#4.0.0+20160423143914", - "isomorphic-fetch": "registry:dt/isomorphic-fetch#0.0.0+20160505171433" - } -} diff --git a/samples/client/petstore-security-test/typescript-fetch/.gitignore b/samples/client/petstore/typescript-fetch/builds/es6/.gitignore similarity index 100% rename from samples/client/petstore-security-test/typescript-fetch/.gitignore rename to samples/client/petstore/typescript-fetch/builds/es6/.gitignore diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/.swagger-codegen-ignore b/samples/client/petstore/typescript-fetch/builds/es6/.swagger-codegen-ignore similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/.swagger-codegen-ignore rename to samples/client/petstore/typescript-fetch/builds/es6/.swagger-codegen-ignore diff --git a/samples/client/petstore/typescript-fetch/builds/es6/.swagger-codegen/VERSION b/samples/client/petstore/typescript-fetch/builds/es6/.swagger-codegen/VERSION new file mode 100644 index 00000000000..6b4d1577382 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/es6/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.2.3 \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/es6/README.md b/samples/client/petstore/typescript-fetch/builds/es6/README.md new file mode 100644 index 00000000000..5f980bcb095 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/es6/README.md @@ -0,0 +1,45 @@ +## @swagger/typescript-fetch-petstore@0.0.1-SNAPSHOT.201707180154 + +This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: + +Environment +* Node.js +* Webpack +* Browserify + +Language level +* ES5 - you must have a Promises/A+ library installed +* ES6 + +Module system +* CommonJS +* ES6 module system + +It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html)) + +### Building + +To build an compile the typescript sources to javascript use: +``` +npm install +npm run build +``` + +### publishing + +First build the package than run ```npm publish``` + +### consuming + +navigate to the folder of your consuming project and run one of next commando's. + +_published:_ + +``` +npm install @swagger/typescript-fetch-petstore@0.0.1-SNAPSHOT.201707180154 --save +``` + +_unPublished (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE --save \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/es6/api.ts b/samples/client/petstore/typescript-fetch/builds/es6/api.ts new file mode 100644 index 00000000000..0e01c3ca21c --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/es6/api.ts @@ -0,0 +1,1879 @@ +// tslint:disable +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +import * as url from "url"; +import * as isomorphicFetch from "isomorphic-fetch"; + +const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ""); + +/** + * + * @export + * @interface FetchAPI + */ +export interface FetchAPI { + (url: string, init?: any): Promise; +} + +/** + * + * @export + * @interface FetchArgs + */ +export interface FetchArgs { + url: string; + options: any; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + constructor(public basePath: string = BASE_PATH, public fetch: FetchAPI = isomorphicFetch) { + } +}; + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + name: "RequiredError" + constructor(public field: string, msg?: string) { + super(msg); + } +} + +/** + * Describes the result of uploading an image resource + * @export + * @interface ApiResponse + */ +export interface ApiResponse { + /** + * + * @type {number} + * @memberof ApiResponse + */ + code?: number; + /** + * + * @type {string} + * @memberof ApiResponse + */ + type?: string; + /** + * + * @type {string} + * @memberof ApiResponse + */ + message?: string; +} + +/** + * A category for a pet + * @export + * @interface Category + */ +export interface Category { + /** + * + * @type {number} + * @memberof Category + */ + id?: number; + /** + * + * @type {string} + * @memberof Category + */ + name?: string; +} + +/** + * An order for a pets from the pet store + * @export + * @interface Order + */ +export interface Order { + /** + * + * @type {number} + * @memberof Order + */ + id?: number; + /** + * + * @type {number} + * @memberof Order + */ + petId?: number; + /** + * + * @type {number} + * @memberof Order + */ + quantity?: number; + /** + * + * @type {Date} + * @memberof Order + */ + shipDate?: Date; + /** + * Order Status + * @type {string} + * @memberof Order + */ + status?: Order.StatusEnum; + /** + * + * @type {boolean} + * @memberof Order + */ + complete?: boolean; +} + +/** + * @export + * @namespace Order + */ +export namespace Order { + /** + * @export + * @enum {string} + */ + export enum StatusEnum { + Placed = 'placed', + Approved = 'approved', + Delivered = 'delivered' + } +} + +/** + * A pet for sale in the pet store + * @export + * @interface Pet + */ +export interface Pet { + /** + * + * @type {number} + * @memberof Pet + */ + id?: number; + /** + * + * @type {Category} + * @memberof Pet + */ + category?: Category; + /** + * + * @type {string} + * @memberof Pet + */ + name: string; + /** + * + * @type {Array<string>} + * @memberof Pet + */ + photoUrls: Array; + /** + * + * @type {Array<Tag>} + * @memberof Pet + */ + tags?: Array; + /** + * pet status in the store + * @type {string} + * @memberof Pet + */ + status?: Pet.StatusEnum; +} + +/** + * @export + * @namespace Pet + */ +export namespace Pet { + /** + * @export + * @enum {string} + */ + export enum StatusEnum { + Available = 'available', + Pending = 'pending', + Sold = 'sold' + } +} + +/** + * A tag for a pet + * @export + * @interface Tag + */ +export interface Tag { + /** + * + * @type {number} + * @memberof Tag + */ + id?: number; + /** + * + * @type {string} + * @memberof Tag + */ + name?: string; +} + +/** + * A User who is purchasing from the pet store + * @export + * @interface User + */ +export interface User { + /** + * + * @type {number} + * @memberof User + */ + id?: number; + /** + * + * @type {string} + * @memberof User + */ + username?: string; + /** + * + * @type {string} + * @memberof User + */ + firstName?: string; + /** + * + * @type {string} + * @memberof User + */ + lastName?: string; + /** + * + * @type {string} + * @memberof User + */ + email?: string; + /** + * + * @type {string} + * @memberof User + */ + password?: string; + /** + * + * @type {string} + * @memberof User + */ + phone?: string; + /** + * User Status + * @type {number} + * @memberof User + */ + userStatus?: number; +} + + +/** + * PetApi - fetch parameter creator + */ +export const PetApiFetchParamCreator = { + /** + * + * @summary Add a new pet to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addPet(body: Pet, options?: any): FetchArgs { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling addPet.'); + } + const path = `/pet`; + const urlObj = url.parse(path, true); + const headers = {} as any; + + headers['Content-Type'] = 'application/json'; + + let requestOptions = { + method: 'POST', + headers: headers, + body: body === null ? '' : JSON.stringify(body), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePet(petId: number, apiKey?: string, options?: any): FetchArgs { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling deletePet.'); + } + const path = `/pet/{petId}` + .replace(`{${"petId"}}`, String(petId)); + const urlObj = url.parse(path, true); + const headers = {} as any; + + if (apiKey !== undefined && apiKey !== null) { + headers['api_key'] = String(apiKey); + } + + let requestOptions = { + method: 'DELETE', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<string>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByStatus(status: Array, options?: any): FetchArgs { + // verify required parameter 'status' is not null or undefined + if (status === null || status === undefined) { + throw new RequiredError('status','Required parameter status was null or undefined when calling findPetsByStatus.'); + } + const path = `/pet/findByStatus`; + const urlObj = url.parse(path, true); + const headers = {} as any; + const queryParameters = {} as any; + + if (status) { + queryParameters['status'] = status.join(','); + } + urlObj.query = Object.assign({}, urlObj.query, queryParameters); + + let requestOptions = { + method: 'GET', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array<string>} tags Tags to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByTags(tags: Array, options?: any): FetchArgs { + // verify required parameter 'tags' is not null or undefined + if (tags === null || tags === undefined) { + throw new RequiredError('tags','Required parameter tags was null or undefined when calling findPetsByTags.'); + } + const path = `/pet/findByTags`; + const urlObj = url.parse(path, true); + const headers = {} as any; + const queryParameters = {} as any; + + if (tags) { + queryParameters['tags'] = tags.join(','); + } + urlObj.query = Object.assign({}, urlObj.query, queryParameters); + + let requestOptions = { + method: 'GET', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPetById(petId: number, options?: any): FetchArgs { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling getPetById.'); + } + const path = `/pet/{petId}` + .replace(`{${"petId"}}`, String(petId)); + const urlObj = url.parse(path, true); + const headers = {} as any; + + + let requestOptions = { + method: 'GET', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * + * @summary Update an existing pet + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePet(body: Pet, options?: any): FetchArgs { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling updatePet.'); + } + const path = `/pet`; + const urlObj = url.parse(path, true); + const headers = {} as any; + + headers['Content-Type'] = 'application/json'; + + let requestOptions = { + method: 'PUT', + headers: headers, + body: body === null ? '' : JSON.stringify(body), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): FetchArgs { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling updatePetWithForm.'); + } + const path = `/pet/{petId}` + .replace(`{${"petId"}}`, String(petId)); + const urlObj = url.parse(path, true); + const headers = {} as any; + const formParams = new url.URLSearchParams(); + + if (name !== undefined) { + formParams.set('name', name); + } + + if (status !== undefined) { + formParams.set('status', status); + } + + headers['Content-Type'] = 'application/x-www-form-urlencoded'; + + let requestOptions = { + method: 'POST', + headers: headers, + body: formParams.toString(), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): FetchArgs { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling uploadFile.'); + } + const path = `/pet/{petId}/uploadImage` + .replace(`{${"petId"}}`, String(petId)); + const urlObj = url.parse(path, true); + const headers = {} as any; + const formParams = new url.URLSearchParams(); + + if (additionalMetadata !== undefined) { + formParams.set('additionalMetadata', additionalMetadata); + } + + if (file !== undefined) { + formParams.set('file', file); + } + + headers['Content-Type'] = 'application/x-www-form-urlencoded'; + + let requestOptions = { + method: 'POST', + headers: headers, + body: formParams.toString(), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, +}; + +/** + * PetApi - functional programming interface + */ +export const PetApiFp = { + /** + * + * @summary Add a new pet to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addPet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = PetApiFetchParamCreator.addPet(body, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePet(petId: number, apiKey?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = PetApiFetchParamCreator.deletePet(petId, apiKey, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }; + }, + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<string>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByStatus(status: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { + const fetchArgs = PetApiFetchParamCreator.findPetsByStatus(status, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array<string>} tags Tags to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByTags(tags: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { + const fetchArgs = PetApiFetchParamCreator.findPetsByTags(tags, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPetById(petId: number, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = PetApiFetchParamCreator.getPetById(petId, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Update an existing pet + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = PetApiFetchParamCreator.updatePet(body, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = PetApiFetchParamCreator.updatePetWithForm(petId, name, status, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = PetApiFetchParamCreator.uploadFile(petId, additionalMetadata, file, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, +}; + +/** + * PetApi - object-oriented interface + * @export + * @class PetApi + * @extends {BaseAPI} + */ +export class PetApi extends BaseAPI { + /** + * + * @summary Add a new pet to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public addPet(body: Pet, options?: any) { + return PetApiFp.addPet(body, options)(this.fetch, this.basePath); + } + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public deletePet(petId: number, apiKey?: string, options?: any) { + return PetApiFp.deletePet(petId, apiKey, options)(this.fetch, this.basePath); + } + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<string>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public findPetsByStatus(status: Array, options?: any) { + return PetApiFp.findPetsByStatus(status, options)(this.fetch, this.basePath); + } + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array<string>} tags Tags to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public findPetsByTags(tags: Array, options?: any) { + return PetApiFp.findPetsByTags(tags, options)(this.fetch, this.basePath); + } + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public getPetById(petId: number, options?: any) { + return PetApiFp.getPetById(petId, options)(this.fetch, this.basePath); + } + /** + * + * @summary Update an existing pet + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public updatePet(body: Pet, options?: any) { + return PetApiFp.updatePet(body, options)(this.fetch, this.basePath); + } + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public updatePetWithForm(petId: number, name?: string, status?: string, options?: any) { + return PetApiFp.updatePetWithForm(petId, name, status, options)(this.fetch, this.basePath); + } + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any) { + return PetApiFp.uploadFile(petId, additionalMetadata, file, options)(this.fetch, this.basePath); + } +}; + +/** + * PetApi - factory interface + */ +export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { + return { + /** + * + * @summary Add a new pet to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addPet(body: Pet, options?: any) { + return PetApiFp.addPet(body, options)(fetch, basePath); + }, + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePet(petId: number, apiKey?: string, options?: any) { + return PetApiFp.deletePet(petId, apiKey, options)(fetch, basePath); + }, + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<string>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByStatus(status: Array, options?: any) { + return PetApiFp.findPetsByStatus(status, options)(fetch, basePath); + }, + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array<string>} tags Tags to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByTags(tags: Array, options?: any) { + return PetApiFp.findPetsByTags(tags, options)(fetch, basePath); + }, + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPetById(petId: number, options?: any) { + return PetApiFp.getPetById(petId, options)(fetch, basePath); + }, + /** + * + * @summary Update an existing pet + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePet(body: Pet, options?: any) { + return PetApiFp.updatePet(body, options)(fetch, basePath); + }, + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePetWithForm(petId: number, name?: string, status?: string, options?: any) { + return PetApiFp.updatePetWithForm(petId, name, status, options)(fetch, basePath); + }, + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any) { + return PetApiFp.uploadFile(petId, additionalMetadata, file, options)(fetch, basePath); + }, + }; +}; + + +/** + * StoreApi - fetch parameter creator + */ +export const StoreApiFetchParamCreator = { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteOrder(orderId: string, options?: any): FetchArgs { + // verify required parameter 'orderId' is not null or undefined + if (orderId === null || orderId === undefined) { + throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling deleteOrder.'); + } + const path = `/store/order/{orderId}` + .replace(`{${"orderId"}}`, String(orderId)); + const urlObj = url.parse(path, true); + const headers = {} as any; + + + let requestOptions = { + method: 'DELETE', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInventory(options?: any): FetchArgs { + const path = `/store/inventory`; + const urlObj = url.parse(path, true); + const headers = {} as any; + + + let requestOptions = { + method: 'GET', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrderById(orderId: number, options?: any): FetchArgs { + // verify required parameter 'orderId' is not null or undefined + if (orderId === null || orderId === undefined) { + throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling getOrderById.'); + } + const path = `/store/order/{orderId}` + .replace(`{${"orderId"}}`, String(orderId)); + const urlObj = url.parse(path, true); + const headers = {} as any; + + + let requestOptions = { + method: 'GET', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * + * @summary Place an order for a pet + * @param {Order} body order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + placeOrder(body: Order, options?: any): FetchArgs { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling placeOrder.'); + } + const path = `/store/order`; + const urlObj = url.parse(path, true); + const headers = {} as any; + + headers['Content-Type'] = 'application/json'; + + let requestOptions = { + method: 'POST', + headers: headers, + body: body === null ? '' : JSON.stringify(body), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, +}; + +/** + * StoreApi - functional programming interface + */ +export const StoreApiFp = { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteOrder(orderId: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = StoreApiFetchParamCreator.deleteOrder(orderId, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }; + }, + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInventory(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<{ [key: string]: number; }> { + const fetchArgs = StoreApiFetchParamCreator.getInventory(options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrderById(orderId: number, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = StoreApiFetchParamCreator.getOrderById(orderId, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Place an order for a pet + * @param {Order} body order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + placeOrder(body: Order, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = StoreApiFetchParamCreator.placeOrder(body, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, +}; + +/** + * StoreApi - object-oriented interface + * @export + * @class StoreApi + * @extends {BaseAPI} + */ +export class StoreApi extends BaseAPI { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public deleteOrder(orderId: string, options?: any) { + return StoreApiFp.deleteOrder(orderId, options)(this.fetch, this.basePath); + } + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public getInventory(options?: any) { + return StoreApiFp.getInventory(options)(this.fetch, this.basePath); + } + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public getOrderById(orderId: number, options?: any) { + return StoreApiFp.getOrderById(orderId, options)(this.fetch, this.basePath); + } + /** + * + * @summary Place an order for a pet + * @param {Order} body order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public placeOrder(body: Order, options?: any) { + return StoreApiFp.placeOrder(body, options)(this.fetch, this.basePath); + } +}; + +/** + * StoreApi - factory interface + */ +export const StoreApiFactory = function (fetch?: FetchAPI, basePath?: string) { + return { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteOrder(orderId: string, options?: any) { + return StoreApiFp.deleteOrder(orderId, options)(fetch, basePath); + }, + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInventory(options?: any) { + return StoreApiFp.getInventory(options)(fetch, basePath); + }, + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrderById(orderId: number, options?: any) { + return StoreApiFp.getOrderById(orderId, options)(fetch, basePath); + }, + /** + * + * @summary Place an order for a pet + * @param {Order} body order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + placeOrder(body: Order, options?: any) { + return StoreApiFp.placeOrder(body, options)(fetch, basePath); + }, + }; +}; + + +/** + * UserApi - fetch parameter creator + */ +export const UserApiFetchParamCreator = { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUser(body: User, options?: any): FetchArgs { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling createUser.'); + } + const path = `/user`; + const urlObj = url.parse(path, true); + const headers = {} as any; + + headers['Content-Type'] = 'application/json'; + + let requestOptions = { + method: 'POST', + headers: headers, + body: body === null ? '' : JSON.stringify(body), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array<User>} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithArrayInput(body: Array, options?: any): FetchArgs { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + } + const path = `/user/createWithArray`; + const urlObj = url.parse(path, true); + const headers = {} as any; + + headers['Content-Type'] = 'application/json'; + + let requestOptions = { + method: 'POST', + headers: headers, + body: body === null ? '' : JSON.stringify(body), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array<User>} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithListInput(body: Array, options?: any): FetchArgs { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithListInput.'); + } + const path = `/user/createWithList`; + const urlObj = url.parse(path, true); + const headers = {} as any; + + headers['Content-Type'] = 'application/json'; + + let requestOptions = { + method: 'POST', + headers: headers, + body: body === null ? '' : JSON.stringify(body), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteUser(username: string, options?: any): FetchArgs { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling deleteUser.'); + } + const path = `/user/{username}` + .replace(`{${"username"}}`, String(username)); + const urlObj = url.parse(path, true); + const headers = {} as any; + + + let requestOptions = { + method: 'DELETE', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getUserByName(username: string, options?: any): FetchArgs { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling getUserByName.'); + } + const path = `/user/{username}` + .replace(`{${"username"}}`, String(username)); + const urlObj = url.parse(path, true); + const headers = {} as any; + + + let requestOptions = { + method: 'GET', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + loginUser(username: string, password: string, options?: any): FetchArgs { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling loginUser.'); + } + // verify required parameter 'password' is not null or undefined + if (password === null || password === undefined) { + throw new RequiredError('password','Required parameter password was null or undefined when calling loginUser.'); + } + const path = `/user/login`; + const urlObj = url.parse(path, true); + const headers = {} as any; + const queryParameters = {} as any; + + if (username !== undefined) { + queryParameters['username'] = username as any; + } + if (password !== undefined) { + queryParameters['password'] = password as any; + } + urlObj.query = Object.assign({}, urlObj.query, queryParameters); + + let requestOptions = { + method: 'GET', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + logoutUser(options?: any): FetchArgs { + const path = `/user/logout`; + const urlObj = url.parse(path, true); + const headers = {} as any; + + + let requestOptions = { + method: 'GET', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateUser(username: string, body: User, options?: any): FetchArgs { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling updateUser.'); + } + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling updateUser.'); + } + const path = `/user/{username}` + .replace(`{${"username"}}`, String(username)); + const urlObj = url.parse(path, true); + const headers = {} as any; + + headers['Content-Type'] = 'application/json'; + + let requestOptions = { + method: 'PUT', + headers: headers, + body: body === null ? '' : JSON.stringify(body), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, +}; + +/** + * UserApi - functional programming interface + */ +export const UserApiFp = { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUser(body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = UserApiFetchParamCreator.createUser(body, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array<User>} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithArrayInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = UserApiFetchParamCreator.createUsersWithArrayInput(body, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array<User>} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithListInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = UserApiFetchParamCreator.createUsersWithListInput(body, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }; + }, + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteUser(username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = UserApiFetchParamCreator.deleteUser(username, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getUserByName(username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = UserApiFetchParamCreator.getUserByName(username, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + loginUser(username: string, password: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = UserApiFetchParamCreator.loginUser(username, password, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = UserApiFetchParamCreator.logoutUser(options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }; + }, + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateUser(username: string, body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = UserApiFetchParamCreator.updateUser(username, body, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }; + }, +}; + +/** + * UserApi - object-oriented interface + * @export + * @class UserApi + * @extends {BaseAPI} + */ +export class UserApi extends BaseAPI { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public createUser(body: User, options?: any) { + return UserApiFp.createUser(body, options)(this.fetch, this.basePath); + } + /** + * + * @summary Creates list of users with given input array + * @param {Array<User>} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public createUsersWithArrayInput(body: Array, options?: any) { + return UserApiFp.createUsersWithArrayInput(body, options)(this.fetch, this.basePath); + } + /** + * + * @summary Creates list of users with given input array + * @param {Array<User>} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public createUsersWithListInput(body: Array, options?: any) { + return UserApiFp.createUsersWithListInput(body, options)(this.fetch, this.basePath); + } + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public deleteUser(username: string, options?: any) { + return UserApiFp.deleteUser(username, options)(this.fetch, this.basePath); + } + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public getUserByName(username: string, options?: any) { + return UserApiFp.getUserByName(username, options)(this.fetch, this.basePath); + } + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public loginUser(username: string, password: string, options?: any) { + return UserApiFp.loginUser(username, password, options)(this.fetch, this.basePath); + } + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public logoutUser(options?: any) { + return UserApiFp.logoutUser(options)(this.fetch, this.basePath); + } + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public updateUser(username: string, body: User, options?: any) { + return UserApiFp.updateUser(username, body, options)(this.fetch, this.basePath); + } +}; + +/** + * UserApi - factory interface + */ +export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { + return { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUser(body: User, options?: any) { + return UserApiFp.createUser(body, options)(fetch, basePath); + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array<User>} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithArrayInput(body: Array, options?: any) { + return UserApiFp.createUsersWithArrayInput(body, options)(fetch, basePath); + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array<User>} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithListInput(body: Array, options?: any) { + return UserApiFp.createUsersWithListInput(body, options)(fetch, basePath); + }, + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteUser(username: string, options?: any) { + return UserApiFp.deleteUser(username, options)(fetch, basePath); + }, + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getUserByName(username: string, options?: any) { + return UserApiFp.getUserByName(username, options)(fetch, basePath); + }, + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + loginUser(username: string, password: string, options?: any) { + return UserApiFp.loginUser(username, password, options)(fetch, basePath); + }, + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + logoutUser(options?: any) { + return UserApiFp.logoutUser(options)(fetch, basePath); + }, + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateUser(username: string, body: User, options?: any) { + return UserApiFp.updateUser(username, body, options)(fetch, basePath); + }, + }; +}; + diff --git a/samples/client/petstore-security-test/typescript-fetch/git_push.sh b/samples/client/petstore/typescript-fetch/builds/es6/git_push.sh similarity index 100% rename from samples/client/petstore-security-test/typescript-fetch/git_push.sh rename to samples/client/petstore/typescript-fetch/builds/es6/git_push.sh diff --git a/samples/client/petstore/typescript-fetch/builds/es6/package.json b/samples/client/petstore/typescript-fetch/builds/es6/package.json new file mode 100644 index 00000000000..1b215122bb7 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/es6/package.json @@ -0,0 +1,30 @@ +{ + "name": "@swagger/typescript-fetch-petstore", + "version": "0.0.1-SNAPSHOT.201707180154", + "description": "swagger client for @swagger/typescript-fetch-petstore", + "author": "Swagger Codegen Contributors", + "keywords": [ + "fetch", + "typescript", + "swagger-client", + "@swagger/typescript-fetch-petstore" + ], + "license": "Unlicense", + "main": "./dist/api.js", + "typings": "./dist/api.d.ts", + "scripts" : { + "build": "tsc --outDir dist/", + "postinstall": "npm run build" + }, + "dependencies": { + "isomorphic-fetch": "^2.2.1", + "@types/isomorphic-fetch": "0.0.33", + "@types/node": "^8.0.9" + }, + "devDependencies": { + "typescript": "^2.0" + }, + "publishConfig":{ + "registry":"https://skimdb.npmjs.com/registry" + } +} diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/pom.xml b/samples/client/petstore/typescript-fetch/builds/es6/pom.xml similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/pom.xml rename to samples/client/petstore/typescript-fetch/builds/es6/pom.xml diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/tsconfig.json b/samples/client/petstore/typescript-fetch/builds/es6/tsconfig.json similarity index 61% rename from samples/client/petstore/typescript-fetch/builds/es6-target/tsconfig.json rename to samples/client/petstore/typescript-fetch/builds/es6/tsconfig.json index 06a8e0437b9..0eb23e488b2 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/tsconfig.json +++ b/samples/client/petstore/typescript-fetch/builds/es6/tsconfig.json @@ -5,13 +5,9 @@ "module": "commonjs", "noImplicitAny": true, "outDir": "dist", - "rootDir": "." - }, + "rootDir": "." }, "exclude": [ "dist", - "node_modules", - "typings/browser", - "typings/main", - "typings/main.d.ts" + "node_modules" ] } diff --git a/samples/client/petstore/typescript-fetch/builds/default/.gitignore b/samples/client/petstore/typescript-fetch/builds/npm/.gitignore similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/.gitignore rename to samples/client/petstore/typescript-fetch/builds/npm/.gitignore diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.swagger-codegen-ignore b/samples/client/petstore/typescript-fetch/builds/npm/.swagger-codegen-ignore similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/.swagger-codegen-ignore rename to samples/client/petstore/typescript-fetch/builds/npm/.swagger-codegen-ignore diff --git a/samples/client/petstore/typescript-fetch/builds/npm/.swagger-codegen/VERSION b/samples/client/petstore/typescript-fetch/builds/npm/.swagger-codegen/VERSION new file mode 100644 index 00000000000..6b4d1577382 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/npm/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.2.3 \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/npm/README.md b/samples/client/petstore/typescript-fetch/builds/npm/README.md new file mode 100644 index 00000000000..236109a8d53 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/npm/README.md @@ -0,0 +1,45 @@ +## @swagger/typescript-fetch-petstore@0.0.1 + +This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: + +Environment +* Node.js +* Webpack +* Browserify + +Language level +* ES5 - you must have a Promises/A+ library installed +* ES6 + +Module system +* CommonJS +* ES6 module system + +It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html)) + +### Building + +To build an compile the typescript sources to javascript use: +``` +npm install +npm run build +``` + +### publishing + +First build the package than run ```npm publish``` + +### consuming + +navigate to the folder of your consuming project and run one of next commando's. + +_published:_ + +``` +npm install @swagger/typescript-fetch-petstore@0.0.1 --save +``` + +_unPublished (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE --save \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/npm/api.ts b/samples/client/petstore/typescript-fetch/builds/npm/api.ts new file mode 100644 index 00000000000..0e01c3ca21c --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/npm/api.ts @@ -0,0 +1,1879 @@ +// tslint:disable +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +import * as url from "url"; +import * as isomorphicFetch from "isomorphic-fetch"; + +const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ""); + +/** + * + * @export + * @interface FetchAPI + */ +export interface FetchAPI { + (url: string, init?: any): Promise; +} + +/** + * + * @export + * @interface FetchArgs + */ +export interface FetchArgs { + url: string; + options: any; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + constructor(public basePath: string = BASE_PATH, public fetch: FetchAPI = isomorphicFetch) { + } +}; + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + name: "RequiredError" + constructor(public field: string, msg?: string) { + super(msg); + } +} + +/** + * Describes the result of uploading an image resource + * @export + * @interface ApiResponse + */ +export interface ApiResponse { + /** + * + * @type {number} + * @memberof ApiResponse + */ + code?: number; + /** + * + * @type {string} + * @memberof ApiResponse + */ + type?: string; + /** + * + * @type {string} + * @memberof ApiResponse + */ + message?: string; +} + +/** + * A category for a pet + * @export + * @interface Category + */ +export interface Category { + /** + * + * @type {number} + * @memberof Category + */ + id?: number; + /** + * + * @type {string} + * @memberof Category + */ + name?: string; +} + +/** + * An order for a pets from the pet store + * @export + * @interface Order + */ +export interface Order { + /** + * + * @type {number} + * @memberof Order + */ + id?: number; + /** + * + * @type {number} + * @memberof Order + */ + petId?: number; + /** + * + * @type {number} + * @memberof Order + */ + quantity?: number; + /** + * + * @type {Date} + * @memberof Order + */ + shipDate?: Date; + /** + * Order Status + * @type {string} + * @memberof Order + */ + status?: Order.StatusEnum; + /** + * + * @type {boolean} + * @memberof Order + */ + complete?: boolean; +} + +/** + * @export + * @namespace Order + */ +export namespace Order { + /** + * @export + * @enum {string} + */ + export enum StatusEnum { + Placed = 'placed', + Approved = 'approved', + Delivered = 'delivered' + } +} + +/** + * A pet for sale in the pet store + * @export + * @interface Pet + */ +export interface Pet { + /** + * + * @type {number} + * @memberof Pet + */ + id?: number; + /** + * + * @type {Category} + * @memberof Pet + */ + category?: Category; + /** + * + * @type {string} + * @memberof Pet + */ + name: string; + /** + * + * @type {Array<string>} + * @memberof Pet + */ + photoUrls: Array; + /** + * + * @type {Array<Tag>} + * @memberof Pet + */ + tags?: Array; + /** + * pet status in the store + * @type {string} + * @memberof Pet + */ + status?: Pet.StatusEnum; +} + +/** + * @export + * @namespace Pet + */ +export namespace Pet { + /** + * @export + * @enum {string} + */ + export enum StatusEnum { + Available = 'available', + Pending = 'pending', + Sold = 'sold' + } +} + +/** + * A tag for a pet + * @export + * @interface Tag + */ +export interface Tag { + /** + * + * @type {number} + * @memberof Tag + */ + id?: number; + /** + * + * @type {string} + * @memberof Tag + */ + name?: string; +} + +/** + * A User who is purchasing from the pet store + * @export + * @interface User + */ +export interface User { + /** + * + * @type {number} + * @memberof User + */ + id?: number; + /** + * + * @type {string} + * @memberof User + */ + username?: string; + /** + * + * @type {string} + * @memberof User + */ + firstName?: string; + /** + * + * @type {string} + * @memberof User + */ + lastName?: string; + /** + * + * @type {string} + * @memberof User + */ + email?: string; + /** + * + * @type {string} + * @memberof User + */ + password?: string; + /** + * + * @type {string} + * @memberof User + */ + phone?: string; + /** + * User Status + * @type {number} + * @memberof User + */ + userStatus?: number; +} + + +/** + * PetApi - fetch parameter creator + */ +export const PetApiFetchParamCreator = { + /** + * + * @summary Add a new pet to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addPet(body: Pet, options?: any): FetchArgs { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling addPet.'); + } + const path = `/pet`; + const urlObj = url.parse(path, true); + const headers = {} as any; + + headers['Content-Type'] = 'application/json'; + + let requestOptions = { + method: 'POST', + headers: headers, + body: body === null ? '' : JSON.stringify(body), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePet(petId: number, apiKey?: string, options?: any): FetchArgs { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling deletePet.'); + } + const path = `/pet/{petId}` + .replace(`{${"petId"}}`, String(petId)); + const urlObj = url.parse(path, true); + const headers = {} as any; + + if (apiKey !== undefined && apiKey !== null) { + headers['api_key'] = String(apiKey); + } + + let requestOptions = { + method: 'DELETE', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<string>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByStatus(status: Array, options?: any): FetchArgs { + // verify required parameter 'status' is not null or undefined + if (status === null || status === undefined) { + throw new RequiredError('status','Required parameter status was null or undefined when calling findPetsByStatus.'); + } + const path = `/pet/findByStatus`; + const urlObj = url.parse(path, true); + const headers = {} as any; + const queryParameters = {} as any; + + if (status) { + queryParameters['status'] = status.join(','); + } + urlObj.query = Object.assign({}, urlObj.query, queryParameters); + + let requestOptions = { + method: 'GET', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array<string>} tags Tags to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByTags(tags: Array, options?: any): FetchArgs { + // verify required parameter 'tags' is not null or undefined + if (tags === null || tags === undefined) { + throw new RequiredError('tags','Required parameter tags was null or undefined when calling findPetsByTags.'); + } + const path = `/pet/findByTags`; + const urlObj = url.parse(path, true); + const headers = {} as any; + const queryParameters = {} as any; + + if (tags) { + queryParameters['tags'] = tags.join(','); + } + urlObj.query = Object.assign({}, urlObj.query, queryParameters); + + let requestOptions = { + method: 'GET', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPetById(petId: number, options?: any): FetchArgs { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling getPetById.'); + } + const path = `/pet/{petId}` + .replace(`{${"petId"}}`, String(petId)); + const urlObj = url.parse(path, true); + const headers = {} as any; + + + let requestOptions = { + method: 'GET', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * + * @summary Update an existing pet + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePet(body: Pet, options?: any): FetchArgs { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling updatePet.'); + } + const path = `/pet`; + const urlObj = url.parse(path, true); + const headers = {} as any; + + headers['Content-Type'] = 'application/json'; + + let requestOptions = { + method: 'PUT', + headers: headers, + body: body === null ? '' : JSON.stringify(body), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): FetchArgs { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling updatePetWithForm.'); + } + const path = `/pet/{petId}` + .replace(`{${"petId"}}`, String(petId)); + const urlObj = url.parse(path, true); + const headers = {} as any; + const formParams = new url.URLSearchParams(); + + if (name !== undefined) { + formParams.set('name', name); + } + + if (status !== undefined) { + formParams.set('status', status); + } + + headers['Content-Type'] = 'application/x-www-form-urlencoded'; + + let requestOptions = { + method: 'POST', + headers: headers, + body: formParams.toString(), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): FetchArgs { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling uploadFile.'); + } + const path = `/pet/{petId}/uploadImage` + .replace(`{${"petId"}}`, String(petId)); + const urlObj = url.parse(path, true); + const headers = {} as any; + const formParams = new url.URLSearchParams(); + + if (additionalMetadata !== undefined) { + formParams.set('additionalMetadata', additionalMetadata); + } + + if (file !== undefined) { + formParams.set('file', file); + } + + headers['Content-Type'] = 'application/x-www-form-urlencoded'; + + let requestOptions = { + method: 'POST', + headers: headers, + body: formParams.toString(), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, +}; + +/** + * PetApi - functional programming interface + */ +export const PetApiFp = { + /** + * + * @summary Add a new pet to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addPet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = PetApiFetchParamCreator.addPet(body, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePet(petId: number, apiKey?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = PetApiFetchParamCreator.deletePet(petId, apiKey, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }; + }, + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<string>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByStatus(status: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { + const fetchArgs = PetApiFetchParamCreator.findPetsByStatus(status, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array<string>} tags Tags to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByTags(tags: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { + const fetchArgs = PetApiFetchParamCreator.findPetsByTags(tags, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPetById(petId: number, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = PetApiFetchParamCreator.getPetById(petId, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Update an existing pet + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = PetApiFetchParamCreator.updatePet(body, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = PetApiFetchParamCreator.updatePetWithForm(petId, name, status, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = PetApiFetchParamCreator.uploadFile(petId, additionalMetadata, file, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, +}; + +/** + * PetApi - object-oriented interface + * @export + * @class PetApi + * @extends {BaseAPI} + */ +export class PetApi extends BaseAPI { + /** + * + * @summary Add a new pet to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public addPet(body: Pet, options?: any) { + return PetApiFp.addPet(body, options)(this.fetch, this.basePath); + } + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public deletePet(petId: number, apiKey?: string, options?: any) { + return PetApiFp.deletePet(petId, apiKey, options)(this.fetch, this.basePath); + } + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<string>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public findPetsByStatus(status: Array, options?: any) { + return PetApiFp.findPetsByStatus(status, options)(this.fetch, this.basePath); + } + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array<string>} tags Tags to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public findPetsByTags(tags: Array, options?: any) { + return PetApiFp.findPetsByTags(tags, options)(this.fetch, this.basePath); + } + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public getPetById(petId: number, options?: any) { + return PetApiFp.getPetById(petId, options)(this.fetch, this.basePath); + } + /** + * + * @summary Update an existing pet + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public updatePet(body: Pet, options?: any) { + return PetApiFp.updatePet(body, options)(this.fetch, this.basePath); + } + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public updatePetWithForm(petId: number, name?: string, status?: string, options?: any) { + return PetApiFp.updatePetWithForm(petId, name, status, options)(this.fetch, this.basePath); + } + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any) { + return PetApiFp.uploadFile(petId, additionalMetadata, file, options)(this.fetch, this.basePath); + } +}; + +/** + * PetApi - factory interface + */ +export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { + return { + /** + * + * @summary Add a new pet to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addPet(body: Pet, options?: any) { + return PetApiFp.addPet(body, options)(fetch, basePath); + }, + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePet(petId: number, apiKey?: string, options?: any) { + return PetApiFp.deletePet(petId, apiKey, options)(fetch, basePath); + }, + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<string>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByStatus(status: Array, options?: any) { + return PetApiFp.findPetsByStatus(status, options)(fetch, basePath); + }, + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array<string>} tags Tags to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByTags(tags: Array, options?: any) { + return PetApiFp.findPetsByTags(tags, options)(fetch, basePath); + }, + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPetById(petId: number, options?: any) { + return PetApiFp.getPetById(petId, options)(fetch, basePath); + }, + /** + * + * @summary Update an existing pet + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePet(body: Pet, options?: any) { + return PetApiFp.updatePet(body, options)(fetch, basePath); + }, + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePetWithForm(petId: number, name?: string, status?: string, options?: any) { + return PetApiFp.updatePetWithForm(petId, name, status, options)(fetch, basePath); + }, + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any) { + return PetApiFp.uploadFile(petId, additionalMetadata, file, options)(fetch, basePath); + }, + }; +}; + + +/** + * StoreApi - fetch parameter creator + */ +export const StoreApiFetchParamCreator = { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteOrder(orderId: string, options?: any): FetchArgs { + // verify required parameter 'orderId' is not null or undefined + if (orderId === null || orderId === undefined) { + throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling deleteOrder.'); + } + const path = `/store/order/{orderId}` + .replace(`{${"orderId"}}`, String(orderId)); + const urlObj = url.parse(path, true); + const headers = {} as any; + + + let requestOptions = { + method: 'DELETE', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInventory(options?: any): FetchArgs { + const path = `/store/inventory`; + const urlObj = url.parse(path, true); + const headers = {} as any; + + + let requestOptions = { + method: 'GET', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrderById(orderId: number, options?: any): FetchArgs { + // verify required parameter 'orderId' is not null or undefined + if (orderId === null || orderId === undefined) { + throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling getOrderById.'); + } + const path = `/store/order/{orderId}` + .replace(`{${"orderId"}}`, String(orderId)); + const urlObj = url.parse(path, true); + const headers = {} as any; + + + let requestOptions = { + method: 'GET', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * + * @summary Place an order for a pet + * @param {Order} body order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + placeOrder(body: Order, options?: any): FetchArgs { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling placeOrder.'); + } + const path = `/store/order`; + const urlObj = url.parse(path, true); + const headers = {} as any; + + headers['Content-Type'] = 'application/json'; + + let requestOptions = { + method: 'POST', + headers: headers, + body: body === null ? '' : JSON.stringify(body), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, +}; + +/** + * StoreApi - functional programming interface + */ +export const StoreApiFp = { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteOrder(orderId: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = StoreApiFetchParamCreator.deleteOrder(orderId, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }; + }, + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInventory(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<{ [key: string]: number; }> { + const fetchArgs = StoreApiFetchParamCreator.getInventory(options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrderById(orderId: number, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = StoreApiFetchParamCreator.getOrderById(orderId, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Place an order for a pet + * @param {Order} body order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + placeOrder(body: Order, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = StoreApiFetchParamCreator.placeOrder(body, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, +}; + +/** + * StoreApi - object-oriented interface + * @export + * @class StoreApi + * @extends {BaseAPI} + */ +export class StoreApi extends BaseAPI { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public deleteOrder(orderId: string, options?: any) { + return StoreApiFp.deleteOrder(orderId, options)(this.fetch, this.basePath); + } + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public getInventory(options?: any) { + return StoreApiFp.getInventory(options)(this.fetch, this.basePath); + } + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public getOrderById(orderId: number, options?: any) { + return StoreApiFp.getOrderById(orderId, options)(this.fetch, this.basePath); + } + /** + * + * @summary Place an order for a pet + * @param {Order} body order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public placeOrder(body: Order, options?: any) { + return StoreApiFp.placeOrder(body, options)(this.fetch, this.basePath); + } +}; + +/** + * StoreApi - factory interface + */ +export const StoreApiFactory = function (fetch?: FetchAPI, basePath?: string) { + return { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteOrder(orderId: string, options?: any) { + return StoreApiFp.deleteOrder(orderId, options)(fetch, basePath); + }, + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInventory(options?: any) { + return StoreApiFp.getInventory(options)(fetch, basePath); + }, + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrderById(orderId: number, options?: any) { + return StoreApiFp.getOrderById(orderId, options)(fetch, basePath); + }, + /** + * + * @summary Place an order for a pet + * @param {Order} body order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + placeOrder(body: Order, options?: any) { + return StoreApiFp.placeOrder(body, options)(fetch, basePath); + }, + }; +}; + + +/** + * UserApi - fetch parameter creator + */ +export const UserApiFetchParamCreator = { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUser(body: User, options?: any): FetchArgs { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling createUser.'); + } + const path = `/user`; + const urlObj = url.parse(path, true); + const headers = {} as any; + + headers['Content-Type'] = 'application/json'; + + let requestOptions = { + method: 'POST', + headers: headers, + body: body === null ? '' : JSON.stringify(body), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array<User>} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithArrayInput(body: Array, options?: any): FetchArgs { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + } + const path = `/user/createWithArray`; + const urlObj = url.parse(path, true); + const headers = {} as any; + + headers['Content-Type'] = 'application/json'; + + let requestOptions = { + method: 'POST', + headers: headers, + body: body === null ? '' : JSON.stringify(body), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array<User>} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithListInput(body: Array, options?: any): FetchArgs { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithListInput.'); + } + const path = `/user/createWithList`; + const urlObj = url.parse(path, true); + const headers = {} as any; + + headers['Content-Type'] = 'application/json'; + + let requestOptions = { + method: 'POST', + headers: headers, + body: body === null ? '' : JSON.stringify(body), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteUser(username: string, options?: any): FetchArgs { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling deleteUser.'); + } + const path = `/user/{username}` + .replace(`{${"username"}}`, String(username)); + const urlObj = url.parse(path, true); + const headers = {} as any; + + + let requestOptions = { + method: 'DELETE', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getUserByName(username: string, options?: any): FetchArgs { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling getUserByName.'); + } + const path = `/user/{username}` + .replace(`{${"username"}}`, String(username)); + const urlObj = url.parse(path, true); + const headers = {} as any; + + + let requestOptions = { + method: 'GET', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + loginUser(username: string, password: string, options?: any): FetchArgs { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling loginUser.'); + } + // verify required parameter 'password' is not null or undefined + if (password === null || password === undefined) { + throw new RequiredError('password','Required parameter password was null or undefined when calling loginUser.'); + } + const path = `/user/login`; + const urlObj = url.parse(path, true); + const headers = {} as any; + const queryParameters = {} as any; + + if (username !== undefined) { + queryParameters['username'] = username as any; + } + if (password !== undefined) { + queryParameters['password'] = password as any; + } + urlObj.query = Object.assign({}, urlObj.query, queryParameters); + + let requestOptions = { + method: 'GET', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + logoutUser(options?: any): FetchArgs { + const path = `/user/logout`; + const urlObj = url.parse(path, true); + const headers = {} as any; + + + let requestOptions = { + method: 'GET', + headers: headers, + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateUser(username: string, body: User, options?: any): FetchArgs { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling updateUser.'); + } + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling updateUser.'); + } + const path = `/user/{username}` + .replace(`{${"username"}}`, String(username)); + const urlObj = url.parse(path, true); + const headers = {} as any; + + headers['Content-Type'] = 'application/json'; + + let requestOptions = { + method: 'PUT', + headers: headers, + body: body === null ? '' : JSON.stringify(body), + } as any; + if (options) { + requestOptions = Object.assign(requestOptions, options); + } + + return { + url: url.format(urlObj), + options: requestOptions, + }; + }, +}; + +/** + * UserApi - functional programming interface + */ +export const UserApiFp = { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUser(body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = UserApiFetchParamCreator.createUser(body, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array<User>} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithArrayInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = UserApiFetchParamCreator.createUsersWithArrayInput(body, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array<User>} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithListInput(body: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = UserApiFetchParamCreator.createUsersWithListInput(body, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }; + }, + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteUser(username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = UserApiFetchParamCreator.deleteUser(username, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getUserByName(username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = UserApiFetchParamCreator.getUserByName(username, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + loginUser(username: string, password: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = UserApiFetchParamCreator.loginUser(username, password, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.json(); + } else { + throw response; + } + }); + }; + }, + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = UserApiFetchParamCreator.logoutUser(options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }; + }, + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateUser(username: string, body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { + const fetchArgs = UserApiFetchParamCreator.updateUser(username, body, options); + return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { + return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { + if (response.status >= 200 && response.status < 300) { + return response; + } else { + throw response; + } + }); + }; + }, +}; + +/** + * UserApi - object-oriented interface + * @export + * @class UserApi + * @extends {BaseAPI} + */ +export class UserApi extends BaseAPI { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public createUser(body: User, options?: any) { + return UserApiFp.createUser(body, options)(this.fetch, this.basePath); + } + /** + * + * @summary Creates list of users with given input array + * @param {Array<User>} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public createUsersWithArrayInput(body: Array, options?: any) { + return UserApiFp.createUsersWithArrayInput(body, options)(this.fetch, this.basePath); + } + /** + * + * @summary Creates list of users with given input array + * @param {Array<User>} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public createUsersWithListInput(body: Array, options?: any) { + return UserApiFp.createUsersWithListInput(body, options)(this.fetch, this.basePath); + } + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public deleteUser(username: string, options?: any) { + return UserApiFp.deleteUser(username, options)(this.fetch, this.basePath); + } + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public getUserByName(username: string, options?: any) { + return UserApiFp.getUserByName(username, options)(this.fetch, this.basePath); + } + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public loginUser(username: string, password: string, options?: any) { + return UserApiFp.loginUser(username, password, options)(this.fetch, this.basePath); + } + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public logoutUser(options?: any) { + return UserApiFp.logoutUser(options)(this.fetch, this.basePath); + } + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public updateUser(username: string, body: User, options?: any) { + return UserApiFp.updateUser(username, body, options)(this.fetch, this.basePath); + } +}; + +/** + * UserApi - factory interface + */ +export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { + return { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUser(body: User, options?: any) { + return UserApiFp.createUser(body, options)(fetch, basePath); + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array<User>} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithArrayInput(body: Array, options?: any) { + return UserApiFp.createUsersWithArrayInput(body, options)(fetch, basePath); + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array<User>} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithListInput(body: Array, options?: any) { + return UserApiFp.createUsersWithListInput(body, options)(fetch, basePath); + }, + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteUser(username: string, options?: any) { + return UserApiFp.deleteUser(username, options)(fetch, basePath); + }, + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getUserByName(username: string, options?: any) { + return UserApiFp.getUserByName(username, options)(fetch, basePath); + }, + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + loginUser(username: string, password: string, options?: any) { + return UserApiFp.loginUser(username, password, options)(fetch, basePath); + }, + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + logoutUser(options?: any) { + return UserApiFp.logoutUser(options)(fetch, basePath); + }, + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateUser(username: string, body: User, options?: any) { + return UserApiFp.updateUser(username, body, options)(fetch, basePath); + }, + }; +}; + diff --git a/samples/client/petstore/typescript-fetch/builds/default/git_push.sh b/samples/client/petstore/typescript-fetch/builds/npm/git_push.sh similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/git_push.sh rename to samples/client/petstore/typescript-fetch/builds/npm/git_push.sh diff --git a/samples/client/petstore/typescript-fetch/builds/npm/package.json b/samples/client/petstore/typescript-fetch/builds/npm/package.json new file mode 100644 index 00000000000..63d62013bab --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/npm/package.json @@ -0,0 +1,30 @@ +{ + "name": "@swagger/typescript-fetch-petstore", + "version": "0.0.1", + "description": "swagger client for @swagger/typescript-fetch-petstore", + "author": "Swagger Codegen Contributors", + "keywords": [ + "fetch", + "typescript", + "swagger-client", + "@swagger/typescript-fetch-petstore" + ], + "license": "Unlicense", + "main": "./dist/api.js", + "typings": "./dist/api.d.ts", + "scripts" : { + "build": "tsc --outDir dist/", + "postinstall": "npm run build" + }, + "dependencies": { + "isomorphic-fetch": "^2.2.1", + "@types/isomorphic-fetch": "0.0.33", + "@types/node": "^8.0.9" + }, + "devDependencies": { + "typescript": "^2.0" + }, + "publishConfig":{ + "registry":"https://skimdb.npmjs.com/registry" + } +} diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/pom.xml b/samples/client/petstore/typescript-fetch/builds/npm/pom.xml similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/pom.xml rename to samples/client/petstore/typescript-fetch/builds/npm/pom.xml diff --git a/samples/client/petstore/typescript-fetch/builds/default/tsconfig.json b/samples/client/petstore/typescript-fetch/builds/npm/tsconfig.json similarity index 63% rename from samples/client/petstore/typescript-fetch/builds/default/tsconfig.json rename to samples/client/petstore/typescript-fetch/builds/npm/tsconfig.json index 72ff2567206..8d30e0ab5c7 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/tsconfig.json +++ b/samples/client/petstore/typescript-fetch/builds/npm/tsconfig.json @@ -5,13 +5,13 @@ "module": "commonjs", "noImplicitAny": true, "outDir": "dist", - "rootDir": "." + "rootDir": ".", + "lib": [ + "es6" + ] }, "exclude": [ "dist", - "node_modules", - "typings/browser", - "typings/main", - "typings/main.d.ts" + "node_modules" ] } diff --git a/samples/client/petstore/typescript-fetch/builds/npm/yarn.lock b/samples/client/petstore/typescript-fetch/builds/npm/yarn.lock new file mode 100644 index 00000000000..853225c316d --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/npm/yarn.lock @@ -0,0 +1,47 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@types/isomorphic-fetch@0.0.33": + version "0.0.33" + resolved "https://registry.yarnpkg.com/@types/isomorphic-fetch/-/isomorphic-fetch-0.0.33.tgz#3ea1b86f8b73e6a7430d01d4dbd5b1f63fd72718" + +"@types/node@^8.0.9": + version "8.0.13" + resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.13.tgz#530f0f9254209b0335bf5cc6387822594ef47093" + +encoding@^0.1.11: + version "0.1.12" + resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" + dependencies: + iconv-lite "~0.4.13" + +iconv-lite@~0.4.13: + version "0.4.18" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.18.tgz#23d8656b16aae6742ac29732ea8f0336a4789cf2" + +is-stream@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + +isomorphic-fetch@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" + dependencies: + node-fetch "^1.0.1" + whatwg-fetch ">=0.10.0" + +node-fetch@^1.0.1: + version "1.7.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.1.tgz#899cb3d0a3c92f952c47f1b876f4c8aeabd400d5" + dependencies: + encoding "^0.1.11" + is-stream "^1.0.1" + +typescript@^2.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.4.1.tgz#c3ccb16ddaa0b2314de031e7e6fee89e5ba346bc" + +whatwg-fetch@>=0.10.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84" diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.gitignore b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.gitignore deleted file mode 100644 index 35e2fb2b02e..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -wwwroot/*.js -node_modules -typings diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.swagger-codegen/VERSION b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.swagger-codegen/VERSION deleted file mode 100644 index 7fea99011a6..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -2.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/README.md b/samples/client/petstore/typescript-fetch/builds/with-npm-version/README.md deleted file mode 100644 index 664e1755933..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# TypeScript-Fetch - -This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: - -Environment -* Node.js -* Webpack -* Browserify - -Language level -* ES5 - you must have a Promises/A+ library installed -* ES6 - -Module system -* CommonJS -* ES6 module system - -It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html)) - -### Installation ### - -`swagger-codegen` does not generate JavaScript directly. The generated Node module comes with `package.json` that bundles `typescript` and `typings` so it can self-compile during `prepublish` stage. The should be run automatically during `npm install` or `npm publish`. - -CAVEAT: Due to [privilege implications](https://docs.npmjs.com/misc/scripts#user), `npm` would skip all scripts if the user is `root`. You would need to manually run it with `npm run prepublish` or run `npm install --unsafe-perm`. - -#### NPM #### -You may publish the module to NPM. In this case, you would be able to install the module as any other NPM module. It maybe useful to use [scoped packages](https://docs.npmjs.com/misc/scope). - -You can also use `npm link` to link the module. However, this would not modify `package.json` of the installing project, as such you would need to relink every time you deploy that project. - -You can also directly install the module using `npm install file_path`. If you do `npm install file_path --save`, NPM will save relative path to `package.json`. In this case, `npm install` and `npm shrinkwrap` may misbehave. You would need to manually edit `package.json` and replace it with absolute path. - -Regardless of which method you deployed your NPM module, the ES6 module syntaxes are as follows: -``` -import * as localName from 'npmName'; -import {operationId} from 'npmName'; -``` -The CommonJS syntax is as follows: -``` -import localName = require('npmName'); -``` - -#### Direct copy/symlink #### -You may also simply copy or symlink the generated module into a directory under your project. The syntax of this is as follows: - -With ES6 module syntax, the following syntaxes are supported: -``` -import * as localName from './symlinkDir'; -import {operationId} from './symlinkDir'; -``` -The CommonJS syntax is as follows: -``` -import localName = require('./symlinkDir')'; -``` diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts deleted file mode 100644 index 34271f7c8fb..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts +++ /dev/null @@ -1,1323 +0,0 @@ -/** - * Swagger Petstore - * This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters - * - * OpenAPI spec version: 1.0.0 - * Contact: apiteam@wordnik.com - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -import * as querystring from "querystring"; -import * as url from "url"; - -import * as isomorphicFetch from "isomorphic-fetch"; -import * as assign from "core-js/library/fn/object/assign"; - -interface Dictionary { [index: string]: T; } -export interface FetchAPI { (url: string, init?: any): Promise; } - -const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ""); - -export interface FetchArgs { - url: string; - options: any; -} - -export class BaseAPI { - basePath: string; - fetch: FetchAPI; - - constructor(fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) { - this.basePath = basePath; - this.fetch = fetch; - } -}; - -export interface Category { - "id"?: number; - "name"?: string; -} - -export interface Order { - "id"?: number; - "petId"?: number; - "quantity"?: number; - "shipDate"?: Date; - /** - * Order Status - */ - "status"?: OrderStatusEnum; - "complete"?: boolean; -} - -export type OrderStatusEnum = "placed" | "approved" | "delivered"; -export interface Pet { - "id"?: number; - "category"?: Category; - "name": string; - "photoUrls": Array; - "tags"?: Array; - /** - * pet status in the store - */ - "status"?: PetStatusEnum; -} - -export type PetStatusEnum = "available" | "pending" | "sold"; -export interface Tag { - "id"?: number; - "name"?: string; -} - -export interface User { - "id"?: number; - "username"?: string; - "firstName"?: string; - "lastName"?: string; - "email"?: string; - "password"?: string; - "phone"?: string; - /** - * User Status - */ - "userStatus"?: number; -} - - - -/** - * PetApi - fetch parameter creator - */ -export const PetApiFetchParamCreator = { - /** - * - * @summary Add a new pet to the store - * @param body Pet object that needs to be added to the store - */ - addPet(params: { "body"?: Pet; }, options?: any): FetchArgs { - const baseUrl = `/pet`; - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/json" }; - if (params["body"]) { - fetchOptions.body = JSON.stringify(params["body"] || {}); - } - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * - * @summary Deletes a pet - * @param petId Pet id to delete - * @param apiKey - */ - deletePet(params: { "petId": number; "apiKey"?: string; }, options?: any): FetchArgs { - // verify required parameter "petId" is set - if (params["petId"] == null) { - throw new Error("Missing required parameter petId when calling deletePet"); - } - const baseUrl = `/pet/{petId}` - .replace(`{${"petId"}}`, `${ params["petId"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "DELETE" }, options); - - let contentTypeHeader: Dictionary = {}; - fetchOptions.headers = assign({ - "api_key": params["apiKey"], - }, contentTypeHeader, fetchOptions.headers); - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * Multiple status values can be provided with comma separated strings - * @summary Finds Pets by status - * @param status Status values that need to be considered for filter - */ - findPetsByStatus(params: { "status"?: Array; }, options?: any): FetchArgs { - const baseUrl = `/pet/findByStatus`; - let urlObj = url.parse(baseUrl, true); - urlObj.query = assign({}, urlObj.query, { - "status": params["status"], - }); - let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @summary Finds Pets by tags - * @param tags Tags to filter by - */ - findPetsByTags(params: { "tags"?: Array; }, options?: any): FetchArgs { - const baseUrl = `/pet/findByTags`; - let urlObj = url.parse(baseUrl, true); - urlObj.query = assign({}, urlObj.query, { - "tags": params["tags"], - }); - let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @summary Find pet by ID - * @param petId ID of pet that needs to be fetched - */ - getPetById(params: { "petId": number; }, options?: any): FetchArgs { - // verify required parameter "petId" is set - if (params["petId"] == null) { - throw new Error("Missing required parameter petId when calling getPetById"); - } - const baseUrl = `/pet/{petId}` - .replace(`{${"petId"}}`, `${ params["petId"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * - * @summary Update an existing pet - * @param body Pet object that needs to be added to the store - */ - updatePet(params: { "body"?: Pet; }, options?: any): FetchArgs { - const baseUrl = `/pet`; - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "PUT" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/json" }; - if (params["body"]) { - fetchOptions.body = JSON.stringify(params["body"] || {}); - } - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * - * @summary Updates a pet in the store with form data - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet - * @param status Updated status of the pet - */ - updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }, options?: any): FetchArgs { - // verify required parameter "petId" is set - if (params["petId"] == null) { - throw new Error("Missing required parameter petId when calling updatePetWithForm"); - } - const baseUrl = `/pet/{petId}` - .replace(`{${"petId"}}`, `${ params["petId"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; - fetchOptions.body = querystring.stringify({ - "name": params["name"], - "status": params["status"], - }); - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * - * @summary uploads an image - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload - */ - uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }, options?: any): FetchArgs { - // verify required parameter "petId" is set - if (params["petId"] == null) { - throw new Error("Missing required parameter petId when calling uploadFile"); - } - const baseUrl = `/pet/{petId}/uploadImage` - .replace(`{${"petId"}}`, `${ params["petId"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; - fetchOptions.body = querystring.stringify({ - "additionalMetadata": params["additionalMetadata"], - "file": params["file"], - }); - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, -}; - -/** - * PetApi - functional programming interface - */ -export const PetApiFp = { - /** - * - * @summary Add a new pet to the store - * @param body Pet object that needs to be added to the store - */ - addPet(params: { "body"?: Pet; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator.addPet(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Deletes a pet - * @param petId Pet id to delete - * @param apiKey - */ - deletePet(params: { "petId": number; "apiKey"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator.deletePet(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * Multiple status values can be provided with comma separated strings - * @summary Finds Pets by status - * @param status Status values that need to be considered for filter - */ - findPetsByStatus(params: { "status"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { - const fetchArgs = PetApiFetchParamCreator.findPetsByStatus(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } else { - throw response; - } - }); - }; - }, - /** - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @summary Finds Pets by tags - * @param tags Tags to filter by - */ - findPetsByTags(params: { "tags"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> { - const fetchArgs = PetApiFetchParamCreator.findPetsByTags(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } else { - throw response; - } - }); - }; - }, - /** - * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @summary Find pet by ID - * @param petId ID of pet that needs to be fetched - */ - getPetById(params: { "petId": number; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator.getPetById(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Update an existing pet - * @param body Pet object that needs to be added to the store - */ - updatePet(params: { "body"?: Pet; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator.updatePet(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Updates a pet in the store with form data - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet - * @param status Updated status of the pet - */ - updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator.updatePetWithForm(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary uploads an image - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload - */ - uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = PetApiFetchParamCreator.uploadFile(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, -}; - -/** - * PetApi - object-oriented interface - */ -export class PetApi extends BaseAPI { - /** - * - * @summary Add a new pet to the store - * @param body Pet object that needs to be added to the store - */ - addPet(params: { "body"?: Pet; }, options?: any) { - return PetApiFp.addPet(params, options)(this.fetch, this.basePath); - } - /** - * - * @summary Deletes a pet - * @param petId Pet id to delete - * @param apiKey - */ - deletePet(params: { "petId": number; "apiKey"?: string; }, options?: any) { - return PetApiFp.deletePet(params, options)(this.fetch, this.basePath); - } - /** - * Multiple status values can be provided with comma separated strings - * @summary Finds Pets by status - * @param status Status values that need to be considered for filter - */ - findPetsByStatus(params: { "status"?: Array; }, options?: any) { - return PetApiFp.findPetsByStatus(params, options)(this.fetch, this.basePath); - } - /** - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @summary Finds Pets by tags - * @param tags Tags to filter by - */ - findPetsByTags(params: { "tags"?: Array; }, options?: any) { - return PetApiFp.findPetsByTags(params, options)(this.fetch, this.basePath); - } - /** - * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @summary Find pet by ID - * @param petId ID of pet that needs to be fetched - */ - getPetById(params: { "petId": number; }, options?: any) { - return PetApiFp.getPetById(params, options)(this.fetch, this.basePath); - } - /** - * - * @summary Update an existing pet - * @param body Pet object that needs to be added to the store - */ - updatePet(params: { "body"?: Pet; }, options?: any) { - return PetApiFp.updatePet(params, options)(this.fetch, this.basePath); - } - /** - * - * @summary Updates a pet in the store with form data - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet - * @param status Updated status of the pet - */ - updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }, options?: any) { - return PetApiFp.updatePetWithForm(params, options)(this.fetch, this.basePath); - } - /** - * - * @summary uploads an image - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload - */ - uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }, options?: any) { - return PetApiFp.uploadFile(params, options)(this.fetch, this.basePath); - } -}; - -/** - * PetApi - factory interface - */ -export const PetApiFactory = function (fetch?: FetchAPI, basePath?: string) { - return { - /** - * - * @summary Add a new pet to the store - * @param body Pet object that needs to be added to the store - */ - addPet(params: { "body"?: Pet; }, options?: any) { - return PetApiFp.addPet(params, options)(fetch, basePath); - }, - /** - * - * @summary Deletes a pet - * @param petId Pet id to delete - * @param apiKey - */ - deletePet(params: { "petId": number; "apiKey"?: string; }, options?: any) { - return PetApiFp.deletePet(params, options)(fetch, basePath); - }, - /** - * Multiple status values can be provided with comma separated strings - * @summary Finds Pets by status - * @param status Status values that need to be considered for filter - */ - findPetsByStatus(params: { "status"?: Array; }, options?: any) { - return PetApiFp.findPetsByStatus(params, options)(fetch, basePath); - }, - /** - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @summary Finds Pets by tags - * @param tags Tags to filter by - */ - findPetsByTags(params: { "tags"?: Array; }, options?: any) { - return PetApiFp.findPetsByTags(params, options)(fetch, basePath); - }, - /** - * Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - * @summary Find pet by ID - * @param petId ID of pet that needs to be fetched - */ - getPetById(params: { "petId": number; }, options?: any) { - return PetApiFp.getPetById(params, options)(fetch, basePath); - }, - /** - * - * @summary Update an existing pet - * @param body Pet object that needs to be added to the store - */ - updatePet(params: { "body"?: Pet; }, options?: any) { - return PetApiFp.updatePet(params, options)(fetch, basePath); - }, - /** - * - * @summary Updates a pet in the store with form data - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet - * @param status Updated status of the pet - */ - updatePetWithForm(params: { "petId": string; "name"?: string; "status"?: string; }, options?: any) { - return PetApiFp.updatePetWithForm(params, options)(fetch, basePath); - }, - /** - * - * @summary uploads an image - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload - */ - uploadFile(params: { "petId": number; "additionalMetadata"?: string; "file"?: any; }, options?: any) { - return PetApiFp.uploadFile(params, options)(fetch, basePath); - }, - }; -}; - - -/** - * StoreApi - fetch parameter creator - */ -export const StoreApiFetchParamCreator = { - /** - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @summary Delete purchase order by ID - * @param orderId ID of the order that needs to be deleted - */ - deleteOrder(params: { "orderId": string; }, options?: any): FetchArgs { - // verify required parameter "orderId" is set - if (params["orderId"] == null) { - throw new Error("Missing required parameter orderId when calling deleteOrder"); - } - const baseUrl = `/store/order/{orderId}` - .replace(`{${"orderId"}}`, `${ params["orderId"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "DELETE" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * Returns a map of status codes to quantities - * @summary Returns pet inventories by status - */ - getInventory(options?: any): FetchArgs { - const baseUrl = `/store/inventory`; - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @summary Find purchase order by ID - * @param orderId ID of pet that needs to be fetched - */ - getOrderById(params: { "orderId": string; }, options?: any): FetchArgs { - // verify required parameter "orderId" is set - if (params["orderId"] == null) { - throw new Error("Missing required parameter orderId when calling getOrderById"); - } - const baseUrl = `/store/order/{orderId}` - .replace(`{${"orderId"}}`, `${ params["orderId"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * - * @summary Place an order for a pet - * @param body order placed for purchasing the pet - */ - placeOrder(params: { "body"?: Order; }, options?: any): FetchArgs { - const baseUrl = `/store/order`; - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/json" }; - if (params["body"]) { - fetchOptions.body = JSON.stringify(params["body"] || {}); - } - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, -}; - -/** - * StoreApi - functional programming interface - */ -export const StoreApiFp = { - /** - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @summary Delete purchase order by ID - * @param orderId ID of the order that needs to be deleted - */ - deleteOrder(params: { "orderId": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = StoreApiFetchParamCreator.deleteOrder(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * Returns a map of status codes to quantities - * @summary Returns pet inventories by status - */ - getInventory(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<{ [key: string]: number; }> { - const fetchArgs = StoreApiFetchParamCreator.getInventory(options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } else { - throw response; - } - }); - }; - }, - /** - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @summary Find purchase order by ID - * @param orderId ID of pet that needs to be fetched - */ - getOrderById(params: { "orderId": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = StoreApiFetchParamCreator.getOrderById(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Place an order for a pet - * @param body order placed for purchasing the pet - */ - placeOrder(params: { "body"?: Order; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = StoreApiFetchParamCreator.placeOrder(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } else { - throw response; - } - }); - }; - }, -}; - -/** - * StoreApi - object-oriented interface - */ -export class StoreApi extends BaseAPI { - /** - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @summary Delete purchase order by ID - * @param orderId ID of the order that needs to be deleted - */ - deleteOrder(params: { "orderId": string; }, options?: any) { - return StoreApiFp.deleteOrder(params, options)(this.fetch, this.basePath); - } - /** - * Returns a map of status codes to quantities - * @summary Returns pet inventories by status - */ - getInventory(options?: any) { - return StoreApiFp.getInventory(options)(this.fetch, this.basePath); - } - /** - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @summary Find purchase order by ID - * @param orderId ID of pet that needs to be fetched - */ - getOrderById(params: { "orderId": string; }, options?: any) { - return StoreApiFp.getOrderById(params, options)(this.fetch, this.basePath); - } - /** - * - * @summary Place an order for a pet - * @param body order placed for purchasing the pet - */ - placeOrder(params: { "body"?: Order; }, options?: any) { - return StoreApiFp.placeOrder(params, options)(this.fetch, this.basePath); - } -}; - -/** - * StoreApi - factory interface - */ -export const StoreApiFactory = function (fetch?: FetchAPI, basePath?: string) { - return { - /** - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @summary Delete purchase order by ID - * @param orderId ID of the order that needs to be deleted - */ - deleteOrder(params: { "orderId": string; }, options?: any) { - return StoreApiFp.deleteOrder(params, options)(fetch, basePath); - }, - /** - * Returns a map of status codes to quantities - * @summary Returns pet inventories by status - */ - getInventory(options?: any) { - return StoreApiFp.getInventory(options)(fetch, basePath); - }, - /** - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @summary Find purchase order by ID - * @param orderId ID of pet that needs to be fetched - */ - getOrderById(params: { "orderId": string; }, options?: any) { - return StoreApiFp.getOrderById(params, options)(fetch, basePath); - }, - /** - * - * @summary Place an order for a pet - * @param body order placed for purchasing the pet - */ - placeOrder(params: { "body"?: Order; }, options?: any) { - return StoreApiFp.placeOrder(params, options)(fetch, basePath); - }, - }; -}; - - -/** - * UserApi - fetch parameter creator - */ -export const UserApiFetchParamCreator = { - /** - * This can only be done by the logged in user. - * @summary Create user - * @param body Created user object - */ - createUser(params: { "body"?: User; }, options?: any): FetchArgs { - const baseUrl = `/user`; - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/json" }; - if (params["body"]) { - fetchOptions.body = JSON.stringify(params["body"] || {}); - } - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * - * @summary Creates list of users with given input array - * @param body List of user object - */ - createUsersWithArrayInput(params: { "body"?: Array; }, options?: any): FetchArgs { - const baseUrl = `/user/createWithArray`; - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/json" }; - if (params["body"]) { - fetchOptions.body = JSON.stringify(params["body"] || {}); - } - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * - * @summary Creates list of users with given input array - * @param body List of user object - */ - createUsersWithListInput(params: { "body"?: Array; }, options?: any): FetchArgs { - const baseUrl = `/user/createWithList`; - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "POST" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/json" }; - if (params["body"]) { - fetchOptions.body = JSON.stringify(params["body"] || {}); - } - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * This can only be done by the logged in user. - * @summary Delete user - * @param username The name that needs to be deleted - */ - deleteUser(params: { "username": string; }, options?: any): FetchArgs { - // verify required parameter "username" is set - if (params["username"] == null) { - throw new Error("Missing required parameter username when calling deleteUser"); - } - const baseUrl = `/user/{username}` - .replace(`{${"username"}}`, `${ params["username"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "DELETE" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * - * @summary Get user by user name - * @param username The name that needs to be fetched. Use user1 for testing. - */ - getUserByName(params: { "username": string; }, options?: any): FetchArgs { - // verify required parameter "username" is set - if (params["username"] == null) { - throw new Error("Missing required parameter username when calling getUserByName"); - } - const baseUrl = `/user/{username}` - .replace(`{${"username"}}`, `${ params["username"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * - * @summary Logs user into the system - * @param username The user name for login - * @param password The password for login in clear text - */ - loginUser(params: { "username"?: string; "password"?: string; }, options?: any): FetchArgs { - const baseUrl = `/user/login`; - let urlObj = url.parse(baseUrl, true); - urlObj.query = assign({}, urlObj.query, { - "username": params["username"], - "password": params["password"], - }); - let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * - * @summary Logs out current logged in user session - */ - logoutUser(options?: any): FetchArgs { - const baseUrl = `/user/logout`; - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "GET" }, options); - - let contentTypeHeader: Dictionary = {}; - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, - /** - * This can only be done by the logged in user. - * @summary Updated user - * @param username name that need to be deleted - * @param body Updated user object - */ - updateUser(params: { "username": string; "body"?: User; }, options?: any): FetchArgs { - // verify required parameter "username" is set - if (params["username"] == null) { - throw new Error("Missing required parameter username when calling updateUser"); - } - const baseUrl = `/user/{username}` - .replace(`{${"username"}}`, `${ params["username"] }`); - let urlObj = url.parse(baseUrl, true); - let fetchOptions: RequestInit = assign({}, { method: "PUT" }, options); - - let contentTypeHeader: Dictionary = {}; - contentTypeHeader = { "Content-Type": "application/json" }; - if (params["body"]) { - fetchOptions.body = JSON.stringify(params["body"] || {}); - } - if (contentTypeHeader) { - fetchOptions.headers = assign({}, contentTypeHeader, fetchOptions.headers); - } - return { - url: url.format(urlObj), - options: fetchOptions, - }; - }, -}; - -/** - * UserApi - functional programming interface - */ -export const UserApiFp = { - /** - * This can only be done by the logged in user. - * @summary Create user - * @param body Created user object - */ - createUser(params: { "body"?: User; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator.createUser(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Creates list of users with given input array - * @param body List of user object - */ - createUsersWithArrayInput(params: { "body"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator.createUsersWithArrayInput(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Creates list of users with given input array - * @param body List of user object - */ - createUsersWithListInput(params: { "body"?: Array; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator.createUsersWithListInput(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * This can only be done by the logged in user. - * @summary Delete user - * @param username The name that needs to be deleted - */ - deleteUser(params: { "username": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator.deleteUser(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Get user by user name - * @param username The name that needs to be fetched. Use user1 for testing. - */ - getUserByName(params: { "username": string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator.getUserByName(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Logs user into the system - * @param username The user name for login - * @param password The password for login in clear text - */ - loginUser(params: { "username"?: string; "password"?: string; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator.loginUser(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } else { - throw response; - } - }); - }; - }, - /** - * - * @summary Logs out current logged in user session - */ - logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator.logoutUser(options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, - /** - * This can only be done by the logged in user. - * @summary Updated user - * @param username name that need to be deleted - * @param body Updated user object - */ - updateUser(params: { "username": string; "body"?: User; }, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise { - const fetchArgs = UserApiFetchParamCreator.updateUser(params, options); - return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => { - return fetch(basePath + fetchArgs.url, fetchArgs.options).then((response) => { - if (response.status >= 200 && response.status < 300) { - return response; - } else { - throw response; - } - }); - }; - }, -}; - -/** - * UserApi - object-oriented interface - */ -export class UserApi extends BaseAPI { - /** - * This can only be done by the logged in user. - * @summary Create user - * @param body Created user object - */ - createUser(params: { "body"?: User; }, options?: any) { - return UserApiFp.createUser(params, options)(this.fetch, this.basePath); - } - /** - * - * @summary Creates list of users with given input array - * @param body List of user object - */ - createUsersWithArrayInput(params: { "body"?: Array; }, options?: any) { - return UserApiFp.createUsersWithArrayInput(params, options)(this.fetch, this.basePath); - } - /** - * - * @summary Creates list of users with given input array - * @param body List of user object - */ - createUsersWithListInput(params: { "body"?: Array; }, options?: any) { - return UserApiFp.createUsersWithListInput(params, options)(this.fetch, this.basePath); - } - /** - * This can only be done by the logged in user. - * @summary Delete user - * @param username The name that needs to be deleted - */ - deleteUser(params: { "username": string; }, options?: any) { - return UserApiFp.deleteUser(params, options)(this.fetch, this.basePath); - } - /** - * - * @summary Get user by user name - * @param username The name that needs to be fetched. Use user1 for testing. - */ - getUserByName(params: { "username": string; }, options?: any) { - return UserApiFp.getUserByName(params, options)(this.fetch, this.basePath); - } - /** - * - * @summary Logs user into the system - * @param username The user name for login - * @param password The password for login in clear text - */ - loginUser(params: { "username"?: string; "password"?: string; }, options?: any) { - return UserApiFp.loginUser(params, options)(this.fetch, this.basePath); - } - /** - * - * @summary Logs out current logged in user session - */ - logoutUser(options?: any) { - return UserApiFp.logoutUser(options)(this.fetch, this.basePath); - } - /** - * This can only be done by the logged in user. - * @summary Updated user - * @param username name that need to be deleted - * @param body Updated user object - */ - updateUser(params: { "username": string; "body"?: User; }, options?: any) { - return UserApiFp.updateUser(params, options)(this.fetch, this.basePath); - } -}; - -/** - * UserApi - factory interface - */ -export const UserApiFactory = function (fetch?: FetchAPI, basePath?: string) { - return { - /** - * This can only be done by the logged in user. - * @summary Create user - * @param body Created user object - */ - createUser(params: { "body"?: User; }, options?: any) { - return UserApiFp.createUser(params, options)(fetch, basePath); - }, - /** - * - * @summary Creates list of users with given input array - * @param body List of user object - */ - createUsersWithArrayInput(params: { "body"?: Array; }, options?: any) { - return UserApiFp.createUsersWithArrayInput(params, options)(fetch, basePath); - }, - /** - * - * @summary Creates list of users with given input array - * @param body List of user object - */ - createUsersWithListInput(params: { "body"?: Array; }, options?: any) { - return UserApiFp.createUsersWithListInput(params, options)(fetch, basePath); - }, - /** - * This can only be done by the logged in user. - * @summary Delete user - * @param username The name that needs to be deleted - */ - deleteUser(params: { "username": string; }, options?: any) { - return UserApiFp.deleteUser(params, options)(fetch, basePath); - }, - /** - * - * @summary Get user by user name - * @param username The name that needs to be fetched. Use user1 for testing. - */ - getUserByName(params: { "username": string; }, options?: any) { - return UserApiFp.getUserByName(params, options)(fetch, basePath); - }, - /** - * - * @summary Logs user into the system - * @param username The user name for login - * @param password The password for login in clear text - */ - loginUser(params: { "username"?: string; "password"?: string; }, options?: any) { - return UserApiFp.loginUser(params, options)(fetch, basePath); - }, - /** - * - * @summary Logs out current logged in user session - */ - logoutUser(options?: any) { - return UserApiFp.logoutUser(options)(fetch, basePath); - }, - /** - * This can only be done by the logged in user. - * @summary Updated user - * @param username name that need to be deleted - * @param body Updated user object - */ - updateUser(params: { "username": string; "body"?: User; }, options?: any) { - return UserApiFp.updateUser(params, options)(fetch, basePath); - }, - }; -}; - diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/git_push.sh b/samples/client/petstore/typescript-fetch/builds/with-npm-version/git_push.sh deleted file mode 100644 index ed374619b13..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/git_push.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/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' - diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json b/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json deleted file mode 100644 index f4c8ca8a162..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "@swagger/typescript-fetch-petstore", - "version": "0.0.1", - "license": "Unlicense", - "main": "./dist/api.js", - "browser": "./dist/api.js", - "typings": "./dist/api.d.ts", - "dependencies": { - "core-js": "^2.4.0", - "isomorphic-fetch": "^2.2.1" - }, - "scripts" : { - "prepublish" : "typings install && tsc", - "test": "tslint api.ts" - }, - "devDependencies": { - "tslint": "^3.15.1", - "typescript": "^1.8.10", - "typings": "^1.0.4" - } -} 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 deleted file mode 100644 index 72ff2567206..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "declaration": true, - "target": "es5", - "module": "commonjs", - "noImplicitAny": true, - "outDir": "dist", - "rootDir": "." - }, - "exclude": [ - "dist", - "node_modules", - "typings/browser", - "typings/main", - "typings/main.d.ts" - ] -} diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/tslint.json b/samples/client/petstore/typescript-fetch/builds/with-npm-version/tslint.json deleted file mode 100644 index 6eb02acec8c..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/tslint.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "jsRules": { - "class-name": true, - "comment-format": [ - true, - "check-space" - ], - "indent": [ - true, - "spaces" - ], - "no-duplicate-variable": true, - "no-eval": true, - "no-trailing-whitespace": true, - "no-unsafe-finally": true, - "one-line": [ - true, - "check-open-brace", - "check-whitespace" - ], - "quotemark": [ - true, - "double" - ], - "semicolon": [ - true, - "always" - ], - "triple-equals": [ - true, - "allow-null-check" - ], - "variable-name": [ - true, - "ban-keywords" - ], - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type" - ] - }, - "rules": { - "class-name": true, - "comment-format": [ - true, - "check-space" - ], - "indent": [ - true, - "spaces" - ], - "no-eval": true, - "no-internal-module": true, - "no-trailing-whitespace": true, - "no-unsafe-finally": true, - "no-var-keyword": true, - "one-line": [ - true, - "check-open-brace", - "check-whitespace" - ], - "quotemark": [ - true, - "double" - ], - "semicolon": [ - true, - "always" - ], - "triple-equals": [ - true, - "allow-null-check" - ], - "typedef-whitespace": [ - true, - { - "call-signature": "nospace", - "index-signature": "nospace", - "parameter": "nospace", - "property-declaration": "nospace", - "variable-declaration": "nospace" - } - ], - "variable-name": [ - true, - "ban-keywords" - ], - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type" - ] - } -} diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/typings.json b/samples/client/petstore/typescript-fetch/builds/with-npm-version/typings.json deleted file mode 100644 index a82ea152b4a..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/typings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "version": false, - "dependencies": {}, - "globalDependencies": { - "core-js": "registry:dt/core-js#0.0.0+20160317120654", - "node": "registry:dt/node#4.0.0+20160423143914", - "isomorphic-fetch": "registry:dt/isomorphic-fetch#0.0.0+20160505171433" - } -} diff --git a/samples/client/petstore/typescript-fetch/tests/default/typings.json b/samples/client/petstore/typescript-fetch/tests/default/typings.json deleted file mode 100644 index d05709202f7..00000000000 --- a/samples/client/petstore/typescript-fetch/tests/default/typings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "typescript-fetch-test", - "version": false, - "globalDependencies": { - "chai": "registry:dt/chai#3.4.0+20160317120654", - "es6-promise": "registry:dt/es6-promise#0.0.0+20160423074304", - "mocha": "registry:dt/mocha#2.2.5+20160317120654" - } -} diff --git a/samples/client/petstore/typescript-fetch/tests/default/package.json b/samples/client/petstore/typescript-fetch/tests/npm/package.json similarity index 70% rename from samples/client/petstore/typescript-fetch/tests/default/package.json rename to samples/client/petstore/typescript-fetch/tests/npm/package.json index b95b42bc29e..f4090da2dd3 100644 --- a/samples/client/petstore/typescript-fetch/tests/default/package.json +++ b/samples/client/petstore/typescript-fetch/tests/npm/package.json @@ -1,19 +1,19 @@ { "private": true, "dependencies": { - "chai": "^3.5.0" + "chai": "^3.5.0", + "mocha": "^3.4.2" }, "devDependencies": { + "@types/chai": "^4.0.1", + "@types/mocha": "^2.2.41", "browserify": "^13.0.1", "ts-loader": "^0.8.2", "tsify": "^0.16.0", - "typescript": "^1.8.10", - "typings": "^1.0.4", + "typescript": "2.0.10", "webpack": "^1.13.0" }, "scripts": { - "prepublish": "./scripts/prepublish.sh", - "pretest": "npm install mocha", "test": "mocha" }, "name": "typescript-fetch-test", diff --git a/samples/client/petstore/typescript-fetch/tests/default/pom.xml b/samples/client/petstore/typescript-fetch/tests/npm/pom.xml similarity index 100% rename from samples/client/petstore/typescript-fetch/tests/default/pom.xml rename to samples/client/petstore/typescript-fetch/tests/npm/pom.xml diff --git a/samples/client/petstore/typescript-fetch/tests/default/run_tests_via_browserify.html b/samples/client/petstore/typescript-fetch/tests/npm/run_tests_via_browserify.html similarity index 100% rename from samples/client/petstore/typescript-fetch/tests/default/run_tests_via_browserify.html rename to samples/client/petstore/typescript-fetch/tests/npm/run_tests_via_browserify.html diff --git a/samples/client/petstore/typescript-fetch/tests/default/run_tests_via_webpack.html b/samples/client/petstore/typescript-fetch/tests/npm/run_tests_via_webpack.html similarity index 100% rename from samples/client/petstore/typescript-fetch/tests/default/run_tests_via_webpack.html rename to samples/client/petstore/typescript-fetch/tests/npm/run_tests_via_webpack.html diff --git a/samples/client/petstore/typescript-fetch/tests/default/scripts/prepublish.sh b/samples/client/petstore/typescript-fetch/tests/npm/scripts/prepublish.sh old mode 100755 new mode 100644 similarity index 74% rename from samples/client/petstore/typescript-fetch/tests/default/scripts/prepublish.sh rename to samples/client/petstore/typescript-fetch/tests/npm/scripts/prepublish.sh index 3c0dfb05953..2fcbd19a58d --- a/samples/client/petstore/typescript-fetch/tests/default/scripts/prepublish.sh +++ b/samples/client/petstore/typescript-fetch/tests/npm/scripts/prepublish.sh @@ -1,7 +1,6 @@ #!/bin/bash -npm install ../../builds/default -typings install +npm install ../../builds/npm # Build Node.js tsc diff --git a/samples/client/petstore/typescript-fetch/tests/default/test/PetApi.ts b/samples/client/petstore/typescript-fetch/tests/npm/test/PetApi.ts similarity index 67% rename from samples/client/petstore/typescript-fetch/tests/default/test/PetApi.ts rename to samples/client/petstore/typescript-fetch/tests/npm/test/PetApi.ts index 251c3f3a902..17110fb9d63 100644 --- a/samples/client/petstore/typescript-fetch/tests/default/test/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/tests/npm/test/PetApi.ts @@ -1,5 +1,5 @@ import {expect} from 'chai'; -import {PetApi, Pet, Category} from 'typescript-fetch-api'; +import {PetApi, Pet, Category} from '@swagger/typescript-fetch-petstore'; describe('PetApi', () => { @@ -15,21 +15,21 @@ describe('PetApi', () => { }); it('should add and delete Pet', () => { - return api.addPet({ body: fixture }, requestOptions).then(() => { + return api.addPet(fixture, requestOptions).then(() => { }); }); it('should get Pet by ID', () => { - return api.getPetById({ petId: fixture.id }, requestOptions).then((result) => { + return api.getPetById(fixture.id, requestOptions).then((result) => { return expect(result).to.deep.equal(fixture); }); }); it('should update Pet by ID', () => { - return api.getPetById({ petId: fixture.id }, requestOptions).then( (result) => { + return api.getPetById(fixture.id, requestOptions).then( (result) => { result.name = 'newname'; - return api.updatePet({ body: result }, requestOptions).then(() => { - return api.getPetById({ petId: fixture.id }, requestOptions).then( (result) => { + return api.updatePet(result, requestOptions).then(() => { + return api.getPetById(fixture.id, requestOptions).then( (result) => { return expect(result.name).to.deep.equal('newname'); }); }); @@ -37,11 +37,11 @@ describe('PetApi', () => { }); it('should delete Pet', () => { - return api.deletePet({ petId: fixture.id }, requestOptions); + return api.deletePet(fixture.id, requestOptions); }); it('should not contain deleted Pet', () => { - return api.getPetById({ petId: fixture.id }, requestOptions).then((result) => { + return api.getPetById(fixture.id, requestOptions).then((result) => { return expect(result).to.not.exist; }, (err) => { return expect(err).to.exist; @@ -71,7 +71,7 @@ function createTestFixture(ts = Date.now()) { 'name': `pet${ts}`, 'category': category, 'photoUrls': ['http://foo.bar.com/1', 'http://foo.bar.com/2'], - 'status': 'available', + 'status': Pet.StatusEnum.Available, 'tags': [] }; diff --git a/samples/client/petstore/typescript-fetch/tests/default/test/PetApiFactory.ts b/samples/client/petstore/typescript-fetch/tests/npm/test/PetApiFactory.ts similarity index 63% rename from samples/client/petstore/typescript-fetch/tests/default/test/PetApiFactory.ts rename to samples/client/petstore/typescript-fetch/tests/npm/test/PetApiFactory.ts index be2b802c1e7..f4c87f3bdbe 100644 --- a/samples/client/petstore/typescript-fetch/tests/default/test/PetApiFactory.ts +++ b/samples/client/petstore/typescript-fetch/tests/npm/test/PetApiFactory.ts @@ -1,5 +1,5 @@ import {expect} from 'chai'; -import {PetApiFactory, Pet, Category} from 'typescript-fetch-api'; +import {PetApiFactory, Pet, Category} from '@swagger/typescript-fetch-petstore'; describe('PetApiFactory', () => { @@ -10,21 +10,21 @@ describe('PetApiFactory', () => { const fixture: Pet = createTestFixture(); it('should add and delete Pet', () => { - return PetApiFactory().addPet({ body: fixture }, requestOptions).then(() => { + return PetApiFactory().addPet(fixture, requestOptions).then(() => { }); }); it('should get Pet by ID', () => { - return PetApiFactory().getPetById({ petId: fixture.id }, requestOptions).then((result) => { + return PetApiFactory().getPetById(fixture.id, requestOptions).then((result) => { return expect(result).to.deep.equal(fixture); }); }); it('should update Pet by ID', () => { - return PetApiFactory().getPetById({ petId: fixture.id }, requestOptions).then( (result) => { + return PetApiFactory().getPetById(fixture.id, requestOptions).then( (result) => { result.name = 'newname'; - return PetApiFactory().updatePet({ body: result }, requestOptions).then(() => { - return PetApiFactory().getPetById({ petId: fixture.id }, requestOptions).then( (result) => { + return PetApiFactory().updatePet(result, requestOptions).then(() => { + return PetApiFactory().getPetById(fixture.id, requestOptions).then( (result) => { return expect(result.name).to.deep.equal('newname'); }); }); @@ -32,11 +32,11 @@ describe('PetApiFactory', () => { }); it('should delete Pet', () => { - return PetApiFactory().deletePet({ petId: fixture.id }, requestOptions); + return PetApiFactory().deletePet(fixture.id, requestOptions); }); it('should not contain deleted Pet', () => { - return PetApiFactory().getPetById({ petId: fixture.id }, requestOptions).then((result) => { + return PetApiFactory().getPetById(fixture.id, requestOptions).then((result) => { return expect(result).to.not.exist; }, (err) => { return expect(err).to.exist; @@ -65,7 +65,7 @@ function createTestFixture(ts = Date.now()) { 'name': `pet${ts}`, 'category': category, 'photoUrls': ['http://foo.bar.com/1', 'http://foo.bar.com/2'], - 'status': 'available', + 'status': Pet.StatusEnum.Available, 'tags': [] }; diff --git a/samples/client/petstore/typescript-fetch/tests/default/test/StoreApi.ts b/samples/client/petstore/typescript-fetch/tests/npm/test/StoreApi.ts similarity index 91% rename from samples/client/petstore/typescript-fetch/tests/default/test/StoreApi.ts rename to samples/client/petstore/typescript-fetch/tests/npm/test/StoreApi.ts index 14b26e4f2d0..e859bc9588d 100644 --- a/samples/client/petstore/typescript-fetch/tests/default/test/StoreApi.ts +++ b/samples/client/petstore/typescript-fetch/tests/npm/test/StoreApi.ts @@ -1,5 +1,5 @@ import {expect} from 'chai'; -import {StoreApi} from 'typescript-fetch-api'; +import {StoreApi} from '@swagger/typescript-fetch-petstore'; describe('StoreApi', function() { diff --git a/samples/client/petstore/typescript-fetch/tests/default/test/StoreApiFactory.ts b/samples/client/petstore/typescript-fetch/tests/npm/test/StoreApiFactory.ts similarity index 90% rename from samples/client/petstore/typescript-fetch/tests/default/test/StoreApiFactory.ts rename to samples/client/petstore/typescript-fetch/tests/npm/test/StoreApiFactory.ts index bef90b2a558..b2374b08ca2 100644 --- a/samples/client/petstore/typescript-fetch/tests/default/test/StoreApiFactory.ts +++ b/samples/client/petstore/typescript-fetch/tests/npm/test/StoreApiFactory.ts @@ -1,5 +1,5 @@ import {expect} from 'chai'; -import {StoreApiFactory} from 'typescript-fetch-api'; +import {StoreApiFactory} from '@swagger/typescript-fetch-petstore'; describe('StoreApiFactory', function() { diff --git a/samples/client/petstore/typescript-fetch/tests/default/test/index.ts b/samples/client/petstore/typescript-fetch/tests/npm/test/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/tests/default/test/index.ts rename to samples/client/petstore/typescript-fetch/tests/npm/test/index.ts diff --git a/samples/client/petstore/typescript-fetch/tests/default/test/mocha.opts b/samples/client/petstore/typescript-fetch/tests/npm/test/mocha.opts similarity index 100% rename from samples/client/petstore/typescript-fetch/tests/default/test/mocha.opts rename to samples/client/petstore/typescript-fetch/tests/npm/test/mocha.opts diff --git a/samples/client/petstore/typescript-fetch/tests/default/tsconfig.json b/samples/client/petstore/typescript-fetch/tests/npm/tsconfig.json similarity index 55% rename from samples/client/petstore/typescript-fetch/tests/default/tsconfig.json rename to samples/client/petstore/typescript-fetch/tests/npm/tsconfig.json index e47c2647e01..e41ab9ac270 100644 --- a/samples/client/petstore/typescript-fetch/tests/default/tsconfig.json +++ b/samples/client/petstore/typescript-fetch/tests/npm/tsconfig.json @@ -5,12 +5,16 @@ "noImplicitAny": true, "sourceMap": false, "outDir": "dist", - "rootDir": "." + "rootDir": ".", + "lib": [ + "es6", + "dom" + ], + "types": [ + "mocha" + ] }, "exclude": [ - "node_modules", - "typings/browser", - "typings/main", - "typings/main.d.ts" + "node_modules" ] } \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/tests/default/webpack.config.js b/samples/client/petstore/typescript-fetch/tests/npm/webpack.config.js similarity index 100% rename from samples/client/petstore/typescript-fetch/tests/default/webpack.config.js rename to samples/client/petstore/typescript-fetch/tests/npm/webpack.config.js diff --git a/samples/client/petstore/typescript-fetch/tests/npm/yarn.lock b/samples/client/petstore/typescript-fetch/tests/npm/yarn.lock new file mode 100644 index 00000000000..bbc3188e687 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/tests/npm/yarn.lock @@ -0,0 +1,1971 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@types/chai@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.0.1.tgz#37fea779617cfec3fd2b19a0247e8bbdd5133bf6" + +"@types/mocha@^2.2.41": + version "2.2.41" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.41.tgz#e27cf0817153eb9f2713b2d3f6c68f1e1c3ca608" + +JSONStream@^1.0.3: + version "1.3.1" + resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.1.tgz#707f761e01dae9e16f1bcf93703b78c70966579a" + dependencies: + jsonparse "^1.2.0" + through ">=2.2.7 <3" + +abbrev@1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.0.tgz#d0554c2256636e2f56e7c2e5ad183f859428d81f" + +acorn@^3.0.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" + +acorn@^4.0.3: + version "4.0.13" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" + +ajv@^4.9.1: + version "4.11.8" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" + dependencies: + co "^4.6.0" + json-stable-stringify "^1.0.1" + +align-text@^0.1.1, align-text@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" + dependencies: + kind-of "^3.0.2" + longest "^1.0.1" + repeat-string "^1.5.2" + +amdefine@>=0.0.4: + version "1.0.1" + resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +anymatch@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.0.tgz#a3e52fa39168c825ff57b0248126ce5a8ff95507" + dependencies: + arrify "^1.0.0" + micromatch "^2.1.5" + +aproba@^1.0.3: + version "1.1.2" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.1.2.tgz#45c6629094de4e96f693ef7eab74ae079c240fc1" + +are-we-there-yet@~1.1.2: + version "1.1.4" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz#bb5dca382bb94f05e15194373d16fd3ba1ca110d" + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" + +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + dependencies: + arr-flatten "^1.0.1" + +arr-flatten@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + +array-filter@~0.0.0: + version "0.0.1" + resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec" + +array-map@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662" + +array-reduce@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/array-reduce/-/array-reduce-0.0.0.tgz#173899d3ffd1c7d9383e4479525dbe278cab5f2b" + +array-union@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + dependencies: + array-uniq "^1.0.1" + +array-uniq@^1.0.1, array-uniq@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + +arrify@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + +asn1@~0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + +assert-plus@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" + +assert@^1.1.1, assert@^1.4.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91" + dependencies: + util "0.10.3" + +assertion-error@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.0.2.tgz#13ca515d86206da0bac66e834dd397d87581094c" + +astw@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/astw/-/astw-2.2.0.tgz#7bd41784d32493987aeb239b6b4e1c57a873b917" + dependencies: + acorn "^4.0.3" + +async-each@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" + +async@^0.9.0: + version "0.9.2" + resolved "https://registry.yarnpkg.com/async/-/async-0.9.2.tgz#aea74d5e61c1f899613bf64bda66d4c78f2fd17d" + +async@^1.3.0: + version "1.5.2" + resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + +async@~0.2.6: + version "0.2.10" + resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + +aws-sign2@~0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" + +aws4@^1.2.1: + version "1.6.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +base64-js@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.1.tgz#a91947da1f4a516ea38e5b4ec0ec3773675e0886" + +bcrypt-pbkdf@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" + dependencies: + tweetnacl "^0.14.3" + +big.js@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.1.3.tgz#4cada2193652eb3ca9ec8e55c9015669c9806978" + +binary-extensions@^1.0.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.8.0.tgz#48ec8d16df4377eae5fa5884682480af4d95c774" + +block-stream@*: + version "0.0.9" + resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" + dependencies: + inherits "~2.0.0" + +boom@2.x.x: + version "2.10.1" + resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" + dependencies: + hoek "2.x.x" + +brace-expansion@^1.1.7: + version "1.1.8" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + +browser-pack@^6.0.1: + version "6.0.2" + resolved "https://registry.yarnpkg.com/browser-pack/-/browser-pack-6.0.2.tgz#f86cd6cef4f5300c8e63e07a4d512f65fbff4531" + dependencies: + JSONStream "^1.0.3" + combine-source-map "~0.7.1" + defined "^1.0.0" + through2 "^2.0.0" + umd "^3.0.0" + +browser-resolve@^1.11.0, browser-resolve@^1.7.0: + version "1.11.2" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" + dependencies: + resolve "1.1.7" + +browser-stdout@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" + +browserify-aes@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-0.4.0.tgz#067149b668df31c4b58533e02d01e806d8608e2c" + dependencies: + inherits "^2.0.1" + +browserify-zlib@^0.1.4, browserify-zlib@~0.1.2: + version "0.1.4" + resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.1.4.tgz#bb35f8a519f600e0fa6b8485241c979d0141fb2d" + dependencies: + pako "~0.2.0" + +browserify@^13.0.1: + version "13.3.0" + resolved "https://registry.yarnpkg.com/browserify/-/browserify-13.3.0.tgz#b5a9c9020243f0c70e4675bec8223bc627e415ce" + dependencies: + JSONStream "^1.0.3" + assert "^1.4.0" + browser-pack "^6.0.1" + browser-resolve "^1.11.0" + browserify-zlib "~0.1.2" + buffer "^4.1.0" + cached-path-relative "^1.0.0" + concat-stream "~1.5.1" + console-browserify "^1.1.0" + constants-browserify "~1.0.0" + crypto-browserify "^3.0.0" + defined "^1.0.0" + deps-sort "^2.0.0" + domain-browser "~1.1.0" + duplexer2 "~0.1.2" + events "~1.1.0" + glob "^7.1.0" + has "^1.0.0" + htmlescape "^1.1.0" + https-browserify "~0.0.0" + inherits "~2.0.1" + insert-module-globals "^7.0.0" + labeled-stream-splicer "^2.0.0" + module-deps "^4.0.8" + os-browserify "~0.1.1" + parents "^1.0.1" + path-browserify "~0.0.0" + process "~0.11.0" + punycode "^1.3.2" + querystring-es3 "~0.2.0" + read-only-stream "^2.0.0" + readable-stream "^2.0.2" + resolve "^1.1.4" + shasum "^1.0.0" + shell-quote "^1.6.1" + stream-browserify "^2.0.0" + stream-http "^2.0.0" + string_decoder "~0.10.0" + subarg "^1.0.0" + syntax-error "^1.1.1" + through2 "^2.0.0" + timers-browserify "^1.0.1" + tty-browserify "~0.0.0" + url "~0.11.0" + util "~0.10.1" + vm-browserify "~0.0.1" + xtend "^4.0.0" + +buffer@^4.1.0, buffer@^4.9.0: + version "4.9.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298" + dependencies: + base64-js "^1.0.2" + ieee754 "^1.1.4" + isarray "^1.0.0" + +builtin-status-codes@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" + +cached-path-relative@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cached-path-relative/-/cached-path-relative-1.0.1.tgz#d09c4b52800aa4c078e2dd81a869aac90d2e54e7" + +camelcase@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + +center-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" + dependencies: + align-text "^0.1.3" + lazy-cache "^1.0.3" + +chai@^3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/chai/-/chai-3.5.0.tgz#4d02637b067fe958bdbfdd3a40ec56fef7373247" + dependencies: + assertion-error "^1.0.1" + deep-eql "^0.1.3" + type-detect "^1.0.0" + +chokidar@^1.0.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" + dependencies: + anymatch "^1.3.0" + async-each "^1.0.0" + glob-parent "^2.0.0" + inherits "^2.0.1" + is-binary-path "^1.0.0" + is-glob "^2.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.0.0" + optionalDependencies: + fsevents "^1.0.0" + +cliui@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" + dependencies: + center-align "^0.1.1" + right-align "^0.1.1" + wordwrap "0.0.2" + +clone@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.2.tgz#260b7a99ebb1edfe247538175f783243cb19d149" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +colors@^1.0.3: + version "1.1.2" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" + +combine-source-map@~0.7.1: + version "0.7.2" + resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.7.2.tgz#0870312856b307a87cc4ac486f3a9a62aeccc09e" + dependencies: + convert-source-map "~1.1.0" + inline-source-map "~0.6.0" + lodash.memoize "~3.0.3" + source-map "~0.5.3" + +combined-stream@^1.0.5, combined-stream@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" + dependencies: + delayed-stream "~1.0.0" + +commander@2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" + dependencies: + graceful-readlink ">= 1.0.0" + +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +concat-stream@~1.5.0, concat-stream@~1.5.1: + version "1.5.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.5.2.tgz#708978624d856af41a5a741defdd261da752c266" + dependencies: + inherits "~2.0.1" + readable-stream "~2.0.0" + typedarray "~0.0.5" + +console-browserify@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" + dependencies: + date-now "^0.1.4" + +console-control-strings@^1.0.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + +constants-browserify@^1.0.0, constants-browserify@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" + +convert-source-map@^1.1.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.0.tgz#9acd70851c6d5dfdd93d9282e5edf94a03ff46b5" + +convert-source-map@~1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.1.3.tgz#4829c877e9fe49b3161f3bf3673888e204699860" + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +cryptiles@2.x.x: + version "2.0.5" + resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" + dependencies: + boom "2.x.x" + +crypto-browserify@3.3.0, crypto-browserify@^3.0.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.3.0.tgz#b9fc75bb4a0ed61dcf1cd5dae96eb30c9c3e506c" + dependencies: + browserify-aes "0.4.0" + pbkdf2-compat "2.0.1" + ripemd160 "0.2.0" + sha.js "2.2.6" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + dependencies: + assert-plus "^1.0.0" + +date-now@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" + +debug@2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.0.tgz#bc596bcabe7617f11d9fa15361eded5608b8499b" + dependencies: + ms "0.7.2" + +debug@^2.2.0: + version "2.6.8" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" + dependencies: + ms "2.0.0" + +decamelize@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + +deep-eql@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-0.1.3.tgz#ef558acab8de25206cd713906d74e56930eb69f2" + dependencies: + type-detect "0.1.1" + +deep-extend@~0.4.0: + version "0.4.2" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" + +defined@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + +deps-sort@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/deps-sort/-/deps-sort-2.0.0.tgz#091724902e84658260eb910748cccd1af6e21fb5" + dependencies: + JSONStream "^1.0.3" + shasum "^1.0.0" + subarg "^1.0.0" + through2 "^2.0.0" + +detective@^4.0.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/detective/-/detective-4.5.0.tgz#6e5a8c6b26e6c7a254b1c6b6d7490d98ec91edd1" + dependencies: + acorn "^4.0.3" + defined "^1.0.0" + +diff@3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" + +domain-browser@^1.1.1, domain-browser@~1.1.0: + version "1.1.7" + resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.1.7.tgz#867aa4b093faa05f1de08c06f4d7b21fdf8698bc" + +duplexer2@^0.1.2, duplexer2@~0.1.0, duplexer2@~0.1.2: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" + dependencies: + readable-stream "^2.0.2" + +ecc-jsbn@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" + dependencies: + jsbn "~0.1.0" + +emojis-list@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" + +enhanced-resolve@^0.9.0, enhanced-resolve@~0.9.0: + version "0.9.1" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-0.9.1.tgz#4d6e689b3725f86090927ccc86cd9f1635b89e2e" + dependencies: + graceful-fs "^4.1.2" + memory-fs "^0.2.0" + tapable "^0.1.8" + +errno@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.4.tgz#b896e23a9e5e8ba33871fc996abd3635fc9a1c7d" + dependencies: + prr "~0.0.0" + +error-ex@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" + dependencies: + is-arrayish "^0.2.1" + +escape-string-regexp@1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +events@^1.0.0, events@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + dependencies: + is-posix-bracket "^0.1.0" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + dependencies: + fill-range "^2.1.0" + +extend@~3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" + +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + dependencies: + is-extglob "^1.0.0" + +extsprintf@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550" + +filename-regex@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + +fill-range@^2.1.0: + version "2.2.3" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^1.1.3" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + +for-in@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + +for-own@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + dependencies: + for-in "^1.0.1" + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + +form-data@~2.1.1: + version "2.1.4" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1" + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.5" + mime-types "^2.1.12" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +fsevents@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.2.tgz#3282b713fb3ad80ede0e9fcf4611b5aa6fc033f4" + dependencies: + nan "^2.3.0" + node-pre-gyp "^0.6.36" + +fstream-ignore@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/fstream-ignore/-/fstream-ignore-1.0.5.tgz#9c31dae34767018fe1d249b24dada67d092da105" + dependencies: + fstream "^1.0.0" + inherits "2" + minimatch "^3.0.0" + +fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2: + version "1.0.11" + resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" + dependencies: + graceful-fs "^4.1.2" + inherits "~2.0.0" + mkdirp ">=0.5 0" + rimraf "2" + +function-bind@^1.0.2: + version "1.1.0" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771" + +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + dependencies: + assert-plus "^1.0.0" + +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + dependencies: + is-glob "^2.0.0" + +glob@7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.2" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^6.0.1: + version "6.0.4" + resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22" + dependencies: + inflight "^1.0.4" + inherits "2" + minimatch "2 || 3" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.0.5, glob@^7.1.0: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globby@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-4.1.0.tgz#080f54549ec1b82a6c60e631fc82e1211dbe95f8" + dependencies: + array-union "^1.0.1" + arrify "^1.0.0" + glob "^6.0.1" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +graceful-fs@^4.1.2: + version "4.1.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + +"graceful-readlink@>= 1.0.0": + version "1.0.1" + resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" + +growl@1.9.2: + version "1.9.2" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f" + +har-schema@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e" + +har-validator@~4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a" + dependencies: + ajv "^4.9.1" + har-schema "^1.0.5" + +has-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + +has-unicode@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + +has@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" + dependencies: + function-bind "^1.0.2" + +hawk@~3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" + dependencies: + boom "2.x.x" + cryptiles "2.x.x" + hoek "2.x.x" + sntp "1.x.x" + +hoek@2.x.x: + version "2.16.3" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" + +htmlescape@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/htmlescape/-/htmlescape-1.1.1.tgz#3a03edc2214bca3b66424a3e7959349509cb0351" + +http-signature@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf" + dependencies: + assert-plus "^0.2.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +https-browserify@0.0.1, https-browserify@~0.0.0: + version "0.0.1" + resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-0.0.1.tgz#3f91365cabe60b77ed0ebba24b454e3e09d95a82" + +ieee754@^1.1.4: + version "1.1.8" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" + +indexof@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.1, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +inherits@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" + +ini@~1.3.0: + version "1.3.4" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e" + +inline-source-map@~0.6.0: + version "0.6.2" + resolved "https://registry.yarnpkg.com/inline-source-map/-/inline-source-map-0.6.2.tgz#f9393471c18a79d1724f863fa38b586370ade2a5" + dependencies: + source-map "~0.5.3" + +insert-module-globals@^7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/insert-module-globals/-/insert-module-globals-7.0.1.tgz#c03bf4e01cb086d5b5e5ace8ad0afe7889d638c3" + dependencies: + JSONStream "^1.0.3" + combine-source-map "~0.7.1" + concat-stream "~1.5.1" + is-buffer "^1.1.0" + lexical-scope "^1.2.0" + process "~0.11.0" + through2 "^2.0.0" + xtend "^4.0.0" + +interpret@^0.6.4: + version "0.6.6" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-0.6.6.tgz#fecd7a18e7ce5ca6abfb953e1f86213a49f1625b" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + +is-binary-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + dependencies: + binary-extensions "^1.0.0" + +is-buffer@^1.1.0, is-buffer@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc" + +is-dotfile@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + dependencies: + is-primitive "^2.0.0" + +is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + dependencies: + is-extglob "^1.0.0" + +is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + dependencies: + kind-of "^3.0.2" + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + dependencies: + kind-of "^3.0.2" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + +isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isarray@~0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + dependencies: + isarray "1.0.0" + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + +json-stable-stringify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" + dependencies: + jsonify "~0.0.0" + +json-stable-stringify@~0.0.0: + version "0.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz#611c23e814db375527df851193db59dd2af27f45" + dependencies: + jsonify "~0.0.0" + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + +json3@3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" + +json5@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + +jsonparse@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" + +jsprim@^1.2.2: + version "1.4.0" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.0.tgz#a3b87e40298d8c380552d8cc7628a0bb95a22918" + dependencies: + assert-plus "1.0.0" + extsprintf "1.0.2" + json-schema "0.2.3" + verror "1.3.6" + +kind-of@^3.0.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + dependencies: + is-buffer "^1.1.5" + +labeled-stream-splicer@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/labeled-stream-splicer/-/labeled-stream-splicer-2.0.0.tgz#a52e1d138024c00b86b1c0c91f677918b8ae0a59" + dependencies: + inherits "^2.0.1" + isarray "~0.0.1" + stream-splicer "^2.0.0" + +lazy-cache@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" + +lexical-scope@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/lexical-scope/-/lexical-scope-1.2.0.tgz#fcea5edc704a4b3a8796cdca419c3a0afaf22df4" + dependencies: + astw "^2.0.0" + +loader-utils@^0.2.11, loader-utils@^0.2.6: + version "0.2.17" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.17.tgz#f86e6374d43205a6e6c60e9196f17c0299bfb348" + dependencies: + big.js "^3.1.3" + emojis-list "^2.0.0" + json5 "^0.5.0" + object-assign "^4.0.1" + +lodash._baseassign@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e" + dependencies: + lodash._basecopy "^3.0.0" + lodash.keys "^3.0.0" + +lodash._basecopy@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" + +lodash._basecreate@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz#1bc661614daa7fc311b7d03bf16806a0213cf821" + +lodash._getnative@^3.0.0: + version "3.9.1" + resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" + +lodash._isiterateecall@^3.0.0: + version "3.0.9" + resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" + +lodash.create@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/lodash.create/-/lodash.create-3.1.1.tgz#d7f2849f0dbda7e04682bb8cd72ab022461debe7" + dependencies: + lodash._baseassign "^3.0.0" + lodash._basecreate "^3.0.0" + lodash._isiterateecall "^3.0.0" + +lodash.isarguments@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" + +lodash.isarray@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" + +lodash.keys@^3.0.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" + dependencies: + lodash._getnative "^3.0.0" + lodash.isarguments "^3.0.0" + lodash.isarray "^3.0.0" + +lodash.memoize@~3.0.3: + version "3.0.4" + resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f" + +longest@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" + +memory-fs@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.2.0.tgz#f2bb25368bc121e391c2520de92969caee0a0290" + +memory-fs@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.3.0.tgz#7bcc6b629e3a43e871d7e29aca6ae8a7f15cbb20" + dependencies: + errno "^0.1.3" + readable-stream "^2.0.1" + +micromatch@^2.1.5: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + +mime-db@~1.27.0: + version "1.27.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.27.0.tgz#820f572296bbd20ec25ed55e5b5de869e5436eb1" + +mime-types@^2.1.12, mime-types@~2.1.7: + version "2.1.15" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.15.tgz#a4ebf5064094569237b8cf70046776d09fc92aed" + dependencies: + mime-db "~1.27.0" + +"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8, minimist@~0.0.1: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +minimist@^1.1.0, minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + +mkdirp@0.5.1, "mkdirp@>=0.5 0", mkdirp@^0.5.1, mkdirp@~0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +mocha@^3.4.2: + version "3.4.2" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-3.4.2.tgz#d0ef4d332126dbf18d0d640c9b382dd48be97594" + dependencies: + browser-stdout "1.3.0" + commander "2.9.0" + debug "2.6.0" + diff "3.2.0" + escape-string-regexp "1.0.5" + glob "7.1.1" + growl "1.9.2" + json3 "3.3.2" + lodash.create "3.1.1" + mkdirp "0.5.1" + supports-color "3.1.2" + +module-deps@^4.0.8: + version "4.1.1" + resolved "https://registry.yarnpkg.com/module-deps/-/module-deps-4.1.1.tgz#23215833f1da13fd606ccb8087b44852dcb821fd" + dependencies: + JSONStream "^1.0.3" + browser-resolve "^1.7.0" + cached-path-relative "^1.0.0" + concat-stream "~1.5.0" + defined "^1.0.0" + detective "^4.0.0" + duplexer2 "^0.1.2" + inherits "^2.0.1" + parents "^1.0.0" + readable-stream "^2.0.2" + resolve "^1.1.3" + stream-combiner2 "^1.1.1" + subarg "^1.0.0" + through2 "^2.0.0" + xtend "^4.0.0" + +ms@0.7.2: + version "0.7.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + +nan@^2.3.0: + version "2.6.2" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.6.2.tgz#e4ff34e6c95fdfb5aecc08de6596f43605a7db45" + +node-libs-browser@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-0.7.0.tgz#3e272c0819e308935e26674408d7af0e1491b83b" + dependencies: + assert "^1.1.1" + browserify-zlib "^0.1.4" + buffer "^4.9.0" + console-browserify "^1.1.0" + constants-browserify "^1.0.0" + crypto-browserify "3.3.0" + domain-browser "^1.1.1" + events "^1.0.0" + https-browserify "0.0.1" + os-browserify "^0.2.0" + path-browserify "0.0.0" + process "^0.11.0" + punycode "^1.2.4" + querystring-es3 "^0.2.0" + readable-stream "^2.0.5" + stream-browserify "^2.0.1" + stream-http "^2.3.1" + string_decoder "^0.10.25" + timers-browserify "^2.0.2" + tty-browserify "0.0.0" + url "^0.11.0" + util "^0.10.3" + vm-browserify "0.0.4" + +node-pre-gyp@^0.6.36: + version "0.6.36" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.36.tgz#db604112cb74e0d477554e9b505b17abddfab786" + dependencies: + mkdirp "^0.5.1" + nopt "^4.0.1" + npmlog "^4.0.2" + rc "^1.1.7" + request "^2.81.0" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^2.2.1" + tar-pack "^3.4.0" + +nopt@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + dependencies: + abbrev "1" + osenv "^0.1.4" + +normalize-path@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + dependencies: + remove-trailing-separator "^1.0.1" + +npmlog@^4.0.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.3" + set-blocking "~2.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +oauth-sign@~0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" + +object-assign@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-2.1.1.tgz#43c36e5d569ff8e4816c4efa8be02d26967c18aa" + +object-assign@^4.0.1, object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + +once@^1.3.0, once@^1.3.3: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +optimist@~0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +os-browserify@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.2.1.tgz#63fc4ccee5d2d7763d26bbf8601078e6c2e0044f" + +os-browserify@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.1.2.tgz#49ca0293e0b19590a5f5de10c7f265a617d8fe54" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +os-tmpdir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + +osenv@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.4.tgz#42fe6d5953df06c8064be6f176c3d05aaaa34644" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + +pako@~0.2.0: + version "0.2.9" + resolved "https://registry.yarnpkg.com/pako/-/pako-0.2.9.tgz#f3f7522f4ef782348da8161bad9ecfd51bf83a75" + +parents@^1.0.0, parents@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parents/-/parents-1.0.1.tgz#fedd4d2bf193a77745fe71e371d73c3307d9c751" + dependencies: + path-platform "~0.11.15" + +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + dependencies: + error-ex "^1.2.0" + +path-browserify@0.0.0, path-browserify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-parse@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" + +path-platform@~0.11.15: + version "0.11.15" + resolved "https://registry.yarnpkg.com/path-platform/-/path-platform-0.11.15.tgz#e864217f74c36850f0852b78dc7bf7d4a5721bf2" + +pbkdf2-compat@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pbkdf2-compat/-/pbkdf2-compat-2.0.1.tgz#b6e0c8fa99494d94e0511575802a59a5c142f288" + +performance-now@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" + +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + +process-nextick-args@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" + +process@^0.11.0, process@~0.11.0: + version "0.11.10" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + +prr@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a" + +punycode@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" + +punycode@^1.2.4, punycode@^1.3.2, punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + +qs@~6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" + +querystring-es3@^0.2.0, querystring-es3@~0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" + +querystring@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" + +randomatic@^1.1.3: + version "1.1.7" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c" + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +rc@^1.1.7: + version "1.2.1" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.1.tgz#2e03e8e42ee450b8cb3dce65be1bf8974e1dfd95" + dependencies: + deep-extend "~0.4.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + +read-only-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-only-stream/-/read-only-stream-2.0.0.tgz#2724fd6a8113d73764ac288d4386270c1dbf17f0" + dependencies: + readable-stream "^2.0.2" + +readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.6: + version "2.3.3" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + safe-buffer "~5.1.1" + string_decoder "~1.0.3" + util-deprecate "~1.0.1" + +readable-stream@~2.0.0: + version "2.0.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + string_decoder "~0.10.x" + util-deprecate "~1.0.1" + +readdirp@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" + dependencies: + graceful-fs "^4.1.2" + minimatch "^3.0.2" + readable-stream "^2.0.2" + set-immediate-shim "^1.0.1" + +regex-cache@^0.4.2: + version "0.4.3" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.3.tgz#9b1a6c35d4d0dfcef5711ae651e8e9d3d7114145" + dependencies: + is-equal-shallow "^0.1.3" + is-primitive "^2.0.0" + +remove-trailing-separator@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.0.2.tgz#69b062d978727ad14dc6b56ba4ab772fd8d70511" + +repeat-element@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" + +repeat-string@^1.5.2: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + +request@^2.81.0: + version "2.81.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" + dependencies: + aws-sign2 "~0.6.0" + aws4 "^1.2.1" + caseless "~0.12.0" + combined-stream "~1.0.5" + extend "~3.0.0" + forever-agent "~0.6.1" + form-data "~2.1.1" + har-validator "~4.2.1" + hawk "~3.1.3" + http-signature "~1.1.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.7" + oauth-sign "~0.8.1" + performance-now "^0.2.0" + qs "~6.4.0" + safe-buffer "^5.0.1" + stringstream "~0.0.4" + tough-cookie "~2.3.0" + tunnel-agent "^0.6.0" + uuid "^3.0.0" + +resolve@1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + +resolve@^1.1.3, resolve@^1.1.4: + version "1.3.3" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5" + dependencies: + path-parse "^1.0.5" + +right-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" + dependencies: + align-text "^0.1.1" + +rimraf@2, rimraf@^2.5.1, rimraf@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" + dependencies: + glob "^7.0.5" + +ripemd160@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-0.2.0.tgz#2bf198bde167cacfa51c0a928e84b68bbe171fce" + +safe-buffer@^5.0.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" + +semver@^5.0.1, semver@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" + +set-blocking@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + +set-immediate-shim@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" + +setimmediate@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + +sha.js@2.2.6: + version "2.2.6" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.2.6.tgz#17ddeddc5f722fb66501658895461977867315ba" + +sha.js@~2.4.4: + version "2.4.8" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.8.tgz#37068c2c476b6baf402d14a49c67f597921f634f" + dependencies: + inherits "^2.0.1" + +shasum@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/shasum/-/shasum-1.0.2.tgz#e7012310d8f417f4deb5712150e5678b87ae565f" + dependencies: + json-stable-stringify "~0.0.0" + sha.js "~2.4.4" + +shell-quote@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.6.1.tgz#f4781949cce402697127430ea3b3c5476f481767" + dependencies: + array-filter "~0.0.0" + array-map "~0.0.0" + array-reduce "~0.0.0" + jsonify "~0.0.0" + +signal-exit@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + +sntp@1.x.x: + version "1.0.9" + resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" + dependencies: + hoek "2.x.x" + +source-list-map@~0.1.7: + version "0.1.8" + resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-0.1.8.tgz#c550b2ab5427f6b3f21f5afead88c4f5587b2106" + +source-map@~0.4.1: + version "0.4.4" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" + dependencies: + amdefine ">=0.0.4" + +source-map@~0.5.1, source-map@~0.5.3: + version "0.5.6" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" + +sshpk@^1.7.0: + version "1.13.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.1.tgz#512df6da6287144316dc4c18fe1cf1d940739be3" + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + dashdash "^1.12.0" + getpass "^0.1.1" + optionalDependencies: + bcrypt-pbkdf "^1.0.0" + ecc-jsbn "~0.1.1" + jsbn "~0.1.0" + tweetnacl "~0.14.0" + +stream-browserify@^2.0.0, stream-browserify@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" + dependencies: + inherits "~2.0.1" + readable-stream "^2.0.2" + +stream-combiner2@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stream-combiner2/-/stream-combiner2-1.1.1.tgz#fb4d8a1420ea362764e21ad4780397bebcb41cbe" + dependencies: + duplexer2 "~0.1.0" + readable-stream "^2.0.2" + +stream-http@^2.0.0, stream-http@^2.3.1: + version "2.7.2" + resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.7.2.tgz#40a050ec8dc3b53b33d9909415c02c0bf1abfbad" + dependencies: + builtin-status-codes "^3.0.0" + inherits "^2.0.1" + readable-stream "^2.2.6" + to-arraybuffer "^1.0.0" + xtend "^4.0.0" + +stream-splicer@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/stream-splicer/-/stream-splicer-2.0.0.tgz#1b63be438a133e4b671cc1935197600175910d83" + dependencies: + inherits "^2.0.1" + readable-stream "^2.0.2" + +string-width@^1.0.1, string-width@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +string_decoder@^0.10.25, string_decoder@~0.10.0, string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + +string_decoder@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" + dependencies: + safe-buffer "~5.1.0" + +stringstream@~0.0.4: + version "0.0.5" + resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + dependencies: + is-utf8 "^0.2.0" + +strip-json-comments@^2.0.0, strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + +subarg@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/subarg/-/subarg-1.0.0.tgz#f62cf17581e996b48fc965699f54c06ae268b8d2" + dependencies: + minimist "^1.1.0" + +supports-color@3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5" + dependencies: + has-flag "^1.0.0" + +supports-color@^3.1.0: + version "3.2.3" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" + dependencies: + has-flag "^1.0.0" + +syntax-error@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/syntax-error/-/syntax-error-1.3.0.tgz#1ed9266c4d40be75dc55bf9bb1cb77062bb96ca1" + dependencies: + acorn "^4.0.3" + +tapable@^0.1.8, tapable@~0.1.8: + version "0.1.10" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.1.10.tgz#29c35707c2b70e50d07482b5d202e8ed446dafd4" + +tar-pack@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.4.0.tgz#23be2d7f671a8339376cbdb0b8fe3fdebf317984" + dependencies: + debug "^2.2.0" + fstream "^1.0.10" + fstream-ignore "^1.0.5" + once "^1.3.3" + readable-stream "^2.1.4" + rimraf "^2.5.1" + tar "^2.2.1" + uid-number "^0.0.6" + +tar@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" + dependencies: + block-stream "*" + fstream "^1.0.2" + inherits "2" + +through2@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" + dependencies: + readable-stream "^2.1.5" + xtend "~4.0.1" + +"through@>=2.2.7 <3": + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + +timers-browserify@^1.0.1: + version "1.4.2" + resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-1.4.2.tgz#c9c58b575be8407375cb5e2462dacee74359f41d" + dependencies: + process "~0.11.0" + +timers-browserify@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.2.tgz#ab4883cf597dcd50af211349a00fbca56ac86b86" + dependencies: + setimmediate "^1.0.4" + +to-arraybuffer@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" + +tough-cookie@~2.3.0: + version "2.3.2" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a" + dependencies: + punycode "^1.4.1" + +ts-loader@^0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-0.8.2.tgz#7331296d13d5b3105cd905cebca39143eed2b255" + dependencies: + arrify "^1.0.0" + colors "^1.0.3" + enhanced-resolve "^0.9.0" + loader-utils "^0.2.6" + object-assign "^2.0.0" + semver "^5.0.1" + +tsconfig@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/tsconfig/-/tsconfig-2.2.0.tgz#7fc16e2790dab70c049bd861c1c532bb770e0837" + dependencies: + array-uniq "^1.0.2" + globby "^4.0.0" + parse-json "^2.2.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + strip-json-comments "^2.0.0" + xtend "^4.0.0" + +tsify@^0.16.0: + version "0.16.0" + resolved "https://registry.yarnpkg.com/tsify/-/tsify-0.16.0.tgz#c29a84794bf1d86bb65977113a3b5f03acb84a9f" + dependencies: + commondir "^1.0.1" + convert-source-map "^1.1.0" + through2 "^2.0.0" + tsconfig "^2.2.0" + typescript "~1.8.7" + +tty-browserify@0.0.0, tty-browserify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + +type-detect@0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-0.1.1.tgz#0ba5ec2a885640e470ea4e8505971900dac58822" + +type-detect@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-1.0.0.tgz#762217cc06db258ec48908a1298e8b95121e8ea2" + +typedarray@~0.0.5: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + +typescript@2.0.10: + version "2.0.10" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.0.10.tgz#ccdd4ed86fd5550a407101a0814012e1b3fac3dd" + +typescript@~1.8.7: + version "1.8.10" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-1.8.10.tgz#b475d6e0dff0bf50f296e5ca6ef9fbb5c7320f1e" + +uglify-js@~2.7.3: + version "2.7.5" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.7.5.tgz#4612c0c7baaee2ba7c487de4904ae122079f2ca8" + dependencies: + async "~0.2.6" + source-map "~0.5.1" + uglify-to-browserify "~1.0.0" + yargs "~3.10.0" + +uglify-to-browserify@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" + +uid-number@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" + +umd@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/umd/-/umd-3.0.1.tgz#8ae556e11011f63c2596708a8837259f01b3d60e" + +url@^0.11.0, url@~0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" + dependencies: + punycode "1.3.2" + querystring "0.2.0" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + +util@0.10.3, util@^0.10.3, util@~0.10.1: + version "0.10.3" + resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" + dependencies: + inherits "2.0.1" + +uuid@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" + +verror@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.3.6.tgz#cff5df12946d297d2baaefaa2689e25be01c005c" + dependencies: + extsprintf "1.0.2" + +vm-browserify@0.0.4, vm-browserify@~0.0.1: + version "0.0.4" + resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" + dependencies: + indexof "0.0.1" + +watchpack@^0.2.1: + version "0.2.9" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-0.2.9.tgz#62eaa4ab5e5ba35fdfc018275626e3c0f5e3fb0b" + dependencies: + async "^0.9.0" + chokidar "^1.0.0" + graceful-fs "^4.1.2" + +webpack-core@~0.6.9: + version "0.6.9" + resolved "https://registry.yarnpkg.com/webpack-core/-/webpack-core-0.6.9.tgz#fc571588c8558da77be9efb6debdc5a3b172bdc2" + dependencies: + source-list-map "~0.1.7" + source-map "~0.4.1" + +webpack@^1.13.0: + version "1.15.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-1.15.0.tgz#4ff31f53db03339e55164a9d468ee0324968fe98" + dependencies: + acorn "^3.0.0" + async "^1.3.0" + clone "^1.0.2" + enhanced-resolve "~0.9.0" + interpret "^0.6.4" + loader-utils "^0.2.11" + memory-fs "~0.3.0" + mkdirp "~0.5.0" + node-libs-browser "^0.7.0" + optimist "~0.6.0" + supports-color "^3.1.0" + tapable "~0.1.8" + uglify-js "~2.7.3" + watchpack "^0.2.1" + webpack-core "~0.6.9" + +wide-align@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.2.tgz#571e0f1b0604636ebc0dfc21b0339bbe31341710" + dependencies: + string-width "^1.0.2" + +window-size@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" + +wordwrap@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +xtend@^4.0.0, xtend@~4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" + +yargs@~3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" + dependencies: + camelcase "^1.0.2" + cliui "^2.1.0" + decamelize "^1.0.0" + window-size "0.1.0" From df32eaff8d8cce0ec11774c6bde42aa366451cc5 Mon Sep 17 00:00:00 2001 From: Isman Usoh Date: Tue, 18 Jul 2017 02:49:01 +0700 Subject: [PATCH 5/8] Delete dev swagger file --- .../src/test/resources/2_0/swagger.json | 2521 ----------------- 1 file changed, 2521 deletions(-) delete mode 100644 modules/swagger-codegen/src/test/resources/2_0/swagger.json diff --git a/modules/swagger-codegen/src/test/resources/2_0/swagger.json b/modules/swagger-codegen/src/test/resources/2_0/swagger.json deleted file mode 100644 index d9abd230b88..00000000000 --- a/modules/swagger-codegen/src/test/resources/2_0/swagger.json +++ /dev/null @@ -1,2521 +0,0 @@ -{ - "basePath": "/v1", - "consumes": [ - "application/json" - ], - "definitions": { - "EnumIndexValue": { - "description": "EnumIndexValue.", - "enum": [ - "0", - "1" - ], - "type": "string" - }, - "EnumNumberValue": { - "description": "EnumNumberValue.", - "enum": [ - "2", - "5" - ], - "type": "string" - }, - "EnumStringValue": { - "description": "EnumStringValue.", - "enum": [ - "VALUE_1", - "VALUE_2" - ], - "type": "string" - }, - "TestModel": { - "description": "This is a description of a model", - "properties": { - "numberValue": { - "type": "number", - "format": "double", - "description": "This is a description of this model property, numberValue" - }, - "numberArray": { - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - "stringValue": { - "type": "string" - }, - "stringArray": { - "type": "array", - "items": { - "type": "string" - } - }, - "boolValue": { - "type": "boolean" - }, - "boolArray": { - "type": "array", - "items": { - "type": "boolean" - } - }, - "enumValue": { - "$ref": "#/definitions/EnumIndexValue" - }, - "enumArray": { - "type": "array", - "items": { - "$ref": "#/definitions/EnumIndexValue" - } - }, - "enumNumberValue": { - "$ref": "#/definitions/EnumNumberValue" - }, - "enumNumberArray": { - "type": "array", - "items": { - "$ref": "#/definitions/EnumNumberValue" - } - }, - "enumStringValue": { - "$ref": "#/definitions/EnumStringValue" - }, - "enumStringArray": { - "type": "array", - "items": { - "$ref": "#/definitions/EnumStringValue" - } - }, - "modelValue": { - "$ref": "#/definitions/TestSubModel" - }, - "modelsArray": { - "type": "array", - "items": { - "$ref": "#/definitions/TestSubModel" - } - }, - "strLiteralVal": { - "type": "string", - "enum": [ - "Foo", - "Bar" - ] - }, - "strLiteralArr": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "Foo", - "Bar" - ] - } - }, - "dateValue": { - "type": "string", - "format": "date-time" - }, - "optionalString": { - "type": "string" - }, - "modelsObjectIndirect": { - "$ref": "#/definitions/TestSubModelContainer" - }, - "modelsObjectIndirectNS": { - "$ref": "#/definitions/TestSubModelContainerNamespace.TestSubModelContainer" - }, - "modelsObjectIndirectNS2": { - "$ref": "#/definitions/TestSubModelContainerNamespace.InnerNamespace.TestSubModelContainer2" - }, - "modelsObjectIndirectNS_Alias": { - "$ref": "#/definitions/TestSubModelContainerNamespace_TestSubModelContainer" - }, - "modelsObjectIndirectNS2_Alias": { - "$ref": "#/definitions/TestSubModelContainerNamespace_InnerNamespace_TestSubModelContainer2" - }, - "modelsArrayIndirect": { - "$ref": "#/definitions/TestSubArrayModelContainer" - }, - "modelsEnumIndirect": { - "$ref": "#/definitions/TestSubEnumModelContainer" - }, - "typeAliasCase1": { - "$ref": "#/definitions/TypeAliasModelCase1" - }, - "TypeAliasCase2": { - "$ref": "#/definitions/TypeAliasModelCase2" - }, - "id": { - "type": "number", - "format": "double" - } - }, - "required": [ - "numberValue", - "numberArray", - "stringValue", - "stringArray", - "boolValue", - "boolArray", - "modelValue", - "modelsArray", - "strLiteralVal", - "strLiteralArr", - "id" - ], - "type": "object" - }, - "TestSubModel": { - "properties": { - "email": { - "type": "string" - }, - "circular": { - "$ref": "#/definitions/TestModel" - }, - "id": { - "type": "number", - "format": "double" - } - }, - "required": [ - "email", - "id" - ], - "type": "object" - }, - "TestSubModel2": { - "properties": { - "testSubModel2": { - "type": "boolean" - }, - "email": { - "type": "string" - }, - "circular": { - "$ref": "#/definitions/TestModel" - }, - "id": { - "type": "number", - "format": "double" - } - }, - "required": [ - "testSubModel2", - "email", - "id" - ], - "type": "object" - }, - "TestSubModelContainer": { - "properties": {}, - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/TestSubModel2" - } - }, - "TestSubModelNamespace.TestSubModelNS": { - "properties": { - "testSubModelNS": { - "type": "boolean" - }, - "email": { - "type": "string" - }, - "circular": { - "$ref": "#/definitions/TestModel" - }, - "id": { - "type": "number", - "format": "double" - } - }, - "required": [ - "testSubModelNS", - "email", - "id" - ], - "type": "object" - }, - "TestSubModelContainerNamespace.TestSubModelContainer": { - "properties": {}, - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/TestSubModelNamespace.TestSubModelNS" - } - }, - "TestSubModelContainerNamespace.InnerNamespace.TestSubModelContainer2": { - "properties": {}, - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/TestSubModelNamespace.TestSubModelNS" - } - }, - "TestSubModelContainerNamespace_TestSubModelContainer": { - "properties": {}, - "type": "object" - }, - "TestSubModelContainerNamespace_InnerNamespace_TestSubModelContainer2": { - "properties": {}, - "type": "object" - }, - "TestSubArrayModelContainer": { - "properties": {}, - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "$ref": "#/definitions/TestSubModel2" - } - } - }, - "TestSubEnumModelContainer": { - "properties": {}, - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/EnumStringValue" - } - }, - "TypeAliasModelCase1": { - "properties": { - "value1": { - "type": "string" - }, - "value2": { - "type": "string" - } - }, - "required": [ - "value1", - "value2" - ], - "type": "object" - }, - "TypeAliasModelCase2": { - "properties": { - "value1": { - "type": "string" - }, - "value2": { - "type": "string" - }, - "value3": { - "type": "string" - } - }, - "required": [ - "value1", - "value2", - "value3" - ], - "type": "object" - }, - "TestClassModel": { - "description": "This is a description of TestClassModel", - "properties": { - "publicStringProperty": { - "type": "string", - "description": "This is a description of a public string property", - "minLength": 3, - "maxLength": 20, - "pattern": "^[a-zA-Z]+$" - }, - "optionalPublicStringProperty": { - "type": "string", - "minLength": 0, - "maxLength": 10 - }, - "stringProperty": { - "type": "string" - }, - "publicConstructorVar": { - "type": "string", - "description": "This is a description for publicConstructorVar" - }, - "optionalPublicConstructorVar": { - "type": "string" - }, - "id": { - "type": "number", - "format": "double" - } - }, - "required": [ - "publicStringProperty", - "stringProperty", - "publicConstructorVar", - "id" - ], - "type": "object" - }, - "GenericRequestTestModel": { - "properties": { - "name": { - "type": "string" - }, - "value": { - "$ref": "#/definitions/TestModel" - } - }, - "required": [ - "name", - "value" - ], - "type": "object" - }, - "Result": { - "properties": { - "value": { - "type": "object" - } - }, - "required": [ - "value" - ], - "type": "object" - }, - "GenericModelTestModel": { - "properties": { - "result": { - "$ref": "#/definitions/TestModel" - } - }, - "required": [ - "result" - ], - "type": "object" - }, - "GenericModelTestModel[]": { - "properties": { - "result": { - "type": "array", - "items": { - "$ref": "#/definitions/TestModel" - } - } - }, - "required": [ - "result" - ], - "type": "object" - }, - "GenericModelstring": { - "properties": { - "result": { - "type": "string" - } - }, - "required": [ - "result" - ], - "type": "object" - }, - "GenericModelstring[]": { - "properties": { - "result": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "result" - ], - "type": "object" - }, - "ErrorResponseModel": { - "properties": { - "status": { - "type": "number", - "format": "double" - }, - "message": { - "type": "string" - } - }, - "required": [ - "status", - "message" - ], - "type": "object" - }, - "Gender": { - "enum": [ - "MALE", - "FEMALE" - ], - "type": "string" - }, - "ParameterTestModel": { - "properties": { - "firstname": { - "type": "string" - }, - "lastname": { - "type": "string" - }, - "age": { - "type": "integer", - "format": "int32", - "minimum": 1, - "maximum": 100 - }, - "weight": { - "type": "number", - "format": "float" - }, - "human": { - "type": "boolean" - }, - "gender": { - "$ref": "#/definitions/Gender" - } - }, - "required": [ - "firstname", - "lastname", - "age", - "weight", - "human", - "gender" - ], - "type": "object" - }, - "UserResponseModel": { - "properties": { - "id": { - "type": "number", - "format": "double" - }, - "name": { - "type": "string" - } - }, - "required": [ - "id", - "name" - ], - "type": "object" - }, - "ValidateDateResponse": { - "properties": { - "minDateValue": { - "type": "string", - "format": "date-time" - }, - "maxDateValue": { - "type": "string", - "format": "date-time" - } - }, - "required": [ - "minDateValue", - "maxDateValue" - ], - "type": "object" - }, - "ValidateNumberResponse": { - "properties": { - "minValue": { - "type": "number", - "format": "double" - }, - "maxValue": { - "type": "number", - "format": "double" - } - }, - "required": [ - "minValue", - "maxValue" - ], - "type": "object" - }, - "ValidateBooleanResponse": { - "properties": { - "boolValue": { - "type": "boolean" - } - }, - "required": [ - "boolValue" - ], - "type": "object" - }, - "ValidateStringResponse": { - "properties": { - "minLength": { - "type": "string" - }, - "maxLength": { - "type": "string" - }, - "patternValue": { - "type": "string" - } - }, - "required": [ - "minLength", - "maxLength", - "patternValue" - ], - "type": "object" - }, - "ValidateModel": { - "properties": { - "floatValue": { - "type": "number", - "format": "float" - }, - "doubleValue": { - "type": "number", - "format": "double" - }, - "intValue": { - "type": "integer", - "format": "int32" - }, - "longValue": { - "type": "integer", - "format": "int64" - }, - "booleanValue": { - "type": "boolean" - }, - "arrayValue": { - "type": "array", - "items": { - "type": "number", - "format": "double" - } - }, - "dateValue": { - "type": "string", - "format": "date" - }, - "datetimeValue": { - "type": "string", - "format": "date-time" - }, - "numberMax10": { - "type": "number", - "format": "double", - "maximum": 10 - }, - "numberMin5": { - "type": "number", - "format": "double", - "minimum": 5 - }, - "stringMax10Lenght": { - "type": "string", - "maxLength": 10 - }, - "stringMin5Lenght": { - "type": "string", - "minLength": 5 - }, - "stringPatternAZaz": { - "type": "string", - "pattern": "^[a-zA-Z]+$" - }, - "arrayMax5Item": { - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 5 - }, - "arrayMin2Item": { - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "minItems": 2 - }, - "arrayUniqueItem": { - "type": "array", - "items": { - "type": "number", - "format": "double" - } - } - }, - "required": [ - "floatValue", - "doubleValue", - "intValue", - "longValue", - "booleanValue", - "arrayValue", - "dateValue", - "datetimeValue", - "numberMax10", - "numberMin5", - "stringMax10Lenght", - "stringMin5Lenght", - "stringPatternAZaz", - "arrayMax5Item", - "arrayMin2Item", - "arrayUniqueItem" - ], - "type": "object" - } - }, - "info": { - "title": "tsoa app", - "description": "a description", - "license": { - "name": "MIT" - }, - "version": "1.0" - }, - "paths": { - "/PutTest": { - "put": { - "operationId": "PutTestPutModel", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "parameters": [ - { - "in": "body", - "name": "model", - "required": true, - "schema": { - "$ref": "#/definitions/TestModel" - } - } - ] - } - }, - "/PutTest/Location": { - "put": { - "operationId": "PutTestPutModelAtLocation", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "parameters": [] - } - }, - "/PutTest/Multi": { - "put": { - "operationId": "PutTestPutWithMultiReturn", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/TestModel" - } - } - } - }, - "parameters": [] - } - }, - "/PutTest/WithId/{id}": { - "put": { - "operationId": "PutTestPutWithId", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "type": "number", - "format": "double" - } - ] - } - }, - "/PostTest": { - "post": { - "operationId": "PostTestPostModel", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "parameters": [ - { - "in": "body", - "name": "model", - "required": true, - "schema": { - "$ref": "#/definitions/TestModel" - } - } - ] - }, - "patch": { - "operationId": "PostTestUpdateModel", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "parameters": [ - { - "in": "body", - "name": "model", - "required": true, - "schema": { - "$ref": "#/definitions/TestModel" - } - } - ] - } - }, - "/PostTest/WithClassModel": { - "post": { - "operationId": "PostTestPostClassModel", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestClassModel" - } - } - }, - "parameters": [ - { - "in": "body", - "name": "model", - "required": true, - "schema": { - "$ref": "#/definitions/TestClassModel" - } - } - ] - } - }, - "/PostTest/Location": { - "post": { - "operationId": "PostTestPostModelAtLocation", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "parameters": [] - } - }, - "/PostTest/Multi": { - "post": { - "operationId": "PostTestPostWithMultiReturn", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/TestModel" - } - } - } - }, - "parameters": [] - } - }, - "/PostTest/WithId/{id}": { - "post": { - "operationId": "PostTestPostWithId", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "type": "number", - "format": "double" - } - ] - } - }, - "/PostTest/WithBodyAndQueryParams": { - "post": { - "operationId": "PostTestPostWithBodyAndQueryParams", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "parameters": [ - { - "in": "body", - "name": "model", - "required": true, - "schema": { - "$ref": "#/definitions/TestModel" - } - }, - { - "in": "query", - "name": "query", - "required": true, - "type": "string" - } - ] - } - }, - "/PostTest/GenericBody": { - "post": { - "operationId": "PostTestGetGenericRequest", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "parameters": [ - { - "in": "body", - "name": "genericReq", - "required": true, - "schema": { - "$ref": "#/definitions/GenericRequestTestModel" - } - } - ] - } - }, - "/PatchTest": { - "patch": { - "operationId": "PatchTestPatchModel", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "parameters": [ - { - "in": "body", - "name": "model", - "required": true, - "schema": { - "$ref": "#/definitions/TestModel" - } - } - ] - } - }, - "/PatchTest/Location": { - "patch": { - "operationId": "PatchTestPatchModelAtLocation", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "parameters": [] - } - }, - "/PatchTest/Multi": { - "patch": { - "operationId": "PatchTestPatchWithMultiReturn", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/TestModel" - } - } - } - }, - "parameters": [] - } - }, - "/PatchTest/WithId/{id}": { - "patch": { - "operationId": "PatchTestPatchWithId", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "type": "number", - "format": "double" - } - ] - } - }, - "/GetTest": { - "get": { - "operationId": "GetTestGetModel", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - }, - "examples": { - "application/json": { - "boolArray": [ - true, - false - ], - "boolValue": true, - "id": 1, - "modelValue": { - "email": "test@test.com", - "id": 100 - }, - "numberArray": [ - 1, - 2, - 3 - ], - "numberValue": 1, - "optionalString": "optional string", - "strLiteralArr": [ - "Foo", - "Bar" - ], - "strLiteralVal": "Foo", - "stringArray": [ - "string one", - "string two" - ], - "stringValue": "a string" - } - } - } - }, - "description": "This is a description of the getModel method\r\nthis is some more text on another line", - "parameters": [] - } - }, - "/GetTest/Current": { - "get": { - "operationId": "GetTestGetCurrentModel", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "parameters": [] - } - }, - "/GetTest/ClassModel": { - "get": { - "operationId": "GetTestGetClassModel", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestClassModel" - } - } - }, - "parameters": [] - } - }, - "/GetTest/Multi": { - "get": { - "operationId": "GetTestGetMultipleModels", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/TestModel" - } - } - } - }, - "parameters": [] - } - }, - "/GetTest/{numberPathParam}/{booleanPathParam}/{stringPathParam}": { - "get": { - "operationId": "GetTestGetModelByParams", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "parameters": [ - { - "description": "This is a description for numberPathParam", - "in": "path", - "name": "numberPathParam", - "required": true, - "type": "number", - "format": "double", - "minimum": 1, - "maximum": 10 - }, - { - "in": "path", - "name": "stringPathParam", - "required": true, - "type": "string", - "minLength": 1, - "maxLength": 10 - }, - { - "in": "path", - "name": "booleanPathParam", - "required": true, - "type": "boolean" - }, - { - "in": "query", - "name": "booleanParam", - "required": true, - "type": "boolean" - }, - { - "in": "query", - "name": "stringParam", - "required": true, - "type": "string", - "minLength": 3, - "maxLength": 10 - }, - { - "description": "This is a description for numberParam", - "in": "query", - "name": "numberParam", - "required": true, - "type": "number", - "format": "double" - }, - { - "in": "query", - "name": "optionalStringParam", - "required": false, - "type": "string" - } - ] - } - }, - "/GetTest/ResponseWithUnionTypeProperty": { - "get": { - "operationId": "GetTestGetResponseWithUnionTypeProperty", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/Result" - } - } - }, - "parameters": [] - } - }, - "/GetTest/UnionTypeResponse": { - "get": { - "operationId": "GetTestGetUnionTypeResponse", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "type": "object" - } - } - }, - "parameters": [] - } - }, - "/GetTest/Request": { - "get": { - "operationId": "GetTestGetRequest", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "parameters": [] - } - }, - "/GetTest/DateParam": { - "get": { - "operationId": "GetTestGetByDataParam", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "parameters": [ - { - "in": "query", - "name": "date", - "required": true, - "type": "string", - "format": "date-time" - } - ] - } - }, - "/GetTest/ThrowsError": { - "get": { - "operationId": "GetTestGetThrowsError", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "parameters": [] - } - }, - "/GetTest/GeneratesTags": { - "get": { - "operationId": "GetTestGetGeneratesTags", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "tags": [ - "test", - "test-two" - ], - "parameters": [] - } - }, - "/GetTest/HandleBufferType": { - "get": { - "operationId": "GetTestGetBuffer", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "type": "string", - "format": "byte" - } - } - }, - "parameters": [ - { - "in": "query", - "name": "buffer", - "required": true, - "type": "string", - "format": "byte" - } - ] - } - }, - "/GetTest/GenericModel": { - "get": { - "operationId": "GetTestGetGenericModel", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/GenericModelTestModel" - } - } - }, - "parameters": [] - } - }, - "/GetTest/GenericModelArray": { - "get": { - "operationId": "GetTestGetGenericModelArray", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/GenericModelTestModel[]" - } - } - }, - "parameters": [] - } - }, - "/GetTest/GenericPrimitive": { - "get": { - "operationId": "GetTestGetGenericPrimitive", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/GenericModelstring" - } - } - }, - "parameters": [] - } - }, - "/GetTest/GenericPrimitiveArray": { - "get": { - "operationId": "GetTestGetGenericPrimitiveArray", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/GenericModelstring[]" - } - } - }, - "parameters": [] - } - }, - "/DeleteTest": { - "delete": { - "operationId": "DeleteTestDeleteWithReturnValue", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "parameters": [] - } - }, - "/DeleteTest/Current": { - "delete": { - "operationId": "DeleteTestDeleteCurrent", - "produces": [ - "application/json" - ], - "responses": { - "204": { - "description": "No content" - } - }, - "parameters": [] - } - }, - "/DeleteTest/{numberPathParam}/{booleanPathParam}/{stringPathParam}": { - "delete": { - "operationId": "DeleteTestGetModelByParams", - "produces": [ - "application/json" - ], - "responses": { - "204": { - "description": "No content" - } - }, - "parameters": [ - { - "in": "path", - "name": "numberPathParam", - "required": true, - "type": "number", - "format": "double" - }, - { - "in": "path", - "name": "stringPathParam", - "required": true, - "type": "string" - }, - { - "in": "path", - "name": "booleanPathParam", - "required": true, - "type": "boolean" - }, - { - "in": "query", - "name": "booleanParam", - "required": true, - "type": "boolean" - }, - { - "in": "query", - "name": "stringParam", - "required": true, - "type": "string" - }, - { - "in": "query", - "name": "numberParam", - "required": true, - "type": "number", - "format": "double" - } - ] - } - }, - "/MethodTest/Get": { - "get": { - "operationId": "MethodGetMethod", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "parameters": [] - } - }, - "/MethodTest/Post": { - "post": { - "operationId": "MethodPostMethod", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "parameters": [] - } - }, - "/MethodTest/Patch": { - "patch": { - "operationId": "MethodPatchMethod", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "parameters": [] - } - }, - "/MethodTest/Put": { - "put": { - "operationId": "MethodPutMethod", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "parameters": [] - } - }, - "/MethodTest/Delete": { - "delete": { - "operationId": "MethodDeleteMethod", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "parameters": [] - } - }, - "/MethodTest/Description": { - "get": { - "operationId": "MethodDescription", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "description": "method description", - "parameters": [] - } - }, - "/MethodTest/Tags": { - "get": { - "operationId": "MethodTags", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "tags": [ - "Tag1", - "Tag2", - "Tag3" - ], - "parameters": [] - } - }, - "/MethodTest/MultiResponse": { - "get": { - "operationId": "MethodMultiResponse", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/ErrorResponseModel" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/ErrorResponseModel" - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/ErrorResponseModel" - } - } - }, - "parameters": [] - } - }, - "/MethodTest/SuccessResponse": { - "get": { - "operationId": "MethodSuccessResponse", - "produces": [ - "application/json" - ], - "responses": { - "201": { - "description": "Created" - } - }, - "parameters": [] - } - }, - "/MethodTest/ApiSecurity": { - "get": { - "operationId": "MethodApiSecurity", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "security": [ - { - "api_key": [] - } - ], - "parameters": [] - } - }, - "/MethodTest/OauthSecurity": { - "get": { - "operationId": "MethodOauthSecurity", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "security": [ - { - "tsoa_auth": [ - "write:pets", - "read:pets" - ] - } - ], - "parameters": [] - } - }, - "/MethodTest/DeprecatedMethod": { - "get": { - "operationId": "MethodDeprecatedMethod", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "deprecated": true, - "parameters": [] - } - }, - "/MethodTest/SummaryMethod": { - "get": { - "operationId": "MethodSummaryMethod", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "summary": "simple summary", - "parameters": [] - } - }, - "/ParameterTest/Query": { - "get": { - "operationId": "ParameterGetQuery", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/ParameterTestModel" - } - } - }, - "description": "Get test paramater", - "parameters": [ - { - "description": "Firstname description", - "in": "query", - "name": "firstname", - "required": true, - "type": "string" - }, - { - "description": "Lastname description", - "in": "query", - "name": "last_name", - "required": true, - "type": "string" - }, - { - "description": "Age description", - "in": "query", - "name": "age", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "description": "Weight description", - "in": "query", - "name": "weight", - "required": true, - "type": "number", - "format": "float" - }, - { - "description": "Human description", - "in": "query", - "name": "human", - "required": true, - "type": "boolean" - }, - { - "description": "Gender description", - "in": "query", - "name": "gender", - "required": true, - "schema": { - "$ref": "#/definitions/Gender" - } - } - ] - } - }, - "/ParameterTest/Path/{firstname}/{last_name}/{age}/{weight}/{human}/{gender}": { - "get": { - "operationId": "ParameterGetPath", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/ParameterTestModel" - } - } - }, - "description": "Path test paramater", - "parameters": [ - { - "description": "Firstname description", - "in": "path", - "name": "firstname", - "required": true, - "type": "string" - }, - { - "description": "Lastname description", - "in": "path", - "name": "last_name", - "required": true, - "type": "string" - }, - { - "description": "Age description", - "in": "path", - "name": "age", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "description": "Weight description", - "in": "path", - "name": "weight", - "required": true, - "type": "number", - "format": "float" - }, - { - "description": "Human description", - "in": "path", - "name": "human", - "required": true, - "type": "boolean" - }, - { - "description": "Gender description", - "in": "path", - "name": "gender", - "required": true, - "schema": { - "$ref": "#/definitions/Gender" - } - } - ] - } - }, - "/ParameterTest/Header": { - "get": { - "operationId": "ParameterGetHeader", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/ParameterTestModel" - } - } - }, - "description": "Header test paramater", - "parameters": [ - { - "description": "Firstname description", - "in": "header", - "name": "firstname", - "required": true, - "type": "string" - }, - { - "description": "Lastname description", - "in": "header", - "name": "last_name", - "required": true, - "type": "string" - }, - { - "description": "Age description", - "in": "header", - "name": "age", - "required": true, - "type": "integer", - "format": "int32" - }, - { - "description": "Weight description", - "in": "header", - "name": "weight", - "required": true, - "type": "number", - "format": "float" - }, - { - "description": "Human description", - "in": "header", - "name": "human", - "required": true, - "type": "boolean" - }, - { - "description": "Gender description", - "in": "header", - "name": "gender", - "required": true, - "schema": { - "$ref": "#/definitions/Gender" - } - } - ] - } - }, - "/ParameterTest/Request": { - "get": { - "operationId": "ParameterGetRequest", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/ParameterTestModel" - } - } - }, - "description": "Request test paramater", - "parameters": [] - } - }, - "/ParameterTest/Body": { - "post": { - "operationId": "ParameterGetBody", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/ParameterTestModel" - } - } - }, - "description": "Body test paramater", - "parameters": [ - { - "description": "Body description", - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ParameterTestModel" - } - } - ] - } - }, - "/ParameterTest/BodyProps": { - "post": { - "operationId": "ParameterGetBodyProps", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/ParameterTestModel" - } - } - }, - "parameters": [ - { - "in": "body", - "name": "body", - "schema": { - "properties": { - "firstname": { - "type": "string" - }, - "lastname": { - "type": "string" - }, - "age": { - "type": "integer", - "format": "int32" - }, - "weight": { - "type": "number", - "format": "float" - }, - "human": { - "type": "boolean" - }, - "gender": { - "$ref": "#/definitions/Gender" - } - }, - "title": "ParameterGetBodyPropsBody", - "type": "object", - "required": [ - "firstname", - "lastname", - "age", - "weight", - "human", - "gender" - ] - } - } - ] - } - }, - "/SecurityTest": { - "get": { - "operationId": "SecurityTestGetWithApi", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/UserResponseModel" - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/ErrorResponseModel" - } - } - }, - "security": [ - { - "api_key": [] - } - ], - "parameters": [] - } - }, - "/SecurityTest/Koa": { - "get": { - "operationId": "SecurityTestGetWithApiForKoa", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/UserResponseModel" - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/ErrorResponseModel" - } - } - }, - "security": [ - { - "api_key": [] - } - ], - "parameters": [] - } - }, - "/SecurityTest/Oauth": { - "get": { - "operationId": "SecurityTestGetWithSecurity", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/UserResponseModel" - } - }, - "404": { - "description": "Not Fount", - "schema": { - "$ref": "#/definitions/ErrorResponseModel" - } - } - }, - "security": [ - { - "tsoa_auth": [ - "write:pets", - "read:pets" - ] - } - ], - "parameters": [] - } - }, - "/Validate/parameter/date": { - "get": { - "operationId": "ValidateDateValidate", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/ValidateDateResponse" - } - } - }, - "parameters": [ - { - "in": "query", - "name": "minDateValue", - "required": true, - "type": "string", - "format": "date" - }, - { - "in": "query", - "name": "maxDateValue", - "required": true, - "type": "string", - "format": "date" - } - ] - } - }, - "/Validate/parameter/datetime": { - "get": { - "operationId": "ValidateDateTimeValidate", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/ValidateDateResponse" - } - } - }, - "parameters": [ - { - "in": "query", - "name": "minDateValue", - "required": true, - "type": "string", - "format": "date-time" - }, - { - "in": "query", - "name": "maxDateValue", - "required": true, - "type": "string", - "format": "date-time" - } - ] - } - }, - "/Validate/parameter/integer": { - "get": { - "operationId": "ValidateLongValidate", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/ValidateNumberResponse" - } - } - }, - "parameters": [ - { - "in": "query", - "name": "minValue", - "required": true, - "type": "integer", - "format": "int32", - "minimum": 5 - }, - { - "in": "query", - "name": "maxValue", - "required": true, - "type": "integer", - "format": "int32", - "maximum": 3 - } - ] - } - }, - "/Validate/parameter/float": { - "get": { - "operationId": "ValidateDoubleValidate", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/ValidateNumberResponse" - } - } - }, - "parameters": [ - { - "in": "query", - "name": "minValue", - "required": true, - "type": "number", - "format": "float", - "minimum": 5.5 - }, - { - "in": "query", - "name": "maxValue", - "required": true, - "type": "number", - "format": "float", - "maximum": 3.5 - } - ] - } - }, - "/Validate/parameter/boolean": { - "get": { - "operationId": "ValidateBooleanValidate", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/ValidateBooleanResponse" - } - } - }, - "parameters": [ - { - "in": "query", - "name": "boolValue", - "required": true, - "type": "boolean" - } - ] - } - }, - "/Validate/parameter/string": { - "get": { - "operationId": "ValidateStringValidate", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/ValidateStringResponse" - } - } - }, - "parameters": [ - { - "in": "query", - "name": "minLength", - "required": true, - "type": "string", - "minLength": 5 - }, - { - "in": "query", - "name": "maxLength", - "required": true, - "type": "string", - "maxLength": 3 - }, - { - "in": "query", - "name": "patternValue", - "required": true, - "type": "string", - "pattern": "^[a-zA-Z]+$" - } - ] - } - }, - "/Validate/parameter/customRequiredErrorMsg": { - "get": { - "operationId": "ValidateCustomRequiredErrorMsg", - "produces": [ - "application/json" - ], - "responses": { - "204": { - "description": "No content" - } - }, - "parameters": [ - { - "in": "query", - "name": "longValue", - "required": true, - "type": "integer", - "format": "int64" - } - ] - } - }, - "/Validate/parameter/customInvalidErrorMsg": { - "get": { - "operationId": "ValidateCustomInvalidErrorMsg", - "produces": [ - "application/json" - ], - "responses": { - "204": { - "description": "No content" - } - }, - "parameters": [ - { - "in": "query", - "name": "longValue", - "required": true, - "type": "integer", - "format": "int64" - } - ] - } - }, - "/Validate/body": { - "post": { - "operationId": "ValidateBodyValidate", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/ValidateModel" - } - } - }, - "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ValidateModel" - } - } - ] - } - }, - "/Controller/normalStatusCode": { - "get": { - "operationId": "TestNormalStatusCode", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "parameters": [] - } - }, - "/Controller/customNomalStatusCode": { - "get": { - "operationId": "TestCustomNomalStatusCode", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "Ok", - "schema": { - "$ref": "#/definitions/TestModel" - } - } - }, - "parameters": [] - } - }, - "/Controller/noContentStatusCode": { - "get": { - "operationId": "TestNoContentStatusCode", - "produces": [ - "application/json" - ], - "responses": { - "204": { - "description": "No content" - } - }, - "parameters": [] - } - }, - "/Controller/customNoContentStatusCode": { - "get": { - "operationId": "TestCustomNoContentStatusCode", - "produces": [ - "application/json" - ], - "responses": { - "204": { - "description": "No content" - } - }, - "parameters": [] - } - } - }, - "produces": [ - "application/json" - ], - "swagger": "2.0", - "securityDefinitions": { - "api_key": { - "type": "apiKey", - "name": "access_token", - "in": "query" - }, - "tsoa_auth": { - "type": "oauth2", - "authorizationUrl": "http://swagger.io/api/oauth/dialog", - "flow": "implicit", - "scopes": { - "write:pets": "modify things", - "read:pets": "read things" - } - } - }, - "host": "localhost:3000", - "api_key": { - "type": "apiKey", - "name": "api_key", - "in": "header" - }, - "tsoa_auth": { - "type": "oauth2", - "authorizationUrl": "http://swagger.io/api/oauth/dialog", - "flow": "implicit", - "scopes": { - "write:pets": "modify things", - "read:pets": "read things" - } - } -} \ No newline at end of file From f8a81b7b75d918aa9a23eb3150a661c238f67417 Mon Sep 17 00:00:00 2001 From: Isman Usoh Date: Tue, 18 Jul 2017 02:55:02 +0700 Subject: [PATCH 6/8] Update project config --- .gitignore | 3 ++- .travis.yml | 11 +++-------- pom.xml | 24 ++++++------------------ pom.xml.circleci | 24 ++++++------------------ 4 files changed, 17 insertions(+), 45 deletions(-) diff --git a/.gitignore b/.gitignore index 0d24b8c983a..c8c845fd6ed 100644 --- a/.gitignore +++ b/.gitignore @@ -155,7 +155,8 @@ samples/client/petstore/typescript-node/npm/node_modules samples/client/petstore/typescript-node/**/typings samples/client/petstore/typescript-angular/**/typings samples/client/petstore/typescript-fetch/**/dist/ -samples/client/petstore/typescript-fetch/**/typings +samples/client/petstore/typescript-fetch/**/npm-debug.log +samples/client/petstore/typescript-fetch/**/node_modules/ samples/client/petstore/typescript-angular2/npm/npm-debug.log samples/client/petstore/typescript-node/npm/npm-debug.log diff --git a/.travis.yml b/.travis.yml index 0657f524586..cad5958a56b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,14 +12,9 @@ cache: - $HOME/samples/client/petstore/python/.venv/ - $HOME/samples/client/petstore/typescript-node/npm/node_modules - $HOME/samples/client/petstore/typescript-node/npm/typings/ - - $HOME/samples/client/petstore/typescript-fetch/tests/default/node_modules - - $HOME/samples/client/petstore/typescript-fetch/tests/default/typings - - $HOME/samples/client/petstore/typescript-fetch/builds/default/node_modules - - $HOME/samples/client/petstore/typescript-fetch/builds/default/typings - - $HOME/samples/client/petstore/typescript-fetch/builds/es6-target/node_modules - - $HOME/samples/client/petstore/typescript-fetch/builds/es6-target/typings - - $HOME/samples/client/petstore/typescript-fetch/builds/with-npm-version/node_modules - - $HOME/samples/client/petstore/typescript-fetch/npm/with-npm-version/typings + - $HOME/samples/client/petstore/typescript-fetch/builds/es6/node_modules + - $HOME/samples/client/petstore/typescript-fetch/builds/npm/node_modules + - $HOME/samples/client/petstore/typescript-fetch/tests/npm/node_modules - $HOME/samples/client/petstore/typescript-angular/node_modules - $HOME/samples/client/petstore/typescript-angular/typings - $HOME/.cocoapods/repos/master diff --git a/pom.xml b/pom.xml index 3af72333d58..19015b8fc8c 100644 --- a/pom.xml +++ b/pom.xml @@ -613,7 +613,7 @@ - typescript-fetch-client-tests-default + typescript-fetch-client-tests-npm env @@ -621,23 +621,11 @@ - samples/client/petstore/typescript-fetch/tests/default - - - - typescript-fetch-client-builds-default - - - env - java - - - - samples/client/petstore/typescript-fetch/builds/default + samples/client/petstore/typescript-fetch/tests/npm - typescript-fetch-client-builds-es6-target + typescript-fetch-client-builds-npm env @@ -645,11 +633,11 @@ - samples/client/petstore/typescript-fetch/builds/es6-target + samples/client/petstore/typescript-fetch/builds/npm - typescript-fetch-client-builds-with-npm-version + typescript-fetch-client-builds-es6 env @@ -657,7 +645,7 @@ - samples/client/petstore/typescript-fetch/builds/with-npm-version + samples/client/petstore/typescript-fetch/builds/es6 diff --git a/pom.xml.circleci b/pom.xml.circleci index 12e96df168e..b5316ea6647 100644 --- a/pom.xml.circleci +++ b/pom.xml.circleci @@ -596,7 +596,7 @@ - typescript-fetch-client-tests-default + typescript-fetch-client-tests-npm env @@ -604,11 +604,11 @@ - samples/client/petstore/typescript-fetch/tests/default + samples/client/petstore/typescript-fetch/tests/npm - typescript-fetch-client-builds-default + typescript-fetch-client-builds-npm env @@ -616,11 +616,11 @@ - samples/client/petstore/typescript-fetch/builds/default + samples/client/petstore/typescript-fetch/builds/npm - typescript-fetch-client-builds-es6-target + typescript-fetch-client-builds-es6 env @@ -628,19 +628,7 @@ - samples/client/petstore/typescript-fetch/builds/es6-target - - - - typescript-fetch-client-builds-with-npm-version - - - env - java - - - - samples/client/petstore/typescript-fetch/builds/with-npm-version + samples/client/petstore/typescript-fetch/builds/es6 From bb4a0218c78ea51a276310e400351805cc371fed Mon Sep 17 00:00:00 2001 From: Isman Usoh Date: Tue, 18 Jul 2017 04:08:25 +0700 Subject: [PATCH 7/8] marge --- ...rs-resteasy-eap-java8-petstore-server.json | 3 + ...axrs-resteasy-eap-java8-petstore-server.sh | 35 + bin/swift3-petstore-unwraprequired.json | 7 + bin/swift3-petstore-unwraprequired.sh | 31 + bin/typescript-angular4-petstore-with-npm.sh | 31 + bin/windows/python2-flask-petstore.bat | 10 + bin/windows/python3-flask-petstore.bat | 10 + .../typescript-angular2-interfaces.bat | 10 + .../typescript-angular2-petstore-all.bat | 3 + bin/windows/typescript-angular4-with-npm.bat | 10 + .../typescript-fetch-petstore-tsoa.bat | 13 + .../Java/CustomInstantDeserializer.mustache | 232 ++ .../Java/libraries/retrofit2/JSON.mustache | 399 +++ .../customInstantDeserializer.mustache | 232 ++ .../spring-boot/jacksonConfiguration.mustache | 23 + .../jacksonConfiguration.mustache | 23 + .../TypeScript-Fetch/configuration.mustache | 12 + .../aspnetcore/validateModel.mustache | 23 + .../csharp/GlobalConfiguration.mustache | 25 + .../csharp/IReadableConfiguration.mustache | 85 + .../src/main/resources/nodejs/writer.mustache | 43 + .../resources/php/HeaderSelector.mustache | 100 + .../src/main/resources/scala/client.mustache | 22 + .../main/resources/tizen/Doxyfile.mustache | 2313 +++++++++++++++++ .../main/resources/tizen/doc-readme.mustache | 54 + .../tizen/generateDocumentation.mustache | 4 + .../resources/tizen/netclient-body.mustache | 359 +++ .../resources/tizen/netclient-header.mustache | 53 + .../main/resources/tizen/requestinfo.mustache | 66 + .../typescript-angular2/api.module.mustache | 25 + .../typescript-angular2/api.service.mustache | 280 ++ .../rxjs-operators.mustache | 11 + .../resources/typescript-jquery/apis.mustache | 9 + .../typescript-jquery/configuration.mustache | 6 + .../typescript-jquery/index.mustache | 4 + .../typescript-jquery/licenseInfo.mustache | 11 + .../typescript-jquery/masterApiEntry.mustache | 0 .../typescript-jquery/model.mustache | 13 + .../typescript-jquery/modelEnum.mustache | 12 + .../typescript-jquery/modelGeneric.mustache | 28 + .../typescript-jquery/models.mustache | 5 + .../typescript-jquery/variables.mustache | 7 + .../codegen/csharp/CsharpModelEnumTest.java | 75 + ...Angular2ArrayAndObjectIntegrationTest.java | 32 + ...escriptAngular2PestoreIntegrationTest.java | 32 + .../test/resources/2_0/datePropertyTest.json | 45 + .../additional-properties-expected/.gitignore | 3 + .../additional-properties-expected/LICENSE | 201 ++ .../api.module.ts | 21 + .../api/user.service.ts | 166 ++ .../configuration.ts | 24 + .../git_push.sh | 52 + .../rxjs-operators.ts | 11 + .../variables.ts | 3 + .../array-and-object-expected/.gitignore | 3 + .../array-and-object-expected/LICENSE | 201 ++ .../array-and-object-expected/api.module.ts | 21 + .../api/project.service.ts | 430 +++ .../configuration.ts | 24 + .../array-and-object-expected/git_push.sh | 52 + .../rxjs-operators.ts | 11 + .../array-and-object-expected/variables.ts | 3 + .../typescript/node-es5-expected/.gitignore | 3 + .../typescript/node-es5-expected/LICENSE | 201 ++ .../typescript/petstore-expected/.gitignore | 3 + .../petstore-expected/.swagger-codegen-ignore | 23 + .../typescript/petstore-expected/LICENSE | 201 ++ .../typescript/petstore-expected/README.md | 44 + .../petstore-expected/api.module.ts | 23 + .../typescript/petstore-expected/api/api.ts | 3 + .../petstore-expected/api/pet.service.ts | 646 +++++ .../petstore-expected/api/store.service.ts | 313 +++ .../petstore-expected/api/user.service.ts | 573 ++++ .../petstore-expected/configuration.ts | 24 + .../typescript/petstore-expected/git_push.sh | 52 + .../typescript/petstore-expected/index.ts | 5 + .../petstore-expected/model/apiResponse.ts | 34 + .../petstore-expected/model/category.ts | 32 + .../petstore-expected/model/models.ts | 6 + .../petstore-expected/model/order.ts | 50 + .../typescript/petstore-expected/model/pet.ts | 52 + .../typescript/petstore-expected/model/tag.ts | 32 + .../petstore-expected/model/user.ts | 47 + .../typescript/petstore-expected/package.json | 38 + .../petstore-expected/rxjs-operators.ts | 11 + .../petstore-expected/tsconfig.json | 28 + .../typescript/petstore-expected/typings.json | 5 + .../typescript/petstore-expected/variables.ts | 3 + .../typescript/petstore-spec.json | 1030 ++++++++ 89 files changed, 9534 insertions(+) create mode 100644 bin/jaxrs-resteasy-eap-java8-petstore-server.json create mode 100644 bin/jaxrs-resteasy-eap-java8-petstore-server.sh create mode 100644 bin/swift3-petstore-unwraprequired.json create mode 100644 bin/swift3-petstore-unwraprequired.sh create mode 100644 bin/typescript-angular4-petstore-with-npm.sh create mode 100644 bin/windows/python2-flask-petstore.bat create mode 100644 bin/windows/python3-flask-petstore.bat create mode 100644 bin/windows/typescript-angular2-interfaces.bat create mode 100644 bin/windows/typescript-angular2-petstore-all.bat create mode 100644 bin/windows/typescript-angular4-with-npm.bat create mode 100644 bin/windows/typescript-fetch-petstore-tsoa.bat create mode 100644 modules/swagger-codegen/src/main/resources/Java/CustomInstantDeserializer.mustache create mode 100644 modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/JSON.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaSpring/customInstantDeserializer.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-boot/jacksonConfiguration.mustache create mode 100644 modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/jacksonConfiguration.mustache create mode 100644 modules/swagger-codegen/src/main/resources/TypeScript-Fetch/configuration.mustache create mode 100644 modules/swagger-codegen/src/main/resources/aspnetcore/validateModel.mustache create mode 100644 modules/swagger-codegen/src/main/resources/csharp/GlobalConfiguration.mustache create mode 100644 modules/swagger-codegen/src/main/resources/csharp/IReadableConfiguration.mustache create mode 100644 modules/swagger-codegen/src/main/resources/nodejs/writer.mustache create mode 100644 modules/swagger-codegen/src/main/resources/php/HeaderSelector.mustache create mode 100644 modules/swagger-codegen/src/main/resources/scala/client.mustache create mode 100644 modules/swagger-codegen/src/main/resources/tizen/Doxyfile.mustache create mode 100644 modules/swagger-codegen/src/main/resources/tizen/doc-readme.mustache create mode 100644 modules/swagger-codegen/src/main/resources/tizen/generateDocumentation.mustache create mode 100644 modules/swagger-codegen/src/main/resources/tizen/netclient-body.mustache create mode 100644 modules/swagger-codegen/src/main/resources/tizen/netclient-header.mustache create mode 100644 modules/swagger-codegen/src/main/resources/tizen/requestinfo.mustache create mode 100644 modules/swagger-codegen/src/main/resources/typescript-angular2/api.module.mustache create mode 100644 modules/swagger-codegen/src/main/resources/typescript-angular2/api.service.mustache create mode 100644 modules/swagger-codegen/src/main/resources/typescript-angular2/rxjs-operators.mustache create mode 100644 modules/swagger-codegen/src/main/resources/typescript-jquery/apis.mustache create mode 100644 modules/swagger-codegen/src/main/resources/typescript-jquery/configuration.mustache create mode 100644 modules/swagger-codegen/src/main/resources/typescript-jquery/index.mustache create mode 100644 modules/swagger-codegen/src/main/resources/typescript-jquery/licenseInfo.mustache create mode 100644 modules/swagger-codegen/src/main/resources/typescript-jquery/masterApiEntry.mustache create mode 100644 modules/swagger-codegen/src/main/resources/typescript-jquery/model.mustache create mode 100644 modules/swagger-codegen/src/main/resources/typescript-jquery/modelEnum.mustache create mode 100644 modules/swagger-codegen/src/main/resources/typescript-jquery/modelGeneric.mustache create mode 100644 modules/swagger-codegen/src/main/resources/typescript-jquery/models.mustache create mode 100644 modules/swagger-codegen/src/main/resources/typescript-jquery/variables.mustache create mode 100644 modules/swagger-codegen/src/test/java/io/swagger/codegen/csharp/CsharpModelEnumTest.java create mode 100644 modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangular2/TypescriptAngular2ArrayAndObjectIntegrationTest.java create mode 100644 modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangular2/TypescriptAngular2PestoreIntegrationTest.java create mode 100644 modules/swagger-codegen/src/test/resources/2_0/datePropertyTest.json create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/.gitignore create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/LICENSE create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/api.module.ts create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/api/user.service.ts create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/configuration.ts create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/git_push.sh create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/rxjs-operators.ts create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/additional-properties-expected/variables.ts create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/.gitignore create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/LICENSE create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/api.module.ts create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/api/project.service.ts create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/configuration.ts create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/git_push.sh create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/rxjs-operators.ts create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/array-and-object-expected/variables.ts create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-expected/.gitignore create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/node-es5-expected/LICENSE create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/.gitignore create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/.swagger-codegen-ignore create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/LICENSE create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/README.md create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/api.module.ts create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/api/api.ts create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/api/pet.service.ts create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/api/store.service.ts create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/api/user.service.ts create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/configuration.ts create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/git_push.sh create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/index.ts create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/model/apiResponse.ts create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/model/category.ts create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/model/models.ts create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/model/order.ts create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/model/pet.ts create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/model/tag.ts create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/model/user.ts create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/package.json create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/rxjs-operators.ts create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/tsconfig.json create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/typings.json create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-expected/variables.ts create mode 100644 modules/swagger-codegen/src/test/resources/integrationtests/typescript/petstore-spec.json diff --git a/bin/jaxrs-resteasy-eap-java8-petstore-server.json b/bin/jaxrs-resteasy-eap-java8-petstore-server.json new file mode 100644 index 00000000000..3d80aca58ce --- /dev/null +++ b/bin/jaxrs-resteasy-eap-java8-petstore-server.json @@ -0,0 +1,3 @@ +{ + "dateLibrary": "java8" +} diff --git a/bin/jaxrs-resteasy-eap-java8-petstore-server.sh b/bin/jaxrs-resteasy-eap-java8-petstore-server.sh new file mode 100644 index 00000000000..b5897c06382 --- /dev/null +++ b/bin/jaxrs-resteasy-eap-java8-petstore-server.sh @@ -0,0 +1,35 @@ +#!/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" +ags="$@ generate --artifact-id swagger-jaxrs-resteasy-eap-java8-server -t modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l jaxrs-resteasy-eap -o samples/server/petstore/jaxrs-resteasy/eap-java8 -DhideGenerationTimestamp=true -c ./bin/jaxrs-resteasy-eap-java8-petstore-server.json" + +echo "Removing files and folders under samples/server/petstore/jaxrs-resteasy/eap-java8/src/main" +rm -rf samples/server/petstore/jaxrs-resteasy/eap-java8/src/main +find samples/server/petstore/jaxrs-resteasy/eap-java8 -maxdepth 1 -type f ! -name "README.md" -exec rm {} + + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/swift3-petstore-unwraprequired.json b/bin/swift3-petstore-unwraprequired.json new file mode 100644 index 00000000000..f077c429ee8 --- /dev/null +++ b/bin/swift3-petstore-unwraprequired.json @@ -0,0 +1,7 @@ +{ + "podSummary": "PetstoreClient", + "podHomepage": "https://github.com/swagger-api/swagger-codegen", + "podAuthors": "", + "projectName": "PetstoreClient", + "unwrapRequired": true +} \ No newline at end of file diff --git a/bin/swift3-petstore-unwraprequired.sh b/bin/swift3-petstore-unwraprequired.sh new file mode 100644 index 00000000000..65355a18ecf --- /dev/null +++ b/bin/swift3-petstore-unwraprequired.sh @@ -0,0 +1,31 @@ +#!/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" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/swift3 -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l swift3 -c ./bin/swift3-petstore-unwraprequired.json -o samples/client/petstore/swift3/unwraprequired" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-angular4-petstore-with-npm.sh b/bin/typescript-angular4-petstore-with-npm.sh new file mode 100644 index 00000000000..597a83630e1 --- /dev/null +++ b/bin/typescript-angular4-petstore-with-npm.sh @@ -0,0 +1,31 @@ +#!/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" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l typescript-angular -c bin/typescript-petstore-npm.json -o samples/client/petstore/typescript-angular4/npm --additional-properties ngVersion=4" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/python2-flask-petstore.bat b/bin/windows/python2-flask-petstore.bat new file mode 100644 index 00000000000..ae0b14f21f5 --- /dev/null +++ b/bin/windows/python2-flask-petstore.bat @@ -0,0 +1,10 @@ +set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l python-flask -o samples\server\petstore\flaskConnexion-python2 -c bin\supportPython2.json -D service + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/python3-flask-petstore.bat b/bin/windows/python3-flask-petstore.bat new file mode 100644 index 00000000000..97d95f4f8de --- /dev/null +++ b/bin/windows/python3-flask-petstore.bat @@ -0,0 +1,10 @@ +set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l python-flask -o samples\server\petstore\flaskConnexion -D service + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-angular2-interfaces.bat b/bin/windows/typescript-angular2-interfaces.bat new file mode 100644 index 00000000000..6185232b704 --- /dev/null +++ b/bin/windows/typescript-angular2-interfaces.bat @@ -0,0 +1,10 @@ +set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -c bin\typescript-petstore-npm.json -l typescript-angular -o samples\client\petstore\typescript-angular2\with-interfaces -D withInterfaces=true --additional-properties ngVersion=2 + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-angular2-petstore-all.bat b/bin/windows/typescript-angular2-petstore-all.bat new file mode 100644 index 00000000000..3378de085de --- /dev/null +++ b/bin/windows/typescript-angular2-petstore-all.bat @@ -0,0 +1,3 @@ +call .\bin\windows\typescript-angular2-with-npm.bat +call .\bin\windows\typescript-angular2-interfaces.bat +call .\bin\windows\typescript-angular2.bat diff --git a/bin/windows/typescript-angular4-with-npm.bat b/bin/windows/typescript-angular4-with-npm.bat new file mode 100644 index 00000000000..f91d22dca41 --- /dev/null +++ b/bin/windows/typescript-angular4-with-npm.bat @@ -0,0 +1,10 @@ +set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -c bin\typescript-petstore-npm.json -l typescript-angular -o samples\client\petstore\typescript-angular2\npm --additional-properties ngVersion=4 + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/typescript-fetch-petstore-tsoa.bat b/bin/windows/typescript-fetch-petstore-tsoa.bat new file mode 100644 index 00000000000..64ff1dc67f3 --- /dev/null +++ b/bin/windows/typescript-fetch-petstore-tsoa.bat @@ -0,0 +1,13 @@ +@ECHO OFF +set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M + +echo Typescript-Fetch Petstore API client (NPM version) +set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\swagger.json -l typescript-fetch -c bin/typescript-fetch-petstore-npm.json -o samples\client\petstore\typescript-fetch\tsoa + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/modules/swagger-codegen/src/main/resources/Java/CustomInstantDeserializer.mustache b/modules/swagger-codegen/src/main/resources/Java/CustomInstantDeserializer.mustache new file mode 100644 index 00000000000..dbf4d30e117 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Java/CustomInstantDeserializer.mustache @@ -0,0 +1,232 @@ +package {{invokerPackage}}; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonTokenId; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.datatype.threetenbp.DateTimeUtils; +import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils; +import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase; +import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction; +import com.fasterxml.jackson.datatype.threetenbp.function.Function; +import org.threeten.bp.DateTimeException; +import org.threeten.bp.Instant; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.ZonedDateTime; +import org.threeten.bp.format.DateTimeFormatter; +import org.threeten.bp.temporal.Temporal; +import org.threeten.bp.temporal.TemporalAccessor; + +import java.io.IOException; +import java.math.BigDecimal; + +/** + * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. + * Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format. + * + * @author Nick Williams + */ +public class CustomInstantDeserializer + extends ThreeTenDateTimeDeserializerBase { + private static final long serialVersionUID = 1L; + + public static final CustomInstantDeserializer INSTANT = new CustomInstantDeserializer( + Instant.class, DateTimeFormatter.ISO_INSTANT, + new Function() { + @Override + public Instant apply(TemporalAccessor temporalAccessor) { + return Instant.from(temporalAccessor); + } + }, + new Function() { + @Override + public Instant apply(FromIntegerArguments a) { + return Instant.ofEpochMilli(a.value); + } + }, + new Function() { + @Override + public Instant apply(FromDecimalArguments a) { + return Instant.ofEpochSecond(a.integer, a.fraction); + } + }, + null + ); + + public static final CustomInstantDeserializer OFFSET_DATE_TIME = new CustomInstantDeserializer( + OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, + new Function() { + @Override + public OffsetDateTime apply(TemporalAccessor temporalAccessor) { + return OffsetDateTime.from(temporalAccessor); + } + }, + new Function() { + @Override + public OffsetDateTime apply(FromIntegerArguments a) { + return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); + } + }, + new Function() { + @Override + public OffsetDateTime apply(FromDecimalArguments a) { + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); + } + }, + new BiFunction() { + @Override + public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { + return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); + } + } + ); + + public static final CustomInstantDeserializer ZONED_DATE_TIME = new CustomInstantDeserializer( + ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, + new Function() { + @Override + public ZonedDateTime apply(TemporalAccessor temporalAccessor) { + return ZonedDateTime.from(temporalAccessor); + } + }, + new Function() { + @Override + public ZonedDateTime apply(FromIntegerArguments a) { + return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); + } + }, + new Function() { + @Override + public ZonedDateTime apply(FromDecimalArguments a) { + return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); + } + }, + new BiFunction() { + @Override + public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { + return zonedDateTime.withZoneSameInstant(zoneId); + } + } + ); + + protected final Function fromMilliseconds; + + protected final Function fromNanoseconds; + + protected final Function parsedToValue; + + protected final BiFunction adjust; + + protected CustomInstantDeserializer(Class supportedType, + DateTimeFormatter parser, + Function parsedToValue, + Function fromMilliseconds, + Function fromNanoseconds, + BiFunction adjust) { + super(supportedType, parser); + this.parsedToValue = parsedToValue; + this.fromMilliseconds = fromMilliseconds; + this.fromNanoseconds = fromNanoseconds; + this.adjust = adjust == null ? new BiFunction() { + @Override + public T apply(T t, ZoneId zoneId) { + return t; + } + } : adjust; + } + + @SuppressWarnings("unchecked") + protected CustomInstantDeserializer(CustomInstantDeserializer base, DateTimeFormatter f) { + super((Class) base.handledType(), f); + parsedToValue = base.parsedToValue; + fromMilliseconds = base.fromMilliseconds; + fromNanoseconds = base.fromNanoseconds; + adjust = base.adjust; + } + + @Override + protected JsonDeserializer withDateFormat(DateTimeFormatter dtf) { + if (dtf == _formatter) { + return this; + } + return new CustomInstantDeserializer(this, dtf); + } + + @Override + public T deserialize(JsonParser parser, DeserializationContext context) throws IOException { + //NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only + //string values have to be adjusted to the configured TZ. + switch (parser.getCurrentTokenId()) { + case JsonTokenId.ID_NUMBER_FLOAT: { + BigDecimal value = parser.getDecimalValue(); + long seconds = value.longValue(); + int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); + return fromNanoseconds.apply(new FromDecimalArguments( + seconds, nanoseconds, getZone(context))); + } + + case JsonTokenId.ID_NUMBER_INT: { + long timestamp = parser.getLongValue(); + if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { + return this.fromNanoseconds.apply(new FromDecimalArguments( + timestamp, 0, this.getZone(context) + )); + } + return this.fromMilliseconds.apply(new FromIntegerArguments( + timestamp, this.getZone(context) + )); + } + + case JsonTokenId.ID_STRING: { + String string = parser.getText().trim(); + if (string.length() == 0) { + return null; + } + if (string.endsWith("+0000")) { + string = string.substring(0, string.length() - 5) + "Z"; + } + T value; + try { + TemporalAccessor acc = _formatter.parse(string); + value = parsedToValue.apply(acc); + if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { + return adjust.apply(value, this.getZone(context)); + } + } catch (DateTimeException e) { + throw _peelDTE(e); + } + return value; + } + } + throw context.mappingException("Expected type float, integer, or string."); + } + + private ZoneId getZone(DeserializationContext context) { + // Instants are always in UTC, so don't waste compute cycles + return (_valueClass == Instant.class) ? null : DateTimeUtils.timeZoneToZoneId(context.getTimeZone()); + } + + private static class FromIntegerArguments { + public final long value; + public final ZoneId zoneId; + + private FromIntegerArguments(long value, ZoneId zoneId) { + this.value = value; + this.zoneId = zoneId; + } + } + + private static class FromDecimalArguments { + public final long integer; + public final int fraction; + public final ZoneId zoneId; + + private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) { + this.integer = integer; + this.fraction = fraction; + this.zoneId = zoneId; + } + } +} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/JSON.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/JSON.mustache new file mode 100644 index 00000000000..79c398fc1b9 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/JSON.mustache @@ -0,0 +1,399 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +{{#joda}} +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.ISODateTimeFormat; +{{/joda}} +{{#threetenbp}} +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.format.DateTimeFormatter; +{{/threetenbp}} + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +{{#java8}} +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +{{/java8}} +import java.util.Date; + +public class JSON { + private Gson gson; + private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + {{#joda}} + private DateTimeTypeAdapter dateTimeTypeAdapter = new DateTimeTypeAdapter(); + private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + {{/joda}} + {{#jsr310}} + private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + {{/jsr310}} + + public JSON() { + gson = new GsonBuilder() + .registerTypeAdapter(Date.class, dateTypeAdapter) + .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) + {{#joda}} + .registerTypeAdapter(DateTime.class, dateTimeTypeAdapter) + .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) + {{/joda}} + {{#jsr310}} + .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) + .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) + {{/jsr310}} + .create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + * @return JSON + */ + public JSON setGson(Gson gson) { + this.gson = gson; + return this; + } + + {{#joda}} + /** + * Gson TypeAdapter for Joda DateTime type + */ + public static class DateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public DateTimeTypeAdapter() { + this(ISODateTimeFormat.dateTime().withOffsetParsed()); + } + + public DateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, DateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.print(date)); + } + } + + @Override + public DateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return formatter.parseDateTime(date); + } + } + } + + /** + * Gson TypeAdapter for Joda LocalDate type + */ + public class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(ISODateTimeFormat.date()); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.print(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return formatter.parseLocalDate(date); + } + } + } + + public JSON setDateTimeFormat(DateTimeFormatter dateFormat) { + dateTimeTypeAdapter.setFormat(dateFormat); + return this; + } + + public JSON setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + return this; + } + + {{/joda}} + {{#jsr310}} + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public JSON setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + return this; + } + + public JSON setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + return this; + } + + {{/jsr310}} + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() { + } + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() { + } + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public JSON setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + return this; + } + + public JSON setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + return this; + } + +} diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/customInstantDeserializer.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/customInstantDeserializer.mustache new file mode 100644 index 00000000000..b7b8e251bdb --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/customInstantDeserializer.mustache @@ -0,0 +1,232 @@ +package {{configPackage}}; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonTokenId; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.datatype.threetenbp.DateTimeUtils; +import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils; +import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase; +import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction; +import com.fasterxml.jackson.datatype.threetenbp.function.Function; +import org.threeten.bp.DateTimeException; +import org.threeten.bp.Instant; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.ZonedDateTime; +import org.threeten.bp.format.DateTimeFormatter; +import org.threeten.bp.temporal.Temporal; +import org.threeten.bp.temporal.TemporalAccessor; + +import java.io.IOException; +import java.math.BigDecimal; + +/** + * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. + * Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format. + * + * @author Nick Williams + */ +public class CustomInstantDeserializer + extends ThreeTenDateTimeDeserializerBase { + private static final long serialVersionUID = 1L; + + public static final CustomInstantDeserializer INSTANT = new CustomInstantDeserializer( + Instant.class, DateTimeFormatter.ISO_INSTANT, + new Function() { + @Override + public Instant apply(TemporalAccessor temporalAccessor) { + return Instant.from(temporalAccessor); + } + }, + new Function() { + @Override + public Instant apply(FromIntegerArguments a) { + return Instant.ofEpochMilli(a.value); + } + }, + new Function() { + @Override + public Instant apply(FromDecimalArguments a) { + return Instant.ofEpochSecond(a.integer, a.fraction); + } + }, + null + ); + + public static final CustomInstantDeserializer OFFSET_DATE_TIME = new CustomInstantDeserializer( + OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, + new Function() { + @Override + public OffsetDateTime apply(TemporalAccessor temporalAccessor) { + return OffsetDateTime.from(temporalAccessor); + } + }, + new Function() { + @Override + public OffsetDateTime apply(FromIntegerArguments a) { + return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); + } + }, + new Function() { + @Override + public OffsetDateTime apply(FromDecimalArguments a) { + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); + } + }, + new BiFunction() { + @Override + public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { + return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); + } + } + ); + + public static final CustomInstantDeserializer ZONED_DATE_TIME = new CustomInstantDeserializer( + ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, + new Function() { + @Override + public ZonedDateTime apply(TemporalAccessor temporalAccessor) { + return ZonedDateTime.from(temporalAccessor); + } + }, + new Function() { + @Override + public ZonedDateTime apply(FromIntegerArguments a) { + return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); + } + }, + new Function() { + @Override + public ZonedDateTime apply(FromDecimalArguments a) { + return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); + } + }, + new BiFunction() { + @Override + public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { + return zonedDateTime.withZoneSameInstant(zoneId); + } + } + ); + + protected final Function fromMilliseconds; + + protected final Function fromNanoseconds; + + protected final Function parsedToValue; + + protected final BiFunction adjust; + + protected CustomInstantDeserializer(Class supportedType, + DateTimeFormatter parser, + Function parsedToValue, + Function fromMilliseconds, + Function fromNanoseconds, + BiFunction adjust) { + super(supportedType, parser); + this.parsedToValue = parsedToValue; + this.fromMilliseconds = fromMilliseconds; + this.fromNanoseconds = fromNanoseconds; + this.adjust = adjust == null ? new BiFunction() { + @Override + public T apply(T t, ZoneId zoneId) { + return t; + } + } : adjust; + } + + @SuppressWarnings("unchecked") + protected CustomInstantDeserializer(CustomInstantDeserializer base, DateTimeFormatter f) { + super((Class) base.handledType(), f); + parsedToValue = base.parsedToValue; + fromMilliseconds = base.fromMilliseconds; + fromNanoseconds = base.fromNanoseconds; + adjust = base.adjust; + } + + @Override + protected JsonDeserializer withDateFormat(DateTimeFormatter dtf) { + if (dtf == _formatter) { + return this; + } + return new CustomInstantDeserializer(this, dtf); + } + + @Override + public T deserialize(JsonParser parser, DeserializationContext context) throws IOException { + //NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only + //string values have to be adjusted to the configured TZ. + switch (parser.getCurrentTokenId()) { + case JsonTokenId.ID_NUMBER_FLOAT: { + BigDecimal value = parser.getDecimalValue(); + long seconds = value.longValue(); + int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); + return fromNanoseconds.apply(new FromDecimalArguments( + seconds, nanoseconds, getZone(context))); + } + + case JsonTokenId.ID_NUMBER_INT: { + long timestamp = parser.getLongValue(); + if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { + return this.fromNanoseconds.apply(new FromDecimalArguments( + timestamp, 0, this.getZone(context) + )); + } + return this.fromMilliseconds.apply(new FromIntegerArguments( + timestamp, this.getZone(context) + )); + } + + case JsonTokenId.ID_STRING: { + String string = parser.getText().trim(); + if (string.length() == 0) { + return null; + } + if (string.endsWith("+0000")) { + string = string.substring(0, string.length() - 5) + "Z"; + } + T value; + try { + TemporalAccessor acc = _formatter.parse(string); + value = parsedToValue.apply(acc); + if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { + return adjust.apply(value, this.getZone(context)); + } + } catch (DateTimeException e) { + throw _peelDTE(e); + } + return value; + } + } + throw context.mappingException("Expected type float, integer, or string."); + } + + private ZoneId getZone(DeserializationContext context) { + // Instants are always in UTC, so don't waste compute cycles + return (_valueClass == Instant.class) ? null : DateTimeUtils.timeZoneToZoneId(context.getTimeZone()); + } + + private static class FromIntegerArguments { + public final long value; + public final ZoneId zoneId; + + private FromIntegerArguments(long value, ZoneId zoneId) { + this.value = value; + this.zoneId = zoneId; + } + } + + private static class FromDecimalArguments { + public final long integer; + public final int fraction; + public final ZoneId zoneId; + + private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) { + this.integer = integer; + this.fraction = fraction; + this.zoneId = zoneId; + } + } +} diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-boot/jacksonConfiguration.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-boot/jacksonConfiguration.mustache new file mode 100644 index 00000000000..e96aa772c68 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-boot/jacksonConfiguration.mustache @@ -0,0 +1,23 @@ +package {{configPackage}}; + +import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.threeten.bp.Instant; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.ZonedDateTime; + +@Configuration +public class JacksonConfiguration { + + @Bean + @ConditionalOnMissingBean(ThreeTenModule.class) + ThreeTenModule threeTenModule() { + ThreeTenModule module = new ThreeTenModule(); + module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); + module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); + module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); + return module; + } +} diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/jacksonConfiguration.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/jacksonConfiguration.mustache new file mode 100644 index 00000000000..e96aa772c68 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/jacksonConfiguration.mustache @@ -0,0 +1,23 @@ +package {{configPackage}}; + +import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.threeten.bp.Instant; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.ZonedDateTime; + +@Configuration +public class JacksonConfiguration { + + @Bean + @ConditionalOnMissingBean(ThreeTenModule.class) + ThreeTenModule threeTenModule() { + ThreeTenModule module = new ThreeTenModule(); + module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); + module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); + module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); + return module; + } +} diff --git a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/configuration.mustache b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/configuration.mustache new file mode 100644 index 00000000000..f9ef24d8266 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/configuration.mustache @@ -0,0 +1,12 @@ +export class Configuration { + apiKey: { +{{#authMethods}} +{{#isApiKey}} + {{keyParamName}}: string; +{{/isApiKey}} +{{/authMethods}} + }; + username: string; + password: string; + accessToken: string; +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/aspnetcore/validateModel.mustache b/modules/swagger-codegen/src/main/resources/aspnetcore/validateModel.mustache new file mode 100644 index 00000000000..9f850f71d93 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/aspnetcore/validateModel.mustache @@ -0,0 +1,23 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Filters; + +namespace {{packageName}}.Attributes +{ + /// + /// Model state validation attribute + /// + public class ValidateModelStateAttribute : ActionFilterAttribute + { + /// + /// Called before the action method is invoked + /// + /// + public override void OnActionExecuting(ActionExecutingContext context) + { + if (!context.ModelState.IsValid) + { + context.Result = new BadRequestObjectResult(context.ModelState); + } + } + } +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/csharp/GlobalConfiguration.mustache b/modules/swagger-codegen/src/main/resources/csharp/GlobalConfiguration.mustache new file mode 100644 index 00000000000..b218d5cc349 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp/GlobalConfiguration.mustache @@ -0,0 +1,25 @@ +{{>partial_header}} + +using System; +using System.Reflection; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; + +namespace {{packageName}}.Client +{ + /// + /// provides a compile-time extension point for globally configuring + /// API Clients. + /// + /// + /// A customized implementation via partial class may reside in another file and may + /// be excluded from automatic generation via a .swagger-codegen-ignore file. + /// + public partial class GlobalConfiguration : Configuration + { + + } +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/csharp/IReadableConfiguration.mustache b/modules/swagger-codegen/src/main/resources/csharp/IReadableConfiguration.mustache new file mode 100644 index 00000000000..ce165e0c81d --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp/IReadableConfiguration.mustache @@ -0,0 +1,85 @@ +{{>partial_header}} + +using System.Collections.Generic; + +namespace {{packageName}}.Client +{ + /// + /// Represents a readable-only configuration contract. + /// + public interface IReadableConfiguration + { + /// + /// Gets the access token. + /// + /// Access token. + string AccessToken { get; } + + /// + /// Gets the API key. + /// + /// API key. + IDictionary ApiKey { get; } + + /// + /// Gets the API key prefix. + /// + /// API key prefix. + IDictionary ApiKeyPrefix { get; } + + /// + /// Gets the base path. + /// + /// Base path. + string BasePath { get; } + + /// + /// Gets the date time format. + /// + /// Date time foramt. + string DateTimeFormat { get; } + + /// + /// Gets the default header. + /// + /// Default header. + IDictionary DefaultHeader { get; } + + /// + /// Gets the temp folder path. + /// + /// Temp folder path. + string TempFolderPath { get; } + + /// + /// Gets the HTTP connection timeout (in milliseconds) + /// + /// HTTP connection timeout. + int Timeout { get; } + + /// + /// Gets the user agent. + /// + /// User agent. + string UserAgent { get; } + + /// + /// Gets the username. + /// + /// Username. + string Username { get; } + + /// + /// Gets the password. + /// + /// Password. + string Password { get; } + + /// + /// Gets the API key with prefix. + /// + /// API key identifier (authentication scheme). + /// API key with prefix. + string GetApiKeyWithPrefix(string apiKeyIdentifier); + } +} diff --git a/modules/swagger-codegen/src/main/resources/nodejs/writer.mustache b/modules/swagger-codegen/src/main/resources/nodejs/writer.mustache new file mode 100644 index 00000000000..7350b54371f --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/nodejs/writer.mustache @@ -0,0 +1,43 @@ +var ResponsePayload = function(code, payload) { + this.code = code; + this.payload = payload; +} + +exports.respondWithCode = function(code, payload) { + return new ResponsePayload(code, payload); +} + +var writeJson = exports.writeJson = function(response, arg1, arg2) { + var code; + var payload; + + if(arg1 && arg1 instanceof ResponsePayload) { + writeJson(response, arg1.payload, arg1.code); + return; + } + + if(arg2 && Number.isInteger(arg2)) { + code = arg2; + } + else { + if(arg1 && Number.isInteger(arg1)) { + code = arg1; + } + } + if(code && arg1) { + payload = arg1; + } + else if(arg1) { + payload = arg1; + } + + if(!code) { + // if no response code given, we default to 200 + code = 200; + } + if(typeof payload === 'object') { + payload = JSON.stringify(payload, null, 2); + } + response.writeHead(code, {'Content-Type': 'application/json'}); + response.end(payload, code); +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/php/HeaderSelector.mustache b/modules/swagger-codegen/src/main/resources/php/HeaderSelector.mustache new file mode 100644 index 00000000000..909beb134d2 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/php/HeaderSelector.mustache @@ -0,0 +1,100 @@ +partial_header}} +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace {{invokerPackage}}; + +use \Exception; + +/** + * ApiException Class Doc Comment + * + * @category Class + * @package {{invokerPackage}} + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class HeaderSelector +{ + + /** + * @param string[] $accept + * @param string[] $contentTypes + * @return array + */ + public function selectHeaders($accept, $contentTypes) + { + $headers = []; + + $accept = $this->selectAcceptHeader($accept); + if ($accept !== null) { + $headers['Accept'] = $accept; + } + + $headers['Content-Type'] = $this->selectContentTypeHeader($contentTypes); + return $headers; + } + + /** + * @param string[] $accept + * @return array + */ + public function selectHeadersForMultipart($accept) + { + $headers = $this->selectHeaders($accept, []); + + unset($headers['Content-Type']); + return $headers; + } + + /** + * Return the header 'Accept' based on an array of Accept provided + * + * @param string[] $accept Array of header + * + * @return string Accept (e.g. application/json) + */ + private function selectAcceptHeader($accept) + { + if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { + return null; + } elseif (preg_grep("/application\/json/i", $accept)) { + return 'application/json'; + } else { + return implode(',', $accept); + } + } + + /** + * Return the content type based on an array of content-type provided + * + * @param string[] $contentType Array fo content-type + * + * @return string Content-Type (e.g. application/json) + */ + private function selectContentTypeHeader($contentType) + { + if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) { + return 'application/json'; + } elseif (preg_grep("/application\/json/i", $contentType)) { + return 'application/json'; + } else { + return implode(',', $contentType); + } + } +} + diff --git a/modules/swagger-codegen/src/main/resources/scala/client.mustache b/modules/swagger-codegen/src/main/resources/scala/client.mustache new file mode 100644 index 00000000000..8098b73c6bb --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/scala/client.mustache @@ -0,0 +1,22 @@ +package {{invokerPackage}} + +{{#imports}}import {{import}} +{{/imports}} +import {{apiPackage}}._ + +import com.wordnik.swagger.client._ + +import java.io.Closeable + +class {{clientName}}(config: SwaggerConfig) extends Closeable { + val locator = config.locator + val name = config.name + + private[this] val client = transportClient + + protected def transportClient: TransportClient = new RestClient(config) + + def close() { + client.close() + } +} diff --git a/modules/swagger-codegen/src/main/resources/tizen/Doxyfile.mustache b/modules/swagger-codegen/src/main/resources/tizen/Doxyfile.mustache new file mode 100644 index 00000000000..af114f74cdb --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/tizen/Doxyfile.mustache @@ -0,0 +1,2313 @@ +# Doxyfile 1.8.6 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = {{#swagger}}{{#info}}"{{title}} {{version}} Tizen SDK"{{/info}}{{/swagger}} + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = {{#swagger}}{{#info}}{{version}}{{/info}}{{/swagger}} + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "An SDK for creating client applications for {{#swagger}}{{#info}}{{title}}{{/info}}{{/swagger}} on Tizen Platform (http://tizen.org/)" + +# With the PROJECT_LOGO tag one can specify an logo or icon that is included in +# the documentation. The maximum height of the logo should not exceed 55 pixels +# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo +# to the output directory. + +PROJECT_LOGO = "./doc/logo.png" + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = "./doc/SDK" + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = NO + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a +# new page for each member. If set to NO, the documentation of a member will be +# part of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make +# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C +# (default is Fortran), use: inc=Fortran f=C. +# +# Note For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by by putting a % sign in front of the word +# or globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = YES + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = NO + +# This flag is only useful for Objective-C code. When set to YES local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO these classes will be included in the various overviews. This option has +# no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = YES + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the +# todo list. This list is created by putting \todo commands in the +# documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the +# test list. This list is created by putting \test commands in the +# documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES the list +# will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. Do not use file names with spaces, bibtex cannot handle them. See +# also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO doxygen will only warn about wrong or incomplete parameter +# documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. +# Note: If this tag is empty the current directory is searched. + +INPUT = ./src ./include + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank the +# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, +# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, +# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, +# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, +# *.qsf, *.as and *.js. + +FILE_PATTERNS = *.h *.cpp + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER ) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES, then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see http://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- +# defined cascading style sheet that is included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefor more robust against future updates. +# Doxygen will copy the style sheet file to the output directory. For an example +# see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the stylesheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = YES + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler ( hhc.exe). If non-empty +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated ( +# YES) or that it should be included in the master .chm file ( NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated ( +# YES) or a normal table of contents ( NO) in the .chm file. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = YES + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# http://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using prerendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from http://www.mathjax.org before deployment. +# The default value is: http://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /