swagger-typescript-api 10.0.3 → 11.0.0--alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +218 -0
  2. package/index.d.ts +93 -0
  3. package/index.js +230 -103
  4. package/package.json +121 -119
  5. package/src/code-formatter.js +101 -0
  6. package/src/code-gen-process.js +456 -0
  7. package/src/configuration.js +425 -0
  8. package/src/constants.js +14 -31
  9. package/src/index.js +6 -257
  10. package/src/schema-components-map.js +60 -0
  11. package/src/schema-parser/schema-formatters.js +145 -0
  12. package/src/schema-parser/schema-parser.js +497 -0
  13. package/src/schema-parser/schema-routes.js +902 -0
  14. package/src/swagger-schema-resolver.js +187 -0
  15. package/src/templates.js +141 -122
  16. package/src/translators/JavaScript.js +49 -49
  17. package/src/type-name.js +79 -0
  18. package/src/util/file-system.js +76 -0
  19. package/src/{utils → util}/id.js +0 -0
  20. package/src/util/internal-case.js +5 -0
  21. package/src/util/logger.js +100 -0
  22. package/src/{utils/resolveName.js → util/name-resolver.js} +1 -1
  23. package/src/util/object-assign.js +11 -0
  24. package/src/util/pascal-case.js +5 -0
  25. package/src/{utils → util}/random.js +1 -1
  26. package/templates/base/data-contract-jsdoc.ejs +29 -24
  27. package/templates/base/data-contracts.ejs +3 -3
  28. package/templates/base/interface-data-contract.ejs +1 -0
  29. package/templates/base/route-docs.ejs +2 -2
  30. package/templates/base/route-type.ejs +2 -2
  31. package/templates/default/route-types.ejs +2 -2
  32. package/templates/modular/api.ejs +2 -2
  33. package/templates/modular/route-types.ejs +2 -2
  34. package/src/apiConfig.js +0 -30
  35. package/src/common.js +0 -28
  36. package/src/components.js +0 -91
  37. package/src/config.js +0 -108
  38. package/src/filePrefix.js +0 -14
  39. package/src/files.js +0 -56
  40. package/src/formatFileContent.js +0 -81
  41. package/src/logger.js +0 -68
  42. package/src/modelNames.js +0 -74
  43. package/src/modelTypes.js +0 -31
  44. package/src/output.js +0 -165
  45. package/src/prettierOptions.js +0 -23
  46. package/src/render/utils/fmtToJSDocLine.js +0 -10
  47. package/src/render/utils/index.js +0 -31
  48. package/src/render/utils/templateRequire.js +0 -17
  49. package/src/routeNames.js +0 -46
  50. package/src/routes.js +0 -809
  51. package/src/schema.js +0 -474
  52. package/src/swagger.js +0 -152
  53. package/src/typeFormatters.js +0 -121
package/index.js CHANGED
@@ -6,110 +6,237 @@
6
6
  // License text available at https://opensource.org/licenses/MIT
7
7
  // Repository https://github.com/acacode/swagger-typescript-api
8
8
 
9
- const { Command } = require("commander");
10
- const { resolve } = require("path");
9
+ const _ = require("lodash");
10
+ const { version, name } = require("./package.json");
11
+ const { cli } = require("./cli");
11
12
  const { generateApi } = require("./src");
12
- const { version, name: packageName } = require("./package.json");
13
- const { TS_KEYWORDS, HTTP_CLIENT } = require("./src/constants");
14
-
15
- const program = new Command(packageName);
13
+ const { HTTP_CLIENT } = require("./src/constants");
14
+ const { resolve } = require("path");
16
15
 
17
- const options = program
18
- .alias("sta")
19
- .version(version, "-v, --version", "output the current version")
20
- .description("Generate api via swagger scheme.\nSupports OA 3.0, 2.0, JSON, yaml.")
21
- .requiredOption("-p, --path <string>", "path/url to swagger scheme")
22
- .option("-o, --output <string>", "output path of typescript api file", "./")
23
- .option("-n, --name <string>", "name of output typescript api file", "Api.ts")
24
- .option("-t, --templates <string>", "path to folder containing templates")
25
- .option(
26
- "-d, --default-as-success",
27
- 'use "default" response status code as success response too.\n' +
28
- 'some swagger schemas use "default" response status code as success response type by default.',
29
- false,
30
- )
31
- .option(
32
- "-r, --responses",
33
- "generate additional information about request responses\n" + "also add typings for bad responses",
34
- false,
35
- )
36
- .option("--union-enums", 'generate all "enum" types as union types (T1 | T2 | TN)', false)
37
- .option("--add-readonly", "generate readonly properties", false)
38
- .option("--route-types", "generate type definitions for API routes", false)
39
- .option("--no-client", "do not generate an API class", true)
40
- .option("--enum-names-as-values", "use values in 'x-enumNames' as enum values (not only as keys)", false)
41
- .option(
42
- "--extract-request-params",
43
- "extract request params to data contract (Also combine path params and query params into one object)",
44
- false,
45
- )
46
- .option("--extract-request-body", "extract request body type to data contract", false)
47
- .option("--extract-response-body", "extract response body type to data contract", false)
48
- .option("--extract-response-error", "extract response error type to data contract", false)
49
- .option("--modular", "generate separated files for http client, data contracts, and routes", false)
50
- .option("--js", "generate js api module with declaration file", false)
51
- .option(
52
- "--module-name-index <number>",
53
- "determines which path index should be used for routes separation (example: GET:/fruites/getFruit -> index:0 -> moduleName -> fruites)",
54
- 0,
55
- )
56
- .option("--module-name-first-tag", "splits routes based on the first tag", false)
57
- .option("--disableStrictSSL", "disabled strict SSL", false)
58
- .option("--disableProxy", "disabled proxy", false)
59
- .option("--axios", "generate axios http client", false)
60
- .option("--unwrap-response-data", "unwrap the data item from the response", false)
61
- .option("--disable-throw-on-error", "Do not throw an error when response.ok is not true", false)
62
- .option("--single-http-client", "Ability to send HttpClient instance to Api constructor", false)
63
- .option("--silent", "Output only errors to console", false)
64
- .option("--default-response <type>", "default type for empty response schema", TS_KEYWORDS.VOID)
65
- .option("--type-prefix <string>", "data contract name prefix", "")
66
- .option("--type-suffix <string>", "data contract name suffix", "")
67
- .option("--clean-output", "clean output folder before generate api. WARNING: May cause data loss", false)
68
- .option("--api-class-name <string>", "name of the api class")
69
- .option("--patch", "fix up small errors in the swagger source definition", false)
70
- .option("--debug", "additional information about processes inside this tool", false)
71
- .parse(process.argv)
72
- .opts();
16
+ const program = cli({
17
+ name: name,
18
+ alias: "sta",
19
+ version: version,
20
+ description: "Generate api via swagger scheme.\nSupports OA 3.0, 2.0, JSON, yaml.",
21
+ options: [
22
+ {
23
+ flags: "-p, --path <string>",
24
+ description: "path/url to swagger scheme",
25
+ required: true,
26
+ },
27
+ {
28
+ flags: "-o, --output <string>",
29
+ description: "output path of typescript api file",
30
+ default: "./",
31
+ },
32
+ {
33
+ flags: "-n, --name <string>",
34
+ description: "name of output typescript api file",
35
+ default: "Api.ts",
36
+ },
37
+ {
38
+ flags: "-t, --templates <string>",
39
+ description: "path to folder containing templates",
40
+ },
41
+ {
42
+ flags: "-d, --default-as-success",
43
+ description:
44
+ 'use "default" response status code as success response too.\n' +
45
+ 'some swagger schemas use "default" response status code as success response type by default.',
46
+ default: false,
47
+ },
48
+ {
49
+ flags: "-r, --responses",
50
+ description: "generate additional information about request responses\n" + "also add typings for bad responses",
51
+ default: false,
52
+ },
53
+ {
54
+ flags: "--union-enums",
55
+ description: 'generate all "enum" types as union types (T1 | T2 | TN)',
56
+ default: false,
57
+ },
58
+ {
59
+ flags: "--add-readonly",
60
+ description: "generate readonly properties",
61
+ default: false,
62
+ },
63
+ {
64
+ flags: "--route-types",
65
+ description: "generate type definitions for API routes",
66
+ default: false,
67
+ },
68
+ {
69
+ flags: "--no-client",
70
+ description: "do not generate an API class",
71
+ default: true,
72
+ },
73
+ {
74
+ flags: "--enum-names-as-values",
75
+ description: "use values in 'x-enumNames' as enum values (not only as keys)",
76
+ default: false,
77
+ },
78
+ {
79
+ flags: "--extract-request-params",
80
+ description:
81
+ "extract request params to data contract (Also combine path params and query params into one object)",
82
+ default: false,
83
+ },
84
+ {
85
+ flags: "--extract-request-body",
86
+ description: "extract request body type to data contract",
87
+ default: false,
88
+ },
89
+ {
90
+ flags: "--extract-response-body",
91
+ description: "extract response body type to data contract",
92
+ default: false,
93
+ },
94
+ {
95
+ flags: "--extract-response-error",
96
+ description: "extract response error type to data contract",
97
+ default: false,
98
+ },
99
+ {
100
+ flags: "--modular",
101
+ description: "generate separated files for http client, data contracts, and routes",
102
+ default: false,
103
+ },
104
+ {
105
+ flags: "--js",
106
+ description: "generate js api module with declaration file",
107
+ default: false,
108
+ },
109
+ {
110
+ flags: "--module-name-index <number>",
111
+ description:
112
+ "determines which path index should be used for routes separation (example: GET:/fruites/getFruit -> index:0 -> moduleName -> fruites)",
113
+ default: 0,
114
+ },
115
+ {
116
+ flags: "--module-name-first-tag",
117
+ description: "splits routes based on the first tag",
118
+ default: false,
119
+ },
120
+ {
121
+ flags: "--disableStrictSSL",
122
+ description: "disabled strict SSL",
123
+ default: false,
124
+ },
125
+ {
126
+ flags: "--disableProxy",
127
+ description: "disabled proxy",
128
+ default: false,
129
+ },
130
+ {
131
+ flags: "--axios",
132
+ description: "generate axios http client",
133
+ default: false,
134
+ },
135
+ {
136
+ flags: "--unwrap-response-data",
137
+ description: "unwrap the data item from the response",
138
+ default: false,
139
+ },
140
+ {
141
+ flags: "--disable-throw-on-error",
142
+ description: "Do not throw an error when response.ok is not true",
143
+ default: false,
144
+ },
145
+ {
146
+ flags: "--single-http-client",
147
+ description: "Ability to send HttpClient instance to Api constructor",
148
+ default: false,
149
+ },
150
+ {
151
+ flags: "--silent",
152
+ description: "Output only errors to console",
153
+ default: false,
154
+ },
155
+ {
156
+ flags: "--default-response <type>",
157
+ description: "default type for empty response schema",
158
+ default: "void",
159
+ },
160
+ {
161
+ flags: "--type-prefix <string>",
162
+ description: "data contract name prefix",
163
+ default: "",
164
+ },
165
+ {
166
+ flags: "--type-suffix <string>",
167
+ description: "data contract name suffix",
168
+ default: "",
169
+ },
170
+ {
171
+ flags: "--clean-output",
172
+ description: "clean output folder before generate api. WARNING: May cause data loss",
173
+ default: false,
174
+ },
175
+ {
176
+ flags: "--api-class-name <string>",
177
+ description: "name of the api class",
178
+ },
179
+ {
180
+ flags: "--patch",
181
+ description: "fix up small errors in the swagger source definition",
182
+ default: false,
183
+ },
184
+ {
185
+ flags: "--debug",
186
+ description: "additional information about processes inside this tool",
187
+ default: false,
188
+ },
189
+ {
190
+ flags: "--another-array-type",
191
+ description: "generate array types as Array<Type> (by default Type[])",
192
+ default: false,
193
+ },
194
+ ],
195
+ });
73
196
 
74
- generateApi({
75
- name: options.name,
76
- url: options.path,
77
- generateRouteTypes: options.routeTypes,
78
- generateClient: !!(options.axios || options.client),
79
- httpClientType: options.axios ? HTTP_CLIENT.AXIOS : HTTP_CLIENT.FETCH,
80
- defaultResponseAsSuccess: options.defaultAsSuccess,
81
- defaultResponseType: options.defaultResponse,
82
- unwrapResponseData: options.unwrapResponseData,
83
- disableThrowOnError: options.disableThrowOnError,
84
- sortTypes: options.sortTypes,
85
- generateUnionEnums: options.unionEnums,
86
- addReadonly: options.addReadonly,
87
- generateResponses: options.responses,
88
- extractRequestParams: !!options.extractRequestParams,
89
- extractRequestBody: !!options.extractRequestBody,
90
- extractResponseBody: !!options.extractResponseBody,
91
- extractResponseError: !!options.extractResponseError,
92
- input: resolve(process.cwd(), options.path),
93
- output: resolve(process.cwd(), options.output || "."),
94
- templates: options.templates,
95
- modular: !!options.modular,
96
- toJS: !!options.js,
97
- enumNamesAsValues: options.enumNamesAsValues,
98
- moduleNameIndex: +(options.moduleNameIndex || 0),
99
- moduleNameFirstTag: options.moduleNameFirstTag,
100
- disableStrictSSL: !!options.disableStrictSSL,
101
- disableProxy: !!options.disableProxy,
102
- singleHttpClient: !!options.singleHttpClient,
103
- cleanOutput: !!options.cleanOutput,
104
- silent: !!options.silent,
105
- typePrefix: options.typePrefix,
106
- typeSuffix: options.typeSuffix,
107
- patch: !!options.patch,
108
- apiClassName: options.apiClassName,
109
- debug: options.debug,
110
- }).catch((err) => {
111
- // NOTE collect all errors on top level and shows to users in any case
112
- console.error(err);
197
+ const main = async () => {
198
+ const { command, options } = await program.execute({ args: process.argv });
199
+ if (command === "generate-templates") {
200
+ } else if (command === null) {
201
+ await generateApi({
202
+ name: options.name,
203
+ url: options.path,
204
+ generateRouteTypes: options.routeTypes,
205
+ generateClient: !!(options.axios || options.client),
206
+ httpClientType: options.axios ? HTTP_CLIENT.AXIOS : HTTP_CLIENT.FETCH,
207
+ defaultResponseAsSuccess: options.defaultAsSuccess,
208
+ defaultResponseType: options.defaultResponse,
209
+ unwrapResponseData: options.unwrapResponseData,
210
+ disableThrowOnError: options.disableThrowOnError,
211
+ sortTypes: options.sortTypes,
212
+ generateUnionEnums: options.unionEnums,
213
+ addReadonly: options.addReadonly,
214
+ generateResponses: options.responses,
215
+ extractRequestParams: !!options.extractRequestParams,
216
+ extractRequestBody: !!options.extractRequestBody,
217
+ extractResponseBody: !!options.extractResponseBody,
218
+ extractResponseError: !!options.extractResponseError,
219
+ input: resolve(process.cwd(), options.path),
220
+ output: resolve(process.cwd(), options.output || "."),
221
+ templates: options.templates,
222
+ modular: !!options.modular,
223
+ toJS: !!options.js,
224
+ enumNamesAsValues: options.enumNamesAsValues,
225
+ moduleNameIndex: +(options.moduleNameIndex || 0),
226
+ moduleNameFirstTag: options.moduleNameFirstTag,
227
+ disableStrictSSL: !!options.disableStrictSSL,
228
+ disableProxy: !!options.disableProxy,
229
+ singleHttpClient: !!options.singleHttpClient,
230
+ cleanOutput: !!options.cleanOutput,
231
+ silent: !!options.silent,
232
+ typePrefix: options.typePrefix,
233
+ typeSuffix: options.typeSuffix,
234
+ patch: !!options.patch,
235
+ apiClassName: options.apiClassName,
236
+ debug: options.debug,
237
+ anotherArrayType: options.anotherArrayType,
238
+ });
239
+ }
240
+ };
113
241
 
114
- process.exit(1);
115
- });
242
+ main();
package/package.json CHANGED
@@ -1,119 +1,121 @@
1
- {
2
- "name": "swagger-typescript-api",
3
- "version": "10.0.3",
4
- "description": "Generate typescript/javascript api from swagger schema",
5
- "scripts": {
6
- "cli:json": "node index.js -r -d -p ./swagger-test-cli.json -n swagger-test-cli.ts",
7
- "cli:yaml": "node index.js -r -d -p ./swagger-test-cli.yaml -n swagger-test-cli.ts",
8
- "node": "node swagger-test-cli/generate.js",
9
- "node:debug": "node --nolazy swagger-test-cli/generate.js",
10
- "contributors": "all-contributors generate",
11
- "cli:help": "node index.js -h",
12
- "test-all": "node --unhandled-rejections=strict ./scriptsRunner.js generate validate test:*",
13
- "test-all(update-snapshots)": "cross-env UPDATE_SNAPSHOTS=true node --unhandled-rejections=strict ./scriptsRunner.js generate validate test:*",
14
- "test-all-extended": "node --unhandled-rejections=strict ./scriptsRunner.js generate-extended validate generate validate test:*",
15
- "test-specific": "node ./scriptsRunner.js generate validate test:*",
16
- "test-specific-only": "node ./scriptsRunner.js test:*",
17
- "prepare": "npm run test-all-extended",
18
- "generate": "node tests/generate.js",
19
- "generate-extended": "node tests/generate-extended.js",
20
- "generate:debug": "node --nolazy tests/generate.js",
21
- "validate": "node tests/validate.js",
22
- "validate:debug": "node --nolazy tests/validate.js",
23
- "test:--route-types": "node tests/spec/routeTypes/test.js",
24
- "test:--no-client": "node tests/spec/noClient/test.js",
25
- "test:--default-as-success": "node tests/spec/defaultAsSuccess/test.js",
26
- "test:--templates": "node tests/spec/templates/test.js",
27
- "test:--union-enums": "node tests/spec/unionEnums/test.js",
28
- "test:--add-readonly": "node tests/spec/readonly/test.js",
29
- "test:--responses": "node tests/spec/responses/test.js",
30
- "test:specProperty": "node tests/spec/specProperty/test.js",
31
- "test:--module-name-index": "node tests/spec/moduleNameIndex/test.js",
32
- "test:--module-name-first-tag": "node tests/spec/moduleNameFirstTag/test.js",
33
- "test:--modular": "node tests/spec/modular/test.js",
34
- "test:--single-http-client": "node tests/spec/singleHttpClient/test.js",
35
- "test:--extract-request-params": "node tests/spec/extractRequestParams/test.js",
36
- "test:--extract-request-body": "node tests/spec/extractRequestBody/test.js",
37
- "test:--extract-response-body": "node tests/spec/extractResponseBody/test.js",
38
- "test:--extract-response-error": "node tests/spec/extractResponseError/test.js",
39
- "test:--enum-names-as-values": "node tests/spec/enumNamesAsValues/test.js",
40
- "test:--default-response": "node tests/spec/defaultResponse/test.js",
41
- "test:--js": "node tests/spec/js/test.js",
42
- "test:--js--axios": "node tests/spec/jsAxios/test.js",
43
- "test:--axios": "node tests/spec/axios/test.js",
44
- "test:--object-types": "node tests/spec/object-types/test.js",
45
- "test:--axios--single-http-client": "node tests/spec/axiosSingleHttpClient/test.js",
46
- "test:--type-suffix--type-prefix": "node tests/spec/typeSuffixPrefix/test.js",
47
- "test:--cli": "node index.js -p tests/spec/cli/schema.json -o tests/spec/cli -n schema.ts --extract-response-body --extract-response-error --type-prefix Prefix --api-class-name MySuperApi --no-client",
48
- "test:partialBaseTemplate": "node tests/spec/partialBaseTemplate/test.js",
49
- "test:partialDefaultTemplate": "node tests/spec/partialDefaultTemplate/test.js",
50
- "test:--patch": "node tests/spec/patch/test.js"
51
- },
52
- "author": "acacode",
53
- "license": "MIT",
54
- "typings": "./index.d.ts",
55
- "main": "src/index.js",
56
- "devDependencies": {
57
- "cross-env": "^7.0.3",
58
- "@types/axios": "^0.14.0",
59
- "@types/lodash": "^4.14.182",
60
- "@types/node": "^15.0.2",
61
- "@types/prettier": "^2.7.0",
62
- "all-contributors-cli": "^6.20.0",
63
- "git-diff": "^2.0.6",
64
- "husky": "^4.3.6",
65
- "pretty-quick": "^3.1.0"
66
- },
67
- "dependencies": {
68
- "@types/swagger-schema-official": "2.0.22",
69
- "axios": "0.27.2",
70
- "commander": "9.4.1",
71
- "cosmiconfig": "7.0.1",
72
- "eta": "1.12.3",
73
- "js-yaml": "4.1.0",
74
- "lodash": "4.17.21",
75
- "make-dir": "3.1.0",
76
- "nanoid": "3.3.4",
77
- "node-emoji": "1.11.0",
78
- "prettier": "2.7.1",
79
- "swagger-schema-official": "2.0.0-bab6bed",
80
- "swagger2openapi": "7.0.8",
81
- "typescript": "4.8.4"
82
- },
83
- "bin": {
84
- "swagger-typescript-api": "index.js",
85
- "sta": "index.js"
86
- },
87
- "husky": {
88
- "hooks": {
89
- "pre-commit": "pretty-quick --staged",
90
- "post-commit": "git update-index -g"
91
- }
92
- },
93
- "keywords": [
94
- "openapi",
95
- "swagger",
96
- "typescript",
97
- "api",
98
- "javascript",
99
- "rest",
100
- "codegen",
101
- "generation",
102
- "http"
103
- ],
104
- "files": [
105
- "src",
106
- "index.js",
107
- "index.d.ts",
108
- "templates",
109
- "LICENSE"
110
- ],
111
- "bugs": {
112
- "url": "https://github.com/acacode/swagger-typescript-api/issues"
113
- },
114
- "homepage": "https://github.com/acacode/swagger-typescript-api",
115
- "repository": {
116
- "type": "git",
117
- "url": "git://github.com/acacode/swagger-typescript-api"
118
- }
119
- }
1
+ {
2
+ "name": "swagger-typescript-api",
3
+ "version": "11.0.0--alpha",
4
+ "description": "Generate typescript/javascript api from swagger schema",
5
+ "scripts": {
6
+ "cli:json": "node index.js -r -d -p ./swagger-test-cli.json -n swagger-test-cli.ts",
7
+ "cli:yaml": "node index.js -r -d -p ./swagger-test-cli.yaml -n swagger-test-cli.ts",
8
+ "node": "node swagger-test-cli/generate.js",
9
+ "node:debug": "node --nolazy swagger-test-cli/generate.js",
10
+ "contributors": "all-contributors generate",
11
+ "cli:help": "node index.js -h",
12
+ "test-all": "node --unhandled-rejections=strict ./scriptsRunner.js generate validate test:*",
13
+ "test-all(update-snapshots)": "cross-env UPDATE_SNAPSHOTS=true node --unhandled-rejections=strict ./scriptsRunner.js generate validate test:*",
14
+ "test-all-extended": "node --unhandled-rejections=strict ./scriptsRunner.js generate-extended validate generate validate test:*",
15
+ "test-specific": "node ./scriptsRunner.js generate validate test:*",
16
+ "test-specific-only": "node ./scriptsRunner.js test:*",
17
+ "generate": "node tests/generate.js",
18
+ "generate-extended": "node tests/generate-extended.js",
19
+ "generate:debug": "node --nolazy tests/generate.js",
20
+ "validate": "node tests/validate.js",
21
+ "validate:debug": "node --nolazy tests/validate.js",
22
+ "test:--route-types": "node tests/spec/routeTypes/test.js",
23
+ "test:--no-client": "node tests/spec/noClient/test.js",
24
+ "test:--default-as-success": "node tests/spec/defaultAsSuccess/test.js",
25
+ "test:--templates": "node tests/spec/templates/test.js",
26
+ "test:--union-enums": "node tests/spec/unionEnums/test.js",
27
+ "test:--add-readonly": "node tests/spec/readonly/test.js",
28
+ "test:--responses": "node tests/spec/responses/test.js",
29
+ "test:specProperty": "node tests/spec/specProperty/test.js",
30
+ "test:--module-name-index": "node tests/spec/moduleNameIndex/test.js",
31
+ "test:--module-name-first-tag": "node tests/spec/moduleNameFirstTag/test.js",
32
+ "test:--modular": "node tests/spec/modular/test.js",
33
+ "test:--single-http-client": "node tests/spec/singleHttpClient/test.js",
34
+ "test:--extract-request-params": "node tests/spec/extractRequestParams/test.js",
35
+ "test:--extract-request-body": "node tests/spec/extractRequestBody/test.js",
36
+ "test:--extract-response-body": "node tests/spec/extractResponseBody/test.js",
37
+ "test:--extract-response-error": "node tests/spec/extractResponseError/test.js",
38
+ "test:--enum-names-as-values": "node tests/spec/enumNamesAsValues/test.js",
39
+ "test:--default-response": "node tests/spec/defaultResponse/test.js",
40
+ "test:--js": "node tests/spec/js/test.js",
41
+ "test:--js--axios": "node tests/spec/jsAxios/test.js",
42
+ "test:--axios": "node tests/spec/axios/test.js",
43
+ "test:--another-array-type": "node tests/spec/another-array-type/test.js",
44
+ "test:--object-types": "node tests/spec/object-types/test.js",
45
+ "test:--axios--single-http-client": "node tests/spec/axiosSingleHttpClient/test.js",
46
+ "test:--type-suffix--type-prefix": "node tests/spec/typeSuffixPrefix/test.js",
47
+ "test:--dot-path-params": "node tests/spec/dot-path-params/test.js",
48
+ "test:--primitive-type-constructs": "node tests/spec/primitive-type-constructs/test.js",
49
+ "test:--cli": "node index.js -p tests/spec/cli/schema.json -o tests/spec/cli -n schema.ts --extract-response-body --extract-response-error --type-prefix Prefix --api-class-name MySuperApi --no-client",
50
+ "test:partialBaseTemplate": "node tests/spec/partialBaseTemplate/test.js",
51
+ "test:partialDefaultTemplate": "node tests/spec/partialDefaultTemplate/test.js",
52
+ "test:--patch": "node tests/spec/patch/test.js"
53
+ },
54
+ "author": "acacode",
55
+ "license": "MIT",
56
+ "typings": "./index.d.ts",
57
+ "main": "src/index.js",
58
+ "devDependencies": {
59
+ "@types/axios": "^0.14.0",
60
+ "@types/lodash": "^4.14.182",
61
+ "@types/node": "^15.0.2",
62
+ "@types/prettier": "^2.7.0",
63
+ "all-contributors-cli": "^6.20.0",
64
+ "cross-env": "^7.0.3",
65
+ "git-diff": "^2.0.6",
66
+ "husky": "^4.3.6",
67
+ "pretty-quick": "^3.1.0"
68
+ },
69
+ "dependencies": {
70
+ "@types/swagger-schema-official": "2.0.22",
71
+ "axios": "0.27.2",
72
+ "cosmiconfig": "7.0.1",
73
+ "didyoumean": "^1.2.2",
74
+ "eta": "1.12.3",
75
+ "js-yaml": "4.1.0",
76
+ "lodash": "4.17.21",
77
+ "make-dir": "3.1.0",
78
+ "nanoid": "3.3.4",
79
+ "node-emoji": "1.11.0",
80
+ "prettier": "2.7.1",
81
+ "swagger-schema-official": "2.0.0-bab6bed",
82
+ "swagger2openapi": "7.0.8",
83
+ "typescript": "4.8.4"
84
+ },
85
+ "bin": {
86
+ "swagger-typescript-api": "index.js",
87
+ "sta": "index.js"
88
+ },
89
+ "husky": {
90
+ "hooks": {
91
+ "pre-commit": "pretty-quick --staged",
92
+ "post-commit": "git update-index -g"
93
+ }
94
+ },
95
+ "keywords": [
96
+ "openapi",
97
+ "swagger",
98
+ "typescript",
99
+ "api",
100
+ "javascript",
101
+ "rest",
102
+ "codegen",
103
+ "generation",
104
+ "http"
105
+ ],
106
+ "files": [
107
+ "src",
108
+ "index.js",
109
+ "index.d.ts",
110
+ "templates",
111
+ "LICENSE"
112
+ ],
113
+ "bugs": {
114
+ "url": "https://github.com/acacode/swagger-typescript-api/issues"
115
+ },
116
+ "homepage": "https://github.com/acacode/swagger-typescript-api",
117
+ "repository": {
118
+ "type": "git",
119
+ "url": "git://github.com/acacode/swagger-typescript-api"
120
+ }
121
+ }