import { Dictionary } from 'ts-essentials'; /** * Field name for the special data field that contains the complete record data. * Used to preserve undeclared fields through the Airbyte platform. */ export declare const FAROS_DATA_FIELD = "__faros_data"; export declare const HEARTBEAT_FIELD = "__faros_heartbeat"; export declare enum AirbyteLogLevel { FATAL = "FATAL", ERROR = "ERROR", WARN = "WARN", INFO = "INFO", DEBUG = "DEBUG", TRACE = "TRACE" } export declare function AirbyteLogLevelOrder(level: AirbyteLogLevel): number; export declare enum AirbyteMessageType { CATALOG = "CATALOG", CONNECTION_STATUS = "CONNECTION_STATUS", LOG = "LOG", RECORD = "RECORD", SPEC = "SPEC", STATE = "STATE", TRACE = "TRACE" } export declare enum AirbyteConnectionStatus { SUCCEEDED = "SUCCEEDED", FAILED = "FAILED" } export declare enum AirbyteTraceFailureType { SYSTEM_ERROR = "system_error", CONFIG_ERROR = "config_error" } export interface AirbyteConfig { backfill?: boolean; check_connection?: boolean; describe_connection?: boolean; probe_streams?: boolean; debug?: boolean; faros_source_id?: string; skip_reset_models?: string[]; source_heartbeat_interval_ms?: number; /** JSON map of stream name to freshness hours. Skip streams synced within their freshness window. */ stream_freshness_hours?: string; [k: string]: any; } export declare function parseAirbyteMessage(s: string): AirbyteMessage; export interface AirbyteMessage { readonly type: AirbyteMessageType; } export declare enum SyncMode { FULL_REFRESH = "full_refresh", INCREMENTAL = "incremental" } export declare enum DestinationSyncMode { APPEND = "append", OVERWRITE = "overwrite", APPEND_DEDUP = "append_dedup" } export interface AirbyteStream { name: string; json_schema: Dictionary; supported_sync_modes?: SyncMode[]; source_defined_cursor?: boolean; default_cursor_field?: string[]; source_defined_primary_key?: string[][]; namespace?: string; } export interface AirbyteCatalog { streams: AirbyteStream[]; } export declare class AirbyteCatalogMessage implements AirbyteMessage { readonly catalog: AirbyteCatalog; readonly type: AirbyteMessageType; constructor(catalog: AirbyteCatalog); } export interface AirbyteConfiguredStream { stream: AirbyteStream; sync_mode: SyncMode; cursor_field?: string[]; destination_sync_mode?: DestinationSyncMode; primary_key?: string[][]; } export interface AirbyteConfiguredCatalog { streams: AirbyteConfiguredStream[]; } export declare class AirbyteConnectionStatusMessage implements AirbyteMessage { readonly connectionStatus: { status: AirbyteConnectionStatus; message?: string; }; readonly type: AirbyteMessageType; constructor(connectionStatus: { status: AirbyteConnectionStatus; message?: string; }); } export declare class AirbyteLog implements AirbyteMessage { readonly log: { level: AirbyteLogLevel; message: string; stack_trace?: string; }; readonly type: AirbyteMessageType; constructor(log: { level: AirbyteLogLevel; message: string; stack_trace?: string; }); static make(level: AirbyteLogLevel, message: string, stack_trace?: string): AirbyteLog; } export declare function isAirbyteLog(msg: AirbyteMessage): msg is AirbyteLog; export declare const AirbyteRawStreamPrefix = "_airbyte_raw_"; export declare const AirbyteRawABId = "_airbyte_ab_id"; export declare const AirbyteRawEmittedAt = "_airbyte_emitted_at"; export declare const AirbyteRawData = "_airbyte_data"; export declare class AirbyteRecord implements AirbyteMessage { readonly record: { stream: string; namespace?: string; emitted_at: number; data: Dictionary; }; readonly type: AirbyteMessageType; constructor(record: { stream: string; namespace?: string; emitted_at: number; data: Dictionary; }); isRaw(): boolean; unpackRaw(): AirbyteRecord; static make(stream: string, data: Dictionary, namespace?: string): AirbyteRecord; } export interface AirbyteTraceError { type: 'ERROR'; emitted_at: number; error: { message: string; internal_message?: string; stack_trace?: string; failure_type?: AirbyteTraceFailureType; }; } export declare class AirbyteTrace implements AirbyteMessage { readonly trace: { type: 'ERROR'; emitted_at: number; error: { message: string; internal_message?: string; stack_trace?: string; failure_type?: AirbyteTraceFailureType; }; }; readonly type: AirbyteMessageType; constructor(trace: { type: 'ERROR'; emitted_at: number; error: { message: string; internal_message?: string; stack_trace?: string; failure_type?: AirbyteTraceFailureType; }; }); static make(err: any, failure_type?: AirbyteTraceFailureType): AirbyteTrace; } export interface Spec { documentationUrl?: string; changelogUrl?: string; connectionSpecification: Dictionary; supportsIncremental?: boolean; supportsNormalization?: boolean; supportsDBT?: boolean; supported_destination_sync_modes?: DestinationSyncMode[]; } export declare class AirbyteSpec implements AirbyteMessage { readonly spec: Spec; readonly type: AirbyteMessageType; constructor(spec: Spec); } export interface AirbyteState { [stream: string]: any; } export interface SyncMessage { summary: string; code: number; action: string; entity?: string; details?: any; messages?: SyncMessage[]; type: 'ERROR' | 'WARNING'; } export interface AirbyteSourceStatusBase { status: 'ERRORED' | 'RUNNING' | 'SUCCESS'; } export interface AirbyteSourceErrorStatus extends AirbyteSourceStatusBase { status: 'ERRORED'; message: SyncMessage & { type: 'ERROR'; }; } export interface AirbyteSourceRunningStatus extends AirbyteSourceStatusBase { status: 'RUNNING'; message?: SyncMessage; } export interface AirbyteSourceSuccessStatus extends AirbyteSourceStatusBase { status: 'SUCCESS'; message?: SyncMessage; } export type AirbyteSourceStatus = AirbyteSourceErrorStatus | AirbyteSourceRunningStatus | AirbyteSourceSuccessStatus; export interface CompressedData { format: 'base64/gzip'; data: string; } export interface StreamDescriptor { name: string; namespace?: string; } export interface AirbyteStreamStateOutput { type: 'STREAM'; stream: { stream_descriptor: StreamDescriptor; stream_state: CompressedData; }; } export interface AirbyteStreamStateInput { type: 'STREAM'; stream: { stream_descriptor: StreamDescriptor; stream_state: CompressedData | Dictionary; }; } export type AirbyteLegacyCompressedState = CompressedData; export interface AirbyteLegacyState { [stream: string]: any; } export interface AirbyteLegacyStateOutput { data: CompressedData; } export type AirbyteInputState = AirbyteStreamStateInput | AirbyteLegacyCompressedState | AirbyteLegacyState; export type AirbyteOutputState = AirbyteStreamStateOutput | AirbyteLegacyStateOutput; export declare class AirbyteStateMessage implements AirbyteMessage { readonly state: AirbyteOutputState; readonly type: AirbyteMessageType; constructor(state: AirbyteOutputState); } export declare class AirbyteSourceStatusMessage extends AirbyteStateMessage { readonly state: AirbyteOutputState; readonly sourceStatus: AirbyteSourceStatus; readonly streamStatus?: { name: string; status: 'SUCCESS' | 'ERROR'; recordsEmitted?: number; }; constructor(state: AirbyteOutputState, sourceStatus: AirbyteSourceStatus, streamStatus?: { name: string; status: 'SUCCESS' | 'ERROR'; recordsEmitted?: number; }); } export declare class AirbyteSourceConfigMessage extends AirbyteStateMessage { readonly state: AirbyteOutputState; readonly redactedConfig: AirbyteConfig; readonly sourceType: string; readonly sourceMode?: string; readonly sourceVersion?: string; readonly redactedUserConfig?: AirbyteConfig; readonly type: AirbyteMessageType; constructor(state: AirbyteOutputState, redactedConfig: AirbyteConfig, sourceType: string, sourceMode?: string, sourceVersion?: string, redactedUserConfig?: AirbyteConfig); } /** * Account-identity metadata the source runner emits before the pre-read * connection check. Carries everything the destination needs to resolve and * persist the account (faros_source_id lives in redactedConfig), so account * identity can be resolved even when the check fails and read() is never * reached. Kept distinct from AirbyteSourceConfigMessage so the destination * does NOT re-run source-config runtime side effects (e.g. mock-data-feed * reset) for it — the config message emitted by read() remains the single * runtime-config signal. */ export interface AirbyteSourceIdentity { redactedConfig: AirbyteConfig; sourceType: string; sourceMode?: string; sourceVersion?: string; redactedUserConfig?: AirbyteConfig; } export declare class AirbyteSourceIdentityMessage extends AirbyteStateMessage { readonly state: AirbyteOutputState; readonly sourceIdentity: AirbyteSourceIdentity; readonly type: AirbyteMessageType; constructor(state: AirbyteOutputState, sourceIdentity: AirbyteSourceIdentity); } export interface AirbyteSourceLog { timestamp: number; message: { level: number; msg: string; stackTrace?: string; }; } export declare class AirbyteSourceLogsMessage extends AirbyteStateMessage { readonly state: AirbyteOutputState; readonly logs: AirbyteSourceLog[]; readonly type: AirbyteMessageType; constructor(state: AirbyteOutputState, logs: AirbyteSourceLog[]); } export declare function isStateMessage(msg: AirbyteMessage): msg is AirbyteStateMessage; export declare function isSourceStatusMessage(msg: AirbyteMessage): msg is AirbyteSourceStatusMessage; export declare function isSourceConfigMessage(msg: AirbyteMessage): msg is AirbyteSourceConfigMessage; export declare function isSourceLogsMessage(msg: AirbyteMessage): msg is AirbyteSourceLogsMessage; export declare function isSourceIdentityMessage(msg: AirbyteMessage): msg is AirbyteSourceIdentityMessage;