@codacy/openapi-typescript-codegen
Advanced tools
Comparing version
@@ -18,2 +18,3 @@ #!/usr/bin/env node | ||
.option('--useOptions', 'Use options instead of arguments') | ||
.option('--splitParameters', 'User arguments for path parameters and options for query parameters') | ||
.option('--useUnionTypes', 'Use union types instead of enums') | ||
@@ -40,2 +41,3 @@ .option('--exportCore <value>', 'Write core files to disk', true) | ||
useOptions: params.useOptions, | ||
splitParameters: params.splitParameters, | ||
useUnionTypes: params.useUnionTypes, | ||
@@ -42,0 +44,0 @@ exportCore: JSON.parse(params.exportCore) === true, |
{ | ||
"name": "@codacy/openapi-typescript-codegen", | ||
"version": "0.0.2", | ||
"version": "0.0.5", | ||
"description": "Library that generates Typescript clients based on the OpenAPI specification.", | ||
@@ -22,3 +22,2 @@ "author": "Codacy", | ||
"axios", | ||
"angular", | ||
"node" | ||
@@ -51,49 +50,37 @@ ], | ||
"prepare": "npm run clean && npm run release", | ||
"codecov": "codecov --token=66c30c23-8954-4892-bef9-fbaed0a2e42b", | ||
"docker": "docker build -t eeelenbaas/openapi-typescript-codegen .", | ||
"generate-codacy": "npm run build && rimraf ./generated && node ./bin/index.js --input ./samples/spec/codacy-api.yaml --output ./generated --useUnionTypes --indent 2 --client axios" | ||
"generate-spa-codacy": "npm run build && rimraf ./generated && node ./bin/index.js --input ./samples/spec/codacy-api.yaml --output ./generated --useUnionTypes --indent 2 --client fetch --splitParameters", | ||
"generate-ide-codacy": "npm run build && rimraf ./generated && node ./bin/index.js --input ./samples/spec/codacy-api.yaml --output ./generated --useUnionTypes --indent 2 --client axios" | ||
}, | ||
"dependencies": { | ||
"@apidevtools/json-schema-ref-parser": "^10.1.0", | ||
"camelcase": "^6.3.0", | ||
"commander": "^11.0.0", | ||
"fs-extra": "^11.1.1", | ||
"handlebars": "^4.7.7", | ||
"json-schema-ref-parser": "^9.0.9" | ||
"commander": "^11.1.0", | ||
"fs-extra": "^11.2.0", | ||
"handlebars": "^4.7.8" | ||
}, | ||
"devDependencies": { | ||
"@angular-devkit/build-angular": "16.1.3", | ||
"@angular/animations": "16.1.3", | ||
"@angular/cli": "16.1.3", | ||
"@angular/common": "16.1.3", | ||
"@angular/compiler": "16.1.3", | ||
"@angular/compiler-cli": "16.1.3", | ||
"@angular/core": "16.1.3", | ||
"@angular/forms": "16.1.3", | ||
"@angular/platform-browser": "16.1.3", | ||
"@angular/platform-browser-dynamic": "16.1.3", | ||
"@angular/router": "16.1.3", | ||
"@babel/cli": "7.23.0", | ||
"@babel/core": "7.23.3", | ||
"@babel/preset-env": "7.23.3", | ||
"@babel/cli": "7.23.4", | ||
"@babel/core": "7.23.7", | ||
"@babel/preset-env": "7.23.8", | ||
"@babel/preset-typescript": "7.23.3", | ||
"@rollup/plugin-commonjs": "25.0.7", | ||
"@rollup/plugin-node-resolve": "15.2.3", | ||
"@rollup/plugin-typescript": "11.1.5", | ||
"@types/cross-spawn": "6.0.5", | ||
"@rollup/plugin-terser": "^0.4.4", | ||
"@rollup/plugin-typescript": "11.1.6", | ||
"@types/cross-spawn": "6.0.6", | ||
"@types/express": "4.17.21", | ||
"@types/fs-extra": "^11.0.1", | ||
"@types/fs-extra": "^11.0.4", | ||
"@types/glob": "8.1.0", | ||
"@types/jest": "29.5.8", | ||
"@types/node": "20.9.0", | ||
"@types/node-fetch": "2.6.4", | ||
"@types/qs": "6.9.10", | ||
"@typescript-eslint/eslint-plugin": "6.10.0", | ||
"@typescript-eslint/parser": "6.11.0", | ||
"@types/jest": "29.5.11", | ||
"@types/node": "20.11.5", | ||
"@types/node-fetch": "2.6.10", | ||
"@types/qs": "6.9.11", | ||
"@typescript-eslint/eslint-plugin": "6.19.0", | ||
"@typescript-eslint/parser": "6.19.0", | ||
"abort-controller": "3.0.0", | ||
"axios": "1.6.2", | ||
"codecov": "3.8.3", | ||
"axios": "1.6.5", | ||
"cross-spawn": "7.0.3", | ||
"eslint": "8.53.0", | ||
"eslint-config-prettier": "8.10.0", | ||
"eslint-plugin-prettier": "5.0.1", | ||
"eslint": "8.56.0", | ||
"eslint-config-prettier": "9.1.0", | ||
"eslint-plugin-prettier": "5.1.3", | ||
"eslint-plugin-simple-import-sort": "10.0.0", | ||
@@ -105,20 +92,18 @@ "express": "4.18.2", | ||
"jest-cli": "29.7.0", | ||
"node-fetch": "2.6.9", | ||
"prettier": "3.1.0", | ||
"puppeteer": "20.9.0", | ||
"node-fetch": "2.7.0", | ||
"prettier": "3.2.4", | ||
"puppeteer": "21.7.0", | ||
"qs": "6.11.2", | ||
"rimraf": "5.0.5", | ||
"rollup": "3.26.1", | ||
"rollup-plugin-terser": "7.0.2", | ||
"rollup": "4.7.0", | ||
"rxjs": "7.8.1", | ||
"ts-node": "10.9.1", | ||
"ts-node": "10.9.2", | ||
"tslib": "2.6.2", | ||
"typescript": "5.1.6", | ||
"zone.js": "0.13.3" | ||
"typescript": "5.2.2", | ||
"zone.js": "0.14.3" | ||
}, | ||
"overrides": { | ||
"node-fetch": "2.6.9", | ||
"rollup": "3.26.1", | ||
"typescript": "5.1.6" | ||
"node-fetch": "2.7.0", | ||
"rollup": "4.7.0" | ||
} | ||
} |
@@ -62,39 +62,18 @@ Forked from [openapi-typescript-codegen](https://github.com/ferdikoomen/openapi-typescript-codegen) | ||
## Docker usage | ||
## Documentation | ||
To build the Docker container, execute the following command: | ||
``` | ||
docker build . --tag openapi-typescript-codegen | ||
``` | ||
The main documentation can be found in the [openapi-typescript-codegen/wiki](https://github.com/ferdikoomen/openapi-typescript-codegen/wiki) | ||
After this is done, you can execute the CLI commands: | ||
## Sponsors | ||
``` | ||
docker run openapi-typescript-codegen --help | ||
docker run openapi-typescript-codegen --input sample.yaml --output client | ||
``` | ||
Documentation | ||
=== | ||
- [Basic usage](docs/basic-usage.md) | ||
- [OpenAPI object](docs/openapi-object.md) | ||
- [Client instances](docs/client-instances.md) `--name` | ||
- [Argument vs. Object style](docs/arguments-vs-object-style.md) `--useOptions` | ||
- [Enums vs. Union types](docs/enum-vs-union-types.md) `--useUnionTypes` | ||
- [Runtime schemas](docs/runtime-schemas.md) `--exportSchemas` | ||
- [Enum with custom names and descriptions](docs/custom-enums.md) | ||
- [Nullable props (OpenAPI v2)](docs/nullable-props.md) | ||
- [Authorization](docs/authorization.md) | ||
- [External references](docs/external-references.md) | ||
- [Canceling requests](docs/canceling-requests.md) | ||
- [Custom request file](docs/custom-request-file.md) | ||
If you or your company use the OpenAPI Typescript Codegen, please consider supporting me. By sponsoring I can free up time to give this project some love! Details can be found here: https://github.com/sponsors/ferdikoomen | ||
Support | ||
=== | ||
- [Babel support](docs/babel-support.md) | ||
- [Axios support](docs/axios-support.md) | ||
- [Angular support](docs/angular-support.md) | ||
- [Node-Fetch support](docs/node-fetch-support.md) | ||
If you're from an enterprise looking for a fully managed SDK generation, please consider our sponsor: | ||
<a href="https://speakeasyapi.dev/?utm_source=ferdi+repo&utm_medium=github+sponsorship"> | ||
<img alt="speakeasy" src="https://storage.googleapis.com/speakeasy-design-assets/ferdi-sponsorship.png" width="640"/> | ||
</a> | ||
[npm-url]: https://npmjs.org/package/openapi-typescript-codegen | ||
@@ -104,4 +83,2 @@ [npm-image]: https://img.shields.io/npm/v/openapi-typescript-codegen.svg | ||
[license-image]: http://img.shields.io/npm/l/openapi-typescript-codegen.svg | ||
[coverage-url]: https://codecov.io/gh/ferdikoomen/openapi-typescript-codegen | ||
[coverage-image]: https://img.shields.io/codecov/c/github/ferdikoomen/openapi-typescript-codegen.svg | ||
[downloads-url]: http://npm-stat.com/charts.html?package=openapi-typescript-codegen | ||
@@ -108,0 +85,0 @@ [downloads-image]: http://img.shields.io/npm/dm/openapi-typescript-codegen.svg |
@@ -21,2 +21,3 @@ export declare enum HttpClient { | ||
useOptions?: boolean; | ||
splitParameters?: boolean; | ||
useUnionTypes?: boolean; | ||
@@ -23,0 +24,0 @@ exportCore?: boolean; |
Sorry, the diff of this file is too big to display
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
234061
0.16%41
-22.64%938
2.18%6
-14.29%86
-21.1%+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated