IQRF Repository API client class

Client is a wrapper around API methods of IQRF Repository providing shared configuration for Axios instance.

const client = new Client();
const config: AxiosRequestConfig = {
baseURL: 'https://devrepo.iqrfalliance.org/api/',
};
const client = new Client({config});
const config: AxiosRequestConfig = {
baseURL: 'https://repository.iqrfalliance.org/api/',
}
const axiosInstance = axios.create(config);
const client = new Client({axiosInstance

Constructors

Methods

  • Clears all request interceptors

    Returns void

  • Clears all response interceptors

    Returns void

  • Ejects a request interceptor

    Parameters

    • interceptorId: number

      Interceptor ID

    Returns void

  • Ejects a response interceptor

    Parameters

    • interceptorId: number

      Interceptor ID

    Returns void

  • Checks if client has credentials set

    Returns boolean

    true if client has credentials set, false otherwise

  • Adds a request interceptor

    Parameters

    • OptionalonFulfilled: null | ((value: InternalAxiosRequestConfig<any>) => InternalAxiosRequestConfig<any> | Promise<InternalAxiosRequestConfig<any>>)

      Fulfilled callback

    • OptionalonRejected: null | ((error: any) => any)

      Rejected callback

    • Optionaloptions: AxiosInterceptorOptions

      Interceptor options

    Returns number

    Interceptor ID

  • Adds a response interceptor

    Parameters

    Returns number

    Interceptor ID