UNPKG

open-lineage-client

Version:

TypeScript/JavaScript client for creating and sending OpenLineage standard events.

70 lines (69 loc) 2.55 kB
import { AxiosRequestConfig } from 'axios'; import { HttpConfig } from '../transports/HttpTransport.js'; import { TransportConfig } from '../transports/Factory.js'; /** * Builder for creating HttpConfig instances. * Simplifies the creation of HttpConfig objects with many parameters. */ export declare class HttpConfigBuilder { private url; private options; private token; private maxRetries; private initialRetryDelay; private maxRetryDelay; private retryStatusCodes; /** * Creates a new HttpConfigBuilder. * @param url - The URL for the HTTP transport (required). */ constructor(url: string); /** * Sets the Axios request options. * @param options - The Axios request options. * @returns The builder instance for method chaining. */ setOptions(options: AxiosRequestConfig): this; /** * Sets the authorization token. * @param token - The authorization token. * @returns The builder instance for method chaining. */ setToken(token: string): this; /** * Sets the maximum number of retry attempts. * @param maxRetries - The maximum number of retry attempts. * @returns The builder instance for method chaining. */ setMaxRetries(maxRetries: number): this; /** * Sets the initial delay in milliseconds before retrying. * @param initialRetryDelay - The initial delay in milliseconds. * @returns The builder instance for method chaining. */ setInitialRetryDelay(initialRetryDelay: number): this; /** * Sets the maximum delay in milliseconds between retries. * @param maxRetryDelay - The maximum delay in milliseconds. * @returns The builder instance for method chaining. */ setMaxRetryDelay(maxRetryDelay: number): this; /** * Sets the HTTP status codes that should trigger a retry. * @param retryStatusCodes - The HTTP status codes that should trigger a retry. * @returns The builder instance for method chaining. */ setRetryStatusCodes(retryStatusCodes: number[]): this; /** * Builds and returns a new HttpConfig instance with the configured parameters. * @returns A new HttpConfig instance. */ build(): HttpConfig; /** * Creates an HttpConfig instance from a configuration object. * @param config - The transport configuration. * @returns A new HttpConfig instance. * @throws {Error} If the configuration is invalid. */ static fromConfig(config: TransportConfig): HttpConfig; }