Skip to content

Commit 9845ce7

Browse files
authored
Merge branch 'master' into CancellablePromise
2 parents 8b41638 + c8cf2ec commit 9845ce7

File tree

99 files changed

+10199
-8228
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+10199
-8228
lines changed

.circleci/config.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
11
version: 2
22
jobs:
33
build:
4-
working_directory: ~/repo
54
docker:
65
- image: cimg/node:lts-browsers
6+
resource_class: large
7+
working_directory: ~/repo
78
steps:
89
- checkout
910
- restore_cache:
1011
keys:
11-
- v1-dependencies-{{ checksum "package.json" }}
12+
- v1-dependencies-{{ checksum "package-lock.json" }}
1213
- v1-dependencies-
1314
- run:
1415
name: Install dependencies
1516
command: npm install
1617
- save_cache:
17-
key: v1-dependencies-{{ checksum "package.json" }}
18+
key: v1-dependencies-{{ checksum "package-lock.json" }}
1819
paths:
1920
- node_modules
2021
- run:
2122
name: Build library
2223
command: npm run release
2324
- run:
2425
name: Run unit tests
25-
command: npm run test:coverage
26-
- run:
27-
name: Run e2e tests
28-
command: npm run test:e2e
26+
command: npm run test
27+
# - run:
28+
# name: Run e2e tests
29+
# command: npm run test:e2e
2930
- run:
3031
name: Submit to Codecov
3132
command: npm run codecov

.github/dependabot.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,20 @@ updates:
33
- package-ecosystem: npm
44
directory: "/"
55
schedule:
6-
interval: monthly
7-
time: "04:00"
8-
open-pull-requests-limit: 10
6+
interval: "daily"
97
ignore:
108
- dependency-name: "@types/node-fetch"
119
- dependency-name: "node-fetch"
10+
- dependency-name: "camelcase"
11+
- dependency-name: "@angular-devkit/build-angular"
12+
- dependency-name: "@angular/animations"
13+
- dependency-name: "@angular/cli"
14+
- dependency-name: "@angular/common"
15+
- dependency-name: "@angular/compiler"
16+
- dependency-name: "@angular/compiler-cli"
17+
- dependency-name: "@angular/core"
18+
- dependency-name: "@angular/forms"
19+
- dependency-name: "@angular/platform-browser"
20+
- dependency-name: "@angular/platform-browser-dynamic"
21+
- dependency-name: "@angular/router"
22+
- dependency-name: "typescript"

.github/workflows/auto-merge.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: auto-merge
2+
3+
on: pull_request_target
4+
5+
permissions:
6+
pull-requests: write
7+
contents: write
8+
9+
jobs:
10+
dependabot:
11+
runs-on: ubuntu-latest
12+
if: ${{ github.actor == 'dependabot[bot]' }}
13+
steps:
14+
- name: Fetch Dependabot metadata
15+
id: dependabot-metadata
16+
uses: dependabot/fetch-metadata@v1
17+
with:
18+
github-token: ${{ secrets.GITHUB_TOKEN }}
19+
- name: Approve PR
20+
run: gh pr review --approve "$PR_URL"
21+
env:
22+
PR_URL: ${{ github.event.pull_request.html_url }}
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
- name: Merge PR
25+
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
26+
run: gh pr merge --auto --squash "$PR_URL"
27+
env:
28+
PR_URL: ${{ github.event.pull_request.html_url }}
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.licrc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[licenses]
2+
accepted = [
3+
"MIT",
4+
"BSD",
5+
"0BSD",
6+
"BSD-2-Clause",
7+
"BSD-3-Clause",
8+
"Apache-2.0",
9+
"CC-BY-3.0",
10+
"CC-BY-4.0",
11+
"CC0-1.0",
12+
"ISC"
13+
]
14+
15+
[dependencies]
16+
ignored = []
17+
18+
[behavior]
19+
run_only_on_dependency_modification = true
20+
do_not_block_pr = true

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,42 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [0.23.0] - 2022-06-02
5+
### Fixed
6+
- Upgraded dependencies
7+
- Added blank line at the end of generated files
8+
- Added support for Node.js v12
9+
### Added
10+
- Added `request` property inside `ApiError`
11+
- Added support for `@depricated` inside models and operations
12+
13+
## [0.22.0] - 2022-04-26
14+
### Fixed
15+
- Upgraded dependencies
16+
- Fixed issue with `null` value inside comments for OpenAPI v2 enums
17+
- Fixed issue with compatibility for latest version of Axios (0.27.x)
18+
### Removed
19+
- Removed deprecated enum model generation
20+
21+
## [0.21.0] - 2022-04-06
22+
### Fixed
23+
- Return `undefined` to match `noImplicitReturns` rule
24+
- Made `BaseHttpRequest` class abstract
25+
- Removed private fields using `#` inside `CancelablePromise`
26+
- Removed unneeded import `AbortController` from `node-fetch` client
27+
- Filter out wrong enum values
28+
29+
## [0.20.1] - 2022-02-25
30+
### Fixed
31+
- Support enums with single quotes in names for V2
32+
33+
## [0.20.0] - 2022-02-25
34+
### Fixed
35+
- Updated dependencies
36+
- Support enums with single quotes in names for V3
37+
- Generating better names when `operationId` is not given (breaking change)
38+
- Fixed issue where `x-enum` flags where breaking due to non-string values
39+
440
## [0.19.0] - 2022-02-02
541
### Added
642
- Support for Angular client with `--name` option

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Ferdi Koomen
3+
Copyright (c) Ferdi Koomen
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ $ openapi --help
4848
--exportModels <value> Write models to disk (default: true)
4949
--exportSchemas <value> Write schemas to disk (default: false)
5050
--indent <value> Indentation options [4, 2, tab] (default: "4")
51-
--postfix <value> Service name postfix (default: "Service")
51+
--postfixServices Service name postfix (default: "Service")
52+
--postfixModels Model name postfix
5253
--request <value> Path to custom request file
5354
-h, --help display help for command
5455
@@ -69,6 +70,8 @@ Documentation
6970
- [Nullable props (OpenAPI v2)](docs/nullable-props.md)
7071
- [Authorization](docs/authorization.md)
7172
- [External references](docs/external-references.md)
73+
- [Canceling requests](docs/canceling-requests.md)
74+
- [Custom request file](docs/custom-request-file.md)
7275

7376
Support
7477
===

babel.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"@babel/preset-env",
55
{
66
"targets": {
7-
"node": true
7+
"node": "12"
88
}
99
}
1010
],

bin/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ const params = program
2121
.option('--exportModels <value>', 'Write models to disk', true)
2222
.option('--exportSchemas <value>', 'Write schemas to disk', false)
2323
.option('--indent <value>', 'Indentation options [4, 2, tabs]', '4')
24-
.option('--postfix <value>', 'Service name postfix', 'Service')
24+
.option('--postfix <value>', 'Deprecated: Use --postfixServices instead. Service name postfix', 'Service')
25+
.option('--postfixServices <value>', 'Service name postfix', 'Service')
26+
.option('--postfixModels <value>', 'Model name postfix')
2527
.option('--request <value>', 'Path to custom request file')
2628
.parse(process.argv)
2729
.opts();
@@ -41,7 +43,8 @@ if (OpenAPI) {
4143
exportModels: JSON.parse(params.exportModels) === true,
4244
exportSchemas: JSON.parse(params.exportSchemas) === true,
4345
indent: params.indent,
44-
postfix: params.postfix,
46+
postfixServices: params.postfixServices ?? params.postfix,
47+
postfixModels: params.postfixModels,
4548
request: params.request,
4649
})
4750
.then(() => {

bin/index.spec.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ describe('bin', () => {
3434
'true',
3535
'--indent',
3636
'4',
37-
'--postfix',
37+
'--postfixServices',
3838
'Service',
39+
'--postfixModels',
40+
'Dto',
3941
]);
4042
expect(result.stdout.toString()).toBe('');
4143
expect(result.stderr.toString()).toBe('');
@@ -67,4 +69,18 @@ describe('bin', () => {
6769
expect(result.stdout.toString()).toContain(`-o, --output <value>`);
6870
expect(result.stderr.toString()).toBe('');
6971
});
72+
73+
it('should still support the deprecated --postfix parameter', () => {
74+
const result = crossSpawn.sync('node', [
75+
'./bin/index.js',
76+
'--input',
77+
'./test/spec/v3.json',
78+
'--output',
79+
'./test/generated/bin',
80+
'--postfix',
81+
'Service',
82+
]);
83+
expect(result.stdout.toString()).toBe('');
84+
expect(result.stderr.toString()).toBe('');
85+
});
7086
});

0 commit comments

Comments
 (0)