mwbot-ts - v1.2.6
    Preparing search index...

    Interface MwbotRequestConfig

    Configuration options for Mwbot's request methods, extending Axios's request config.

    These options are per-request options and should be passed to request methods as needed. To set default options for all requests, provide them in the Mwbot.constructor or update them with Mwbot.setRequestOptions.

    When passed to a request method, these options are recursively merged with default options. The priority order is:

    where userRequestOptions is the options set by the user with the constructor or the setRequestOptions method. Higher-priority options override lower ones if they share the same properties.

    interface MwbotRequestConfig {
        adapter?: AxiosAdapterConfig | AxiosAdapterConfig[];
        allowAbsoluteUrls?: boolean;
        auth?: AxiosBasicCredentials;
        baseURL?: string;
        beforeRedirect?: (
            options: Record<string, any>,
            responseDetails: {
                headers: Record<string, string>;
                statusCode: HttpStatusCode;
            },
        ) => void;
        cancelToken?: CancelToken;
        data?: any;
        decompress?: boolean;
        disableAbort?: boolean;
        disableRetry?: boolean;
        disableRetryAPI?: boolean;
        disableRetryByCode?: string[];
        env?: { FormData?: new (...args: any[]) => object };
        family?: AddressFamily;
        fetchOptions?: Record<string, any>;
        formSerializer?: FormSerializerOptions;
        headers?:
            | AxiosHeaders
            | Partial<
                RawAxiosHeaders & {
                    Accept: AxiosHeaderValue;
                    Authorization: AxiosHeaderValue;
                    "Content-Encoding": AxiosHeaderValue;
                    "Content-Length": AxiosHeaderValue;
                    "User-Agent": AxiosHeaderValue;
                } & { "Content-Type": ContentType },
            > & Partial<
                {
                    delete: AxiosHeaders;
                    get: AxiosHeaders;
                    head: AxiosHeaders;
                    link: AxiosHeaders;
                    options: AxiosHeaders;
                    patch: AxiosHeaders;
                    post: AxiosHeaders;
                    purge: AxiosHeaders;
                    put: AxiosHeaders;
                    unlink: AxiosHeaders;
                } & { common: AxiosHeaders },
            >;
        httpAgent?: any;
        httpsAgent?: any;
        insecureHTTPParser?: boolean;
        jar?: CookieJar;
        lookup?:
            | (
                (
                    hostname: string,
                    options: object,
                    cb: (
                        err: null | Error,
                        address: LookupAddress | LookupAddress[],
                        family?: AddressFamily,
                    ) => void,
                ) => void
            )
            | (
                (
                    hostname: string,
                    options: object,
                ) => Promise<
                    | LookupAddress
                    | [
                        address: LookupAddressEntry
                        | LookupAddressEntry[],
                        family?: AddressFamily,
                    ],
                >
            );
        maxBodyLength?: number;
        maxContentLength?: number;
        maxRate?: number | [number, number];
        maxRedirects?: number;
        method?: string;
        onDownloadProgress?: (progressEvent: AxiosProgressEvent) => void;
        onUploadProgress?: (progressEvent: AxiosProgressEvent) => void;
        params?: any;
        paramsSerializer?: ParamsSerializerOptions | CustomParamsSerializer;
        proxy?: false | AxiosProxyConfig;
        responseEncoding?: string;
        responseType?: ResponseType;
        signal?: GenericAbortSignal;
        socketPath?: null | string;
        timeout?: number;
        timeoutErrorMessage?: string;
        transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[];
        transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[];
        transitional?: TransitionalOptions;
        transport?: any;
        url?: string;
        validateStatus?: null | ((status: number) => boolean);
        withCredentials?: boolean;
        withXSRFToken?:
            | boolean
            | ((config: InternalAxiosRequestConfig) => undefined | boolean);
        xsrfCookieName?: string;
        xsrfHeaderName?: string;
    }

    Hierarchy

    • AxiosRequestConfig
      • MwbotRequestConfig
    Index

    Properties

    adapter?: AxiosAdapterConfig | AxiosAdapterConfig[]
    allowAbsoluteUrls?: boolean
    auth?: AxiosBasicCredentials
    baseURL?: string
    beforeRedirect?: (
        options: Record<string, any>,
        responseDetails: {
            headers: Record<string, string>;
            statusCode: HttpStatusCode;
        },
    ) => void
    cancelToken?: CancelToken
    data?: any
    decompress?: boolean
    disableAbort?: boolean

    Whether to disable request abortion.

    By default, all requests are abortable. Set this to true to explicitly disable this behavior.

    disableRetry?: boolean

    Whether to disable automatic retries entirely. If set to true, no retries will be attempted for any type of failure.

    See also disableRetryAPI.

    disableRetryAPI?: boolean

    Whether to disable automatic retries for API-related errors. If set to true, retries will not be attempted for errors returned by the API itself.

    HTTP-related errors (e.g., Request timeout (408)) will still be retried.

    disableRetryByCode?: string[]

    A list of error codes for which automatic retries should be disabled.

    If a request fails due to one of these error codes, it will not be retried.

    env?: { FormData?: new (...args: any[]) => object }
    family?: AddressFamily
    fetchOptions?: Record<string, any>
    formSerializer?: FormSerializerOptions
    headers?:
        | AxiosHeaders
        | Partial<
            RawAxiosHeaders & {
                Accept: AxiosHeaderValue;
                Authorization: AxiosHeaderValue;
                "Content-Encoding": AxiosHeaderValue;
                "Content-Length": AxiosHeaderValue;
                "User-Agent": AxiosHeaderValue;
            } & { "Content-Type": ContentType },
        > & Partial<
            {
                delete: AxiosHeaders;
                get: AxiosHeaders;
                head: AxiosHeaders;
                link: AxiosHeaders;
                options: AxiosHeaders;
                patch: AxiosHeaders;
                post: AxiosHeaders;
                purge: AxiosHeaders;
                put: AxiosHeaders;
                unlink: AxiosHeaders;
            } & { common: AxiosHeaders },
        >
    httpAgent?: any
    httpsAgent?: any
    insecureHTTPParser?: boolean
    jar?: CookieJar
    lookup?:
        | (
            (
                hostname: string,
                options: object,
                cb: (
                    err: null | Error,
                    address: LookupAddress | LookupAddress[],
                    family?: AddressFamily,
                ) => void,
            ) => void
        )
        | (
            (
                hostname: string,
                options: object,
            ) => Promise<
                | LookupAddress
                | [
                    address: LookupAddressEntry
                    | LookupAddressEntry[],
                    family?: AddressFamily,
                ],
            >
        )
    maxBodyLength?: number
    maxContentLength?: number
    maxRate?: number | [number, number]
    maxRedirects?: number
    method?: string
    onDownloadProgress?: (progressEvent: AxiosProgressEvent) => void
    onUploadProgress?: (progressEvent: AxiosProgressEvent) => void
    params?: any
    paramsSerializer?: ParamsSerializerOptions | CustomParamsSerializer
    proxy?: false | AxiosProxyConfig
    responseEncoding?: string
    responseType?: ResponseType
    signal?: GenericAbortSignal
    socketPath?: null | string
    timeout?: number
    timeoutErrorMessage?: string
    transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[]
    transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[]
    transitional?: TransitionalOptions
    transport?: any
    url?: string
    validateStatus?: null | ((status: number) => boolean)
    withCredentials?: boolean
    withXSRFToken?:
        | boolean
        | ((config: InternalAxiosRequestConfig) => undefined | boolean)
    xsrfCookieName?: string
    xsrfHeaderName?: string