add script to generate typescript interfaces and paths from openapi schema

This commit is contained in:
Jacob Overgaard
2022-05-18 12:58:27 +02:00
parent d9e6a9391f
commit 03fe60ca7c
2 changed files with 20 additions and 4 deletions

View File

@@ -9,7 +9,8 @@
"version": "0.0.0",
"dependencies": {
"@umbraco-ui/uui": "^0.2.0",
"lit": "^2.0.2"
"lit": "^2.0.2",
"openapi-typescript-fetch": "^1.1.3"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.24.0",
@@ -3752,6 +3753,15 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/openapi-typescript-fetch": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/openapi-typescript-fetch/-/openapi-typescript-fetch-1.1.3.tgz",
"integrity": "sha512-smLZPck4OkKMNExcw8jMgrMOGgVGx2N/s6DbKL2ftNl77g5HfoGpZGFy79RBzU/EkaO0OZpwBnslfdBfh7ZcWg==",
"engines": {
"node": ">= 12.0.0",
"npm": ">= 7.0.0"
}
},
"node_modules/optionator": {
"version": "0.9.1",
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz",
@@ -7765,6 +7775,11 @@
"mimic-fn": "^2.1.0"
}
},
"openapi-typescript-fetch": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/openapi-typescript-fetch/-/openapi-typescript-fetch-1.1.3.tgz",
"integrity": "sha512-smLZPck4OkKMNExcw8jMgrMOGgVGx2N/s6DbKL2ftNl77g5HfoGpZGFy79RBzU/EkaO0OZpwBnslfdBfh7ZcWg=="
},
"optionator": {
"version": "0.9.1",
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz",

View File

@@ -7,7 +7,7 @@
"build": "tsc && vite build",
"test": "echo 'TODO: Implement test'",
"lint": "eslint . --ext .ts --ignore-path .gitignore --cache",
"generate:api": "npx openapi-typescript schemas/**/*.yml --output schemas/schema.ts"
"generate:api": "npx openapi-typescript schemas/**/*.yml --output schemas/generated-schema.ts"
},
"engines": {
"node": ">=16.0.0 <17",
@@ -15,7 +15,8 @@
},
"dependencies": {
"@umbraco-ui/uui": "^0.2.0",
"lit": "^2.0.2"
"lit": "^2.0.2",
"openapi-typescript-fetch": "^1.1.3"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.24.0",
@@ -34,4 +35,4 @@
"msw": {
"workerDirectory": "public"
}
}
}