import { z } from 'zod'; import { type APIClient } from '../api.ts'; import { type AnalyticsOptions, type OrgAnalytics, type QueueAnalytics, type SSEStatsEvent, type StreamAnalyticsOptions, type TimeSeriesData } from './types.ts'; export declare const OrgAnalyticsResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ success: z.ZodLiteral; message: z.ZodString; code: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ success: z.ZodLiteral; data: z.ZodObject<{ analytics: z.ZodObject<{ org_id: z.ZodString; period: z.ZodObject<{ start: z.ZodString; end: z.ZodString; granularity: z.ZodOptional>; }, z.core.$strip>; summary: z.ZodObject<{ total_queues: z.ZodNumber; total_messages_published: z.ZodNumber; total_messages_delivered: z.ZodNumber; total_messages_acknowledged: z.ZodNumber; total_dlq_messages: z.ZodNumber; total_bytes_published: z.ZodNumber; avg_latency_ms: z.ZodNumber; p95_latency_ms: z.ZodNumber; error_rate_percent: z.ZodNumber; }, z.core.$strip>; queues: z.ZodArray>; }, z.core.$strip>; }, z.core.$strip>; }, z.core.$strip>], "success">; export declare const QueueAnalyticsResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ success: z.ZodLiteral; message: z.ZodString; code: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ success: z.ZodLiteral; data: z.ZodObject<{ analytics: z.ZodObject<{ queue_id: z.ZodString; queue_name: z.ZodString; queue_type: z.ZodString; period: z.ZodObject<{ start: z.ZodString; end: z.ZodString; granularity: z.ZodOptional>; }, z.core.$strip>; current: z.ZodObject<{ backlog: z.ZodNumber; dlq_count: z.ZodNumber; messages_in_flight: z.ZodNumber; active_consumers: z.ZodNumber; oldest_message_age_seconds: z.ZodOptional>; }, z.core.$strip>; period_stats: z.ZodObject<{ messages_published: z.ZodNumber; messages_delivered: z.ZodNumber; messages_acknowledged: z.ZodNumber; messages_failed: z.ZodNumber; messages_replayed: z.ZodNumber; bytes_published: z.ZodNumber; delivery_attempts: z.ZodNumber; retry_count: z.ZodNumber; }, z.core.$strip>; latency: z.ZodObject<{ avg_ms: z.ZodNumber; p50_ms: z.ZodOptional; p95_ms: z.ZodOptional; p99_ms: z.ZodOptional; max_ms: z.ZodOptional; }, z.core.$strip>; consumer_latency: z.ZodObject<{ avg_ms: z.ZodNumber; p50_ms: z.ZodOptional; p95_ms: z.ZodOptional; p99_ms: z.ZodOptional; max_ms: z.ZodOptional; }, z.core.$strip>; destinations: z.ZodOptional; last_success_at: z.ZodOptional>; last_failure_at: z.ZodOptional>; }, z.core.$strip>>>; }, z.core.$strip>; }, z.core.$strip>; }, z.core.$strip>], "success">; export declare const TimeSeriesResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ success: z.ZodLiteral; message: z.ZodString; code: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ success: z.ZodLiteral; data: z.ZodObject<{ timeseries: z.ZodObject<{ queue_id: z.ZodString; queue_name: z.ZodString; period: z.ZodObject<{ start: z.ZodString; end: z.ZodString; granularity: z.ZodOptional>; }, z.core.$strip>; series: z.ZodArray; backlog: z.ZodOptional; messages_in_flight: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>; }, z.core.$strip>; }, z.core.$strip>], "success">; /** * Get org-level analytics for all queues. * * Returns aggregated statistics across all queues in the organization. * * @param client - The API client instance * @param options - Analytics options (time range, filters) * @returns Org-level analytics summary * @throws {QueueError} If the API request fails * * @example * ```typescript * const analytics = await getOrgAnalytics(client, { * start: '2026-01-14T00:00:00Z', * end: '2026-01-15T00:00:00Z', * }); * console.log(`Total queues: ${analytics.summary.total_queues}`); * console.log(`Messages published: ${analytics.summary.total_messages_published}`); * ``` */ export declare function getOrgAnalytics(client: APIClient, options?: AnalyticsOptions): Promise; /** * Get org-level time series analytics. * * Returns published and delivery metrics aggregated across all queues. * * @param client - The API client instance * @param options - Analytics options (time range, filters) * @returns Time series analytics data for the org * @throws {QueueError} If the API request fails */ export declare function getOrgTimeSeries(client: APIClient, options?: AnalyticsOptions): Promise; /** * Get detailed analytics for a specific queue. * * Returns current state, period statistics, latency metrics, and destination stats. * * @param client - The API client instance * @param name - The queue name * @param options - Analytics options (time range, filters) * @returns Queue analytics * @throws {QueueNotFoundError} If the queue does not exist * @throws {QueueError} If the API request fails * * @example * ```typescript * const analytics = await getQueueAnalytics(client, 'order-processing', { * start: '2026-01-14T00:00:00Z', * }); * console.log(`Backlog: ${analytics.current.backlog}`); * console.log(`P95 latency: ${analytics.latency.p95_ms}ms`); * ``` */ export declare function getQueueAnalytics(client: APIClient, name: string, options?: AnalyticsOptions): Promise; /** * Get time series analytics data for a queue. * * Returns time-bucketed metrics for visualization in charts and graphs. * * @param client - The API client instance * @param name - The queue name * @param options - Analytics options (time range, granularity) * @returns Time series data * @throws {QueueNotFoundError} If the queue does not exist * @throws {QueueError} If the API request fails * * @example * ```typescript * const timeseries = await getQueueTimeSeries(client, 'order-processing', { * granularity: 'hour', * start: '2026-01-14T00:00:00Z', * }); * for (const point of timeseries.series) { * console.log(`${point.timestamp}: ${point.throughput} msg/h`); * } * ``` */ export declare function getQueueTimeSeries(client: APIClient, name: string, options?: AnalyticsOptions): Promise; /** * Stream real-time analytics for all queues via SSE. * * Returns an async iterator that yields stats events at the specified interval. * The connection stays open until the iterator is closed or an error occurs. * * @param client - The API client instance * @param options - Stream options (interval, orgId) * @returns Async iterator of SSE stats events * * @example * ```typescript * const stream = streamOrgAnalytics(client, { interval: 5 }); * for await (const event of stream) { * console.log(`Backlog: ${event.backlog}, Throughput: ${event.throughput_1m}/min`); * } * ``` */ export declare function streamOrgAnalytics(client: APIClient, options?: StreamAnalyticsOptions): AsyncGenerator; /** * Stream real-time analytics for a specific queue via SSE. * * Returns an async iterator that yields stats events at the specified interval. * * @param client - The API client instance * @param name - The queue name * @param options - Stream options (interval, orgId) * @returns Async iterator of SSE stats events * * @example * ```typescript * const stream = streamQueueAnalytics(client, 'order-processing', { interval: 5 }); * for await (const event of stream) { * console.log(`Backlog: ${event.backlog}, In-flight: ${event.messages_in_flight}`); * } * ``` */ export declare function streamQueueAnalytics(client: APIClient, name: string, options?: StreamAnalyticsOptions): AsyncGenerator; //# sourceMappingURL=analytics.d.ts.map