website refactor
This commit is contained in:
16
apps/website/lib/contracts/api/ApiClient.ts
Normal file
16
apps/website/lib/contracts/api/ApiClient.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* ApiClient contract
|
||||
*
|
||||
* Transport boundary for API calls.
|
||||
* Returns API Transport DTOs only.
|
||||
*
|
||||
* Based on WEBSITE_CONTRACT.md:
|
||||
* - API Transport DTOs are returned by the backend API over HTTP
|
||||
* - Website uses ApiClient to communicate with the API
|
||||
*/
|
||||
export interface ApiClient<TApiDto = unknown> {
|
||||
/**
|
||||
* Execute an API call and return the transport DTO
|
||||
*/
|
||||
execute(...args: unknown[]): Promise<TApiDto>;
|
||||
}
|
||||
Reference in New Issue
Block a user