dist/lib/api.js
function getHeaders(authRequired = false) {
    if (!authRequired)
        return exports.basicHeaders;
    if ((!('X-Auth-Token' in exports.authHeaders) || !('X-User-Id' in exports.authHeaders)) ||
        exports.authHeaders['X-Auth-Token'] === '' ||
        exports.authHeaders['X-User-Id'] === '') {
        throw new Error('Auth required endpoint cannot be called before login');
    }
    return Object.assign({}, exports.basicHeaders, exports.authHeaders);
}
function getHeaders(authRequired = false) {
    if (!authRequired)
        return exports.basicHeaders;
    if ((!('X-Auth-Token' in exports.authHeaders) || !('X-User-Id' in exports.authHeaders)) ||
        exports.authHeaders['X-Auth-Token'] === '' ||
        exports.authHeaders['X-User-Id'] === '') {
        throw new Error('Auth required endpoint cannot be called before login');
    }
    return Object.assign({}, exports.basicHeaders, exports.authHeaders);
}
function getHeaders ( authRequired = false ) { if ( ! authRequired ) return exports . basicHeaders ; if ( ( ! ( 'X-Auth-Token' in exports . authHeaders ) || ! ( 'X-User-Id' in exports . authHeaders ) ) || exports . authHeaders [ 'X-Auth-Token' ] === '' || exports . authHeaders [ 'X-User-Id' ] === '' ) { throw new Error ( 'Auth required endpoint cannot be called before login' ) ; } return Object . assign ( { } , exports . basicHeaders , exports . authHeaders ) ; }
Join basic headers with auth headers if required
Join basic headers with auth headers if required