Initial commit with Email Import Wizard and Task Processor updates
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import api from './client';
|
||||
|
||||
export interface ApiKey {
|
||||
id: string;
|
||||
name: string;
|
||||
keyPrefix: string;
|
||||
createdAt: string;
|
||||
lastUsedAt: string | null;
|
||||
expiresAt: string | null;
|
||||
}
|
||||
|
||||
export interface CreatedApiKey {
|
||||
plainKey: string;
|
||||
entity: ApiKey;
|
||||
}
|
||||
|
||||
export const apiKeysApi = {
|
||||
getApiKeys: () => api.get<ApiKey[]>('/api/api-keys').then(r => r.data),
|
||||
createApiKey: (name: string, expiresDays?: number) =>
|
||||
api.post<CreatedApiKey>('/api/api-keys', { name, expiresDays }).then(r => r.data),
|
||||
deleteApiKey: (id: string) => api.delete(`/api/api-keys/${id}`).then(r => r.data),
|
||||
};
|
||||
Reference in New Issue
Block a user