lib/cloud-request.js
function CloudRequest(options) {
    if (!(this instanceof CloudRequest)) return new CloudRequest(options);
    merge(this, defaultOptions, options);
    if (this.debug) debug.enabled = true;
    if (typeof this.request === 'undefined') {
        this.jar = request.jar();
        this.request = request.defaults({ jar: this.jar });
        if (this.debugNet) {
            this.request.debug = true;
            require('request-debug')(this.request);
        }
    }
    debug('CloudAPI-request initialized with options %o', options);
}
function CloudRequest(options) {
    if (!(this instanceof CloudRequest)) return new CloudRequest(options);
    merge(this, defaultOptions, options);
    if (this.debug) debug.enabled = true;
    if (typeof this.request === 'undefined') {
        this.jar = request.jar();
        this.request = request.defaults({ jar: this.jar });
        if (this.debugNet) {
            this.request.debug = true;
            require('request-debug')(this.request);
        }
    }
    debug('CloudAPI-request initialized with options %o', options);
}
function CloudRequest ( options ) { if ( ! ( this instanceof CloudRequest ) ) return new CloudRequest ( options ) ; merge ( this , defaultOptions , options ) ; if ( this . debug ) debug . enabled = true ; if ( typeof this . request === 'undefined' ) { this . jar = request . jar ( ) ; this . request = request . defaults ( { jar : this . jar } ) ; if ( this . debugNet ) { this . request . debug = true ; require ( 'request-debug' ) ( this . request ) ; } } debug ( 'CloudAPI-request initialized with options %o' , options ) ; }
Unifi Cloud API interface
@param {object} options Default settings for the cloud access
@param {string} options.deviceId defailt device id. Optional
@param {string} options.username cloud username
@param {string} options.password cloud password
@param {string} options.baseUrl default url for the cloud. Optional
@param {boolean} options.debug debug log. Optional. default false
@param {boolean} options.gzip If gzip is enabled for the cloud messages. Optional. default true
@returns CloudRequest
Unifi Cloud API interface