mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
15 lines
556 B
TypeScript
15 lines
556 B
TypeScript
|
import {IRestApiContext} from "@/Interface";
|
||
|
import {makeRestApiRequest} from "@/api/helpers";
|
||
|
|
||
|
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');
|
||
|
}
|