mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 14:15:24 +00:00
28 lines
772 B
TypeScript
28 lines
772 B
TypeScript
import { authApi, handleApiError } from "@/main-axios";
|
|
|
|
/**
|
|
* Admin allowlists of private addresses that outbound requests may reach, one
|
|
* per core feature that makes them.
|
|
*/
|
|
|
|
export async function getNotificationPrivateEndpoints(): Promise<string[]> {
|
|
try {
|
|
return (await authApi.get("/users/notification-private-endpoints")).data
|
|
.hosts;
|
|
} catch (error) {
|
|
throw handleApiError(error, "get notification endpoint allowlist");
|
|
}
|
|
}
|
|
|
|
export async function setNotificationPrivateEndpoints(
|
|
hosts: string[],
|
|
): Promise<string[]> {
|
|
try {
|
|
return (
|
|
await authApi.patch("/users/notification-private-endpoints", { hosts })
|
|
).data.hosts;
|
|
} catch (error) {
|
|
throw handleApiError(error, "update notification endpoint allowlist");
|
|
}
|
|
}
|