/** * Type definitions for the Grepr CLI tool */ import { type AgentSessionEventsIcebergTableSourceSortOrder, PathsV1JobsGetParametersQueryExecution, PathsV1JobsGetParametersQueryProcessing, PathsV1JobsGetParametersQueryState, type SchemaReadDatadog, type SchemaReadDataWarehouse, type SchemaReadS3DataWarehouse, type SchemaReadNewRelic, type SchemaReadOtlp, type SchemaReadSplunk, type SchemaReadSumo, type SchemaOperation } from './openapi/openApiTypes.js'; import type { SourcePredicateOptions } from './lib/query-predicate.js'; import type { SignalSourceInputs } from './lib/signal-source.js'; export type AuthMethod = 'oauth' | 'client-credentials' | 'none'; export type QueryEngine = 'athena' | 'flink' | 'trino'; /** * The concrete query engine a query will execute against, resolved locally from the explicit * `queryEngine` option with Athena as the default. */ export type ResolvedQueryEngine = { kind: 'athena'; } | { kind: 'flink'; } | { kind: 'trino'; }; export interface CliOptions { orgName: string; apiBaseUrl?: string; authBaseUrl: string; authMethod: AuthMethod; queryEngine?: QueryEngine; debug?: boolean; quiet?: boolean; clientId: string; clientSecret?: string; timezone?: string; conf?: string; output?: string; authCache: boolean; browser: boolean; } export interface SavedCliConfig { orgName?: string; apiBaseUrl?: string; authBaseUrl?: string; authMethod?: AuthMethod; clientId?: string; clientSecret?: string; timezone?: string; authCache: boolean; browser: boolean; } export interface CliConfigFile { _default?: string; [configName: string]: SavedCliConfig | string | undefined; } export interface FormattableCommandOptions extends CliOptions { format?: 'table' | 'pretty' | 'raw' | 'compact' | 'csv'; sort?: string; color?: boolean; timestamps?: boolean; jobState?: boolean; maxDepth?: number; maxLines?: number; } export interface QueryCommandOptions extends FormattableCommandOptions, SignalSourceInputs, SourcePredicateOptions { sortOrder?: AgentSessionEventsIcebergTableSourceSortOrder; start?: string; end?: string; limit?: number; } export interface JobPlanCommandOptions extends CliOptions { jobId?: string; patch?: string; color?: boolean; dryRun?: boolean; } export interface JobApplyCommandOptions extends CliOptions { force?: boolean; rollbackEnabled?: boolean; } export interface JobDraftCommandOptions extends CliOptions { /** * Draft the live pipeline as-is with no edits (no plan file). Fetches the * job by id and runs the current config through draft mode. Mutually * exclusive with the positional plan-file argument. */ jobId?: string; /** * Job-graph backend only. `maxAllowedRate` (messages/sec) for the * logs-event-sampler inserted after each live source. Omitted by default so * the server's sampler default applies, mirroring the UI's template drafts. */ sampleRate?: number; /** * Job-graph backend only. `maxBurstLimit` (messages) for the inserted * logs-event-sampler. Defaults to the UI draft value when omitted. */ sampleBurst?: number; /** Wall-clock cap in seconds; the streaming sync job is aborted client-side after it. */ maxDurationSeconds?: number; /** * Template backend only. Path to a JSON array (or NDJSON, one event per line) * of LogEvents to draft the proposed pipeline against instead of live traffic. * Injected as the template input's `draftSource` (a bounded logs-values-source) * and forces the draft to run as BATCH so the bounded source runs to completion * and streams its sink-source-tagged outputs back. This is the deterministic * equivalent of drafting against a signal's sample, avoiding the HEARTBEAT-only * result sparse live traffic produces. */ sampleLogs?: string; } export interface ApiClientConfig { orgName: string; apiBaseUrl: string; authBaseUrl: string; authMethod: AuthMethod; clientId: string; clientSecret?: string; authCache: boolean; browser: boolean; debug: boolean; } export interface ProcessStats { recordsProcessed: number; heartbeatsSent: number; errors: number; errorMessages: string[]; startTime: number | null; endTime: number | null; duration?: string; } export interface EventRecord { jobState: string; data?: LogEventData; heartbeatToken?: string; } export interface LogEventData { id?: string; receivedTimestamp?: string | number; eventTimestamp?: string | number; tags?: Record; severity?: string; message?: string; [key: string]: unknown; } export declare const STREAM_EVENTS: { HEARTBEAT_REQUEST: string; DATA: string; FINISHED: string; FAILED: string; CANCELLED: string; TIMED_OUT: string; SCANNED_MAX: string; QUERY_TOO_LARGE: string; PARSE_ERROR: string; }; export declare const HEARTBEAT_EVENTS: { REQUEST: string; SENT: string; ERROR: string; RETRY: string; }; export interface CommandOption { flags: string; description: string; defaultValue?: string | boolean | string[]; parser?: (value: string) => string | boolean | number; } export { PathsV1JobsGetParametersQueryExecution as JobExecution, PathsV1JobsGetParametersQueryProcessing as JobProcessing, PathsV1JobsGetParametersQueryState as JobState }; export type MergeConfiguration = (options: Record) => Promise; export type CommandOptionValue = string | boolean | number | string[]; export type CommandOptionsRecord = Record; export type IntegrationReadType = SchemaReadDatadog | SchemaReadDataWarehouse | SchemaReadS3DataWarehouse | SchemaReadNewRelic | SchemaReadOtlp | SchemaReadSplunk | SchemaReadSumo; export interface IntegrationTypeAndList { type: T['type']; items: T[]; } export declare const DEFAULT_INPUT = "input"; export declare const DEFAULT_OUTPUT = "output"; export declare const DEFAULT_LIMIT = 100; export interface IO { name: string; vertex: Vertex; } export declare class Vertex { name: string; operation: SchemaOperation; prev: Map; next: Map; constructor(operation: SchemaOperation); addPrev(inputPort: string, prev: IO, addToPrev?: boolean): void; addNext(outputPort: string, next: IO, addToNext?: boolean): void; removePrev(inputPort: string, prev: IO, removeFromPrev?: boolean): void; removeNext(outputPort: string, next: IO, removeFromNext?: boolean): void; } //# sourceMappingURL=types.d.ts.map