From b1984f3c49b6807d4b17c505574d579d9e5969d9 Mon Sep 17 00:00:00 2001 From: Alec Date: Wed, 30 Oct 2019 04:22:47 -0400 Subject: [PATCH] [TS] Fixes typescript-axios "File custom.d.ts not found" when building consumer TS project (#4230) * remove unused file * build(package.json): update node and ts * remove ref to ambient declaration * remove other ref to ambient declaration * remove all references to custom.d.ts, rebuild * regenerate typescript axios samples --- .../codegen/languages/TypeScriptAxiosClientCodegen.java | 1 - .../src/main/resources/typescript-axios/api.mustache | 1 - .../src/main/resources/typescript-axios/apiInner.mustache | 1 - .../src/main/resources/typescript-axios/baseApi.mustache | 1 - .../src/main/resources/typescript-axios/custom.d.mustache | 1 - .../src/main/resources/typescript-axios/model.mustache | 1 - .../src/main/resources/typescript-axios/package.mustache | 4 ++-- .../client/petstore/typescript-axios/builds/default/api.ts | 1 - .../client/petstore/typescript-axios/builds/default/base.ts | 1 - .../client/petstore/typescript-axios/builds/es6-target/api.ts | 1 - .../petstore/typescript-axios/builds/es6-target/base.ts | 1 - .../petstore/typescript-axios/builds/es6-target/package.json | 4 ++-- .../typescript-axios/builds/with-complex-headers/api.ts | 1 - .../typescript-axios/builds/with-complex-headers/base.ts | 1 - .../petstore/typescript-axios/builds/with-interfaces/api.ts | 1 - .../petstore/typescript-axios/builds/with-interfaces/base.ts | 1 - .../with-npm-version-and-separate-models-and-api/api.ts | 1 - .../api/another/level/pet-api.ts | 1 - .../api/another/level/store-api.ts | 1 - .../api/another/level/user-api.ts | 1 - .../with-npm-version-and-separate-models-and-api/base.ts | 1 - .../model/some/levels/deep/api-response.ts | 1 - .../model/some/levels/deep/category.ts | 1 - .../model/some/levels/deep/order.ts | 1 - .../model/some/levels/deep/pet.ts | 1 - .../model/some/levels/deep/tag.ts | 1 - .../model/some/levels/deep/user.ts | 1 - .../with-npm-version-and-separate-models-and-api/package.json | 4 ++-- .../petstore/typescript-axios/builds/with-npm-version/api.ts | 1 - .../petstore/typescript-axios/builds/with-npm-version/base.ts | 1 - .../typescript-axios/builds/with-npm-version/package.json | 4 ++-- 31 files changed, 8 insertions(+), 35 deletions(-) delete mode 100644 modules/openapi-generator/src/main/resources/typescript-axios/custom.d.mustache diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java index fff5afb332f..30f924fda4c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java @@ -107,7 +107,6 @@ public class TypeScriptAxiosClientCodegen extends AbstractTypeScriptClientCodege supportingFiles.add(new SupportingFile("baseApi.mustache", "", "base.ts")); supportingFiles.add(new SupportingFile("api.mustache", "", "api.ts")); supportingFiles.add(new SupportingFile("configuration.mustache", "", "configuration.ts")); - supportingFiles.add(new SupportingFile("custom.d.mustache", "", "custom.d.ts")); supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore")); diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache index 8165cd51077..de8ce193d87 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache @@ -1,5 +1,4 @@ // tslint:disable -/// {{>licenseInfo}} {{^withSeparateModelsAndApi}} diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache index 7e776e3f2ea..3f625aca23d 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache @@ -1,6 +1,5 @@ {{#withSeparateModelsAndApi}} // tslint:disable -/// {{>licenseInfo}} import * as globalImportUrl from 'url'; diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/baseApi.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/baseApi.mustache index b5536db72b6..5ff1902dd45 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/baseApi.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/baseApi.mustache @@ -1,5 +1,4 @@ // tslint:disable -/// {{>licenseInfo}} import { Configuration } from "./configuration"; diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/custom.d.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/custom.d.mustache deleted file mode 100644 index 32534cb1663..00000000000 --- a/modules/openapi-generator/src/main/resources/typescript-axios/custom.d.mustache +++ /dev/null @@ -1 +0,0 @@ -declare module 'url'; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/model.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/model.mustache index 711a1e0f16b..a460d5ce588 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/model.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/model.mustache @@ -1,5 +1,4 @@ // tslint:disable -/// {{>licenseInfo}} {{#withSeparateModelsAndApi}}{{#imports}} import { {{class}} } from './{{filename}}';{{/imports}}{{/withSeparateModelsAndApi}} diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/package.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/package.mustache index ef009759ab6..99e63c25d5a 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/package.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/package.mustache @@ -21,8 +21,8 @@ "axios": "^0.18.0" }, "devDependencies": { - "@types/node": "^8.0.9", - "typescript": "^2.4" + "@types/node": "^12.11.5", + "typescript": "^3.6.4" }{{#npmRepository}},{{/npmRepository}} {{#npmRepository}} "publishConfig": { diff --git a/samples/client/petstore/typescript-axios/builds/default/api.ts b/samples/client/petstore/typescript-axios/builds/default/api.ts index b5d44c028e2..2680cf57f47 100644 --- a/samples/client/petstore/typescript-axios/builds/default/api.ts +++ b/samples/client/petstore/typescript-axios/builds/default/api.ts @@ -1,5 +1,4 @@ // tslint:disable -/// /** * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/client/petstore/typescript-axios/builds/default/base.ts b/samples/client/petstore/typescript-axios/builds/default/base.ts index 64562bd0dd1..71e2f198af3 100644 --- a/samples/client/petstore/typescript-axios/builds/default/base.ts +++ b/samples/client/petstore/typescript-axios/builds/default/base.ts @@ -1,5 +1,4 @@ // tslint:disable -/// /** * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/api.ts b/samples/client/petstore/typescript-axios/builds/es6-target/api.ts index b5d44c028e2..2680cf57f47 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/api.ts +++ b/samples/client/petstore/typescript-axios/builds/es6-target/api.ts @@ -1,5 +1,4 @@ // tslint:disable -/// /** * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/base.ts b/samples/client/petstore/typescript-axios/builds/es6-target/base.ts index 64562bd0dd1..71e2f198af3 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/base.ts +++ b/samples/client/petstore/typescript-axios/builds/es6-target/base.ts @@ -1,5 +1,4 @@ // tslint:disable -/// /** * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/package.json b/samples/client/petstore/typescript-axios/builds/es6-target/package.json index 99b54ef8cc9..073c576bc41 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/package.json +++ b/samples/client/petstore/typescript-axios/builds/es6-target/package.json @@ -21,8 +21,8 @@ "axios": "^0.18.0" }, "devDependencies": { - "@types/node": "^8.0.9", - "typescript": "^2.4" + "@types/node": "^12.11.5", + "typescript": "^3.6.4" }, "publishConfig": { "registry": "https://skimdb.npmjs.com/registry" diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts b/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts index e4e2a763dc6..3c08f74d7da 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts @@ -1,5 +1,4 @@ // tslint:disable -/// /** * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/base.ts b/samples/client/petstore/typescript-axios/builds/with-complex-headers/base.ts index 64562bd0dd1..71e2f198af3 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/base.ts +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/base.ts @@ -1,5 +1,4 @@ // tslint:disable -/// /** * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts b/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts index 691bb79fb62..a7777a08a4a 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts @@ -1,5 +1,4 @@ // tslint:disable -/// /** * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/base.ts b/samples/client/petstore/typescript-axios/builds/with-interfaces/base.ts index 64562bd0dd1..71e2f198af3 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/base.ts +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/base.ts @@ -1,5 +1,4 @@ // tslint:disable -/// /** * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api.ts index 1b630a8f2da..e16c9dd6319 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api.ts @@ -1,5 +1,4 @@ // tslint:disable -/// /** * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts index 70d3de8c013..578ac53ef77 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts @@ -1,5 +1,4 @@ // tslint:disable -/// /** * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts index af5fe4057ec..65c0f296582 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts @@ -1,5 +1,4 @@ // tslint:disable -/// /** * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts index f2a432b5d1f..a7fd1b542c2 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts @@ -1,5 +1,4 @@ // tslint:disable -/// /** * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/base.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/base.ts index 64562bd0dd1..71e2f198af3 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/base.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/base.ts @@ -1,5 +1,4 @@ // tslint:disable -/// /** * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/api-response.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/api-response.ts index f65148b54c8..1ce62626019 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/api-response.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/api-response.ts @@ -1,5 +1,4 @@ // tslint:disable -/// /** * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/category.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/category.ts index b596b740f30..6a836ab3f55 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/category.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/category.ts @@ -1,5 +1,4 @@ // tslint:disable -/// /** * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/order.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/order.ts index ada43bc13f5..1458595e20a 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/order.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/order.ts @@ -1,5 +1,4 @@ // tslint:disable -/// /** * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/pet.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/pet.ts index 8191b6719a9..d2e38753f00 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/pet.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/pet.ts @@ -1,5 +1,4 @@ // tslint:disable -/// /** * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/tag.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/tag.ts index 56e19b3ce0e..3514962f6a4 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/tag.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/tag.ts @@ -1,5 +1,4 @@ // tslint:disable -/// /** * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/user.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/user.ts index 02277cad675..b5f98b2f692 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/user.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/user.ts @@ -1,5 +1,4 @@ // tslint:disable -/// /** * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/package.json b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/package.json index 99b54ef8cc9..073c576bc41 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/package.json +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/package.json @@ -21,8 +21,8 @@ "axios": "^0.18.0" }, "devDependencies": { - "@types/node": "^8.0.9", - "typescript": "^2.4" + "@types/node": "^12.11.5", + "typescript": "^3.6.4" }, "publishConfig": { "registry": "https://skimdb.npmjs.com/registry" diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts index b5d44c028e2..2680cf57f47 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts @@ -1,5 +1,4 @@ // tslint:disable -/// /** * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/base.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version/base.ts index 64562bd0dd1..71e2f198af3 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/base.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/base.ts @@ -1,5 +1,4 @@ // tslint:disable -/// /** * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/package.json b/samples/client/petstore/typescript-axios/builds/with-npm-version/package.json index 99b54ef8cc9..073c576bc41 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/package.json +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/package.json @@ -21,8 +21,8 @@ "axios": "^0.18.0" }, "devDependencies": { - "@types/node": "^8.0.9", - "typescript": "^2.4" + "@types/node": "^12.11.5", + "typescript": "^3.6.4" }, "publishConfig": { "registry": "https://skimdb.npmjs.com/registry"