At the moment, there isn’t a straightforward solution, at least at my level of TS understanding. Know that in v5, we are going to be getting back the simplified response, so there will be no need for the flattentAttribute function that I am using.
I used it in this tutorial because when Strapi 5 was out, I wanted to have an easier time migrating the project. Ince the response will mainly mimic what the flattenAttributes function returns.
Once Strapi 5 is released, we’ll be working on an SDK that will significantly simplify the process of using Strapi types. This development will make our work with Strapi even more straightforward and user-friendly, enhancing our overall development experience.