32 lines
913 B
TypeScript
32 lines
913 B
TypeScript
import { apiClient } from "@/lib/api-client";
|
|
import { env } from "@/config/env";
|
|
|
|
export const apiManagementService = {
|
|
getAllTokens: async () => {
|
|
const response = await apiClient.get(`/${env.endpoints.apiManagement}/tokens`);
|
|
return response.data;
|
|
},
|
|
|
|
createKey: async () => {
|
|
const response = await apiClient.post(`/${env.endpoints.apiManagement}/token`);
|
|
return response.data;
|
|
},
|
|
|
|
deleteKey: async (apiKey: string) => {
|
|
const response = await apiClient.delete(
|
|
`/${env.endpoints.apiManagement}/token`,
|
|
{
|
|
headers: {
|
|
"target-x-api-key": apiKey,
|
|
},
|
|
}
|
|
);
|
|
return response.data;
|
|
},
|
|
|
|
testSecure: async () => {
|
|
const response = await apiClient.get(`/${env.endpoints.apiManagement}/test/secure`);
|
|
return response.data;
|
|
},
|
|
};
|