Skip to content

Commit c6f544c

Browse files
release 1.6.1 (#34)
* Update commander to the latest version 🚀 (#29) * fix(package): update commander to version 5.0.0 * chore(package): update lockfile package-lock.json Co-authored-by: greenkeeper[bot] <23040076+greenkeeper[bot]@users.noreply.github.com> * Update prettier to the latest version 🚀 (#32) * fix(package): update prettier to version 2.0.0 * chore(package): update lockfile package-lock.json Co-authored-by: greenkeeper[bot] <23040076+greenkeeper[bot]@users.noreply.github.com> * bump: update dependencies to latest versions * docs: update CHANGELOG * fix: prettier auto fix markdown * bump: prettier to latest Co-authored-by: greenkeeper[bot] <23040076+greenkeeper[bot]@users.noreply.github.com> Co-authored-by: svolkov <[email protected]>
1 parent 721b35e commit c6f544c

40 files changed

+219
-212
lines changed

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
tests/**/*.ts
1+
tests/**/*.ts
2+
*.md

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# next release
1+
# next release
2+
3+
# 1.6.1
4+
5+
Internal:
6+
7+
- Update `prettier`(`2.0.2`), `swagger2openapi`(`5.4.0`) dependencies
28

39
# 1.6.0
410

@@ -42,7 +48,7 @@ Breaking Changes:
4248
Features:
4349
- `-d, --default-as-success` option. Allows to use "default" status codes as success response type
4450
- `-r, --responses` option. Response declarations in request rescription
45-
This option adds comments of the possible responses from request
51+
This option adds comments of the possible responses from request
4652
![responses comments](./assets/changelog_assets/responses-comments.jpg)
4753
Also typings for `.catch()` callback
4854
![responses catch types](./assets/changelog_assets/responses-catch-types.jpg)

package-lock.json

Lines changed: 56 additions & 56 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131
},
3232
"dependencies": {
3333
"axios": "^0.19.2",
34-
"commander": "^4.1.0",
34+
"commander": "^5.0.0",
3535
"js-yaml": "^3.13.1",
3636
"lodash": "^4.17.15",
3737
"mustache": "^4.0.0",
38-
"swagger2openapi": "^5.3.4",
39-
"prettier": "^1.19.1"
38+
"prettier": "^2.0.2",
39+
"swagger2openapi": "^5.4.0"
4040
},
4141
"bin": {
4242
"swagger-typescript-api": "index.js",

tests/generated/v2.0/adafruit.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,8 @@ export class Api<SecurityDataType> {
333333

334334
private addQueryParams(query?: RequestQueryParamsType): string {
335335
const fixedQuery = query || {};
336-
const keys = Object.keys(fixedQuery).filter(key => "undefined" !== typeof fixedQuery[key]);
337-
return keys.length === 0 ? "" : `?${keys.map(key => this.addQueryParam(fixedQuery, key)).join("&")}`;
336+
const keys = Object.keys(fixedQuery).filter((key) => "undefined" !== typeof fixedQuery[key]);
337+
return keys.length === 0 ? "" : `?${keys.map((key) => this.addQueryParam(fixedQuery, key)).join("&")}`;
338338
}
339339

340340
private mergeRequestOptions(params: RequestParams, securityParams?: RequestParams): RequestParams {
@@ -353,8 +353,8 @@ export class Api<SecurityDataType> {
353353
private safeParseResponse = <T = any, E = any>(response: Response): Promise<T> =>
354354
response
355355
.json()
356-
.then(data => data)
357-
.catch(e => response.text);
356+
.then((data) => data)
357+
.catch((e) => response.text);
358358

359359
public request = <T = any, E = any>(
360360
path: string,
@@ -368,7 +368,7 @@ export class Api<SecurityDataType> {
368368
...this.mergeRequestOptions(params, (secureByDefault || secure) && this.securityWorker(this.securityData)),
369369
method,
370370
body: body ? JSON.stringify(body) : null,
371-
}).then(async response => {
371+
}).then(async (response) => {
372372
const data = await this.safeParseResponse<T, E>(response);
373373
if (!response.ok) throw data;
374374
return data;

tests/generated/v2.0/another-example.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ export class Api<SecurityDataType> {
152152

153153
private addQueryParams(query?: RequestQueryParamsType): string {
154154
const fixedQuery = query || {};
155-
const keys = Object.keys(fixedQuery).filter(key => "undefined" !== typeof fixedQuery[key]);
156-
return keys.length === 0 ? "" : `?${keys.map(key => this.addQueryParam(fixedQuery, key)).join("&")}`;
155+
const keys = Object.keys(fixedQuery).filter((key) => "undefined" !== typeof fixedQuery[key]);
156+
return keys.length === 0 ? "" : `?${keys.map((key) => this.addQueryParam(fixedQuery, key)).join("&")}`;
157157
}
158158

159159
private mergeRequestOptions(params: RequestParams, securityParams?: RequestParams): RequestParams {
@@ -172,8 +172,8 @@ export class Api<SecurityDataType> {
172172
private safeParseResponse = <T = any, E = any>(response: Response): Promise<T> =>
173173
response
174174
.json()
175-
.then(data => data)
176-
.catch(e => response.text);
175+
.then((data) => data)
176+
.catch((e) => response.text);
177177

178178
public request = <T = any, E = any>(
179179
path: string,
@@ -187,7 +187,7 @@ export class Api<SecurityDataType> {
187187
...this.mergeRequestOptions(params, (secureByDefault || secure) && this.securityWorker(this.securityData)),
188188
method,
189189
body: body ? JSON.stringify(body) : null,
190-
}).then(async response => {
190+
}).then(async (response) => {
191191
const data = await this.safeParseResponse<T, E>(response);
192192
if (!response.ok) throw data;
193193
return data;

tests/generated/v2.0/api-with-examples.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ export class Api<SecurityDataType> {
6363
private safeParseResponse = <T = any, E = any>(response: Response): Promise<T> =>
6464
response
6565
.json()
66-
.then(data => data)
67-
.catch(e => response.text);
66+
.then((data) => data)
67+
.catch((e) => response.text);
6868

6969
public request = <T = any, E = any>(
7070
path: string,
@@ -78,7 +78,7 @@ export class Api<SecurityDataType> {
7878
...this.mergeRequestOptions(params, (secureByDefault || secure) && this.securityWorker(this.securityData)),
7979
method,
8080
body: body ? JSON.stringify(body) : null,
81-
}).then(async response => {
81+
}).then(async (response) => {
8282
const data = await this.safeParseResponse<T, E>(response);
8383
if (!response.ok) throw data;
8484
return data;

tests/generated/v2.0/authentiq.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ export class Api<SecurityDataType> {
128128

129129
private addQueryParams(query?: RequestQueryParamsType): string {
130130
const fixedQuery = query || {};
131-
const keys = Object.keys(fixedQuery).filter(key => "undefined" !== typeof fixedQuery[key]);
132-
return keys.length === 0 ? "" : `?${keys.map(key => this.addQueryParam(fixedQuery, key)).join("&")}`;
131+
const keys = Object.keys(fixedQuery).filter((key) => "undefined" !== typeof fixedQuery[key]);
132+
return keys.length === 0 ? "" : `?${keys.map((key) => this.addQueryParam(fixedQuery, key)).join("&")}`;
133133
}
134134

135135
private mergeRequestOptions(params: RequestParams, securityParams?: RequestParams): RequestParams {
@@ -148,8 +148,8 @@ export class Api<SecurityDataType> {
148148
private safeParseResponse = <T = any, E = any>(response: Response): Promise<T> =>
149149
response
150150
.json()
151-
.then(data => data)
152-
.catch(e => response.text);
151+
.then((data) => data)
152+
.catch((e) => response.text);
153153

154154
public request = <T = any, E = any>(
155155
path: string,
@@ -163,7 +163,7 @@ export class Api<SecurityDataType> {
163163
...this.mergeRequestOptions(params, (secureByDefault || secure) && this.securityWorker(this.securityData)),
164164
method,
165165
body: body ? JSON.stringify(body) : null,
166-
}).then(async response => {
166+
}).then(async (response) => {
167167
const data = await this.safeParseResponse<T, E>(response);
168168
if (!response.ok) throw data;
169169
return data;

0 commit comments

Comments
 (0)