Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@superset-ui/core

Package Overview
Dependencies
Maintainers
1
Versions
126
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@superset-ui/core - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

2

esm/callApi/callApi.js

@@ -1,1 +0,1 @@

import _JSON$stringify from'babel-runtime/core-js/json/stringify';import _Object$keys from'babel-runtime/core-js/object/keys';import _typeof from'babel-runtime/helpers/typeof';import _extends from'babel-runtime/helpers/extends';import'whatwg-fetch';import'url-search-params-polyfill';var DEFAULT_HEADERS=null;export default function callApi(a){var b=a.url,c=a.method,d=c===void 0?'GET':c,e=a.mode,f=e===void 0?'same-origin':e,g=a.cache,h=g===void 0?'default':g,i=a.credentials,j=i===void 0?'same-origin':i,k=a.headers,l=a.body,m=a.postPayload,n=a.stringify,o=a.redirect,p=o===void 0?'follow':o,q=a.signal,r={body:l,cache:h,credentials:j,headers:_extends({},DEFAULT_HEADERS,k),method:d,mode:f,redirect:p,signal:q};if('POST'===d&&'object'===('undefined'==typeof m?'undefined':_typeof(m))){var s=new FormData;_Object$keys(m).forEach(function(a){var b=m[a];'undefined'!=typeof b&&s.append(a,!(n!==void 0)||n?_JSON$stringify(m[a]):m[a])}),r=_extends({},r,{body:s})}return fetch(b,r)}
import _JSON$stringify from'babel-runtime/core-js/json/stringify';import _Object$keys from'babel-runtime/core-js/object/keys';import _typeof from'babel-runtime/helpers/typeof';import _extends from'babel-runtime/helpers/extends';import'whatwg-fetch';var DEFAULT_HEADERS=null;export default function callApi(a){var b=a.url,c=a.method,d=c===void 0?'GET':c,e=a.mode,f=e===void 0?'same-origin':e,g=a.cache,h=g===void 0?'default':g,i=a.credentials,j=i===void 0?'same-origin':i,k=a.headers,l=a.body,m=a.postPayload,n=a.stringify,o=a.redirect,p=o===void 0?'follow':o,q=a.signal,r={body:l,cache:h,credentials:j,headers:_extends({},DEFAULT_HEADERS,k),method:d,mode:f,redirect:p,signal:q};if('POST'===d&&'object'===('undefined'==typeof m?'undefined':_typeof(m))){var s=new FormData;_Object$keys(m).forEach(function(a){var b=m[a];'undefined'!=typeof b&&s.append(a,!(n!==void 0)||n?_JSON$stringify(m[a]):m[a])}),r=_extends({},r,{body:s})}return fetch(b,r)}

@@ -1,1 +0,1 @@

import _Promise from'babel-runtime/core-js/promise';var PARSERS={json:function json(a){return a.json().then(function(b){return{json:b,response:a}})},text:function text(a){return a.text().then(function(b){return{response:a,text:b}})}};export default function parseResponse(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:'json';if(null===b)return a;var c=PARSERS[b]||PARSERS.json;return a.then(function(a){return a.ok?a:_Promise.reject({error:a.error||'An error occurred',response:a,status:a.status,statusText:a.statusText})}).then(c)}
import _Promise from'babel-runtime/core-js/promise';var PARSERS={json:function json(a){return a.json().then(function(b){return{json:b,response:a}})},text:function text(a){return a.text().then(function(b){return{response:a,text:b}})}};export default function parseResponse(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:'json';if(null===b)return a;var c=PARSERS[b]||PARSERS.json;return a.then(function(a){return a.ok?a:_Promise.reject(a)}).then(c)}

@@ -1,1 +0,1 @@

import _Promise from'babel-runtime/core-js/promise';import _extends from'babel-runtime/helpers/extends';import _classCallCheck from'babel-runtime/helpers/classCallCheck';import _createClass from'babel-runtime/helpers/createClass';import callApi from'./callApi';var SupersetClient=function(){function a(b){_classCallCheck(this,a);var c=b.protocol,d=void 0===c?'http':c,e=b.host,f=void 0===e?'':e,g=b.headers,h=void 0===g?{}:g,i=b.mode,j=void 0===i?'same-origin':i,k=b.timeout,l=b.credentials;this.headers=h,this.host=f,this.mode=j,this.timeout=k,this.protocol=d,this.credentials=l,this.csrfToken=null,this.didAuthSuccessfully=!1,this.csrfPromise=null}return _createClass(a,[{key:'isAuthenticated',value:function isAuthenticated(){return this.didAuthSuccessfully}},{key:'init',value:function init(){return this.getCSRFToken()}},{key:'getCSRFToken',value:function getCSRFToken(){var a=this;return this.csrfPromise=callApi({credentials:this.credentials,headers:_extends({},this.headers),method:'GET',mode:this.mode,timeout:this.timeout,url:this.getUrl({endpoint:'superset/csrf_token/',host:this.host})}).then(function(b){return b.json&&(a.csrfToken=b.json.csrf_token,a.headers=_extends({},a.headers,{"X-CSRFToken":a.csrfToken}),a.didAuthSuccessfully=!!a.csrfToken),a.csrfToken?b:_Promise.reject({error:'Failed to fetch CSRF token'})}),this.csrfPromise}},{key:'getUrl',value:function getUrl(a){var b=a.host,c=void 0===b?'':b,d=a.endpoint,e=void 0===d?'':d,f='/'===c.slice(-1)?c.slice(0,-1):c;return this.protocol+'://'+f+'/'+('/'===e[0]?e.slice(1):e)}},{key:'ensureAuth',value:function ensureAuth(){return this.csrfPromise||_Promise.reject({error:'SupersetClient has no CSRF token, ensure it is initialized or\n try logging into the Superset instance at '+this.getUrl('/login')})}},{key:'get',value:function get(a){var b=this,c=a.body,d=a.credentials,e=a.headers,f=a.host,g=a.endpoint,h=a.mode,i=a.parseMethod,j=a.signal,k=a.timeout,l=a.url;return this.ensureAuth().then(function(){return callApi({body:c,credentials:d||b.credentials,headers:_extends({},b.headers,e),method:'GET',mode:h||b.mode,parseMethod:i,signal:j,timeout:k||b.timeout,url:l||b.getUrl({endpoint:g,host:f||b.host})})})}},{key:'post',value:function post(a){var b=this,c=a.credentials,d=a.headers,e=a.host,f=a.endpoint,g=a.mode,h=a.parseMethod,i=a.postPayload,j=a.signal,k=a.stringify,l=a.timeout,m=a.url;return this.ensureAuth().then(function(){return callApi({credentials:c||b.credentials,headers:_extends({},b.headers,d),method:'POST',mode:g||b.mode,parseMethod:h,postPayload:i,signal:j,stringify:k,timeout:l||b.timeout,url:m||b.getUrl({endpoint:f,host:e||b.host})})})}}]),a}(),singletonClient=void 0;function hasInstance(){if(!singletonClient)throw new Error('You must call SupersetClient.configure(...) before calling other methods');return!0}var PublicAPI={configure:function configure(a){return singletonClient=new SupersetClient(a||{}),singletonClient},get:function get(){var a;return hasInstance()&&(a=singletonClient).get.apply(a,arguments)},init:function init(){return hasInstance()&&singletonClient.init()},isAuthenticated:function isAuthenticated(){return hasInstance()&&singletonClient.isAuthenticated()},post:function post(){var a;return hasInstance()&&(a=singletonClient).post.apply(a,arguments)},reAuthenticate:function reAuthenticate(){return hasInstance()&&singletonClient.getCSRFToken()},reset:function reset(){singletonClient=null}};export{SupersetClient};export default PublicAPI;
import _Promise from'babel-runtime/core-js/promise';import _extends from'babel-runtime/helpers/extends';import _classCallCheck from'babel-runtime/helpers/classCallCheck';import _createClass from'babel-runtime/helpers/createClass';import callApi from'./callApi';var SupersetClient=function(){function a(b){_classCallCheck(this,a);var c=b.protocol,d=void 0===c?'http':c,e=b.host,f=void 0===e?'':e,g=b.headers,h=void 0===g?{}:g,i=b.mode,j=void 0===i?'same-origin':i,k=b.timeout,l=b.credentials;this.headers=h,this.host=f,this.mode=j,this.timeout=k,this.protocol=d,this.credentials=l,this.csrfToken=null,this.didAuthSuccessfully=!1,this.csrfPromise=null}return _createClass(a,[{key:'isAuthenticated',value:function isAuthenticated(){return this.didAuthSuccessfully}},{key:'init',value:function init(){return this.getCSRFToken()}},{key:'getCSRFToken',value:function getCSRFToken(){var a=this;return this.csrfToken=null,this.csrfPromise=callApi({credentials:this.credentials,headers:_extends({},this.headers),method:'GET',mode:this.mode,timeout:this.timeout,url:this.getUrl({endpoint:'superset/csrf_token/',host:this.host})}).then(function(b){return b.json&&(a.csrfToken=b.json.csrf_token,a.headers=_extends({},a.headers,{"X-CSRFToken":a.csrfToken}),a.didAuthSuccessfully=null!==a.csrfToken&&void 0!==a.csrfPromise),a.didAuthSuccessfully?b:_Promise.reject({error:'Failed to fetch CSRF token'})}),this.csrfPromise}},{key:'getUrl',value:function getUrl(a){var b=a.host,c=void 0===b?'':b,d=a.endpoint,e=void 0===d?'':d,f='/'===c.slice(-1)?c.slice(0,-1):c;return this.protocol+'://'+f+'/'+('/'===e[0]?e.slice(1):e)}},{key:'ensureAuth',value:function ensureAuth(){return this.csrfPromise||_Promise.reject({error:'SupersetClient has no CSRF token, ensure it is initialized or\n try logging into the Superset instance at '+this.getUrl('/login')})}},{key:'get',value:function get(a){var b=this,c=a.body,d=a.credentials,e=a.headers,f=a.host,g=a.endpoint,h=a.mode,i=a.parseMethod,j=a.signal,k=a.timeout,l=a.url;return this.ensureAuth().then(function(){return callApi({body:c,credentials:d||b.credentials,headers:_extends({},b.headers,e),method:'GET',mode:h||b.mode,parseMethod:i,signal:j,timeout:k||b.timeout,url:l||b.getUrl({endpoint:g,host:f||b.host})})})}},{key:'post',value:function post(a){var b=this,c=a.credentials,d=a.headers,e=a.host,f=a.endpoint,g=a.mode,h=a.parseMethod,i=a.postPayload,j=a.signal,k=a.stringify,l=a.timeout,m=a.url;return this.ensureAuth().then(function(){return callApi({credentials:c||b.credentials,headers:_extends({},b.headers,d),method:'POST',mode:g||b.mode,parseMethod:h,postPayload:i,signal:j,stringify:k,timeout:l||b.timeout,url:m||b.getUrl({endpoint:f,host:e||b.host})})})}}]),a}(),singletonClient=void 0;function hasInstance(){if(!singletonClient)throw new Error('You must call SupersetClient.configure(...) before calling other methods');return!0}var PublicAPI={configure:function configure(a){return singletonClient=new SupersetClient(a||{}),singletonClient},get:function get(){var a;return hasInstance()&&(a=singletonClient).get.apply(a,arguments)},init:function init(){return hasInstance()&&singletonClient.init()},isAuthenticated:function isAuthenticated(){return hasInstance()&&singletonClient.isAuthenticated()},post:function post(){var a;return hasInstance()&&(a=singletonClient).post.apply(a,arguments)},reAuthenticate:function reAuthenticate(){return hasInstance()&&singletonClient.getCSRFToken()},reset:function reset(){singletonClient=null}};export{SupersetClient};export default PublicAPI;

@@ -1,1 +0,1 @@

'use strict';var _stringify=require('babel-runtime/core-js/json/stringify'),_stringify2=_interopRequireDefault(_stringify),_keys=require('babel-runtime/core-js/object/keys'),_keys2=_interopRequireDefault(_keys),_typeof2=require('babel-runtime/helpers/typeof'),_typeof3=_interopRequireDefault(_typeof2),_extends2=require('babel-runtime/helpers/extends'),_extends3=_interopRequireDefault(_extends2);Object.defineProperty(exports,'__esModule',{value:!0});exports.default=callApi,require('whatwg-fetch'),require('url-search-params-polyfill');function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}var DEFAULT_HEADERS=null;function callApi(a){var b=a.url,c=a.method,d=c===void 0?'GET':c,e=a.mode,f=e===void 0?'same-origin':e,g=a.cache,h=g===void 0?'default':g,i=a.credentials,j=i===void 0?'same-origin':i,k=a.headers,l=a.body,m=a.postPayload,n=a.stringify,o=a.redirect,p=o===void 0?'follow':o,q=a.signal,r={body:l,cache:h,credentials:j,headers:(0,_extends3.default)({},DEFAULT_HEADERS,k),method:d,mode:f,redirect:p,signal:q};if('POST'===d&&'object'===('undefined'==typeof m?'undefined':(0,_typeof3.default)(m))){var s=new FormData;(0,_keys2.default)(m).forEach(function(a){var b=m[a];'undefined'!=typeof b&&s.append(a,!(n!==void 0)||n?(0,_stringify2.default)(m[a]):m[a])}),r=(0,_extends3.default)({},r,{body:s})}return fetch(b,r)}
'use strict';var _stringify=require('babel-runtime/core-js/json/stringify'),_stringify2=_interopRequireDefault(_stringify),_keys=require('babel-runtime/core-js/object/keys'),_keys2=_interopRequireDefault(_keys),_typeof2=require('babel-runtime/helpers/typeof'),_typeof3=_interopRequireDefault(_typeof2),_extends2=require('babel-runtime/helpers/extends'),_extends3=_interopRequireDefault(_extends2);Object.defineProperty(exports,'__esModule',{value:!0});exports.default=callApi,require('whatwg-fetch');function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}var DEFAULT_HEADERS=null;function callApi(a){var b=a.url,c=a.method,d=c===void 0?'GET':c,e=a.mode,f=e===void 0?'same-origin':e,g=a.cache,h=g===void 0?'default':g,i=a.credentials,j=i===void 0?'same-origin':i,k=a.headers,l=a.body,m=a.postPayload,n=a.stringify,o=a.redirect,p=o===void 0?'follow':o,q=a.signal,r={body:l,cache:h,credentials:j,headers:(0,_extends3.default)({},DEFAULT_HEADERS,k),method:d,mode:f,redirect:p,signal:q};if('POST'===d&&'object'===('undefined'==typeof m?'undefined':(0,_typeof3.default)(m))){var s=new FormData;(0,_keys2.default)(m).forEach(function(a){var b=m[a];'undefined'!=typeof b&&s.append(a,!(n!==void 0)||n?(0,_stringify2.default)(m[a]):m[a])}),r=(0,_extends3.default)({},r,{body:s})}return fetch(b,r)}

@@ -1,1 +0,1 @@

'use strict';var _promise=require('babel-runtime/core-js/promise'),_promise2=_interopRequireDefault(_promise);Object.defineProperty(exports,'__esModule',{value:!0});exports.default=parseResponse;function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}var PARSERS={json:function json(a){return a.json().then(function(b){return{json:b,response:a}})},text:function text(a){return a.text().then(function(b){return{response:a,text:b}})}};function parseResponse(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:'json';if(null===b)return a;var c=PARSERS[b]||PARSERS.json;return a.then(function(a){return a.ok?a:_promise2.default.reject({error:a.error||'An error occurred',response:a,status:a.status,statusText:a.statusText})}).then(c)}
'use strict';var _promise=require('babel-runtime/core-js/promise'),_promise2=_interopRequireDefault(_promise);Object.defineProperty(exports,'__esModule',{value:!0});exports.default=parseResponse;function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}var PARSERS={json:function json(a){return a.json().then(function(b){return{json:b,response:a}})},text:function text(a){return a.text().then(function(b){return{response:a,text:b}})}};function parseResponse(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:'json';if(null===b)return a;var c=PARSERS[b]||PARSERS.json;return a.then(function(a){return a.ok?a:_promise2.default.reject(a)}).then(c)}

@@ -1,1 +0,1 @@

'use strict';var _promise=require('babel-runtime/core-js/promise'),_promise2=_interopRequireDefault(_promise),_extends2=require('babel-runtime/helpers/extends'),_extends3=_interopRequireDefault(_extends2),_classCallCheck2=require('babel-runtime/helpers/classCallCheck'),_classCallCheck3=_interopRequireDefault(_classCallCheck2),_createClass2=require('babel-runtime/helpers/createClass'),_createClass3=_interopRequireDefault(_createClass2),_callApi=require('./callApi'),_callApi2=_interopRequireDefault(_callApi);Object.defineProperty(exports,'__esModule',{value:!0}),exports.SupersetClient=void 0;function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}var SupersetClient=function(){function a(b){(0,_classCallCheck3.default)(this,a);var c=b.protocol,d=void 0===c?'http':c,e=b.host,f=void 0===e?'':e,g=b.headers,h=void 0===g?{}:g,i=b.mode,j=void 0===i?'same-origin':i,k=b.timeout,l=b.credentials;this.headers=h,this.host=f,this.mode=j,this.timeout=k,this.protocol=d,this.credentials=l,this.csrfToken=null,this.didAuthSuccessfully=!1,this.csrfPromise=null}return(0,_createClass3.default)(a,[{key:'isAuthenticated',value:function isAuthenticated(){return this.didAuthSuccessfully}},{key:'init',value:function init(){return this.getCSRFToken()}},{key:'getCSRFToken',value:function getCSRFToken(){var a=this;return this.csrfPromise=(0,_callApi2.default)({credentials:this.credentials,headers:(0,_extends3.default)({},this.headers),method:'GET',mode:this.mode,timeout:this.timeout,url:this.getUrl({endpoint:'superset/csrf_token/',host:this.host})}).then(function(b){return b.json&&(a.csrfToken=b.json.csrf_token,a.headers=(0,_extends3.default)({},a.headers,{"X-CSRFToken":a.csrfToken}),a.didAuthSuccessfully=!!a.csrfToken),a.csrfToken?b:_promise2.default.reject({error:'Failed to fetch CSRF token'})}),this.csrfPromise}},{key:'getUrl',value:function getUrl(a){var b=a.host,c=void 0===b?'':b,d=a.endpoint,e=void 0===d?'':d,f='/'===c.slice(-1)?c.slice(0,-1):c;return this.protocol+'://'+f+'/'+('/'===e[0]?e.slice(1):e)}},{key:'ensureAuth',value:function ensureAuth(){return this.csrfPromise||_promise2.default.reject({error:'SupersetClient has no CSRF token, ensure it is initialized or\n try logging into the Superset instance at '+this.getUrl('/login')})}},{key:'get',value:function get(a){var b=this,c=a.body,d=a.credentials,e=a.headers,f=a.host,g=a.endpoint,h=a.mode,i=a.parseMethod,j=a.signal,k=a.timeout,l=a.url;return this.ensureAuth().then(function(){return(0,_callApi2.default)({body:c,credentials:d||b.credentials,headers:(0,_extends3.default)({},b.headers,e),method:'GET',mode:h||b.mode,parseMethod:i,signal:j,timeout:k||b.timeout,url:l||b.getUrl({endpoint:g,host:f||b.host})})})}},{key:'post',value:function post(a){var b=this,c=a.credentials,d=a.headers,e=a.host,f=a.endpoint,g=a.mode,h=a.parseMethod,i=a.postPayload,j=a.signal,k=a.stringify,l=a.timeout,m=a.url;return this.ensureAuth().then(function(){return(0,_callApi2.default)({credentials:c||b.credentials,headers:(0,_extends3.default)({},b.headers,d),method:'POST',mode:g||b.mode,parseMethod:h,postPayload:i,signal:j,stringify:k,timeout:l||b.timeout,url:m||b.getUrl({endpoint:f,host:e||b.host})})})}}]),a}(),singletonClient=void 0;function hasInstance(){if(!singletonClient)throw new Error('You must call SupersetClient.configure(...) before calling other methods');return!0}var PublicAPI={configure:function configure(a){return singletonClient=new SupersetClient(a||{}),singletonClient},get:function get(){var a;return hasInstance()&&(a=singletonClient).get.apply(a,arguments)},init:function init(){return hasInstance()&&singletonClient.init()},isAuthenticated:function isAuthenticated(){return hasInstance()&&singletonClient.isAuthenticated()},post:function post(){var a;return hasInstance()&&(a=singletonClient).post.apply(a,arguments)},reAuthenticate:function reAuthenticate(){return hasInstance()&&singletonClient.getCSRFToken()},reset:function reset(){singletonClient=null}};exports.SupersetClient=SupersetClient,exports.default=PublicAPI;
'use strict';var _promise=require('babel-runtime/core-js/promise'),_promise2=_interopRequireDefault(_promise),_extends2=require('babel-runtime/helpers/extends'),_extends3=_interopRequireDefault(_extends2),_classCallCheck2=require('babel-runtime/helpers/classCallCheck'),_classCallCheck3=_interopRequireDefault(_classCallCheck2),_createClass2=require('babel-runtime/helpers/createClass'),_createClass3=_interopRequireDefault(_createClass2),_callApi=require('./callApi'),_callApi2=_interopRequireDefault(_callApi);Object.defineProperty(exports,'__esModule',{value:!0}),exports.SupersetClient=void 0;function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}var SupersetClient=function(){function a(b){(0,_classCallCheck3.default)(this,a);var c=b.protocol,d=void 0===c?'http':c,e=b.host,f=void 0===e?'':e,g=b.headers,h=void 0===g?{}:g,i=b.mode,j=void 0===i?'same-origin':i,k=b.timeout,l=b.credentials;this.headers=h,this.host=f,this.mode=j,this.timeout=k,this.protocol=d,this.credentials=l,this.csrfToken=null,this.didAuthSuccessfully=!1,this.csrfPromise=null}return(0,_createClass3.default)(a,[{key:'isAuthenticated',value:function isAuthenticated(){return this.didAuthSuccessfully}},{key:'init',value:function init(){return this.getCSRFToken()}},{key:'getCSRFToken',value:function getCSRFToken(){var a=this;return this.csrfToken=null,this.csrfPromise=(0,_callApi2.default)({credentials:this.credentials,headers:(0,_extends3.default)({},this.headers),method:'GET',mode:this.mode,timeout:this.timeout,url:this.getUrl({endpoint:'superset/csrf_token/',host:this.host})}).then(function(b){return b.json&&(a.csrfToken=b.json.csrf_token,a.headers=(0,_extends3.default)({},a.headers,{"X-CSRFToken":a.csrfToken}),a.didAuthSuccessfully=null!==a.csrfToken&&void 0!==a.csrfPromise),a.didAuthSuccessfully?b:_promise2.default.reject({error:'Failed to fetch CSRF token'})}),this.csrfPromise}},{key:'getUrl',value:function getUrl(a){var b=a.host,c=void 0===b?'':b,d=a.endpoint,e=void 0===d?'':d,f='/'===c.slice(-1)?c.slice(0,-1):c;return this.protocol+'://'+f+'/'+('/'===e[0]?e.slice(1):e)}},{key:'ensureAuth',value:function ensureAuth(){return this.csrfPromise||_promise2.default.reject({error:'SupersetClient has no CSRF token, ensure it is initialized or\n try logging into the Superset instance at '+this.getUrl('/login')})}},{key:'get',value:function get(a){var b=this,c=a.body,d=a.credentials,e=a.headers,f=a.host,g=a.endpoint,h=a.mode,i=a.parseMethod,j=a.signal,k=a.timeout,l=a.url;return this.ensureAuth().then(function(){return(0,_callApi2.default)({body:c,credentials:d||b.credentials,headers:(0,_extends3.default)({},b.headers,e),method:'GET',mode:h||b.mode,parseMethod:i,signal:j,timeout:k||b.timeout,url:l||b.getUrl({endpoint:g,host:f||b.host})})})}},{key:'post',value:function post(a){var b=this,c=a.credentials,d=a.headers,e=a.host,f=a.endpoint,g=a.mode,h=a.parseMethod,i=a.postPayload,j=a.signal,k=a.stringify,l=a.timeout,m=a.url;return this.ensureAuth().then(function(){return(0,_callApi2.default)({credentials:c||b.credentials,headers:(0,_extends3.default)({},b.headers,d),method:'POST',mode:g||b.mode,parseMethod:h,postPayload:i,signal:j,stringify:k,timeout:l||b.timeout,url:m||b.getUrl({endpoint:f,host:e||b.host})})})}}]),a}(),singletonClient=void 0;function hasInstance(){if(!singletonClient)throw new Error('You must call SupersetClient.configure(...) before calling other methods');return!0}var PublicAPI={configure:function configure(a){return singletonClient=new SupersetClient(a||{}),singletonClient},get:function get(){var a;return hasInstance()&&(a=singletonClient).get.apply(a,arguments)},init:function init(){return hasInstance()&&singletonClient.init()},isAuthenticated:function isAuthenticated(){return hasInstance()&&singletonClient.isAuthenticated()},post:function post(){var a;return hasInstance()&&(a=singletonClient).post.apply(a,arguments)},reAuthenticate:function reAuthenticate(){return hasInstance()&&singletonClient.getCSRFToken()},reset:function reset(){singletonClient=null}};exports.SupersetClient=SupersetClient,exports.default=PublicAPI;
{
"name": "@superset-ui/core",
"version": "0.0.3",
"version": "0.0.4",
"description": "Superset UI core 🤖",

@@ -49,3 +49,2 @@ "sideEffects": false,

"babel-runtime": "^6.26.0",
"url-search-params-polyfill": "^4.0.1",
"whatwg-fetch": "^2.0.4"

@@ -52,0 +51,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc