Typescript refactor: Platform select for browser and node (#4500)

* Use string form of filename parameter

This works for the form-data library and is also compatible with the
browser FormData object.

* Add new option to select platform node or browser

When no platform is selected, a default is chosen by the framework
option and likewise the file data type option is implied by the
platform.

* Remove redundant import of node dns module

* Only use form-data library for node platform

* Generate npm package from npmName option

* Use method convertPropertyToBooleanAndWriteBack

* Generate typescript samples with ensure-up-to-date
This commit is contained in:
Bodo Graumann 2020-01-18 12:31:27 +01:00 committed by Tino Fuhrmann
parent 6dfe637b21
commit f3f5fef279
21 changed files with 82 additions and 108 deletions

View File

@ -28,10 +28,10 @@ fi
# if you've executed sbt assembly previously it will use that instead. # 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" export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
echo "Creating default (fetch) client!" echo "Creating default (fetch) client!"
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript -o samples/client/petstore/typescript/builds/default $@" ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript -o samples/client/petstore/typescript/builds/default --additional-properties=platform=node,npmName=ts-petstore-client $@"
java $JAVA_OPTS -jar $executable $ags java $JAVA_OPTS -jar $executable $ags
echo "Creating jquery client!" echo "Creating jquery client!"
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript -o samples/client/petstore/typescript/builds/jquery --additional-properties=framework=jquery,fileContentDataType=Blob $@" ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript -o samples/client/petstore/typescript/builds/jquery --additional-properties=framework=jquery,npmName=ts-petstore-client $@"
java $JAVA_OPTS -jar $executable $ags java $JAVA_OPTS -jar $executable $ags

View File

@ -73,6 +73,7 @@ declare -a scripts=(
"./bin/java-play-framework-petstore-server-all.sh" "./bin/java-play-framework-petstore-server-all.sh"
"./bin/elm-petstore-all.sh" "./bin/elm-petstore-all.sh"
"./bin/meta-codegen.sh" "./bin/meta-codegen.sh"
"./bin/typescript.sh"
# OTHERS # OTHERS
"./bin/utils/export_docs_generators.sh" "./bin/utils/export_docs_generators.sh"
"./bin/utils/copy-to-website.sh" "./bin/utils/copy-to-website.sh"

View File

@ -13,4 +13,5 @@ sidebar_label: typescript
|supportsES6|Generate code that conforms to ES6.| |false| |supportsES6|Generate code that conforms to ES6.| |false|
|fileContentDataType|Specifies the type to use for the content of a file - i.e. Blob (Browser) / Buffer (node)| |Buffer| |fileContentDataType|Specifies the type to use for the content of a file - i.e. Blob (Browser) / Buffer (node)| |Buffer|
|useRxJS|Enable this to internally use rxjs observables. If disabled, a stub is used instead. This is required for the 'angular' framework.| |false| |useRxJS|Enable this to internally use rxjs observables. If disabled, a stub is used instead. This is required for the 'angular' framework.| |false|
|platform|Specifies the platform the code should run on. The default is 'node' for the 'request' framework and 'browser' otherwise.| |null|
|framework|Specify the framework which should be used in the client code.|<dl><dt>**fetch-api**</dt><dd>fetch-api</dd><dt>**jquery**</dt><dd>jquery</dd><dl>|fetch-api| |framework|Specify the framework which should be used in the client code.|<dl><dt>**fetch-api**</dt><dd>fetch-api</dd><dt>**jquery**</dt><dd>jquery</dd><dl>|fetch-api|

View File

@ -46,6 +46,9 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo
private static final String FRAMEWORK_SWITCH = "framework"; private static final String FRAMEWORK_SWITCH = "framework";
private static final String FRAMEWORK_SWITCH_DESC = "Specify the framework which should be used in the client code."; private static final String FRAMEWORK_SWITCH_DESC = "Specify the framework which should be used in the client code.";
private static final String[] FRAMEWORKS = { "fetch-api", "jquery" }; private static final String[] FRAMEWORKS = { "fetch-api", "jquery" };
private static final String PLATFORM_SWITCH = "platform";
private static final String PLATFORM_SWITCH_DESC = "Specifies the platform the code should run on. The default is 'node' for the 'request' framework and 'browser' otherwise.";
private static final String[] PLATFORMS = { "browser", "node" };
private static final String FILE_CONTENT_DATA_TYPE= "fileContentDataType"; private static final String FILE_CONTENT_DATA_TYPE= "fileContentDataType";
private static final String FILE_CONTENT_DATA_TYPE_DESC = "Specifies the type to use for the content of a file - i.e. Blob (Browser) / Buffer (node)"; private static final String FILE_CONTENT_DATA_TYPE_DESC = "Specifies the type to use for the content of a file - i.e. Blob (Browser) / Buffer (node)";
private static final String USE_RXJS_SWITCH = "useRxJS"; private static final String USE_RXJS_SWITCH = "useRxJS";
@ -142,6 +145,14 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo
} }
frameworkOption.defaultValue(FRAMEWORKS[0]); frameworkOption.defaultValue(FRAMEWORKS[0]);
cliOptions.add(new CliOption(TypeScriptClientCodegen.PLATFORM_SWITCH, TypeScriptClientCodegen.PLATFORM_SWITCH_DESC));
CliOption platformOption = new CliOption(TypeScriptClientCodegen.PLATFORM_SWITCH, TypeScriptClientCodegen.PLATFORM_SWITCH_DESC);
for (String option: TypeScriptClientCodegen.PLATFORMS) {
// TODO: improve description?
platformOption.addEnum(option, option);
}
platformOption.defaultValue(PLATFORMS[0]);
cliOptions.add(frameworkOption); cliOptions.add(frameworkOption);
@ -191,16 +202,17 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo
@Override @Override
public Map<String, Object> postProcessSupportingFileData(Map<String, Object> objs) { public Map<String, Object> postProcessSupportingFileData(Map<String, Object> objs) {
final Object propFramework = additionalProperties.get(FRAMEWORK_SWITCH);
Map<String, Boolean> frameworks = new HashMap<>(); Map<String, Boolean> frameworks = new HashMap<>();
for (String framework: FRAMEWORKS) { for (String framework: FRAMEWORKS) {
frameworks.put(framework, framework.equals(additionalProperties.get(FRAMEWORK_SWITCH))); frameworks.put(framework, framework.equals(propFramework));
} }
objs.put("framework", additionalProperties.get(FRAMEWORK_SWITCH)); objs.put("framework", propFramework);
objs.put("frameworks", frameworks); objs.put("frameworks", frameworks);
Object propDataType = additionalProperties.get(FILE_CONTENT_DATA_TYPE); objs.put("fileContentDataType", additionalProperties.get(FILE_CONTENT_DATA_TYPE));
objs.put("fileContentDataType", propDataType == null ? "Buffer" : propDataType);
return objs; return objs;
} }
@ -695,33 +707,40 @@ public class TypeScriptClientCodegen extends DefaultCodegen implements CodegenCo
setModelPropertyNaming((String) additionalProperties.get(CodegenConstants.MODEL_PROPERTY_NAMING)); setModelPropertyNaming((String) additionalProperties.get(CodegenConstants.MODEL_PROPERTY_NAMING));
} }
if (additionalProperties.containsKey(CodegenConstants.SUPPORTS_ES6)) { convertPropertyToBooleanAndWriteBack(CodegenConstants.SUPPORTS_ES6);
// convert to boolean
additionalProperties.put(CodegenConstants.SUPPORTS_ES6,
Boolean.valueOf(additionalProperties.get(CodegenConstants.SUPPORTS_ES6).toString())
);
}
// change package names // change package names
apiPackage = this.apiPackage + ".apis"; apiPackage = this.apiPackage + ".apis";
modelPackage = this.modelPackage + ".models"; modelPackage = this.modelPackage + ".models";
testPackage = this.testPackage + ".tests"; testPackage = this.testPackage + ".tests";
if (additionalProperties.containsKey(FRAMEWORK_SWITCH)) { additionalProperties.putIfAbsent(FRAMEWORK_SWITCH, FRAMEWORKS[0]);
supportingFiles.add(new SupportingFile("generators/" + additionalProperties.get(FRAMEWORK_SWITCH) + ".mustache", "index.ts")); supportingFiles.add(new SupportingFile(
} else { "generators" + File.separator + additionalProperties.get(FRAMEWORK_SWITCH) + ".mustache",
additionalProperties.put(FRAMEWORK_SWITCH, FRAMEWORKS[0]); "index.ts"
supportingFiles.add(new SupportingFile("generators" + File.separator + FRAMEWORKS[0] + ".mustache", "index.ts")); ));
}
String httpLibName = this.getHttpLibForFramework(additionalProperties.get(FRAMEWORK_SWITCH).toString());
supportingFiles.add(new SupportingFile("http" + File.separator + httpLibName + ".mustache", "http", httpLibName + ".ts"));
boolean useRxJS = false; String httpLibName = this.getHttpLibForFramework(additionalProperties.get(FRAMEWORK_SWITCH).toString());
if (additionalProperties.containsKey(USE_RXJS_SWITCH)) { supportingFiles.add(new SupportingFile(
// convert to boolean "http" + File.separator + httpLibName + ".mustache",
useRxJS = Boolean.valueOf(additionalProperties.get(USE_RXJS_SWITCH).toString()); "http", httpLibName + ".ts"
additionalProperties.put(USE_RXJS_SWITCH, useRxJS); ));
Object propPlatform = additionalProperties.get(PLATFORM_SWITCH);
if (propPlatform == null) {
propPlatform = "browser";
additionalProperties.put("platform", propPlatform);
} }
Map<String, Boolean> platforms = new HashMap<>();
for (String platform: PLATFORMS) {
platforms.put(platform, platform.equals(propPlatform));
}
additionalProperties.put("platforms", platforms);
additionalProperties.putIfAbsent(FILE_CONTENT_DATA_TYPE, propPlatform.equals("node") ? "Buffer" : "Blob");
final boolean useRxJS = convertPropertyToBooleanAndWriteBack(USE_RXJS_SWITCH);
if (!useRxJS) { if (!useRxJS) {
supportingFiles.add(new SupportingFile("rxjsStub.mustache", "", "rxjsStub.ts")); supportingFiles.add(new SupportingFile("rxjsStub.mustache", "", "rxjsStub.ts"));
} }

View File

@ -2,7 +2,11 @@
import { BaseAPIRequestFactory, RequiredError } from './baseapi'; import { BaseAPIRequestFactory, RequiredError } from './baseapi';
import {Configuration} from '../configuration'; import {Configuration} from '../configuration';
import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http';
{{#platforms}}
{{#node}}
import * as FormData from "form-data"; import * as FormData from "form-data";
{{/node}}
{{/platforms}}
import {ObjectSerializer} from '../models/ObjectSerializer'; import {ObjectSerializer} from '../models/ObjectSerializer';
import {ApiException} from './exception'; import {ApiException} from './exception';
import {isCodeInRange} from '../util'; import {isCodeInRange} from '../util';
@ -88,7 +92,7 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory {
localVarFormParams.append('{{baseName}}', {{paramName}} as any); localVarFormParams.append('{{baseName}}', {{paramName}} as any);
{{/isFile}} {{/isFile}}
{{#isFile}} {{#isFile}}
localVarFormParams.append('{{baseName}}', {{paramName}}.data, { "filename": {{paramName}}.name }); localVarFormParams.append('{{baseName}}', {{paramName}}.data, {{paramName}}.name);
{{/isFile}} {{/isFile}}
} }
{{/isListContainer}} {{/isListContainer}}

View File

@ -1,5 +1,9 @@
{{#platforms}}
{{#node}}
// TODO: evaluate if we can easily get rid of this library // TODO: evaluate if we can easily get rid of this library
import * as FormData from "form-data"; import * as FormData from "form-data";
{{/node}}
{{/platforms}}
// typings of url-parse are incorrect... // typings of url-parse are incorrect...
// @ts-ignore // @ts-ignore
import * as URLParse from "url-parse"; import * as URLParse from "url-parse";

View File

@ -3,8 +3,11 @@ import * as e6p from 'es6-promise'
import { from, Observable } from {{#useRxJS}}'rxjs'{{/useRxJS}}{{^useRxJS}}'../rxjsStub'{{/useRxJS}}; import { from, Observable } from {{#useRxJS}}'rxjs'{{/useRxJS}}{{^useRxJS}}'../rxjsStub'{{/useRxJS}};
e6p.polyfill(); e6p.polyfill();
import * as $ from 'jquery'; import * as $ from 'jquery';
{{#platforms}}
{{#node}}
import * as FormData from "form-data"; import * as FormData from "form-data";
import { resolve } from 'dns'; {{/node}}
{{/platforms}}
export class JQueryHttpLibrary implements HttpLibrary { export class JQueryHttpLibrary implements HttpLibrary {

View File

@ -1,5 +1,5 @@
{ {
"name": "ts-petstore-client", "name": "{{npmName}}",
"version": "1.0.0", "version": "1.0.0",
"description": "OpenAPI client for {{npmName}}", "description": "OpenAPI client for {{npmName}}",
"author": "OpenAPI-Generator Contributors", "author": "OpenAPI-Generator Contributors",
@ -7,8 +7,7 @@
"fetch", "fetch",
"typescript", "typescript",
"openapi-client", "openapi-client",
"openapi-generator", "openapi-generator"
"{{npmName}}"
], ],
"license": "Unlicense", "license": "Unlicense",
"main": "./dist/index.js", "main": "./dist/index.js",
@ -18,8 +17,6 @@
"prepublishOnly": "npm run build" "prepublishOnly": "npm run build"
}, },
"dependencies": { "dependencies": {
"es6-promise": "^4.2.4",
"@types/node": "*",
{{#frameworks}} {{#frameworks}}
{{#fetch-api}} {{#fetch-api}}
"isomorphic-fetch": "^2.2.1", "isomorphic-fetch": "^2.2.1",
@ -30,11 +27,17 @@
"jquery": "^3.4.1", "jquery": "^3.4.1",
{{/jquery}} {{/jquery}}
{{/frameworks}} {{/frameworks}}
"btoa": "^1.2.1", {{#platforms}}
{{#node}}
"@types/node": "*",
"form-data": "^2.5.0", "form-data": "^2.5.0",
{{/node}}
{{/platforms}}
{{#useRxJS}} {{#useRxJS}}
"rxjs": "^6.4.0", "rxjs": "^6.4.0",
{{/useRxJS}} {{/useRxJS}}
"btoa": "^1.2.1",
"es6-promise": "^4.2.4",
"url-parse": "^1.4.3" "url-parse": "^1.4.3"
}, },
"devDependencies": { "devDependencies": {

View File

@ -365,7 +365,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
} }
if (file !== undefined) { if (file !== undefined) {
// TODO: replace .append with .set // TODO: replace .append with .set
localVarFormParams.append('file', file.data, { "filename": file.name }); localVarFormParams.append('file', file.data, file.name);
} }
requestContext.setBody(localVarFormParams); requestContext.setBody(localVarFormParams);

View File

@ -1,14 +1,13 @@
{ {
"name": "ts-petstore-client", "name": "ts-petstore-client",
"version": "1.0.0", "version": "1.0.0",
"description": "OpenAPI client for ", "description": "OpenAPI client for ts-petstore-client",
"author": "OpenAPI-Generator Contributors", "author": "OpenAPI-Generator Contributors",
"keywords": [ "keywords": [
"fetch", "fetch",
"typescript", "typescript",
"openapi-client", "openapi-client",
"openapi-generator", "openapi-generator"
""
], ],
"license": "Unlicense", "license": "Unlicense",
"main": "./dist/index.js", "main": "./dist/index.js",
@ -18,12 +17,12 @@
"prepublishOnly": "npm run build" "prepublishOnly": "npm run build"
}, },
"dependencies": { "dependencies": {
"es6-promise": "^4.2.4",
"@types/node": "*",
"isomorphic-fetch": "^2.2.1", "isomorphic-fetch": "^2.2.1",
"@types/isomorphic-fetch": "0.0.34", "@types/isomorphic-fetch": "0.0.34",
"btoa": "^1.2.1", "@types/node": "*",
"form-data": "^2.5.0", "form-data": "^2.5.0",
"btoa": "^1.2.1",
"es6-promise": "^4.2.4",
"url-parse": "^1.4.3" "url-parse": "^1.4.3"
}, },
"devDependencies": { "devDependencies": {

View File

@ -2,7 +2,6 @@
import { BaseAPIRequestFactory, RequiredError } from './baseapi'; import { BaseAPIRequestFactory, RequiredError } from './baseapi';
import {Configuration} from '../configuration'; import {Configuration} from '../configuration';
import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http';
import * as FormData from "form-data";
import {ObjectSerializer} from '../models/ObjectSerializer'; import {ObjectSerializer} from '../models/ObjectSerializer';
import {ApiException} from './exception'; import {ApiException} from './exception';
import {isCodeInRange} from '../util'; import {isCodeInRange} from '../util';
@ -365,7 +364,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
} }
if (file !== undefined) { if (file !== undefined) {
// TODO: replace .append with .set // TODO: replace .append with .set
localVarFormParams.append('file', file.data, { "filename": file.name }); localVarFormParams.append('file', file.data, file.name);
} }
requestContext.setBody(localVarFormParams); requestContext.setBody(localVarFormParams);

View File

@ -2,7 +2,6 @@
import { BaseAPIRequestFactory, RequiredError } from './baseapi'; import { BaseAPIRequestFactory, RequiredError } from './baseapi';
import {Configuration} from '../configuration'; import {Configuration} from '../configuration';
import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http';
import * as FormData from "form-data";
import {ObjectSerializer} from '../models/ObjectSerializer'; import {ObjectSerializer} from '../models/ObjectSerializer';
import {ApiException} from './exception'; import {ApiException} from './exception';
import {isCodeInRange} from '../util'; import {isCodeInRange} from '../util';

View File

@ -2,7 +2,6 @@
import { BaseAPIRequestFactory, RequiredError } from './baseapi'; import { BaseAPIRequestFactory, RequiredError } from './baseapi';
import {Configuration} from '../configuration'; import {Configuration} from '../configuration';
import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http'; import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http';
import * as FormData from "form-data";
import {ObjectSerializer} from '../models/ObjectSerializer'; import {ObjectSerializer} from '../models/ObjectSerializer';
import {ApiException} from './exception'; import {ApiException} from './exception';
import {isCodeInRange} from '../util'; import {isCodeInRange} from '../util';

View File

@ -1,5 +1,3 @@
// TODO: evaluate if we can easily get rid of this library
import * as FormData from "form-data";
// typings of url-parse are incorrect... // typings of url-parse are incorrect...
// @ts-ignore // @ts-ignore
import * as URLParse from "url-parse"; import * as URLParse from "url-parse";

View File

@ -3,8 +3,6 @@ import * as e6p from 'es6-promise'
import { from, Observable } from '../rxjsStub'; import { from, Observable } from '../rxjsStub';
e6p.polyfill(); e6p.polyfill();
import * as $ from 'jquery'; import * as $ from 'jquery';
import * as FormData from "form-data";
import { resolve } from 'dns';
export class JQueryHttpLibrary implements HttpLibrary { export class JQueryHttpLibrary implements HttpLibrary {

View File

@ -12,72 +12,26 @@
"@types/sizzle": "*" "@types/sizzle": "*"
} }
}, },
"@types/node": {
"version": "12.12.7",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.7.tgz",
"integrity": "sha512-E6Zn0rffhgd130zbCbAr/JdXfXkoOUFAKNs/rF8qnafSJ8KYaA/j3oz7dcwal+lYjLA7xvdd5J4wdYpCTlP8+w=="
},
"@types/sizzle": { "@types/sizzle": {
"version": "2.3.2", "version": "2.3.2",
"resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.2.tgz", "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.2.tgz",
"integrity": "sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg==" "integrity": "sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg=="
}, },
"asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
},
"btoa": { "btoa": {
"version": "1.2.1", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/btoa/-/btoa-1.2.1.tgz", "resolved": "https://registry.npmjs.org/btoa/-/btoa-1.2.1.tgz",
"integrity": "sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g==" "integrity": "sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g=="
}, },
"combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"requires": {
"delayed-stream": "~1.0.0"
}
},
"delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
},
"es6-promise": { "es6-promise": {
"version": "4.2.6", "version": "4.2.6",
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.6.tgz", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.6.tgz",
"integrity": "sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q==" "integrity": "sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q=="
}, },
"form-data": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz",
"integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==",
"requires": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.6",
"mime-types": "^2.1.12"
}
},
"jquery": { "jquery": {
"version": "3.4.1", "version": "3.4.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.4.1.tgz", "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.4.1.tgz",
"integrity": "sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==" "integrity": "sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw=="
}, },
"mime-db": {
"version": "1.40.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz",
"integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA=="
},
"mime-types": {
"version": "2.1.24",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz",
"integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==",
"requires": {
"mime-db": "1.40.0"
}
},
"querystringify": { "querystringify": {
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz",

View File

@ -1,14 +1,13 @@
{ {
"name": "ts-petstore-client", "name": "ts-petstore-client",
"version": "1.0.0", "version": "1.0.0",
"description": "OpenAPI client for ", "description": "OpenAPI client for ts-petstore-client",
"author": "OpenAPI-Generator Contributors", "author": "OpenAPI-Generator Contributors",
"keywords": [ "keywords": [
"fetch", "fetch",
"typescript", "typescript",
"openapi-client", "openapi-client",
"openapi-generator", "openapi-generator"
""
], ],
"license": "Unlicense", "license": "Unlicense",
"main": "./dist/index.js", "main": "./dist/index.js",
@ -18,12 +17,10 @@
"prepublishOnly": "npm run build" "prepublishOnly": "npm run build"
}, },
"dependencies": { "dependencies": {
"es6-promise": "^4.2.4",
"@types/node": "*",
"@types/jquery": "^3.3.29", "@types/jquery": "^3.3.29",
"jquery": "^3.4.1", "jquery": "^3.4.1",
"btoa": "^1.2.1", "btoa": "^1.2.1",
"form-data": "^2.5.0", "es6-promise": "^4.2.4",
"url-parse": "^1.4.3" "url-parse": "^1.4.3"
}, },
"devDependencies": { "devDependencies": {

View File

@ -4679,10 +4679,8 @@
"version": "file:../../builds/jquery", "version": "file:../../builds/jquery",
"requires": { "requires": {
"@types/jquery": "^3.3.29", "@types/jquery": "^3.3.29",
"@types/node": "*",
"btoa": "^1.2.1", "btoa": "^1.2.1",
"es6-promise": "^4.2.4", "es6-promise": "^4.2.4",
"form-data": "^2.5.0",
"jquery": "^3.4.1", "jquery": "^3.4.1",
"url-parse": "^1.4.3" "url-parse": "^1.4.3"
}, },

View File

@ -2,8 +2,6 @@ declare var QUnit: any;
import * as petstore from "ts-petstore-client"; import * as petstore from "ts-petstore-client";
import * as FormData from "form-data";
let libs: { [key: string]: petstore.http.HttpLibrary } = { let libs: { [key: string]: petstore.http.HttpLibrary } = {
"jquery": new petstore.http.JQueryHttpLibrary() "jquery": new petstore.http.JQueryHttpLibrary()
} }