* ⚡ Adjust `format` script * 🔥 Remove exemption for `editor-ui` * 🎨 Prettify * 👕 Fix lint
15 lines
554 B
TypeScript
15 lines
554 B
TypeScript
import { IRestApiContext } from '@/Interface';
|
|
import { makeRestApiRequest } from '@/utils';
|
|
|
|
export function getApiKey(context: IRestApiContext): Promise<{ apiKey: string | null }> {
|
|
return makeRestApiRequest(context, 'GET', '/me/api-key');
|
|
}
|
|
|
|
export function createApiKey(context: IRestApiContext): Promise<{ apiKey: string | null }> {
|
|
return makeRestApiRequest(context, 'POST', '/me/api-key');
|
|
}
|
|
|
|
export function deleteApiKey(context: IRestApiContext): Promise<{ success: boolean }> {
|
|
return makeRestApiRequest(context, 'DELETE', '/me/api-key');
|
|
}
|