Updated dependencies, cleanup

This commit is contained in:
Ferdi Koomen 2023-04-10 12:38:21 +02:00
parent dbf5c977ec
commit 8b52a04617
15 changed files with 3572 additions and 16720 deletions

View File

@ -1,6 +1,14 @@
# Changelog
All notable changes to this project will be documented in this file.
## [0.24.0] - 2023-04-10
### Fixed
- Upgraded dependencies
- Fixed issue with Cancelable promise
- Fixed issue with escaping reserved keywords in schema names
### Added
- Added `--postfixModels` option
## [0.23.0] - 2022-06-02
### Fixed
- Upgraded dependencies

View File

@ -3,8 +3,6 @@
[![NPM][npm-image]][npm-url]
[![License][license-image]][license-url]
[![Coverage][coverage-image]][coverage-url]
[![Quality][quality-image]][quality-url]
[![Code Climate][climate-image]][climate-url]
[![Downloads][downloads-image]][downloads-url]
[![Build][build-image]][build-url]
@ -14,7 +12,7 @@
- Frontend ❤️ OpenAPI, but we do not want to use JAVA codegen in our builds
- Quick, lightweight, robust and framework-agnostic 🚀
- Supports generation of TypeScript clients
- Supports generations of Fetch, [Node-Fetch](#node-fetch-support), [Axios](#axios-support), [Angular](#angular-support) and XHR http clients
- Supports generations of Fetch, Node-Fetch, Axios, Angular and XHR http clients
- Supports OpenAPI specification v2.0 and v3.0
- Supports JSON and YAML files for input
- Supports generation through CLI, Node.js and NPX
@ -86,10 +84,6 @@ Support
[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
[quality-url]: https://lgtm.com/projects/g/ferdikoomen/openapi-typescript-codegen
[quality-image]: https://img.shields.io/lgtm/grade/javascript/g/ferdikoomen/openapi-typescript-codegen.svg
[climate-url]: https://codeclimate.com/github/ferdikoomen/openapi-typescript-codegen
[climate-image]: https://img.shields.io/codeclimate/maintainability/ferdikoomen/openapi-typescript-codegen.svg
[downloads-url]: http://npm-stat.com/charts.html?package=openapi-typescript-codegen
[downloads-image]: http://img.shields.io/npm/dm/openapi-typescript-codegen.svg
[build-url]: https://circleci.com/gh/ferdikoomen/openapi-typescript-codegen/tree/master

View File

@ -21,7 +21,6 @@ const params = program
.option('--exportModels <value>', 'Write models to disk', true)
.option('--exportSchemas <value>', 'Write schemas to disk', false)
.option('--indent <value>', 'Indentation options [4, 2, tabs]', '4')
.option('--postfix <value>', 'Deprecated: Use --postfixServices instead. Service name postfix', 'Service')
.option('--postfixServices <value>', 'Service name postfix', 'Service')
.option('--postfixModels <value>', 'Model name postfix')
.option('--request <value>', 'Path to custom request file')
@ -43,7 +42,7 @@ if (OpenAPI) {
exportModels: JSON.parse(params.exportModels) === true,
exportSchemas: JSON.parse(params.exportSchemas) === true,
indent: params.indent,
postfixServices: params.postfixServices ?? params.postfix,
postfixServices: params.postfixServices,
postfixModels: params.postfixModels,
request: params.request,
})

View File

@ -9,8 +9,8 @@ If you want to generate the Angular based client then you can specify `--client
The Angular client has been tested with the following versions:
```
"@angular/common": "14.0.x",
"@angular/core": "14.0.x",
"@angular/common": "15.0.x",
"@angular/core": "15.0.x",
"rxjs": "7.5.x",
```

19596
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "openapi-typescript-codegen",
"version": "0.23.0",
"version": "0.24.0",
"description": "Library that generates Typescript clients based on the OpenAPI specification.",
"author": "Ferdi Koomen",
"homepage": "https://github.com/ferdikoomen/openapi-typescript-codegen",
@ -66,61 +66,62 @@
"json-schema-ref-parser": "^9.0.9"
},
"devDependencies": {
"@angular-devkit/build-angular": "14.2.7",
"@angular/animations": "14.2.8",
"@angular/cli": "14.2.7",
"@angular/common": "14.2.8",
"@angular/compiler": "14.2.8",
"@angular/compiler-cli": "14.2.8",
"@angular/core": "14.2.8",
"@angular/forms": "14.2.8",
"@angular/platform-browser": "14.2.8",
"@angular/platform-browser-dynamic": "14.2.8",
"@angular/router": "14.2.8",
"@babel/cli": "7.20.7",
"@babel/core": "7.20.12",
"@babel/preset-env": "7.20.2",
"@babel/preset-typescript": "7.18.6",
"@angular-devkit/build-angular": "15.2.5",
"@angular/animations": "15.2.6",
"@angular/cli": "15.2.5",
"@angular/common": "15.2.6",
"@angular/compiler": "15.2.6",
"@angular/compiler-cli": "15.2.6",
"@angular/core": "15.2.6",
"@angular/forms": "15.2.6",
"@angular/platform-browser": "15.2.6",
"@angular/platform-browser-dynamic": "15.2.6",
"@angular/router": "15.2.6",
"@babel/cli": "7.21.0",
"@babel/core": "7.21.4",
"@babel/preset-env": "7.21.4",
"@babel/preset-typescript": "7.21.4",
"@rollup/plugin-commonjs": "24.0.1",
"@rollup/plugin-node-resolve": "15.0.1",
"@rollup/plugin-node-resolve": "15.0.2",
"@rollup/plugin-typescript": "11.1.0",
"@types/cross-spawn": "6.0.2",
"@types/express": "4.17.15",
"@types/express": "4.17.17",
"@types/fs-extra": "^11.0.1",
"@types/glob": "8.0.1",
"@types/jest": "29.2.5",
"@types/node": "18.11.18",
"@types/node-fetch": "2.6.2",
"@types/glob": "8.1.0",
"@types/jest": "29.5.0",
"@types/node": "18.15.11",
"@types/node-fetch": "2.6.3",
"@types/qs": "6.9.7",
"@typescript-eslint/eslint-plugin": "5.49.0",
"@typescript-eslint/parser": "5.48.2",
"@typescript-eslint/eslint-plugin": "5.57.1",
"@typescript-eslint/parser": "5.57.1",
"abort-controller": "3.0.0",
"axios": "1.2.3",
"axios": "1.3.5",
"codecov": "3.8.3",
"cross-spawn": "7.0.3",
"eslint": "8.32.0",
"eslint-config-prettier": "8.6.0",
"eslint": "8.38.0",
"eslint-config-prettier": "8.8.0",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-simple-import-sort": "8.0.0",
"eslint-plugin-simple-import-sort": "10.0.0",
"express": "4.18.2",
"form-data": "4.0.0",
"glob": "8.1.0",
"jest": "29.3.1",
"jest-cli": "29.3.1",
"node-fetch": "2.6.7",
"prettier": "2.8.3",
"puppeteer": "19.5.2",
"qs": "6.11.0",
"rimraf": "4.4.1",
"rollup": "3.2.3",
"glob": "10.0.0",
"jest": "29.5.0",
"jest-cli": "29.5.0",
"node-fetch": "3.3.1",
"prettier": "2.8.7",
"puppeteer": "19.8.5",
"qs": "6.11.1",
"rimraf": "5.0.0",
"rollup": "3.20.2",
"rollup-plugin-terser": "7.0.2",
"rxjs": "7.8.0",
"ts-node": "10.9.1",
"tslib": "2.4.1",
"typescript": "4.8.4",
"zone.js": "0.11.8"
"tslib": "2.5.0",
"typescript": "5.0.4",
"zone.js": "0.13.0"
},
"overrides" : {
"rollup": "3.2.3"
"rollup": "3.20.2",
"typescript": "5.0.4"
}
}

View File

@ -1,7 +1,7 @@
import { HttpClient } from './HttpClient';
import { Indent } from './Indent';
import { parse as parseV2 } from './openApi/v2';
import { parse as parseV3 } from './openApi/v3';
import { parse as parseV2 } from './openapi/v2';
import { parse as parseV3 } from './openapi/v3';
import { getOpenApiSpec } from './utils/getOpenApiSpec';
import { getOpenApiVersion, OpenApiVersion } from './utils/getOpenApiVersion';
import { isString } from './utils/isString';

View File

@ -1,5 +1,5 @@
import type { Model } from '../../../client/interfaces/Model';
import { reservedWords } from '../../v3/parser/getOperationParameterName';
import { reservedWords } from '../../../utils/reservedWords';
import type { OpenApi } from '../interfaces/OpenApi';
import { getModel } from './getModel';
import { getType } from './getType';

View File

@ -1,7 +1,6 @@
import camelCase from 'camelcase';
const reservedWords =
/^(arguments|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|eval|export|extends|false|finally|for|function|if|implements|import|in|instanceof|interface|let|new|null|package|private|protected|public|return|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)$/g;
import { reservedWords } from '../../../utils/reservedWords';
/**
* Replaces any invalid characters from a parameter name.

View File

@ -1,7 +1,7 @@
import type { Model } from '../../../client/interfaces/Model';
import { reservedWords } from '../../../utils/reservedWords';
import type { OpenApi } from '../interfaces/OpenApi';
import { getModel } from './getModel';
import { reservedWords } from './getOperationParameterName';
import { getType } from './getType';
export const getModels = (openApi: OpenApi): Model[] => {

View File

@ -1,7 +1,6 @@
import camelCase from 'camelcase';
export const reservedWords =
/^(arguments|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|eval|export|extends|false|finally|for|function|if|implements|import|in|instanceof|interface|let|new|null|package|private|protected|public|return|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)$/g;
import { reservedWords } from '../../../utils/reservedWords';
/**
* Replaces any invalid characters from a parameter name.

View File

@ -1,7 +1,7 @@
import type { Model } from '../client/interfaces/Model';
import type { OpenApi } from '../openApi/v3/interfaces/OpenApi';
import type { OpenApiDiscriminator } from '../openApi/v3/interfaces/OpenApiDiscriminator';
import { stripNamespace } from '../openApi/v3/parser/stripNamespace';
import type { OpenApi } from '../openapi/v3/interfaces/OpenApi';
import type { OpenApiDiscriminator } from '../openapi/v3/interfaces/OpenApiDiscriminator';
import { stripNamespace } from '../openapi/v3/parser/stripNamespace';
import type { Dictionary } from './types';
const inverseDictionary = (map: Dictionary<string>): Dictionary<string> => {

View File

@ -0,0 +1,2 @@
export const reservedWords =
/^(arguments|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|eval|export|extends|false|finally|for|function|if|implements|import|in|instanceof|interface|let|new|null|package|private|protected|public|return|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)$/g;

File diff suppressed because it is too large Load Diff

View File

@ -15,7 +15,6 @@ describe('v2', () => {
exportSchemas: true,
exportModels: true,
exportServices: true,
postfixModels: 'Dto',
});
sync('./test/generated/v2/**/*.ts').forEach(file => {
@ -37,7 +36,6 @@ describe('v3', () => {
exportSchemas: true,
exportModels: true,
exportServices: true,
postfixModels: 'Dto',
});
sync('./test/generated/v3/**/*.ts').forEach(file => {