import { apiRequest } from "@/shared/api/request";
import { API_ENDPOINTS, API_OPERATIONS, apiEndpointPath } from "@/shared/api/generated/endpoints";
import type { ApiList, AdminAppDto } from "@/shared/api/types";

export function listAdminApps(): Promise<ApiList<AdminAppDto>> {
    const endpoint = API_ENDPOINTS.listApps;
    return apiRequest<ApiList<AdminAppDto>>(apiEndpointPath(API_OPERATIONS.listApps), {
        method: endpoint.method
    });
}

export function listVisibleAdminApps(): Promise<ApiList<AdminAppDto>> {
    const endpoint = API_ENDPOINTS.listVisibleApps;
    return apiRequest<ApiList<AdminAppDto>>(apiEndpointPath(API_OPERATIONS.listVisibleApps), {
        method: endpoint.method
    });
}
