services -> domains

This commit is contained in:
2026-07-10 20:46:22 +00:00
parent 3c99d26830
commit 79c0c32b98
45 changed files with 1447 additions and 1270 deletions

View File

@@ -1,7 +1,7 @@
import type {
Status,
GlobalConfig,
GlobalConfigResponse,
CentralState,
CentralStateResponse,
HealthResponse,
StatusResponse,
NetworkInfo,
@@ -51,35 +51,35 @@ class ApiService {
// ========================================
// Global Config APIs (Wild Central level)
// Endpoint: /api/v1/config
// Endpoint: /api/v1/state
// ========================================
async getConfig(): Promise<GlobalConfigResponse> {
return this.request<GlobalConfigResponse>('/api/v1/config');
async getConfig(): Promise<CentralStateResponse> {
return this.request<CentralStateResponse>('/api/v1/state');
}
async getConfigYaml(): Promise<string> {
return this.requestText('/api/v1/config/yaml');
return this.requestText('/api/v1/state/yaml');
}
async updateConfigYaml(yamlContent: string): Promise<StatusResponse> {
return this.request<StatusResponse>('/api/v1/config/yaml', {
return this.request<StatusResponse>('/api/v1/state/yaml', {
method: 'PUT',
headers: { 'Content-Type': 'text/plain' },
body: yamlContent
});
}
async createConfig(config: GlobalConfig): Promise<StatusResponse> {
return this.request<StatusResponse>('/api/v1/config', {
async createConfig(config: CentralState): Promise<StatusResponse> {
return this.request<StatusResponse>('/api/v1/state', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(config)
});
}
async updateConfig(config: GlobalConfig): Promise<StatusResponse> {
return this.request<StatusResponse>('/api/v1/config', {
async updateConfig(config: CentralState): Promise<StatusResponse> {
return this.request<StatusResponse>('/api/v1/state', {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(config)