src/base-apis.js
function MatrixBaseApis(opts) {
    utils.checkObjectHasKeys(opts, ["baseUrl", "request"]);

    this.baseUrl = opts.baseUrl;
    this.idBaseUrl = opts.idBaseUrl;

    const httpOpts = {
        baseUrl: opts.baseUrl,
        idBaseUrl: opts.idBaseUrl,
        accessToken: opts.accessToken,
        request: opts.request,
        prefix: httpApi.PREFIX_R0,
        onlyData: true,
        extraParams: opts.queryParams,
        localTimeoutMs: opts.localTimeoutMs,
        useAuthorizationHeader: opts.useAuthorizationHeader,
    };
    this._http = new httpApi.MatrixHttpApi(this, httpOpts);

    this._txnCtr = 0;
}
function MatrixBaseApis(opts) {
    utils.checkObjectHasKeys(opts, ["baseUrl", "request"]);

    this.baseUrl = opts.baseUrl;
    this.idBaseUrl = opts.idBaseUrl;

    const httpOpts = {
        baseUrl: opts.baseUrl,
        idBaseUrl: opts.idBaseUrl,
        accessToken: opts.accessToken,
        request: opts.request,
        prefix: httpApi.PREFIX_R0,
        onlyData: true,
        extraParams: opts.queryParams,
        localTimeoutMs: opts.localTimeoutMs,
        useAuthorizationHeader: opts.useAuthorizationHeader,
    };
    this._http = new httpApi.MatrixHttpApi(this, httpOpts);

    this._txnCtr = 0;
}
function MatrixBaseApis ( opts ) { utils . checkObjectHasKeys ( opts , [ "baseUrl" , "request" ] ) ; this . baseUrl = opts . baseUrl ; this . idBaseUrl = opts . idBaseUrl ; const httpOpts = { baseUrl : opts . baseUrl , idBaseUrl : opts . idBaseUrl , accessToken : opts . accessToken , request : opts . request , prefix : httpApi . PREFIX_R0 , onlyData : true , extraParams : opts . queryParams , localTimeoutMs : opts . localTimeoutMs , useAuthorizationHeader : opts . useAuthorizationHeader , } ; this . _http = new httpApi . MatrixHttpApi ( this , httpOpts ) ; this . _txnCtr = 0 ; }
Low-level wrappers for the Matrix APIs

@constructor

@param {Object} opts Configuration options

@param {string} opts.baseUrl Required. The base URL to the client-server
HTTP API.

@param {string} opts.idBaseUrl Optional. The base identity server URL for
identity server requests.

@param {Function} opts.request Required. The function to invoke for HTTP
requests. The value of this property is typically <code>require("request")
</code> as it returns a function which meets the required interface. See
{@link requestFunction} for more information.

@param {string} opts.accessToken The access_token for this user.

@param {Number=} opts.localTimeoutMs Optional. The default maximum amount of
time to wait before timing out HTTP requests. If not specified, there is no
timeout.

@param {Object} opts.queryParams Optional. Extra query parameters to append
to all requests with this client. Useful for application services which require
<code>?user_id=</code>.

@param {boolean} [opts.useAuthorizationHeader = false] Set to true to use
Authorization header instead of query param to send the access token to the server.
Low - level wrappers for the Matrix APIs