import { AirbyteConnector } from '../connector'; import { AirbyteCatalogMessage, AirbyteConfig, AirbyteConfiguredCatalog, AirbyteMessage, AirbyteSourceIdentityMessage, AirbyteState } from '../protocol'; /** * Airbyte Source * https://docs.airbyte.io/understanding-airbyte/airbyte-specification#source */ export declare abstract class AirbyteSource extends AirbyteConnector { /** * Whether this source opts in to applying defaults from spec.json at * runtime before executing commands. */ useSpecDefaults(): boolean; /** * @returns An AirbyteCatalog representing the available streams and fields in * this integration. For example, given valid credentials to a Postgres * database, returns an Airbyte catalog where each postgres table is a stream, * and each table column is a field. */ abstract discover(config: Config): Promise; /** * Override this method to update the config before running the connector. * The returned config will be passed to the source and destination. */ onBeforeRun(config: Config): Promise; /** * Override this method to update the config before the check command runs. * Only called for the explicit `check` command, not for the pre-read * connection validation that runs in the same process as a sync. */ onBeforeCheck(config: Config): Promise; /** * Override this method to update the config before running the connector. * For example - you might want to run a filter on a list of strings, one * which would require an async call. In that case, this method should be * added to your base class, e.g. the "{AirbyteName}Source" class, for an * example look at the CircleCISource. */ onBeforeRead(config: Config, catalog: AirbyteConfiguredCatalog, state?: AirbyteState): Promise<{ config: Config; catalog: AirbyteConfiguredCatalog; state?: AirbyteState; }>; /** * Override this method to perform any action with the config after * running the connector. * For example - you might want to add some logging or stats. Take a * look at the JiraSource for an example. */ onAfterRead(config: Config): Promise; /** * Builds the source identity message that carries the redacted config, * source type, mode and connector version. The source runner emits this as * the very first output of a sync — before the pre-read connection check — * so the destination can resolve account identity (faros_source_id) even * when the check fails and read() is never reached. It is kept distinct from * the source config message (emitted by read()) so the destination does not * re-run source-config runtime side effects for it. * * Returns undefined for sources that do not extend AirbyteSourceBase. */ sourceIdentityMessage(_state: AirbyteState, _redactedConfig: AirbyteConfig, _config: Config, _redactedUserConfig?: AirbyteConfig): AirbyteSourceIdentityMessage | undefined; /** * @returns A generator of the AirbyteMessages generated by reading the source * with the given configuration, catalog, and state. */ abstract read(config: Config, redactedConfig: AirbyteConfig, catalog: AirbyteConfiguredCatalog, state: AirbyteState, redactedUserConfig?: AirbyteConfig): AsyncGenerator; }