mirror of
https://github.com/ivuorinen/cinode-api.git
synced 2026-01-26 03:04:03 +00:00
25 lines
556 B
Bash
Executable File
25 lines
556 B
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Generate Cinode TypeScript type definitions
|
|
|
|
SRC="https://api.cinode.com/swagger/v0.1/swagger.json"
|
|
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_TS"
|
|
|
|
npm run prettier
|