From 03968d8fbc19fe9bd8d90a005fe565449afccb9b Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Sat, 16 Aug 2025 12:20:51 +0200 Subject: [PATCH] api/inventory: remove leaked schemas --- .gitignore | 1 - pkgs/clan-app/ui/src/hooks/api.ts | 7 ------- pkgs/clan-cli/flake-module.nix | 6 ------ 3 files changed, 14 deletions(-) diff --git a/.gitignore b/.gitignore index 7e60f97d6..75dbd7889 100644 --- a/.gitignore +++ b/.gitignore @@ -39,7 +39,6 @@ select # Generated files pkgs/clan-app/ui/api/API.json pkgs/clan-app/ui/api/API.ts -pkgs/clan-app/ui/api/Inventory.ts pkgs/clan-app/ui/api/modules_schemas.json pkgs/clan-app/ui/api/schema.json pkgs/clan-app/ui/.fonts diff --git a/pkgs/clan-app/ui/src/hooks/api.ts b/pkgs/clan-app/ui/src/hooks/api.ts index 7a1e7b0b5..e787917d9 100644 --- a/pkgs/clan-app/ui/src/hooks/api.ts +++ b/pkgs/clan-app/ui/src/hooks/api.ts @@ -1,17 +1,10 @@ import { API } from "@/api/API"; -import { Schema as Inventory } from "@/api/Inventory"; export type OperationNames = keyof API; -type Services = NonNullable; -type ServiceNames = keyof Services; export type OperationArgs = API[T]["arguments"]; export type OperationResponse = API[T]["return"]; -export type ClanServiceInstance = NonNullable< - Services[T] ->[string]; - export type SuccessQuery = Extract< OperationResponse, { status: "success" } diff --git a/pkgs/clan-cli/flake-module.nix b/pkgs/clan-cli/flake-module.nix index a71771ad3..053275f64 100644 --- a/pkgs/clan-cli/flake-module.nix +++ b/pkgs/clan-cli/flake-module.nix @@ -96,12 +96,6 @@ # It treats it not as the type of an empty object, but as non-nullish. # Should be fixed in json2ts: https://github.com/bcherny/json-schema-to-typescript/issues/557 sed -i -e 's/{}/Record/g' $out/API.ts - - # Retrieve python API Typescript types - # 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 ''; }; clan-lib-openapi = pkgs.stdenv.mkDerivation {