Skip to content

Commit 730684a

Browse files
committed
Format the entire codebase
Signed-off-by: Sora Morimoto <[email protected]>
1 parent 1eef3ef commit 730684a

File tree

58 files changed

+46592
-49035
lines changed

Some content is hidden

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

58 files changed

+46592
-49035
lines changed

biome.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
"files": {
44
"ignore": [
55
"package.json",
6-
"tests/**/*.json",
76
"tests/**/expected.ts",
87
"tests/**/expected/**",
98
"tests/**/generated/**",
109
"tests/**/schema.d.ts",
1110
"tests/**/schema.js",
1211
"tests/**/schema.ts"
13-
]
12+
],
13+
"maxSize": 10000000
1414
},
1515
"formatter": {
1616
"enabled": true,

templates/README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
# swagger-typescript-api
1+
# swagger-typescript-api
22

3-
# templates
3+
# templates
44

5-
Templates:
6-
- `api.ejs` - *(generates file)* Api class module (locations: [default](https://github.com/acacode/swagger-typescript-api/tree/next/templates/default/api.ejs), [modular](https://github.com/acacode/swagger-typescript-api/tree/next/templates/modular/api.ejs))
7-
- `data-contracts.ejs` - *(generates file)* all types (data contracts) from swagger schema (locations: [base](https://github.com/acacode/swagger-typescript-api/tree/next/templates/base/data-contracts.ejs))
8-
- `http-client.ejs` - *(generates file)* HttpClient class module (locations: [base](https://github.com/acacode/swagger-typescript-api/tree/next/templates/base/http-client.ejs))
9-
- `procedure-call.ejs` - *(subtemplate)* route in Api class (locations: [default](https://github.com/acacode/swagger-typescript-api/tree/next/templates/default/procedure-call.ejs), [modular](https://github.com/acacode/swagger-typescript-api/tree/next/templates/modular/procedure-call.ejs))
10-
- `route-docs.ejs` - *(generates file)* documentation for route in Api class (locations: [base](https://github.com/acacode/swagger-typescript-api/tree/next/templates/base/route-docs.ejs))
11-
- `route-name.ejs` - *(subtemplate)* route name for route in Api class (locations: [base](https://github.com/acacode/swagger-typescript-api/tree/next/templates/base/route-name.ejs))
12-
- `route-type.ejs` - *(`--route-types` option)* *(subtemplate)* (locations: [base](https://github.com/acacode/swagger-typescript-api/tree/next/templates/base/route-type.ejs))
13-
- `route-types.ejs` - *(`--route-types` option)* *(subtemplate)* (locations: [base](https://github.com/acacode/swagger-typescript-api/tree/next/templates/base/route-types.ejs)) - `data-contract-jsdoc.ejs` - *(subtemplate)* generates JSDOC for data contract (locations: [base](https://github.com/acacode/swagger-typescript-api/tree/next/templates/base/data-contract-jsdoc.ejs))
5+
Templates:
146

15-
[//]: # (- `enum-data-contract.ejs` - *&#40;subtemplate&#41;* generates `enum` data contract &#40;locations: [base]&#40;https://github.com/acacode/swagger-typescript-api/tree/next/templates/base/enum-data-contract.ejs&#41;&#41;)
16-
[//]: # (- `interface-data-contract.ejs` - *&#40;subtemplate&#41;* generates `interface` data contract &#40;locations: [base]&#40;https://github.com/acacode/swagger-typescript-api/tree/next/templates/base/interface-data-contract.ejs&#41;&#41;)
17-
[//]: # (- `type-data-contract.ejs` - *&#40;subtemplate&#41;* generates `type` data contract &#40;locations: [base]&#40;https://github.com/acacode/swagger-typescript-api/tree/next/templates/base/type-data-contract.ejs&#41;&#41;)
7+
- `api.ejs` - _(generates file)_ Api class module (locations: [default](https://github.com/acacode/swagger-typescript-api/tree/next/templates/default/api.ejs), [modular](https://github.com/acacode/swagger-typescript-api/tree/next/templates/modular/api.ejs))
8+
- `data-contracts.ejs` - _(generates file)_ all types (data contracts) from swagger schema (locations: [base](https://github.com/acacode/swagger-typescript-api/tree/next/templates/base/data-contracts.ejs))
9+
- `http-client.ejs` - _(generates file)_ HttpClient class module (locations: [base](https://github.com/acacode/swagger-typescript-api/tree/next/templates/base/http-client.ejs))
10+
- `procedure-call.ejs` - _(subtemplate)_ route in Api class (locations: [default](https://github.com/acacode/swagger-typescript-api/tree/next/templates/default/procedure-call.ejs), [modular](https://github.com/acacode/swagger-typescript-api/tree/next/templates/modular/procedure-call.ejs))
11+
- `route-docs.ejs` - _(generates file)_ documentation for route in Api class (locations: [base](https://github.com/acacode/swagger-typescript-api/tree/next/templates/base/route-docs.ejs))
12+
- `route-name.ejs` - _(subtemplate)_ route name for route in Api class (locations: [base](https://github.com/acacode/swagger-typescript-api/tree/next/templates/base/route-name.ejs))
13+
- `route-type.ejs` - _(`--route-types` option)_ _(subtemplate)_ (locations: [base](https://github.com/acacode/swagger-typescript-api/tree/next/templates/base/route-type.ejs))
14+
- `route-types.ejs` - _(`--route-types` option)_ _(subtemplate)_ (locations: [base](https://github.com/acacode/swagger-typescript-api/tree/next/templates/base/route-types.ejs)) - `data-contract-jsdoc.ejs` - _(subtemplate)_ generates JSDOC for data contract (locations: [base](https://github.com/acacode/swagger-typescript-api/tree/next/templates/base/data-contract-jsdoc.ejs))
15+
16+
[//]: # "- `enum-data-contract.ejs` - *(subtemplate)* generates `enum` data contract (locations: [base](https://github.com/acacode/swagger-typescript-api/tree/next/templates/base/enum-data-contract.ejs))"
17+
[//]: # "- `interface-data-contract.ejs` - *(subtemplate)* generates `interface` data contract (locations: [base](https://github.com/acacode/swagger-typescript-api/tree/next/templates/base/interface-data-contract.ejs))"
18+
[//]: # "- `type-data-contract.ejs` - *(subtemplate)* generates `type` data contract (locations: [base](https://github.com/acacode/swagger-typescript-api/tree/next/templates/base/type-data-contract.ejs))"

templates/base/README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# swagger-typescript-api
1+
# swagger-typescript-api
22

3-
# templates/base
3+
# templates/base
44

5-
This templates use both for multiple api files and single api file
5+
This templates use both for multiple api files and single api file
66

7-
8-
path prefix `@base`
7+
path prefix `@base`

templates/default/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# swagger-typescript-api
1+
# swagger-typescript-api
22

3-
# templates/default
3+
# templates/default
44

5-
This templates use for single api file (without `--modular` option)
5+
This templates use for single api file (without `--modular` option)
66

7-
path prefix `@default`
7+
path prefix `@default`

templates/modular/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# swagger-typescript-api
1+
# swagger-typescript-api
22

3-
# templates/modular
3+
# templates/modular
44

5-
This templates use for multiple api files (`--modular` option)
5+
This templates use for multiple api files (`--modular` option)
66

7-
path prefix `@modular`
7+
path prefix `@modular`

tests/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# swagger-typescript-api
1+
# swagger-typescript-api
22

3-
## 📃 EXAMPLES
3+
## 📃 EXAMPLES
44

5-
As you see above here is two folders:
6-
1. [**`schemas`**](./schemas) -
7-
- [**`v2.0`**](./schemas/v2.0) - schemas with Swagger 2.0
8-
- [**`v3.0`**](./schemas/v3.0) - schemas with OA 3.0
9-
1. [**`generated`**](./generated) -
10-
- [**`v2.0`**](./generated/v2.0) - generated api modules for Swagger 2.0 schemas from above folder
11-
- [**`v3.0`**](./generated/v3.0) - generated api modules for OA 3.0 schemas from above folder
5+
As you see above here is two folders:
126

7+
1. [**`schemas`**](./schemas) -
8+
- [**`v2.0`**](./schemas/v2.0) - schemas with Swagger 2.0
9+
- [**`v3.0`**](./schemas/v3.0) - schemas with OA 3.0
10+
1. [**`generated`**](./generated) -
11+
- [**`v2.0`**](./generated/v2.0) - generated api modules for Swagger 2.0 schemas from above folder
12+
- [**`v3.0`**](./generated/v3.0) - generated api modules for OA 3.0 schemas from above folder
1313

14-
Most schemas taken from [apis.guru](https://apis.guru/openapi-directory/), [swagger.io github repo](https://swagger.io/), [Github api description](https://github.com/github/rest-api-description) and [up-banking](https://github.com/up-banking/api)
14+
Most schemas taken from [apis.guru](https://apis.guru/openapi-directory/), [swagger.io github repo](https://swagger.io/), [Github api description](https://github.com/github/rest-api-description) and [up-banking](https://github.com/up-banking/api)

tests/schemas/v2.0/another-example.json

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,10 @@
225225
}
226226
],
227227
"security": [],
228-
"consumes": ["application/x-www-form-urlencoded", "multipart/form-data"],
228+
"consumes": [
229+
"application/x-www-form-urlencoded",
230+
"multipart/form-data"
231+
],
229232
"tags": ["pet"]
230233
}
231234
},
@@ -263,7 +266,10 @@
263266
}
264267
],
265268
"security": [],
266-
"consumes": ["multipart/form-data", "application/x-www-form-urlencoded"],
269+
"consumes": [
270+
"multipart/form-data",
271+
"application/x-www-form-urlencoded"
272+
],
267273
"tags": ["pet"]
268274
}
269275
},
@@ -996,7 +1002,12 @@
9961002
},
9971003
"PetNames": {
9981004
"type": "string",
999-
"enum": ["Fluffy Hero", "Piggy Po", "Swagger Typescript Api", "UPPER_CASE"]
1005+
"enum": [
1006+
"Fluffy Hero",
1007+
"Piggy Po",
1008+
"Swagger Typescript Api",
1009+
"UPPER_CASE"
1010+
]
10001011
},
10011012
"PetIds": {
10021013
"type": "integer",

tests/schemas/v2.0/api-with-examples.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ paths:
1212
multiple line 2
1313
multiple line 3
1414
produces:
15-
- application/json
15+
- application/json
1616
responses:
1717
"200":
1818
description: |-
@@ -82,7 +82,7 @@ paths:
8282
operationId: getVersionDetailsv2
8383
summary: Show API version details
8484
produces:
85-
- application/json
85+
- application/json
8686
responses:
8787
"200":
8888
description: |-
@@ -191,4 +191,4 @@ paths:
191191
type: string
192192

193193
consumes:
194-
- application/json
194+
- application/json

tests/schemas/v2.0/enums.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@
3535
},
3636
"SomeInterestEnum": {
3737
"format": "int32",
38-
"enum": [6, 2, 1, 67, 88, 122, 88, 0, 213, 12378, 123125, 32452, 1111, 66666],
38+
"enum": [
39+
6, 2, 1, 67, 88, 122, 88, 0, 213, 12378, 123125, 32452, 1111, 66666
40+
],
3941
"type": "integer",
4042
"x-enumNames": [
4143
"Bla",

tests/schemas/v2.0/furkot-example.yaml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
swagger: '2.0'
1+
swagger: "2.0"
22
schemes:
33
- https
44
host: trips.furkot.com
@@ -15,63 +15,63 @@ info:
1515
x-apisguru-categories:
1616
- location
1717
x-logo:
18-
url: 'https://api.apis.guru/v2/cache/logo/https_cdn.furkot.com_img_furkot-banner-black-4x1.svg'
18+
url: "https://api.apis.guru/v2/cache/logo/https_cdn.furkot.com_img_furkot-banner-black-4x1.svg"
1919
x-origin:
2020
- format: swagger
21-
url: 'https://help.furkot.com/widgets/furkot-api.yaml'
22-
version: '2.0'
21+
url: "https://help.furkot.com/widgets/furkot-api.yaml"
22+
version: "2.0"
2323
x-preferred: true
2424
x-providerName: furkot.com
2525
externalDocs:
2626
description: Furkot API description
27-
url: 'https://help.furkot.com/widgets/furkot-api.html'
27+
url: "https://help.furkot.com/widgets/furkot-api.html"
2828
produces:
2929
- application/json
3030
securityDefinitions:
3131
furkot_auth_access_code:
32-
authorizationUrl: 'https://trips.furkot.com/oauth/authorize'
32+
authorizationUrl: "https://trips.furkot.com/oauth/authorize"
3333
flow: accessCode
3434
scopes:
35-
'read:trips': list trips and stops info
36-
tokenUrl: 'https://trips.furkot.com/pub/api/access_token'
35+
"read:trips": list trips and stops info
36+
tokenUrl: "https://trips.furkot.com/pub/api/access_token"
3737
type: oauth2
3838
furkot_auth_implicit:
39-
authorizationUrl: 'https://trips.furkot.com/oauth/authorize'
39+
authorizationUrl: "https://trips.furkot.com/oauth/authorize"
4040
flow: implicit
4141
scopes:
42-
'read:trips': list users trips info
42+
"read:trips": list users trips info
4343
type: oauth2
4444
security:
4545
- furkot_auth_access_code:
46-
- 'read:trips'
46+
- "read:trips"
4747
- furkot_auth_implicit:
48-
- 'read:trips'
48+
- "read:trips"
4949
paths:
5050
/trip:
5151
get:
5252
description: list user's trips
5353
responses:
54-
'200':
54+
"200":
5555
description: Successful response
5656
schema:
5757
items:
58-
$ref: '#/definitions/Trip'
58+
$ref: "#/definitions/Trip"
5959
type: array
60-
'/trip/{trip_id}/stop':
60+
"/trip/{trip_id}/stop":
6161
get:
62-
description: 'list stops for a trip identified by {trip_id}'
62+
description: "list stops for a trip identified by {trip_id}"
6363
parameters:
6464
- description: id of the trip
6565
in: path
6666
name: trip_id
6767
required: true
6868
type: string
6969
responses:
70-
'200':
70+
"200":
7171
description: Successful response
7272
schema:
7373
items:
74-
$ref: '#/definitions/Step'
74+
$ref: "#/definitions/Step"
7575
type: array
7676
definitions:
7777
Step:
@@ -80,7 +80,7 @@ definitions:
8080
description: address of the stop
8181
type: string
8282
arrival:
83-
description: 'arrival at the stop in its local timezone as YYYY-MM-DDThh:mm'
83+
description: "arrival at the stop in its local timezone as YYYY-MM-DDThh:mm"
8484
format: date-time
8585
type: string
8686
coordinates:
@@ -96,7 +96,7 @@ definitions:
9696
type: number
9797
type: object
9898
departure:
99-
description: 'departure from the stop in its local timezone as YYYY-MM-DDThh:mm'
99+
description: "departure from the stop in its local timezone as YYYY-MM-DDThh:mm"
100100
format: date-time
101101
type: string
102102
name:
@@ -137,14 +137,14 @@ definitions:
137137
Trip:
138138
properties:
139139
begin:
140-
description: 'begin of the trip in its local timezone as YYYY-MM-DDThh:mm'
140+
description: "begin of the trip in its local timezone as YYYY-MM-DDThh:mm"
141141
format: date-time
142142
type: string
143143
description:
144144
description: description of the trip (truncated to 200 characters)
145145
type: string
146146
end:
147-
description: 'end of the trip in its local timezone as YYYY-MM-DDThh:mm'
147+
description: "end of the trip in its local timezone as YYYY-MM-DDThh:mm"
148148
format: date-time
149149
type: string
150150
id:

0 commit comments

Comments
 (0)