mirror of
https://github.com/n8n-io/n8n.git
synced 2026-06-03 18:27:09 +02:00
18 lines
594 B
TypeScript
18 lines
594 B
TypeScript
import type { ApiKey, IRestApiContext } from '@/Interface';
|
|
import { makeRestApiRequest } from '@/utils/apiUtils';
|
|
|
|
export async function getApiKeys(context: IRestApiContext): Promise<ApiKey[]> {
|
|
return await makeRestApiRequest(context, 'GET', '/api-keys');
|
|
}
|
|
|
|
export async function createApiKey(context: IRestApiContext): Promise<ApiKey> {
|
|
return await makeRestApiRequest(context, 'POST', '/api-keys');
|
|
}
|
|
|
|
export async function deleteApiKey(
|
|
context: IRestApiContext,
|
|
id: string,
|
|
): Promise<{ success: boolean }> {
|
|
return await makeRestApiRequest(context, 'DELETE', `/api-keys/${id}`);
|
|
}
|