Clan-ts-api: filter out reserved tags from typescript, library generates invalid types

This commit is contained in:
Johannes Kirschbauer
2024-11-08 13:54:14 +01:00
parent a67f42ee7a
commit 46836496aa

View File

@@ -88,6 +88,7 @@
buildInputs = [
pkgs.python3
pkgs.json2ts
pkgs.jq
];
installPhase = ''
@@ -98,7 +99,9 @@
json2ts --input $out/API.json > $out/API.ts
# Retrieve python API Typescript types
json2ts --input ${self'.legacyPackages.schemas.inventory}/schema.json > $out/Inventory.ts
# delete the reserved tags from typechecking because the conversion library doesn't support them
jq 'del(.properties.tags.properties)' ${self'.legacyPackages.schemas.inventory}/schema.json > schema.json
json2ts --input schema.json > $out/Inventory.ts
cp ${self'.legacyPackages.schemas.inventory}/* $out
'';
};