UNPKG

@elastic.io/maester-client

Version:
53 lines (52 loc) 1.66 kB
import { Readable, Duplex } from 'stream'; import { AxiosRequestConfig } from 'axios'; export declare const TTL_HEADER = "x-eio-ttl"; export declare const CONTENT_TYPE_HEADER = "content-type"; export interface StreamBasedRequestConfig { getFreshStream?: () => Promise<Readable>; axiosReqConfig: AxiosRequestConfig; } export interface reqWithBodyHeaders { [TTL_HEADER]?: number; [CONTENT_TYPE_HEADER]?: string; [index: `x-query-${string}`]: string | number; [index: `x-meta-${string}`]: string | number; } export interface reqHeaders { responseType?: ResponseType; } export interface ReqOptions extends reqHeaders { jwtPayloadOrToken?: JWTPayload | string; retryOptions?: RetryOptions; } export interface ReqWithBodyOptions { jwtPayloadOrToken?: JWTPayload | string; retryOptions?: RetryOptions; headers?: reqWithBodyHeaders; } export interface RetryOptions { retriesCount?: number; requestTimeout?: number; } export interface JWTPayload { tenantId?: string; contractId?: string; workspaceId?: string; flowId?: string; userId?: string; } export type searchObjectCriteria = string | object; export type uploadData = string | object | number | Array<any>; export type TransformMiddleware = () => Duplex; export type ResponseType = 'stream' | 'json' | 'arraybuffer'; export declare const DEFAULT_RESPONSE_TYPE: ResponseType; export declare const RETRIES_COUNT: { readonly minValue: 0; readonly defaultValue: 2; readonly maxValue: 4; }; export declare const REQUEST_TIMEOUT: { readonly minValue: 500; readonly defaultValue: 10000; readonly maxValue: 20000; };