@superset-ui/connection
Advanced tools
Comparing version 0.12.12 to 0.12.13
@@ -6,16 +6,15 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
export default function callApi(_ref) { | ||
let { | ||
body, | ||
cache = 'default', | ||
credentials = 'same-origin', | ||
headers, | ||
method = 'GET', | ||
mode = 'same-origin', | ||
postPayload, | ||
redirect = 'follow', | ||
signal, | ||
stringify = true, | ||
url | ||
} = _ref; | ||
export default function callApi({ | ||
body, | ||
cache = 'default', | ||
credentials = 'same-origin', | ||
headers, | ||
method = 'GET', | ||
mode = 'same-origin', | ||
postPayload, | ||
redirect = 'follow', | ||
signal, | ||
stringify = true, | ||
url | ||
}) { | ||
const request = { | ||
@@ -22,0 +21,0 @@ body, |
@@ -6,7 +6,3 @@ function rejectIfNotOkay(response) { | ||
export default function parseResponse(apiPromise, parseMethod) { | ||
if (parseMethod === void 0) { | ||
parseMethod = 'json'; | ||
} | ||
export default function parseResponse(apiPromise, parseMethod = 'json') { | ||
const checkedPromise = apiPromise.then(rejectIfNotOkay); | ||
@@ -13,0 +9,0 @@ |
@@ -5,3 +5,3 @@ // HTTP status codes | ||
export const CACHE_AVAILABLE = 'caches' in self; | ||
export const CACHE_AVAILABLE = ('caches' in self); | ||
export const CACHE_KEY = '@SUPERSET-UI/CONNECTION'; |
@@ -7,13 +7,11 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
export default class SupersetClientClass { | ||
constructor(_temp) { | ||
let { | ||
protocol = 'http:', | ||
host = 'localhost', | ||
headers = {}, | ||
mode = 'same-origin', | ||
timeout, | ||
credentials = undefined, | ||
csrfToken = undefined | ||
} = _temp === void 0 ? {} : _temp; | ||
constructor({ | ||
protocol = 'http:', | ||
host = 'localhost', | ||
headers = {}, | ||
mode = 'same-origin', | ||
timeout, | ||
credentials = undefined, | ||
csrfToken = undefined | ||
} = {}) { | ||
_defineProperty(this, "credentials", void 0); | ||
@@ -52,7 +50,3 @@ | ||
init(force) { | ||
if (force === void 0) { | ||
force = false; | ||
} | ||
init(force = false) { | ||
if (this.isAuthenticated() && !force) { | ||
@@ -94,18 +88,17 @@ return this.csrfPromise; | ||
async request(_ref) { | ||
let { | ||
body, | ||
credentials, | ||
endpoint, | ||
headers, | ||
host, | ||
method, | ||
mode, | ||
parseMethod, | ||
postPayload, | ||
signal, | ||
stringify, | ||
timeout, | ||
url | ||
} = _ref; | ||
async request({ | ||
body, | ||
credentials, | ||
endpoint, | ||
headers, | ||
host, | ||
method, | ||
mode, | ||
parseMethod, | ||
postPayload, | ||
signal, | ||
stringify, | ||
timeout, | ||
url | ||
}) { | ||
return this.ensureAuth().then(() => callApi({ | ||
@@ -175,8 +168,7 @@ body, | ||
getUrl(_temp2) { | ||
let { | ||
host: inputHost, | ||
endpoint = '', | ||
url | ||
} = _temp2 === void 0 ? {} : _temp2; | ||
getUrl({ | ||
host: inputHost, | ||
endpoint = '', | ||
url | ||
} = {}) { | ||
if (typeof url === 'string') return url; | ||
@@ -183,0 +175,0 @@ const host = inputHost != null ? inputHost : this.host; |
@@ -13,16 +13,15 @@ "use strict"; | ||
// This function fetches an API response and returns the corresponding json | ||
function callApi(_ref) { | ||
let { | ||
body, | ||
cache = 'default', | ||
credentials = 'same-origin', | ||
headers, | ||
method = 'GET', | ||
mode = 'same-origin', | ||
postPayload, | ||
redirect = 'follow', | ||
signal, | ||
stringify = true, | ||
url | ||
} = _ref; | ||
function callApi({ | ||
body, | ||
cache = 'default', | ||
credentials = 'same-origin', | ||
headers, | ||
method = 'GET', | ||
mode = 'same-origin', | ||
postPayload, | ||
redirect = 'follow', | ||
signal, | ||
stringify = true, | ||
url | ||
}) { | ||
const request = { | ||
@@ -29,0 +28,0 @@ body, |
@@ -11,7 +11,3 @@ "use strict"; | ||
function parseResponse(apiPromise, parseMethod) { | ||
if (parseMethod === void 0) { | ||
parseMethod = 'json'; | ||
} | ||
function parseResponse(apiPromise, parseMethod = 'json') { | ||
const checkedPromise = apiPromise.then(rejectIfNotOkay); | ||
@@ -18,0 +14,0 @@ |
@@ -11,5 +11,5 @@ "use strict"; | ||
exports.HTTP_STATUS_NOT_MODIFIED = HTTP_STATUS_NOT_MODIFIED; | ||
const CACHE_AVAILABLE = 'caches' in self; | ||
const CACHE_AVAILABLE = ('caches' in self); | ||
exports.CACHE_AVAILABLE = CACHE_AVAILABLE; | ||
const CACHE_KEY = '@SUPERSET-UI/CONNECTION'; | ||
exports.CACHE_KEY = CACHE_KEY; |
@@ -15,13 +15,11 @@ "use strict"; | ||
class SupersetClientClass { | ||
constructor(_temp) { | ||
let { | ||
protocol = 'http:', | ||
host = 'localhost', | ||
headers = {}, | ||
mode = 'same-origin', | ||
timeout, | ||
credentials = undefined, | ||
csrfToken = undefined | ||
} = _temp === void 0 ? {} : _temp; | ||
constructor({ | ||
protocol = 'http:', | ||
host = 'localhost', | ||
headers = {}, | ||
mode = 'same-origin', | ||
timeout, | ||
credentials = undefined, | ||
csrfToken = undefined | ||
} = {}) { | ||
_defineProperty(this, "credentials", void 0); | ||
@@ -60,7 +58,3 @@ | ||
init(force) { | ||
if (force === void 0) { | ||
force = false; | ||
} | ||
init(force = false) { | ||
if (this.isAuthenticated() && !force) { | ||
@@ -102,18 +96,17 @@ return this.csrfPromise; | ||
async request(_ref) { | ||
let { | ||
body, | ||
credentials, | ||
endpoint, | ||
headers, | ||
host, | ||
method, | ||
mode, | ||
parseMethod, | ||
postPayload, | ||
signal, | ||
stringify, | ||
timeout, | ||
url | ||
} = _ref; | ||
async request({ | ||
body, | ||
credentials, | ||
endpoint, | ||
headers, | ||
host, | ||
method, | ||
mode, | ||
parseMethod, | ||
postPayload, | ||
signal, | ||
stringify, | ||
timeout, | ||
url | ||
}) { | ||
return this.ensureAuth().then(() => (0, _callApi.default)({ | ||
@@ -183,8 +176,7 @@ body, | ||
getUrl(_temp2) { | ||
let { | ||
host: inputHost, | ||
endpoint = '', | ||
url | ||
} = _temp2 === void 0 ? {} : _temp2; | ||
getUrl({ | ||
host: inputHost, | ||
endpoint = '', | ||
url | ||
} = {}) { | ||
if (typeof url === 'string') return url; | ||
@@ -191,0 +183,0 @@ const host = inputHost != null ? inputHost : this.host; |
{ | ||
"name": "@superset-ui/connection", | ||
"version": "0.12.12", | ||
"version": "0.12.13", | ||
"description": "Superset UI connection", | ||
@@ -40,3 +40,3 @@ "sideEffects": false, | ||
}, | ||
"gitHead": "6854fd7cfbfde1df2702c2579a71989eefccd721" | ||
"gitHead": "308f2abebca860cdabd1b3138b4237c81ef3296d" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51593
779