Skip to content

Commit

Permalink
feat: add autogenerated openapi spec
Browse files Browse the repository at this point in the history
  • Loading branch information
jrea committed Apr 4, 2022
1 parent be23f45 commit 17c2557
Show file tree
Hide file tree
Showing 147 changed files with 13,431 additions and 14,824 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dist
dist
lib/nile/src/generated
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions lib/nile/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
node_modules
dist
docs
src/generated
spec/output.swagger.json

.yarn/*
!.yarn/patches
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions lib/nile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ yarn set version berry
To run:

```bash
yarn build
yarn start
```

Expand Down
7 changes: 7 additions & 0 deletions lib/nile/openapi-merge.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"inputs": [
{ "inputFile": "./spec/api.yaml" },
{ "inputFile": "./spec/auth.yaml" }
],
"output": "./spec/output.swagger.json"
}
7 changes: 7 additions & 0 deletions lib/nile/openapitools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "5.4.0"
}
}
8 changes: 7 additions & 1 deletion lib/nile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@
"scripts": {
"start": "tsdx watch",
"build": "tsdx build && yarn build:types",
"prebuild": "yarn build:api:merge && yarn build:api:gen",
"build:readme": "./scripts/lib-readme-shim.sh",
"build:types": "tsc -d --declarationDir dist --emitDeclarationOnly",
"build:api:merge": "yarn openapi-merge-cli",
"build:api:gen": "yarn openapi-generator-cli generate -i spec/output.swagger.json -g typescript --package-name nile -o src/generated/openapi --additional-properties=ngVersion=6.1.7,npmName=theniledev,supportsES6=true,npmVersion=6.9.0,withInterfaces=true,withSeparateModelsAndApi=true,moduleName=Nile,projectName=@theniledev/js",
"test": "tsdx test",
"prepare": "tsdx build && yarn build:types",
"prepare": "yarn prebuild && tsdx build && yarn build:types",
"size": "size-limit",
"analyze": "size-limit --why"
},
Expand All @@ -34,9 +38,11 @@
}
],
"devDependencies": {
"@openapitools/openapi-generator-cli": "^2.4.26",
"@size-limit/preset-small-lib": "^7.0.8",
"@types/jest": "^27.4.1",
"@types/node": "^17.0.23",
"openapi-merge-cli": "^1.3.1",
"size-limit": "^7.0.8",
"tsdx": "^0.14.1",
"tslib": "^2.3.1",
Expand Down
9 changes: 9 additions & 0 deletions lib/nile/scripts/lib-readme-shim.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# personalize the open api docs for use with the actual interface
sed -i '' -e "/import \* as fs from 'fs';/,1 d" ./src/generated/openapi/DefaultApi.md
sed -i '' -e "s/Nile.DefaultApi/Nile/" ./src/generated/openapi/DefaultApi.md
sed -i '' -e "s/const apiInstance/const nile/" ./src/generated/openapi/DefaultApi.md
sed -i '' -e "s/apiInstance\./nile\./" ./src/generated/openapi/DefaultApi.md

cp ./src/generated/openapi/DefaultApi.md ./src/README.md
Loading

0 comments on commit 17c2557

Please sign in to comment.