/** * Resilience API Service * * Handles API communication for healthchecks, quotas, and fallbacks. */ import { IHealthcheckSchema, IHealthcheckStatus, IHealthcheckRunResult, IQuotaSchema, IQuotaRunOptions, IQuotaDispatchOptions, IFallbackSchema, IFallbackRunOptions, IFallbackDispatchOptions } from '../../resilience/types'; import { EnvType } from '../../types'; export interface IResilienceApiConfig { token: string; env_type: EnvType; base_url?: string; workspace_id?: string; user_id?: string; public_key?: string; access_key?: string; } export declare class ResilienceApiService { private client; private baseUrl; private authContext; constructor(config: IResilienceApiConfig); /** * Create a new healthcheck */ createHealthcheck(productTag: string, data: IHealthcheckSchema): Promise; /** * Get a healthcheck by tag */ getHealthcheck(productTag: string, tag: string): Promise; /** * Update a healthcheck */ updateHealthcheck(productTag: string, tag: string, data: Partial): Promise; /** * Delete a healthcheck */ deleteHealthcheck(productTag: string, tag: string): Promise; /** * List all healthchecks for a product */ listHealthchecks(productTag: string): Promise; /** * Get healthcheck status */ getHealthcheckStatus(productTag: string, tag: string, env: string): Promise; /** * Manually trigger a healthcheck */ runHealthcheck(productTag: string, tag: string, env: string): Promise; /** * Create a new quota */ createQuota(productTag: string, data: IQuotaSchema): Promise; /** * Get a quota by tag */ getQuota(productTag: string, tag: string): Promise; /** * Update a quota */ updateQuota(productTag: string, tag: string, data: Partial): Promise; /** * Delete a quota */ deleteQuota(productTag: string, tag: string): Promise; /** * List all quotas for a product */ listQuotas(productTag: string): Promise; /** * Run a quota */ runQuota(options: IQuotaRunOptions): Promise; /** * Dispatch/schedule a quota for later execution */ dispatchQuota(options: IQuotaDispatchOptions): Promise<{ jobId: string; }>; /** * Create a new fallback */ createFallback(productTag: string, data: IFallbackSchema): Promise; /** * Get a fallback by tag */ getFallback(productTag: string, tag: string): Promise; /** * Update a fallback */ updateFallback(productTag: string, tag: string, data: Partial): Promise; /** * Delete a fallback */ deleteFallback(productTag: string, tag: string): Promise; /** * List all fallbacks for a product */ listFallbacks(productTag: string): Promise; /** * Run a fallback */ runFallback(options: IFallbackRunOptions): Promise; /** * Dispatch/schedule a fallback for later execution */ dispatchFallback(options: IFallbackDispatchOptions): Promise<{ jobId: string; }>; } export default ResilienceApiService;