import { ConnectorLogger, RequestObserver, HttpRequest, HttpResponse } from '@rawdash/connector-shared'; export { ConnectorLogger, ConnectorLoggerOptions, LogFields, createDefaultConnectorLogger, noopConnectorLogger } from '@rawdash/connector-shared'; import { z } from 'zod'; type FilterOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'contains'; interface FilterCondition { field: string; op: FilterOperator; value: string | number | boolean; } type FilterClause = FilterCondition | { or: FilterCondition[]; }; type Secret = { $secret: string; }; type SecretRef = Secret; declare function secret(name: string): Secret; declare function isSecret(value: unknown): value is Secret; declare const secretRefSchema: z.ZodType; declare function withSecretRef(schema: T): z.ZodUnion<[T, z.ZodType]>; interface SecretsResolver { resolve(name: string): unknown; } declare class EnvSecretsResolver implements SecretsResolver { resolve(name: string): unknown; } declare function extractSecretNames(value: unknown): string[]; declare function resolveSecrets(obj: T, resolver: SecretsResolver): T; interface ConnectorCost { recommendedInterval?: string; minInterval?: string; perSync?: string; warning?: string; } type ConnectorSchemas = Readonly>; type ConnectorClass = { new (settings: never, creds?: never, ctx?: ConnectorContext): Connector; readonly credentials?: CredentialsSchema; readonly schemas: ConnectorSchemas; readonly resources?: ResourceDefinitions; readonly cost?: ConnectorCost; }; type ConnectorRegistry = Record; declare function instantiateConnector(entry: ConfiguredConnector, registry: ConnectorRegistry, secretsResolver?: SecretsResolver, logger?: ConnectorLogger): Connector; interface ResourceField { name: string; description: string; unit?: string; } interface ResourceFilterField { field: string; ops: FilterOperator[]; values?: (string | number)[]; } interface ResourceDefBase { description: string; endpoint?: string; notes?: string; dynamic?: boolean; responses?: Readonly>; } type ResourceDefinition = (ResourceDefBase & { shape: 'entity'; fields?: ResourceField[]; filterable: ResourceFilterField[]; }) | (ResourceDefBase & { shape: 'event'; fields?: ResourceField[]; filterable: ResourceFilterField[]; }) | (ResourceDefBase & { shape: 'metric'; unit?: string; granularity?: string; dimensions?: ResourceField[]; measures?: ResourceField[]; }) | (ResourceDefBase & { shape: 'distribution'; kind?: 'buckets' | 'quantiles'; unit?: string; }) | (ResourceDefBase & { shape: 'edge'; from?: string; to?: string; }); type ResourceDefinitions = Readonly>; declare function defineResources(defs: T): T; type UnionToIntersection = (U extends unknown ? (x: U) => void : never) extends (x: infer I) => void ? I : never; type ResponsesOf = UnionToIntersection<{ [K in keyof T]: T[K] extends { responses: infer R; } ? R extends Readonly> ? R : object : object; }[keyof T]>; declare function schemasFromResources(defs: T): ResponsesOf & ConnectorSchemas; interface WidgetFormat { kind: 'currency' | 'number' | 'percent' | 'duration' | 'bytes'; currency?: string; decimals?: number; compact?: boolean; } interface ResolvedWidgetFormat extends WidgetFormat { scale?: number; } declare function currencyScaleFromUnit(unit: string | undefined): number; interface RetentionConfig { maxAge?: number; maxSize?: number; floor?: number; intervalMs?: number; } interface RetentionSpec { fetchSpecs?: Record; watermarks?: Record; gracePeriodMs?: number; } interface RetentionDeletionPlan { events: Event[]; metrics: MetricSample[]; distributions: Distribution[]; entities: Entity[]; } declare function selectForDeletion(rows: T[], getTs: (row: T) => number, config: RetentionConfig, nowMs?: number): T[]; declare function computeRetention(handle: StorageHandle, spec: RetentionSpec, nowMs?: number): Promise; declare const widgetFormatSchema: z.ZodObject<{ kind: z.ZodEnum<{ number: "number"; currency: "currency"; percent: "percent"; duration: "duration"; bytes: "bytes"; }>; currency: z.ZodOptional; decimals: z.ZodOptional; compact: z.ZodOptional; }, z.core.$strip>; declare const shapeSchema: z.ZodEnum<{ entity: "entity"; event: "event"; metric: "metric"; distribution: "distribution"; edge: "edge"; }>; declare const aggFnSchema: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; declare const filterOperatorSchema: z.ZodEnum<{ eq: "eq"; neq: "neq"; gt: "gt"; gte: "gte"; lt: "lt"; lte: "lte"; contains: "contains"; }>; declare const filterConditionSchema: z.ZodObject<{ field: z.ZodString; op: z.ZodEnum<{ eq: "eq"; neq: "neq"; gt: "gt"; gte: "gte"; lt: "lt"; lte: "lte"; contains: "contains"; }>; value: z.ZodUnion; }, z.core.$strip>; declare const filterClauseSchema: z.ZodUnion; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>; declare const groupBySchema: z.ZodObject<{ field: z.ZodString; granularity: z.ZodEnum<{ hour: "hour"; day: "day"; week: "week"; month: "month"; }>; }, z.core.$strip>; declare const computedMetricSchema: z.ZodObject<{ connectorId: z.ZodString; shape: z.ZodEnum<{ entity: "entity"; event: "event"; metric: "metric"; distribution: "distribution"; edge: "edge"; }>; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>; declare const metricOrMetricsSchema: z.ZodUnion; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>, z.ZodArray; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>>]>; declare const mergeFnSchema: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; }>; declare const metricAggregateSchema: z.ZodObject<{ fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; }>; label: z.ZodOptional; }, z.core.$strip>; declare const statWidgetSchema: z.ZodObject<{ kind: z.ZodLiteral<"stat">; title: z.ZodString; metric: z.ZodUnion; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>, z.ZodArray; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>>]>; aggregate: z.ZodOptional; label: z.ZodOptional; }, z.core.$strip>>; window: z.ZodOptional; compare: z.ZodDefault>; format: z.ZodOptional; currency: z.ZodOptional; decimals: z.ZodOptional; compact: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>; declare const statusWidgetSchema: z.ZodObject<{ kind: z.ZodLiteral<"status">; title: z.ZodString; source: z.ZodUnion]>; }, z.core.$strip>; declare const timeseriesWidgetSchema: z.ZodObject<{ kind: z.ZodLiteral<"timeseries">; title: z.ZodString; metric: z.ZodUnion; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>, z.ZodArray; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>>]>; aggregate: z.ZodOptional; label: z.ZodOptional; }, z.core.$strip>>; window: z.ZodString; granularity: z.ZodDefault>; format: z.ZodOptional; currency: z.ZodOptional; decimals: z.ZodOptional; compact: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>; declare const distributionWidgetSchema: z.ZodObject<{ kind: z.ZodLiteral<"distribution">; title: z.ZodString; metric: z.ZodUnion; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>, z.ZodArray; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>>]>; aggregate: z.ZodOptional; label: z.ZodOptional; }, z.core.$strip>>; window: z.ZodString; format: z.ZodOptional; currency: z.ZodOptional; decimals: z.ZodOptional; compact: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>; declare const widgetSchemas: { readonly stat: z.ZodObject<{ kind: z.ZodLiteral<"stat">; title: z.ZodString; metric: z.ZodUnion; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>, z.ZodArray; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>>]>; aggregate: z.ZodOptional; label: z.ZodOptional; }, z.core.$strip>>; window: z.ZodOptional; compare: z.ZodDefault>; format: z.ZodOptional; currency: z.ZodOptional; decimals: z.ZodOptional; compact: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>; readonly status: z.ZodObject<{ kind: z.ZodLiteral<"status">; title: z.ZodString; source: z.ZodUnion]>; }, z.core.$strip>; readonly timeseries: z.ZodObject<{ kind: z.ZodLiteral<"timeseries">; title: z.ZodString; metric: z.ZodUnion; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>, z.ZodArray; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>>]>; aggregate: z.ZodOptional; label: z.ZodOptional; }, z.core.$strip>>; window: z.ZodString; granularity: z.ZodDefault>; format: z.ZodOptional; currency: z.ZodOptional; decimals: z.ZodOptional; compact: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>; readonly distribution: z.ZodObject<{ kind: z.ZodLiteral<"distribution">; title: z.ZodString; metric: z.ZodUnion; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>, z.ZodArray; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>>]>; aggregate: z.ZodOptional; label: z.ZodOptional; }, z.core.$strip>>; window: z.ZodString; format: z.ZodOptional; currency: z.ZodOptional; decimals: z.ZodOptional; compact: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>; }; declare const widgetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"stat">; title: z.ZodString; metric: z.ZodUnion; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>, z.ZodArray; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>>]>; aggregate: z.ZodOptional; label: z.ZodOptional; }, z.core.$strip>>; window: z.ZodOptional; compare: z.ZodDefault>; format: z.ZodOptional; currency: z.ZodOptional; decimals: z.ZodOptional; compact: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"status">; title: z.ZodString; source: z.ZodUnion]>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"timeseries">; title: z.ZodString; metric: z.ZodUnion; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>, z.ZodArray; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>>]>; aggregate: z.ZodOptional; label: z.ZodOptional; }, z.core.$strip>>; window: z.ZodString; granularity: z.ZodDefault>; format: z.ZodOptional; currency: z.ZodOptional; decimals: z.ZodOptional; compact: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"distribution">; title: z.ZodString; metric: z.ZodUnion; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>, z.ZodArray; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>>]>; aggregate: z.ZodOptional; label: z.ZodOptional; }, z.core.$strip>>; window: z.ZodString; format: z.ZodOptional; currency: z.ZodOptional; decimals: z.ZodOptional; compact: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>], "kind">; type WidgetKind = keyof typeof widgetSchemas; declare function getWidgetSchema(kind: WidgetKind): z.ZodObject<{ kind: z.ZodLiteral<"stat">; title: z.ZodString; metric: z.ZodUnion; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>, z.ZodArray; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>>]>; aggregate: z.ZodOptional; label: z.ZodOptional; }, z.core.$strip>>; window: z.ZodOptional; compare: z.ZodDefault>; format: z.ZodOptional; currency: z.ZodOptional; decimals: z.ZodOptional; compact: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip> | z.ZodObject<{ kind: z.ZodLiteral<"status">; title: z.ZodString; source: z.ZodUnion]>; }, z.core.$strip> | z.ZodObject<{ kind: z.ZodLiteral<"timeseries">; title: z.ZodString; metric: z.ZodUnion; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>, z.ZodArray; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>>]>; aggregate: z.ZodOptional; label: z.ZodOptional; }, z.core.$strip>>; window: z.ZodString; granularity: z.ZodDefault>; format: z.ZodOptional; currency: z.ZodOptional; decimals: z.ZodOptional; compact: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip> | z.ZodObject<{ kind: z.ZodLiteral<"distribution">; title: z.ZodString; metric: z.ZodUnion; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>, z.ZodArray; name: z.ZodOptional; entityType: z.ZodOptional; field: z.ZodOptional; fn: z.ZodEnum<{ count: "count"; sum: "sum"; avg: "avg"; min: "min"; max: "max"; latest: "latest"; first: "first"; }>; window: z.ZodOptional; filter: z.ZodOptional; value: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ or: z.ZodArray; value: z.ZodUnion; }, z.core.$strip>>; }, z.core.$strip>]>>>; groupBy: z.ZodOptional; }, z.core.$strip>>; label: z.ZodOptional; }, z.core.$strip>>]>; aggregate: z.ZodOptional; label: z.ZodOptional; }, z.core.$strip>>; window: z.ZodString; format: z.ZodOptional; currency: z.ZodOptional; decimals: z.ZodOptional; compact: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>; type AggFn = 'count' | 'sum' | 'avg' | 'min' | 'max' | 'latest' | 'first'; type Shape = 'event' | 'entity' | 'metric' | 'edge' | 'distribution'; interface GroupBy { field: string; granularity: 'hour' | 'day' | 'week' | 'month'; } interface Metric { connector: { name: string; }; shape: Shape; name?: string; entityType?: string; field?: string; fn: AggFn; window?: string; filter?: FilterClause[]; groupBy?: GroupBy; label?: string; } interface ComputedMetric { readonly connectorId: string; readonly shape: Shape; readonly name?: string; readonly entityType?: string; readonly field?: string; readonly fn: AggFn; readonly window?: string; readonly filter?: FilterClause[]; readonly groupBy?: GroupBy; readonly label?: string; } type MergeFn = 'count' | 'sum' | 'avg' | 'min' | 'max'; interface MetricAggregate { fn: MergeFn; label?: string; } interface StatWidget { kind: 'stat'; title: string; metric: ComputedMetric | ComputedMetric[]; aggregate?: MetricAggregate; window?: string; compare?: 'none' | 'previous-period'; format?: WidgetFormat; } interface StatusWidget { kind: 'status'; title: string; source: string | string[]; } interface TimeseriesWidget { kind: 'timeseries'; title: string; metric: ComputedMetric | ComputedMetric[]; aggregate?: MetricAggregate; window: string; granularity?: 'hour' | 'day' | 'week'; format?: WidgetFormat; } interface DistributionWidget { kind: 'distribution'; title: string; metric: ComputedMetric | ComputedMetric[]; aggregate?: MetricAggregate; window: string; format?: WidgetFormat; } type Widget = StatWidget | StatusWidget | TimeseriesWidget | DistributionWidget; declare function widgetMetrics(widget: Widget): ComputedMetric[]; declare function statusSources(widget: StatusWidget): string[]; declare function widgetConnectorIds(widget: Widget): string[]; interface ConfiguredConnector { name: string; connectorId: string; config: Record; syncIntervalSeconds?: number; enabled?: boolean; displayName?: string; } declare const DEFAULT_SYNC_INTERVAL_SECONDS = 300; interface NormalizedConfiguredConnector extends ConfiguredConnector { syncIntervalSeconds: number; enabled: boolean; displayName: string; } declare function normalizeConfiguredConnector(entry: ConfiguredConnector): NormalizedConfiguredConnector; interface Dashboard { widgets: Record; } interface DashboardConfig { connectors: ConfiguredConnector[]; dashboards: Record; retention?: RetentionConfig; } declare function defineDashboard(options: { widgets: Record; }): Dashboard; declare function defineMetric(options: Metric): ComputedMetric; declare function defineConfig(config: DashboardConfig): DashboardConfig; interface FetchSpec { filter?: FilterClause[]; requiredWindowMs?: number; } interface ResourceBackfill { specs: FetchSpec[]; } type ConnectorBackfill = Map; declare function computeConnectorBackfill(config: DashboardConfig): Map; declare function fetchSpecsForConnector(config: DashboardConfig, connectorName: string): Record | undefined; type Granularity = 'hour' | 'day' | 'week' | 'month'; declare function parseWindowMs(window: string): number | null; declare function truncateToGranularity(ts: number, granularity: string): string; declare function bucketStartMs(ts: number, granularity: Granularity): number; declare function nextBucketStartMs(bucketStart: number, granularity: Granularity): number; declare function finerGranularity(a: Granularity, b: Granularity): Granularity; type JSONValue = string | number | boolean | null | JSONValue[] | { [key: string]: JSONValue; }; interface Event { name: string; start_ts: number; end_ts: number | null; attributes: Record; } interface Entity { type: string; id: string; attributes: Record; updated_at: number; } interface MetricSample { name: string; ts: number; value: number; attributes: Record; } interface Edge { from_type: string; from_id: string; kind: string; to_type: string; to_id: string; attributes: Record; updated_at: number; } type Distribution = { name: string; ts: number; kind: 'histogram'; data: { buckets: Array<{ le: number; count: number; }>; count: number; sum: number; }; attributes: Record; } | { name: string; ts: number; kind: 'summary'; data: { quantiles: Array<{ q: number; value: number; }>; count: number; sum: number; }; attributes: Record; }; interface EventQuery { name?: string; start?: number; end?: number; } interface EntityQuery { type?: string; } interface MetricQuery { name?: string; start?: number; end?: number; } interface EdgeQuery { fromType?: string; fromId?: string; kind?: string; toType?: string; toId?: string; } interface DistributionQuery { name?: string; start?: number; end?: number; } interface RollupPartials { count: number; numericCount: number; sum: number; min: number | null; max: number | null; firstTs: number | null; firstValue: JSONValue; latestTs: number | null; latestValue: JSONValue; } interface RollupBucket { resource: string; field: string; granularity: Granularity; dims: Record; bucketStart: number; partials: RollupPartials; } interface RollupQuery { resource: string; field?: string; granularity?: Granularity; start?: number; end?: number; } interface DeleteByIdentityTargets { events?: readonly Event[]; metrics?: readonly MetricSample[]; distributions?: readonly Distribution[]; entities?: readonly Entity[]; } interface StorageHandle { event(e: Event): Promise; entity(e: Entity): Promise; metric(m: MetricSample): Promise; edge(e: Edge): Promise; distribution(d: Distribution): Promise; events(es: Event[], scope?: { names?: string[]; }): Promise; entities(es: Entity[], scope?: { types?: string[]; }): Promise; metrics(ms: MetricSample[], scope?: { names?: string[]; replaceWindow?: { start: number; end: number; }; }): Promise; edges(es: Edge[], scope?: { kinds?: string[]; }): Promise; distributions(ds: Distribution[], scope?: { names?: string[]; replaceWindow?: { start: number; end: number; }; }): Promise; queryEvents(q: EventQuery): Promise; getEntity(type: string, id: string): Promise; queryEntities(q: EntityQuery): Promise; queryMetrics(q: MetricQuery): Promise; traverse(q: EdgeQuery): Promise; queryDistributions(q: DistributionQuery): Promise; deleteOlderThan(shape: 'events' | 'metrics' | 'distributions', tsUnixMs: number): Promise<{ rowsDeleted: number; }>; deleteByIdentity?(targets: DeleteByIdentityTargets): Promise<{ rowsDeleted: number; }>; writeRollups?(buckets: RollupBucket[]): Promise; queryRollups?(q: RollupQuery): Promise; getRollupWatermark?(resource: string): Promise; setRollupWatermark?(resource: string, tsUnixMs: number): Promise; } interface ConnectorHealth { status: 'idle' | 'syncing' | 'error' | 'auth_failed' | 'paused'; lastSyncAt: string | null; lastError: string | null; syncIntervalSeconds: number; } interface CredentialField { description: string; auth?: 'none' | 'optional' | 'required'; } type CredentialsSchema = Record; type InferCredentials = { [K in keyof TCreds]: TCreds[K] extends { auth: 'required'; } ? string : string | undefined; }; type InferCredentialInput = { [K in keyof TCreds]: TCreds[K] extends { auth: 'required'; } ? string | Secret : string | Secret | undefined; }; interface SyncOptions { mode: 'full' | 'latest'; since?: string; cursor?: unknown; resources?: ReadonlySet; pageSize?: number; requiredWindowMs?: Record; fetchSpecs?: Record; } declare function resolveBackfillCutoff(options: Pick, resource: string, now: number): number | null; declare function resolveSpecCutoff(requiredWindowMs: number | undefined, now: number): number | null; interface SyncResult { done: boolean; cursor?: unknown; transientError?: unknown; } interface Connector { readonly id: string; readonly credentials?: CredentialsSchema; serializeConfig(): Record; sync(options: SyncOptions, storage: StorageHandle, signal?: AbortSignal): Promise; } interface ConnectorContext { observer?: RequestObserver; secretsResolver?: SecretsResolver; logger?: ConnectorLogger; } interface ConnectorRequestOptions { resource: string; requestId?: string; } interface RetryPolicy { maxAttempts?: number; initialDelayMs?: number; maxDelayMs?: number; signal?: AbortSignal; } declare abstract class BaseConnector implements Connector { abstract readonly id: string; readonly credentials?: TCreds; protected settings: TSettings; protected creds: InferCredentials; private rawCredInput; private ctx; private cachedLogger; constructor(settings: TSettings, creds?: InferCredentialInput, ctx?: ConnectorContext); protected get logger(): ConnectorLogger; protected request(req: HttpRequest, opts: ConnectorRequestOptions): Promise>; protected get(url: string, opts: ConnectorRequestOptions & { headers?: Record; signal?: AbortSignal; rateLimit?: HttpRequest['rateLimit']; }): Promise>; protected post(url: string, opts: ConnectorRequestOptions & { body?: HttpRequest['body']; headers?: Record; signal?: AbortSignal; rateLimit?: HttpRequest['rateLimit']; }): Promise>; protected isResourceEnabled(resource: R): boolean; serializeConfig(): Record; protected sleep(ms: number, signal?: AbortSignal): Promise; protected withRetry(fn: (signal?: AbortSignal) => Promise<{ status: 'done'; value: T; } | { status: 'retry'; }>, options?: RetryPolicy): Promise; abstract sync(options: SyncOptions, storage: StorageHandle, signal?: AbortSignal): Promise; } declare function defineConnector(): >(def: { id: string; credentials?: TCreds; sync: (this: { settings: TSettings; creds: InferCredentials; }, options: SyncOptions, storage: StorageHandle, signal?: AbortSignal) => Promise; }) => { new (settings: TSettings, creds?: InferCredentialInput, ctx?: ConnectorContext): Connector; readonly id: string; readonly credentials: TCreds | undefined; }; declare const DEFAULT_MAX_CHUNK_MS = 30000; interface ChunkedSyncCursor { phase: TPhase; page: TPage | null; spec?: number; } declare function selectActivePhases(resourceToPhase: (resource: R) => P, order: readonly P[], enabled: readonly R[] | undefined): P[]; declare function makeChunkedCursorGuard(phases: readonly TPhase[]): (value: unknown) => value is ChunkedSyncCursor; interface FetchPageResult { items: unknown[]; next: TPage | null; } interface ChunkedSyncOptions { phases: readonly TPhase[]; cursor: ChunkedSyncCursor | undefined; signal: AbortSignal | undefined; fetchPage: (phase: TPhase, page: TPage | null, signal: AbortSignal | undefined, spec: number) => Promise>; writeBatch: (phase: TPhase, items: unknown[], page: TPage | null, spec: number) => Promise; specCount?: (phase: TPhase) => number; logger?: ConnectorLogger; maxChunkMs?: number; pipeline?: boolean; now?: () => number; } declare function paginateChunked(opts: ChunkedSyncOptions): Promise; declare function renderConfigSource(config: DashboardConfig): string; type SyncStatus = 'idle' | 'queued' | 'running' | 'succeeded' | 'failed'; interface SyncState { status: SyncStatus; queuedAt: string | null; startedAt: string | null; lastSyncAt: string | null; lastError: string | null; } declare const ACTIVE_SYNC_STATUSES: ReadonlySet; declare const DEFAULT_SYNC_STATE: SyncState; declare function isSyncActive(status: SyncStatus): boolean; declare function healthStatusFromSyncStatus(status: SyncStatus): 'idle' | 'syncing' | 'error'; type WidgetSyncState = 'fresh' | 'stale' | 'unsynced' | 'syncing' | 'failing'; type WidgetStatus = 'ok' | 'no_data' | 'error'; interface WidgetSeries { key: string; connectorId: string; label: string; data: TData | null; status?: WidgetStatus; syncState?: WidgetSyncState; syncIntervalSeconds?: number; matchedRows?: number; format?: ResolvedWidgetFormat; errorMessage?: string; } interface CachedWidget { widgetId: string; connectorId: string; data: TData | null; series?: WidgetSeries[]; cachedAt: string | null; syncState?: WidgetSyncState; syncIntervalSeconds?: number; format?: ResolvedWidgetFormat; meta?: Record; status?: WidgetStatus; errorMessage?: string; } interface WidgetsListResponse { widgets: CachedWidget[]; } interface HealthResponse { status: 'ok'; } interface TriggerSyncResponse { queued: boolean; } interface DataSource { getWidget(dashboardId: string, widgetId: string): Promise; getWidgets(dashboardId: string): Promise; getHealth(): Promise; getSyncState(): Promise; triggerSync(): Promise; ensureFresh(maxAgeMs?: number): Promise; } interface ServerDataSource { getWidget(dashboardId: string, widgetId: string): Promise; getWidgets(dashboardId: string): Promise; getHealth(): Promise; getSyncState(): Promise; triggerSync(): Promise; } interface MergedPoint { date: string; value: number | null; } interface MergeSeriesOptions { fn?: MergeFn; } declare function mergeSeries(series: readonly WidgetSeries[], opts?: MergeSeriesOptions): MergedPoint[]; declare function mergeSeriesScalar(series: readonly WidgetSeries[], opts?: MergeSeriesOptions): number | null; type ConfigFieldsSchema = z.ZodObject; declare function defineConfigFields(schema: z.ZodObject): z.ZodObject; declare const connectorCategorySchema: z.ZodEnum<{ engineering: "engineering"; product: "product"; analytics: "analytics"; marketing: "marketing"; sales: "sales"; support: "support"; finance: "finance"; infrastructure: "infrastructure"; security: "security"; hr: "hr"; mobile: "mobile"; }>; type ConnectorCategory = z.infer; declare const connectorDocSchema: z.ZodObject<{ displayName: z.ZodString; category: z.ZodEnum<{ engineering: "engineering"; product: "product"; analytics: "analytics"; marketing: "marketing"; sales: "sales"; support: "support"; finance: "finance"; infrastructure: "infrastructure"; security: "security"; hr: "hr"; mobile: "mobile"; }>; tagline: z.ZodString; brandColor: z.ZodOptional; vendor: z.ZodObject<{ name: z.ZodString; domain: z.ZodString; apiDocs: z.ZodOptional; website: z.ZodOptional; }, z.core.$strip>; auth: z.ZodObject<{ summary: z.ZodString; setup: z.ZodArray; }, z.core.$strip>; rateLimit: z.ZodOptional; limitations: z.ZodOptional>; }, z.core.$strip>; type ConnectorDoc = z.infer; declare function defineConnectorDoc(doc: ConnectorDoc): ConnectorDoc; declare const ENUM_CANDIDATE_CAP = 32; type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue; }; type PrimitiveType = 'string' | 'number' | 'boolean' | 'null'; type StringSchema = { type: 'string'; enum?: string[]; freeform?: boolean; }; type NumberSchema = { type: 'number'; }; type BooleanSchema = { type: 'boolean'; }; type NullSchema = { type: 'null'; }; type ObjectSchema = { type: 'object'; properties: Record; required: string[]; }; type ArraySchema = { type: 'array'; items?: Schema; }; type UnionSchema = { type: 'union'; anyOf: Schema[]; }; type Schema = StringSchema | NumberSchema | BooleanSchema | NullSchema | ObjectSchema | ArraySchema | UnionSchema; type DiffKind = 'type-change' | 'new-field' | 'removed-field' | 'required-became-optional' | 'optional-became-required' | 'new-enum-value' | 'enum-widened'; type DiffEntry = { path: string; kind: 'type-change'; detail: { from: string; to: string; }; } | { path: string; kind: 'new-field'; detail: { required: boolean; }; } | { path: string; kind: 'removed-field'; detail: Record; } | { path: string; kind: 'required-became-optional'; detail: Record; } | { path: string; kind: 'optional-became-required'; detail: Record; } | { path: string; kind: 'new-enum-value'; detail: { values: string[]; }; } | { path: string; kind: 'enum-widened'; detail: { from: 'enum'; to: 'freeform'; }; }; declare function infer(value: JsonValue): Schema; declare function merge(a: Schema, b: Schema): Schema; declare function canonicalize(schema: Schema): unknown; declare function stableStringify(value: unknown): string; declare function fingerprint(schema: Schema): Promise; declare function diff(baseline: Schema, observed: Schema): DiffEntry[]; type DriftSeverity = 'breaking' | 'noise'; type ValidationErrorKind = 'type-mismatch' | 'missing-required-field' | 'value-not-in-enum'; interface ValidationError { path: string; kind: ValidationErrorKind; detail: Record; } interface ValidationResult { severity: DriftSeverity; errors: ValidationError[]; } declare function validateObserved(baseline: Schema, observed: Schema): ValidationResult; type FieldNames = F extends readonly { name: infer N extends string; }[] ? N : never; type MetricAttributeKeys = R extends { shape: 'metric'; } ? FieldNames | FieldNames : never; type MetricAttributes = [ MetricAttributeKeys ] extends [never] ? Record : Partial, JSONValue>>; type MetricSampleInput = { ts: number; value: number; attributes?: MetricAttributes; }; declare function metricSample(resources: T, name: K, sample: MetricSampleInput): MetricSample; type MetricIssueSeverity = 'error' | 'warning'; interface MetricValidationIssue { ref: string; severity: MetricIssueSeverity; message: string; } interface MetricValidationResult { errors: MetricValidationIssue[]; warnings: MetricValidationIssue[]; } type ResourcesByConnectorId = Readonly>>; declare function resourcesByConnectorIdFromRegistry(registry: ConnectorRegistry): ResourcesByConnectorId; declare function validateConfigMetrics(config: DashboardConfig, resourcesByConnectorId: ResourcesByConnectorId): MetricValidationResult; declare function formatMetricIssues(issues: MetricValidationIssue[]): string; interface MetricComputation { value: unknown; matchedRows: number; } declare function computeMetric(storage: StorageHandle, metric: ComputedMetric): Promise; declare function computeMetricWithStatus(storage: StorageHandle, metric: ComputedMetric): Promise; declare function isRollupShape(shape: Shape): boolean; declare function emptyPartials(): RollupPartials; declare function foldValueIntoPartials(partials: RollupPartials, ts: number, value: JSONValue | undefined): void; declare function mergePartials(a: RollupPartials, b: RollupPartials): RollupPartials; declare function aggFromPartials(fn: AggFn, partials: RollupPartials): unknown; declare function dimsKey(dims: Record): string; interface RollupSignature { fn: AggFn; field?: string; } interface RollupSpec { resource: string; shape: Shape; granularity: Granularity; dimFields: string[]; signatures: RollupSignature[]; } type ConnectorRollupSpecs = Map; declare function computeRollupSpecs(config: DashboardConfig): Map; interface FoldResult { resource: string; watermark: number; bucketsWritten: number; } declare function foldResourceRollups(handle: StorageHandle, spec: RollupSpec, now?: number): Promise; declare function foldConnectorRollups(handle: StorageHandle, specs: ConnectorRollupSpecs, now?: number): Promise; type RollupReadResult = { used: false; } | { used: true; value: unknown; matchedRows: number; }; declare function tryComputeMetricFromRollups(handle: StorageHandle, metric: ComputedMetric): Promise; declare const BACKFILL_CADENCE_MS: number; interface SyncSchedulingState { lastSyncAt: string | null; lastBackfillAt: string | null; } interface PlanSyncInput { lastSyncAt: Date | null; lastBackfillAt: Date | null; fetchSpecs: Record | undefined; now: Date; cadenceMs?: number; } interface PlanSyncResult { mode: 'full' | 'latest'; options: SyncOptions; backfillDue: boolean; } declare function fetchSpecsHaveRequiredWindow(fetchSpecs: Record | undefined): boolean; declare function planSync(input: PlanSyncInput): PlanSyncResult; declare function compareConnectorVersions(a: string, b: string): number; declare function latestVersion(versions: ReadonlyArray): string | null; interface RetryBackoffOptions { baseMs: number; ceilingMs: number; } declare function computeRetryBackoffMs(consecutiveErrors: number, opts: RetryBackoffOptions): number; declare function normalizeRetryAfter(retryAfter: Date | undefined, now: Date, maxSeconds: number): number; interface GetStorageHandleOptions { signal?: AbortSignal; } interface MarkConnectorSyncSucceededOptions { backfillDue?: boolean; } interface RekeyConnectorResult { rowsAffected: number; } interface ServerStorage { getStorageHandle(connectorId: string, options?: GetStorageHandleOptions): StorageHandle; getHealth(connectorId: string): Promise; getSyncState(): Promise; markSyncQueued(): Promise; markSyncRunning?(): Promise; markSyncSucceeded(): Promise; markSyncFailed(error: string): Promise; getConnectorSyncState?(connectorId: string): Promise; markConnectorSyncSucceeded?(connectorId: string, options?: MarkConnectorSyncSucceededOptions): Promise; rekeyConnectorId?(fromConnectorId: string, toConnectorId: string): Promise; } declare function resolveWidget(dashboardId: string, widgetId: string, widget: Widget, connectors: readonly string[] | undefined, storage: ServerStorage, resourcesByConnectorId?: ResourcesByConnectorId): Promise; declare function hashWidgetConfig(widget: Widget): string; declare function computeWidgetEtag(lastSyncAt: string | null, widget: Widget): string; declare function withAbortSignal(handle: StorageHandle, signal: AbortSignal): StorageHandle; declare class InMemoryStorage implements ServerStorage { private eventStore; private entityStore; private metricStore; private edgeStore; private distributionStore; private rollupStore; private rollupWatermark; private lastWriteAt; private connectorSyncState; private syncState; getStorageHandle(connectorId: string, options?: GetStorageHandleOptions): StorageHandle; private buildHandle; getHealth(connectorId: string): Promise; getConnectorSyncState(connectorId: string): Promise; markConnectorSyncSucceeded(connectorId: string, options?: MarkConnectorSyncSucceededOptions): Promise; getSyncState(): Promise; markSyncQueued(): Promise; markSyncRunning(): Promise; markSyncSucceeded(): Promise; markSyncFailed(error: string): Promise; } declare const wireConnectorSchema: z.ZodObject<{ name: z.ZodString; connectorId: z.ZodString; displayName: z.ZodOptional; config: z.ZodRecord; syncIntervalSeconds: z.ZodOptional; enabled: z.ZodOptional; }, z.core.$strip>; declare const wireDashboardSchema: z.ZodObject<{ id: z.ZodOptional; name: z.ZodString; slug: z.ZodString; config: z.ZodRecord; }, z.core.$strip>; declare const wireConfigSchema: z.ZodObject<{ connectors: z.ZodOptional; config: z.ZodRecord; syncIntervalSeconds: z.ZodOptional; enabled: z.ZodOptional; }, z.core.$strip>>>; dashboards: z.ZodOptional; name: z.ZodString; slug: z.ZodString; config: z.ZodRecord; }, z.core.$strip>>>; }, z.core.$strip>; type WireConnector = z.infer; type WireDashboard = z.infer; type WireConfig = z.infer; declare function toWireConfig(config: DashboardConfig): WireConfig; export { ACTIVE_SYNC_STATUSES, type AggFn, type ArraySchema, BACKFILL_CADENCE_MS, BaseConnector, type BooleanSchema, type CachedWidget, type ChunkedSyncCursor, type ChunkedSyncOptions, type ComputedMetric, type ConfigFieldsSchema, type ConfiguredConnector, type Connector, type ConnectorBackfill, type ConnectorCategory, type ConnectorClass, type ConnectorContext, type ConnectorCost, type ConnectorDoc, type ConnectorHealth, type ConnectorRegistry, type ConnectorRequestOptions, type ConnectorRollupSpecs, type ConnectorSchemas, type CredentialField, type CredentialsSchema, DEFAULT_MAX_CHUNK_MS, DEFAULT_SYNC_INTERVAL_SECONDS, DEFAULT_SYNC_STATE, type Dashboard, type DashboardConfig, type DataSource, type DeleteByIdentityTargets, type DiffEntry, type DiffKind, type Distribution, type DistributionQuery, type DistributionWidget, type DriftSeverity, ENUM_CANDIDATE_CAP, type Edge, type EdgeQuery, type Entity, type EntityQuery, EnvSecretsResolver, type Event, type EventQuery, type FetchPageResult, type FetchSpec, type FilterClause, type FilterCondition, type FilterOperator, type FoldResult, type GetStorageHandleOptions, type Granularity, type GroupBy, type HealthResponse, InMemoryStorage, type InferCredentialInput, type InferCredentials, type JSONValue, type JsonValue, type MarkConnectorSyncSucceededOptions, type MergeFn, type MergeSeriesOptions, type MergedPoint, type Metric, type MetricAggregate, type MetricAttributeKeys, type MetricAttributes, type MetricComputation, type MetricIssueSeverity, type MetricQuery, type MetricSample, type MetricSampleInput, type MetricValidationIssue, type MetricValidationResult, type NormalizedConfiguredConnector, type NullSchema, type NumberSchema, type ObjectSchema, type PlanSyncInput, type PlanSyncResult, type PrimitiveType, type RekeyConnectorResult, type ResolvedWidgetFormat, type ResourceBackfill, type ResourceDefinition, type ResourceDefinitions, type ResourceField, type ResourceFilterField, type ResourcesByConnectorId, type RetentionConfig, type RetentionDeletionPlan, type RetentionSpec, type RetryBackoffOptions, type RollupBucket, type RollupPartials, type RollupQuery, type RollupReadResult, type RollupSignature, type RollupSpec, type Schema, type Secret, type SecretRef, type SecretsResolver, type ServerDataSource, type ServerStorage, type Shape, type StatWidget, type StatusWidget, type StorageHandle, type StringSchema, type SyncOptions, type SyncResult, type SyncSchedulingState, type SyncState, type SyncStatus, type TimeseriesWidget, type TriggerSyncResponse, type UnionSchema, type ValidationError, type ValidationErrorKind, type ValidationResult, type Widget, type WidgetFormat, type WidgetKind, type WidgetSeries, type WidgetStatus, type WidgetSyncState, type WidgetsListResponse, type WireConfig, type WireConnector, type WireDashboard, aggFnSchema, aggFromPartials, bucketStartMs, canonicalize, compareConnectorVersions, computeConnectorBackfill, computeMetric, computeMetricWithStatus, computeRetention, computeRetryBackoffMs, computeRollupSpecs, computeWidgetEtag, computedMetricSchema, connectorCategorySchema, connectorDocSchema, currencyScaleFromUnit, defineConfig, defineConfigFields, defineConnector, defineConnectorDoc, defineDashboard, defineMetric, defineResources, diff, dimsKey, distributionWidgetSchema, emptyPartials, extractSecretNames, fetchSpecsForConnector, fetchSpecsHaveRequiredWindow, filterClauseSchema, filterConditionSchema, filterOperatorSchema, finerGranularity, fingerprint, foldConnectorRollups, foldResourceRollups, foldValueIntoPartials, formatMetricIssues, getWidgetSchema, groupBySchema, hashWidgetConfig, healthStatusFromSyncStatus, infer, instantiateConnector, isRollupShape, isSecret, isSyncActive, latestVersion, makeChunkedCursorGuard, merge, mergeFnSchema, mergePartials, mergeSeries, mergeSeriesScalar, metricAggregateSchema, metricOrMetricsSchema, metricSample, nextBucketStartMs, normalizeConfiguredConnector, normalizeRetryAfter, paginateChunked, parseWindowMs, planSync, renderConfigSource, resolveBackfillCutoff, resolveSecrets, resolveSpecCutoff, resolveWidget, resourcesByConnectorIdFromRegistry, schemasFromResources, secret, secretRefSchema, selectActivePhases, selectForDeletion, shapeSchema, stableStringify, statWidgetSchema, statusSources, statusWidgetSchema, timeseriesWidgetSchema, toWireConfig, truncateToGranularity, tryComputeMetricFromRollups, validateConfigMetrics, validateObserved, widgetConnectorIds, widgetFormatSchema, widgetMetrics, widgetSchema, widgetSchemas, wireConfigSchema, wireConnectorSchema, wireDashboardSchema, withAbortSignal, withSecretRef };