21 lines
498 B
Bash
Executable file
21 lines
498 B
Bash
Executable file
#!/bin/bash
|
|
|
|
generate_schema_for_type() {
|
|
yes | npx typescript-json-schema --noExtraProps true --required --refs false --out "temp_schemas/$1.json" "./types/**.ts" "$1"
|
|
}
|
|
|
|
generate_schemas() {
|
|
rm -rf temp_schemas
|
|
mkdir temp_schemas
|
|
|
|
generate_schema_for_type "AiSuggestionsOutput" &
|
|
generate_schema_for_type "AiSnewuggestionOutput" &
|
|
wait
|
|
|
|
rm -rf ./schemas
|
|
mv temp_schemas schemas
|
|
}
|
|
|
|
# Run the schema generation
|
|
generate_schemas
|
|
echo "Schema generated successfully!"
|