Skip to content

Commit 10949a6

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 90f6c62 + 3275f3b commit 10949a6

File tree

123 files changed

+14985
-25089
lines changed

Some content is hidden

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

123 files changed

+14985
-25089
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/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [ferdikoomen]

.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 }}

.github/workflows/codeql.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
schedule:
9+
- cron: "44 20 * * 3"
10+
11+
jobs:
12+
analyze:
13+
name: Analyze
14+
runs-on: ubuntu-latest
15+
permissions:
16+
actions: read
17+
contents: read
18+
security-events: write
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
language: [ javascript ]
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v3
28+
29+
- name: Initialize CodeQL
30+
uses: github/codeql-action/init@v2
31+
with:
32+
languages: ${{ matrix.language }}
33+
queries: +security-and-quality
34+
35+
- name: Autobuild
36+
uses: github/codeql-action/autobuild@v2
37+
38+
- name: Perform CodeQL Analysis
39+
uses: github/codeql-action/analyze@v2
40+
with:
41+
category: "/language:${{ matrix.language }}"

.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: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,38 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [0.27.0] - 2024-01-15
5+
### Fixed
6+
- Reverted `@apidevtools/json-schema-ref-parser` to version 10.1.0
7+
8+
## [0.26.0] - 2024-01-07
9+
### Fixed
10+
- Upgraded dependencies
11+
12+
## [0.25.0] - 2023-07-05
13+
### Fixed
14+
- Upgraded dependencies
15+
### Added
16+
- Allow usage of a custom axios instance
17+
- Added message in generated files
18+
19+
## [0.24.0] - 2023-04-10
20+
### Fixed
21+
- Upgraded dependencies
22+
- Fixed issue with Cancelable promise
23+
- Fixed issue with escaping reserved keywords in schema names
24+
### Added
25+
- Added `--postfixModels` option
26+
27+
## [0.23.0] - 2022-06-02
28+
### Fixed
29+
- Upgraded dependencies
30+
- Added blank line at the end of generated files
31+
- Added support for Node.js v12
32+
### Added
33+
- Added `request` property inside `ApiError`
34+
- Added support for `@depricated` inside models and operations
35+
436
## [0.22.0] - 2022-04-26
537
### Fixed
638
- Upgraded dependencies

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM node:alpine
2+
WORKDIR /usr/src/openapi
3+
COPY . /usr/src/openapi
4+
RUN npm install
5+
RUN npm run release
6+
ENTRYPOINT [ "node", "/usr/src/openapi/bin/index.js" ]
7+
CMD "--help"

README.md

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
[![NPM][npm-image]][npm-url]
44
[![License][license-image]][license-url]
55
[![Coverage][coverage-image]][coverage-url]
6-
[![Quality][quality-image]][quality-url]
7-
[![Code Climate][climate-image]][climate-url]
6+
[![Coverage][coverage-image]][coverage-url]
87
[![Downloads][downloads-image]][downloads-url]
98
[![Build][build-image]][build-url]
109

@@ -14,7 +13,7 @@
1413
- Frontend ❤️ OpenAPI, but we do not want to use JAVA codegen in our builds
1514
- Quick, lightweight, robust and framework-agnostic 🚀
1615
- Supports generation of TypeScript clients
17-
- Supports generations of Fetch, [Node-Fetch](#node-fetch-support), [Axios](#axios-support), [Angular](#angular-support) and XHR http clients
16+
- Supports generations of Fetch, Node-Fetch, Axios, Angular and XHR http clients
1817
- Supports OpenAPI specification v2.0 and v3.0
1918
- Supports JSON and YAML files for input
2019
- Supports generation through CLI, Node.js and NPX
@@ -48,7 +47,8 @@ $ openapi --help
4847
--exportModels <value> Write models to disk (default: true)
4948
--exportSchemas <value> Write schemas to disk (default: false)
5049
--indent <value> Indentation options [4, 2, tab] (default: "4")
51-
--postfix <value> Service name postfix (default: "Service")
50+
--postfixServices Service name postfix (default: "Service")
51+
--postfixModels Model name postfix
5252
--request <value> Path to custom request file
5353
-h, --help display help for command
5454
@@ -59,34 +59,26 @@ $ openapi --help
5959

6060
Documentation
6161
===
62-
- [Basic usage](docs/basic-usage.md)
63-
- [OpenAPI object](docs/openapi-object.md)
64-
- [Client instances](docs/client-instances.md) `--name`
65-
- [Argument vs. Object style](docs/arguments-vs-object-style.md) `--useOptions`
66-
- [Enums vs. Union types](docs/enum-vs-union-types.md) `--useUnionTypes`
67-
- [Runtime schemas](docs/runtime-schemas.md) `--exportSchemas`
68-
- [Enum with custom names and descriptions](docs/custom-enums.md)
69-
- [Nullable props (OpenAPI v2)](docs/nullable-props.md)
70-
- [Authorization](docs/authorization.md)
71-
- [External references](docs/external-references.md)
72-
73-
Support
62+
63+
The main documentation can be found in the [openapi-typescript-codegen/wiki](https://github.com/ferdikoomen/openapi-typescript-codegen/wiki)
64+
65+
Sponsors
7466
===
75-
- [Babel support](docs/babel-support.md)
76-
- [Axios support](docs/axios-support.md)
77-
- [Angular support](docs/angular-support.md)
78-
- [Node-Fetch support](docs/node-fetch-support.md)
67+
68+
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
69+
70+
If you're from an enterprise looking for a fully managed SDK generation, please consider our sponsor:
71+
72+
<a href="https://speakeasyapi.dev/?utm_source=ferdi+repo&utm_medium=github+sponsorship">
73+
<img alt="speakeasy" src="https://storage.googleapis.com/speakeasy-design-assets/ferdi-sponsorship.png" width="640"/>
74+
</a>
7975

8076
[npm-url]: https://npmjs.org/package/openapi-typescript-codegen
8177
[npm-image]: https://img.shields.io/npm/v/openapi-typescript-codegen.svg
8278
[license-url]: LICENSE
8379
[license-image]: http://img.shields.io/npm/l/openapi-typescript-codegen.svg
8480
[coverage-url]: https://codecov.io/gh/ferdikoomen/openapi-typescript-codegen
8581
[coverage-image]: https://img.shields.io/codecov/c/github/ferdikoomen/openapi-typescript-codegen.svg
86-
[quality-url]: https://lgtm.com/projects/g/ferdikoomen/openapi-typescript-codegen
87-
[quality-image]: https://img.shields.io/lgtm/grade/javascript/g/ferdikoomen/openapi-typescript-codegen.svg
88-
[climate-url]: https://codeclimate.com/github/ferdikoomen/openapi-typescript-codegen
89-
[climate-image]: https://img.shields.io/codeclimate/maintainability/ferdikoomen/openapi-typescript-codegen.svg
9082
[downloads-url]: http://npm-stat.com/charts.html?package=openapi-typescript-codegen
9183
[downloads-image]: http://img.shields.io/npm/dm/openapi-typescript-codegen.svg
9284
[build-url]: https://circleci.com/gh/ferdikoomen/openapi-typescript-codegen/tree/master

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
],

0 commit comments

Comments
 (0)