mirror of
https://github.com/LukeHagar/Prowlarr-TS-SDK.git
synced 2025-12-06 04:21:03 +00:00
30 lines
711 B
Bash
30 lines
711 B
Bash
#!/bin/bash
|
|
|
|
# Install the speakeasy CLI
|
|
curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/install.sh | sh
|
|
|
|
# Setup samples directory
|
|
rmdir samples || true
|
|
mkdir samples
|
|
|
|
npm install
|
|
npm install -g ts-node
|
|
npm link
|
|
npm link prowlarr
|
|
TS_CONFIG_CONTENT=$(cat <<EOL
|
|
{
|
|
"compilerOptions": {
|
|
"baseUrl": ".",
|
|
"paths": {
|
|
"openapi": ["../src/index"],
|
|
"openapi/*": ["../src/*"]
|
|
}
|
|
},
|
|
"include": ["./**/*.ts"]
|
|
}
|
|
EOL
|
|
)
|
|
echo "$TS_CONFIG_CONTENT" > samples/tsconfig.json
|
|
|
|
# Generate starter usage sample with speakeasy
|
|
speakeasy generate usage -s https://raw.githubusercontent.com/Prowlarr/Prowlarr/develop/src/Prowlarr.Api.V1/openapi.json -l typescript -o samples/root.ts |