Create a shared library that includes reusable types and an API client to connect to the backend. This client should handle API requests, responses, and error management in a consistent and reusable way across the application.
- Tasks:
- Define and implement common data types to be used (e.g., request/response data formats, error handling types).
- Implement a client class or utility to facilitate interaction with the backend (e.g., using fetch or axios for REST API calls).
- Implement basic error handling and logging mechanisms for API calls.
- Ensure the client is flexible to support different endpoints and allows for easy expansion (e.g., adding more API routes in the future).
- Write unit tests to verify the API client and data types work as expected.
- Document the library for other developers to use and integrate in kiali plugin.