mirror of
https://github.com/ivuorinen/cinode-api.git
synced 2026-01-26 03:04:03 +00:00
Added Python client, updated TS typings, readme
This commit is contained in:
14
generate.sh
14
generate.sh
@@ -3,13 +3,23 @@
|
||||
# Generate Cinode TypeScript type definitions
|
||||
|
||||
SRC="https://api.cinode.com/swagger/v0.1/swagger.json"
|
||||
DEST="$(pwd)/src/cinode.d.ts"
|
||||
DEST="$(pwd)/src/"
|
||||
DEST_TS="$DEST/cinode.d.ts"
|
||||
DEST_PY="$DEST/cinode-py-client"
|
||||
|
||||
python3 -m pip install --user --upgrade pipx
|
||||
python3 -m pipx ensurepath
|
||||
python3 -m pipx install openapi-python-client --include-deps
|
||||
|
||||
rm -rf "$DEST_PY"
|
||||
openapi-python-client generate --url "$SRC"
|
||||
mv "cinode-api-client" "$DEST_PY"
|
||||
|
||||
npx openapi-typescript \
|
||||
"$SRC" \
|
||||
--export-type \
|
||||
--path-params-as-type \
|
||||
--output "$DEST"
|
||||
--output "$DEST_TS"
|
||||
|
||||
npm run prettier
|
||||
|
||||
|
||||
Reference in New Issue
Block a user