Files
Prowlarr-TS-SDK/.devcontainer/setup.sh
2025-05-16 17:01:58 -05:00

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