MCPcopy
hub / github.com/remix-project-org/remix-project / IApiClient

Interface IApiClient

libs/remix-api/src/lib/plugins/api-client.ts:22–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20}
21
22export interface IApiClient {
23 /**
24 * Make an authenticated HTTP request
25 * @param endpoint - API endpoint path (relative to base URL)
26 * @param options - Request options
27 * @returns Typed response
28 */
29 request<TResponse>(endpoint: string, options?: ApiRequestOptions): Promise<ApiResponse<TResponse>>
30
31 /**
32 * GET request helper
33 */
34 get<TResponse>(endpoint: string, options?: Omit<ApiRequestOptions, 'method'>): Promise<ApiResponse<TResponse>>
35
36 /**
37 * POST request helper
38 */
39 post<TResponse>(endpoint: string, body?: unknown, options?: Omit<ApiRequestOptions, 'method' | 'body'>): Promise<ApiResponse<TResponse>>
40
41 /**
42 * PUT request helper
43 */
44 put<TResponse>(endpoint: string, body?: unknown, options?: Omit<ApiRequestOptions, 'method' | 'body'>): Promise<ApiResponse<TResponse>>
45
46 /**
47 * DELETE request helper
48 */
49 delete<TResponse>(endpoint: string, options?: Omit<ApiRequestOptions, 'method'>): Promise<ApiResponse<TResponse>>
50
51 /**
52 * Set the authentication token
53 */
54 setToken(token: string | null): void
55
56 /**
57 * Get current token
58 */
59 getToken(): string | null
60
61 /**
62 * Set token refresh callback
63 */
64 setTokenRefreshCallback(callback: () => Promise<string | null>): void
65}
66
67/**
68 * Base API client implementation

Callers 60

createPRFunction · 0.65
serve.jsFile · 0.65
metamask.test.tsFile · 0.65
vega.jsFile · 0.65
transformFunction · 0.65
remotebranchesMethod · 0.65
getGitHubUserMethod · 0.65
remotecommitsMethod · 0.65
requestMethod · 0.65
verifyMethod · 0.65
getProvidersMethod · 0.65
getRegistrationModeMethod · 0.65

Implementers 1

ApiClientlibs/remix-api/src/lib/plugins/api-cli

Calls

no outgoing calls

Tested by

no test coverage detected