Navigate to API Connectors extension. Select your space and TypeScript language. Then press generate button.
In the generated archive you get a sample typescript project.
Copy files from src/io/starhive/schema of the sample project into app/api/starhive/schemacatalog in this project

Go to ClientFactory.ts and replace new Map() with JSON_DECODERS constant imported from the schema directory.
This would allow you to use domain types in your code without having to manually map type and attribute ids in your code.
import {JSON_DECODERS} from "@/app/api/starhive/schema/JsonDecoders";
//return new StarhiveClient(starhiveApiToken()!, starhiveWorkspaceId()!, new Map())
return new StarhiveClient(starhiveApiToken()!, starhiveWorkspaceId()!, JSON_DECODERS)