feat(observability): phase 3 - direct proxy creation with validation
Add standalone proxy management: - Multi-step validation pipeline (DNS, TCP, HTTP) with diagnostic hints - Proxy lifecycle: create/update/delete via NPM API with SSL auto-assign - Periodic health monitoring (5min) with event log on status transitions - Unified /api/proxies/all endpoint merging standalone + managed proxies - Frontend types and API functions for downstream UI phases
This commit is contained in:
@@ -9,11 +9,14 @@ import type {
|
||||
NpmCertificate,
|
||||
Project,
|
||||
ProjectDetail,
|
||||
ProxyView,
|
||||
Registry,
|
||||
RegistryImage,
|
||||
Settings,
|
||||
Stage,
|
||||
StageEnv,
|
||||
StandaloneProxy,
|
||||
ValidationResult,
|
||||
Volume
|
||||
} from './types';
|
||||
|
||||
@@ -365,4 +368,41 @@ export function fetchEventLogStats(): Promise<EventLogStats> {
|
||||
return get<EventLogStats>('/api/events/log/stats');
|
||||
}
|
||||
|
||||
// ── Proxies ─────────────────────────────────────────────────────────
|
||||
|
||||
export function validateProxy(host: string, port: number): Promise<ValidationResult> {
|
||||
return post<ValidationResult>('/api/proxies/validate', { host, port });
|
||||
}
|
||||
|
||||
export function createProxy(data: {
|
||||
domain: string;
|
||||
destination_url: string;
|
||||
destination_port: number;
|
||||
}): Promise<StandaloneProxy> {
|
||||
return post<StandaloneProxy>('/api/proxies', data);
|
||||
}
|
||||
|
||||
export function listProxies(): Promise<StandaloneProxy[]> {
|
||||
return get<StandaloneProxy[]>('/api/proxies');
|
||||
}
|
||||
|
||||
export function getProxy(id: string): Promise<StandaloneProxy> {
|
||||
return get<StandaloneProxy>(`/api/proxies/${id}`);
|
||||
}
|
||||
|
||||
export function updateProxy(
|
||||
id: string,
|
||||
data: { domain: string; destination_url: string; destination_port: number }
|
||||
): Promise<StandaloneProxy> {
|
||||
return put<StandaloneProxy>(`/api/proxies/${id}`, data);
|
||||
}
|
||||
|
||||
export function deleteProxy(id: string): Promise<{ deleted: string }> {
|
||||
return del<{ deleted: string }>(`/api/proxies/${id}`);
|
||||
}
|
||||
|
||||
export function listAllProxies(): Promise<ProxyView[]> {
|
||||
return get<ProxyView[]>('/api/proxies/all');
|
||||
}
|
||||
|
||||
export { ApiError };
|
||||
|
||||
Reference in New Issue
Block a user