UNPKG

microstrategy

Version:

A node.js wrapper for the MicroStrategy REST API & Task API

19 lines 73.8 kB
var mstrapi=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=16)}([function(t,e,r){"use strict";var n=r(6),o=Object.prototype.toString;function i(t){return"[object Array]"===o.call(t)}function s(t){return void 0===t}function a(t){return null!==t&&"object"==typeof t}function u(t){return"[object Function]"===o.call(t)}function c(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),i(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}t.exports={isArray:i,isArrayBuffer:function(t){return"[object ArrayBuffer]"===o.call(t)},isBuffer:function(t){return null!==t&&!s(t)&&null!==t.constructor&&!s(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:a,isUndefined:s,isDate:function(t){return"[object Date]"===o.call(t)},isFile:function(t){return"[object File]"===o.call(t)},isBlob:function(t){return"[object Blob]"===o.call(t)},isFunction:u,isStream:function(t){return a(t)&&u(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:c,merge:function t(){var e={};function r(r,n){"object"==typeof e[n]&&"object"==typeof r?e[n]=t(e[n],r):e[n]=r}for(var n=0,o=arguments.length;n<o;n++)c(arguments[n],r);return e},deepMerge:function t(){var e={};function r(r,n){"object"==typeof e[n]&&"object"==typeof r?e[n]=t(e[n],r):e[n]="object"==typeof r?t({},r):r}for(var n=0,o=arguments.length;n<o;n++)c(arguments[n],r);return e},extend:function(t,e,r){return c(e,(function(e,o){t[o]=r&&"function"==typeof e?n(e,r):e})),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(t,e,r){"use strict";(function(e){var n=r(38); /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> * @license MIT */function o(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0}function i(t){return e.Buffer&&"function"==typeof e.Buffer.isBuffer?e.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}var s=r(39),a=Object.prototype.hasOwnProperty,u=Array.prototype.slice,c="foo"===function(){}.name;function f(t){return Object.prototype.toString.call(t)}function h(t){return!i(t)&&("function"==typeof e.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer))))}var p=t.exports=v,l=/\s*function\s+([^\(\s]*)\s*/;function d(t){if(s.isFunction(t)){if(c)return t.name;var e=t.toString().match(l);return e&&e[1]}}function g(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function y(t){if(c||!s.isFunction(t))return s.inspect(t);var e=d(t);return"[Function"+(e?": "+e:"")+"]"}function m(t,e,r,n,o){throw new p.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:o})}function v(t,e){t||m(t,!0,e,"==",p.ok)}function w(t,e,r,n){if(t===e)return!0;if(i(t)&&i(e))return 0===o(t,e);if(s.isDate(t)&&s.isDate(e))return t.getTime()===e.getTime();if(s.isRegExp(t)&&s.isRegExp(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&"object"==typeof t||null!==e&&"object"==typeof e){if(h(t)&&h(e)&&f(t)===f(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===o(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(i(t)!==i(e))return!1;var a=(n=n||{actual:[],expected:[]}).actual.indexOf(t);return-1!==a&&a===n.expected.indexOf(e)||(n.actual.push(t),n.expected.push(e),function(t,e,r,n){if(null==t||null==e)return!1;if(s.isPrimitive(t)||s.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var o=b(t),i=b(e);if(o&&!i||!o&&i)return!1;if(o)return t=u.call(t),e=u.call(e),w(t,e,r);var a,c,f=R(t),h=R(e);if(f.length!==h.length)return!1;for(f.sort(),h.sort(),c=f.length-1;c>=0;c--)if(f[c]!==h[c])return!1;for(c=f.length-1;c>=0;c--)if(a=f[c],!w(t[a],e[a],r,n))return!1;return!0}(t,e,r,n))}return r?t===e:t==e}function b(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function E(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function T(t,e,r,n){var o;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),o=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!o&&m(o,r,"Missing expected exception"+n);var i="string"==typeof n,a=!t&&o&&!r;if((!t&&s.isError(o)&&i&&E(o,r)||a)&&m(o,r,"Got unwanted exception"+n),t&&o&&r&&!E(o,r)||!t&&o)throw o}p.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return g(y(t.actual),128)+" "+t.operator+" "+g(y(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||m;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,o=d(e),i=n.indexOf("\n"+o);if(i>=0){var s=n.indexOf("\n",i+1);n=n.substring(s+1)}this.stack=n}}},s.inherits(p.AssertionError,Error),p.fail=m,p.ok=v,p.equal=function(t,e,r){t!=e&&m(t,e,r,"==",p.equal)},p.notEqual=function(t,e,r){t==e&&m(t,e,r,"!=",p.notEqual)},p.deepEqual=function(t,e,r){w(t,e,!1)||m(t,e,r,"deepEqual",p.deepEqual)},p.deepStrictEqual=function(t,e,r){w(t,e,!0)||m(t,e,r,"deepStrictEqual",p.deepStrictEqual)},p.notDeepEqual=function(t,e,r){w(t,e,!1)&&m(t,e,r,"notDeepEqual",p.notDeepEqual)},p.notDeepStrictEqual=function t(e,r,n){w(e,r,!0)&&m(e,r,n,"notDeepStrictEqual",t)},p.strictEqual=function(t,e,r){t!==e&&m(t,e,r,"===",p.strictEqual)},p.notStrictEqual=function(t,e,r){t===e&&m(t,e,r,"!==",p.notStrictEqual)},p.throws=function(t,e,r){T(!0,t,e,r)},p.doesNotThrow=function(t,e,r){T(!1,t,e,r)},p.ifError=function(t){if(t)throw t},p.strict=n((function t(e,r){e||m(e,!0,r,"==",t)}),p,{equal:p.strictEqual,deepEqual:p.deepStrictEqual,notEqual:p.notStrictEqual,notDeepEqual:p.notDeepStrictEqual}),p.strict.strict=p.strict;var R=Object.keys||function(t){var e=[];for(var r in t)a.call(t,r)&&e.push(r);return e}}).call(this,r(15))},function(t,e){t.exports=class{constructor(t){this.request=t}_makeRequest(...t){return this.request._makeRequest(...t)}getAuthToken(){return this.request.getAuthToken()}setAuthToken(t){return this.request.setAuthToken(t)}getSessionCredentials(){return this.request.getSessionCredentials()}getSessionHeaders(){return this.request.getSessionHeaders()}setSessionHeaders(t){return this.request.setSessionHeaders(t)}setSessionCredentials(t){return this.request.setSessionCredentials(t)}getProjectHeader(...t){return this.request.getProjectHeader(...t)}throwIfFailed(t,e=200,r="data"){if(!(!0===this.request.skipValidateResponseStatusCode)&&t.status!=e)throw t;return r?t[r]:t}throwExceptionResponse(t){if(!0===this.request.skipThrowOnHTTPException)return t;throw t&&t.response&&t.response.data||t}}},function(t,e){t.exports=(t,e,r)=>{const n={};return e&&(n.offset=e),r&&(n.limit=r),t&&(n.fields=t),n}},function(t,e,r){const n=r(1);t.exports=(t,e)=>e?n(t[e],`Parameter ${e} is required`):n(t,"No params passed")},function(t,e,r){t.exports=r(19)},function(t,e,r){"use strict";t.exports=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}}},function(t,e,r){"use strict";var n=r(0);function o(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,r){if(!e)return t;var i;if(r)i=r(e);else if(n.isURLSearchParams(e))i=e.toString();else{var s=[];n.forEach(e,(function(t,e){null!=t&&(n.isArray(t)?e+="[]":t=[t],n.forEach(t,(function(t){n.isDate(t)?t=t.toISOString():n.isObject(t)&&(t=JSON.stringify(t)),s.push(o(e)+"="+o(t))})))})),i=s.join("&")}if(i){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}},function(t,e,r){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,r){"use strict";(function(e){var n=r(0),o=r(24),i={"Content-Type":"application/x-www-form-urlencoded"};function s(t,e){!n.isUndefined(t)&&n.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var a,u={adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==e&&"[object process]"===Object.prototype.toString.call(e))&&(a=r(11)),a),transformRequest:[function(t,e){return o(e,"Accept"),o(e,"Content-Type"),n.isFormData(t)||n.isArrayBuffer(t)||n.isBuffer(t)||n.isStream(t)||n.isFile(t)||n.isBlob(t)?t:n.isArrayBufferView(t)?t.buffer:n.isURLSearchParams(t)?(s(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):n.isObject(t)?(s(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return t>=200&&t<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],(function(t){u.headers[t]={}})),n.forEach(["post","put","patch"],(function(t){u.headers[t]=n.merge(i)})),t.exports=u}).call(this,r(10))},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var u,c=[],f=!1,h=-1;function p(){f&&u&&(f=!1,u.length?c=u.concat(c):h=-1,c.length&&l())}function l(){if(!f){var t=a(p);f=!0;for(var e=c.length;e;){for(u=c,c=[];++h<e;)u&&u[h].run();h=-1,e=c.length}u=null,f=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function g(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new d(t,e)),1!==c.length||f||a(l)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,r){"use strict";var n=r(0),o=r(25),i=r(7),s=r(27),a=r(30),u=r(31),c=r(12);t.exports=function(t){return new Promise((function(e,f){var h=t.data,p=t.headers;n.isFormData(h)&&delete p["Content-Type"];var l=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",g=t.auth.password||"";p.Authorization="Basic "+btoa(d+":"+g)}var y=s(t.baseURL,t.url);if(l.open(t.method.toUpperCase(),i(y,t.params,t.paramsSerializer),!0),l.timeout=t.timeout,l.onreadystatechange=function(){if(l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in l?a(l.getAllResponseHeaders()):null,n={data:t.responseType&&"text"!==t.responseType?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:r,config:t,request:l};o(e,f,n),l=null}},l.onabort=function(){l&&(f(c("Request aborted",t,"ECONNABORTED",l)),l=null)},l.onerror=function(){f(c("Network Error",t,null,l)),l=null},l.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),f(c(e,t,"ECONNABORTED",l)),l=null},n.isStandardBrowserEnv()){var m=r(32),v=(t.withCredentials||u(y))&&t.xsrfCookieName?m.read(t.xsrfCookieName):void 0;v&&(p[t.xsrfHeaderName]=v)}if("setRequestHeader"in l&&n.forEach(p,(function(t,e){void 0===h&&"content-type"===e.toLowerCase()?delete p[e]:l.setRequestHeader(e,t)})),n.isUndefined(t.withCredentials)||(l.withCredentials=!!t.withCredentials),t.responseType)try{l.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&l.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then((function(t){l&&(l.abort(),f(t),l=null)})),void 0===h&&(h=null),l.send(h)}))}},function(t,e,r){"use strict";var n=r(26);t.exports=function(t,e,r,o,i){var s=new Error(t);return n(s,e,r,o,i)}},function(t,e,r){"use strict";var n=r(0);t.exports=function(t,e){e=e||{};var r={},o=["url","method","params","data"],i=["headers","auth","proxy"],s=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];n.forEach(o,(function(t){void 0!==e[t]&&(r[t]=e[t])})),n.forEach(i,(function(o){n.isObject(e[o])?r[o]=n.deepMerge(t[o],e[o]):void 0!==e[o]?r[o]=e[o]:n.isObject(t[o])?r[o]=n.deepMerge(t[o]):void 0!==t[o]&&(r[o]=t[o])})),n.forEach(s,(function(n){void 0!==e[n]?r[n]=e[n]:void 0!==t[n]&&(r[n]=t[n])}));var a=o.concat(i).concat(s),u=Object.keys(e).filter((function(t){return-1===a.indexOf(t)}));return n.forEach(u,(function(n){void 0!==e[n]?r[n]=e[n]:void 0!==t[n]&&(r[n]=t[n])})),r}},function(t,e,r){"use strict";function n(t){this.message=t}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,t.exports=n},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){t.exports={REST:r(17),TaskAPI:r(54)}},function(t,e,r){const n=r(18),o=r(42),i=r(43),s=r(44),a=r(49),u=r(50),c=r(51),f=r(52),h=r(53);t.exports=class extends n{constructor(...t){return super(...t),this.authentication=new o(this),this.cubes=new i(this),this.datasets=new s(this),this.dossiersAndDocuments=new a(this),this.library=new h(this),this.objectManagement=new u(this),this.reports=new c(this),this.userManagement=new f(this),this}login(...t){return this.authentication.login(...t)}logout(...t){return this.authentication.logout(...t)}clearCookies(){return this.authentication.clearCookies()}}},function(t,e,r){const n=r(5),o=r(35),i=r(1);t.exports=class{constructor({baseUrl:t="https://demo.microstrategy.com/MicroStrategyLibrary/api",skipValidateResponseStatusCode:e=!1,skipThrowOnHTTPException:r=!1}){this._baseUrl,this.setBaseUrl(t),this.defaultHeaders={Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"gzip, deflate, br"},this.sessionHeaders={},this.sessionCredentials,this.globalRequestOptions={withCredentials:!0,timeout:6e5},this.skipValidateResponseStatusCode=!!e,this.skipThrowOnHTTPException=!!r}getDefaultHeaders(){return this.defaultHeaders}getRequestOptions(){return this.globalRequestOptions}getBaseUrl(){return this._baseUrl}setBaseUrl(t){return this._baseUrl=t,"/"!=this.getBaseUrl().substr(-1)&&(this._baseUrl+="/"),this}getAuthToken(){if(!this.sessionHeaders)throw new Error("No stored session headers - create session first via auth.login()");const t=this.sessionHeaders["X-MSTR-AuthToken"];if(!t)throw new Error("No stored auth token - create session first via auth.login()");return t}setAuthToken(t){return this.sessionHeaders["X-MSTR-AuthToken"]=t,this}getSessionHeaders(){return this.sessionHeaders}setSessionHeaders(t){return this.sessionHeaders=t?{...t}:{},this}getSessionCredentials(){return this.sessionCredentials}setSessionCredentials(t={}){return this.sessionCredentials=t,this}setProjectId(t){return this.projectID=t,this}getProjectId(){return this.projectID}getProjectHeader(t=this.getProjectId(),e={}){return"boolean"==typeof t&&t&&(t=this.getProjectId()),i(t,"No projectId provided. Provide it as a function parameter or pre-set it universally using restApi.setProjectId()"),{"X-MSTR-ProjectID":t,...e}}_makeRequest(t,e,r="GET",n,o={}){const i=this.getBaseUrl()+t;switch(r.toUpperCase()){case"GET":return this.get(i,e,n);case"HEAD":return this.get(i,e,n,!0,"HEAD");case"POST":return this.post(i,e,o,n);case"PATCH":return this.post(i,e,o,n,"PATCH");case"DELETE":return this.post(i,e,o,n,"DELETE");case"PUT":return this.post(i,e,o,n,"PUT")}}get(t,e,r={},i=!0,s="GET"){const a={method:s,headers:this._getHeaders(r,i),url:t,...this.getRequestOptions()};return e&&(a.url+="?"+o.stringify(e)),n(a)}post(t,e,r,i={},s="POST",a=!0){const u={method:s,headers:this._getHeaders(i,a),data:e,url:t,...this.getRequestOptions()};return r&&(u.url+="?"+o.stringify(r)),e&&(u.data=e),n(u)}_getHeaders(t={},e){const r=this.getDefaultHeaders(),n=this.getSessionHeaders();return e?{...t,...r,...n}:Object.keys(t).length?t:r}}},function(t,e,r){"use strict";var n=r(0),o=r(6),i=r(20),s=r(13);function a(t){var e=new i(t),r=o(i.prototype.request,e);return n.extend(r,i.prototype,e),n.extend(r,e),r}var u=a(r(9));u.Axios=i,u.create=function(t){return a(s(u.defaults,t))},u.Cancel=r(14),u.CancelToken=r(33),u.isCancel=r(8),u.all=function(t){return Promise.all(t)},u.spread=r(34),t.exports=u,t.exports.default=u},function(t,e,r){"use strict";var n=r(0),o=r(7),i=r(21),s=r(22),a=r(13);function u(t){this.defaults=t,this.interceptors={request:new i,response:new i}}u.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=a(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=[s,void 0],r=Promise.resolve(t);for(this.interceptors.request.forEach((function(t){e.unshift(t.fulfilled,t.rejected)})),this.interceptors.response.forEach((function(t){e.push(t.fulfilled,t.rejected)}));e.length;)r=r.then(e.shift(),e.shift());return r},u.prototype.getUri=function(t){return t=a(this.defaults,t),o(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(t){u.prototype[t]=function(e,r){return this.request(n.merge(r||{},{method:t,url:e}))}})),n.forEach(["post","put","patch"],(function(t){u.prototype[t]=function(e,r,o){return this.request(n.merge(o||{},{method:t,url:e,data:r}))}})),t.exports=u},function(t,e,r){"use strict";var n=r(0);function o(){this.handlers=[]}o.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},o.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},o.prototype.forEach=function(t){n.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=o},function(t,e,r){"use strict";var n=r(0),o=r(23),i=r(8),s=r(9);function a(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return a(t),t.headers=t.headers||{},t.data=o(t.data,t.headers,t.transformRequest),t.headers=n.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||s.adapter)(t).then((function(e){return a(t),e.data=o(e.data,e.headers,t.transformResponse),e}),(function(e){return i(e)||(a(t),e&&e.response&&(e.response.data=o(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},function(t,e,r){"use strict";var n=r(0);t.exports=function(t,e,r){return n.forEach(r,(function(r){t=r(t,e)})),t}},function(t,e,r){"use strict";var n=r(0);t.exports=function(t,e){n.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))}},function(t,e,r){"use strict";var n=r(12);t.exports=function(t,e,r){var o=r.config.validateStatus;!o||o(r.status)?t(r):e(n("Request failed with status code "+r.status,r.config,null,r.request,r))}},function(t,e,r){"use strict";t.exports=function(t,e,r,n,o){return t.config=e,r&&(t.code=r),t.request=n,t.response=o,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t}},function(t,e,r){"use strict";var n=r(28),o=r(29);t.exports=function(t,e){return t&&!n(e)?o(t,e):e}},function(t,e,r){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,r){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,r){"use strict";var n=r(0),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,r,i,s={};return t?(n.forEach(t.split("\n"),(function(t){if(i=t.indexOf(":"),e=n.trim(t.substr(0,i)).toLowerCase(),r=n.trim(t.substr(i+1)),e){if(s[e]&&o.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([r]):s[e]?s[e]+", "+r:r}})),s):s}},function(t,e,r){"use strict";var n=r(0);t.exports=n.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(t){var n=t;return e&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=o(window.location.href),function(e){var r=n.isString(e)?o(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0}},function(t,e,r){"use strict";var n=r(0);t.exports=n.isStandardBrowserEnv()?{write:function(t,e,r,o,i,s){var a=[];a.push(t+"="+encodeURIComponent(e)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(o)&&a.push("path="+o),n.isString(i)&&a.push("domain="+i),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,r){"use strict";var n=r(14);function o(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;t((function(t){r.reason||(r.reason=new n(t),e(r.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var t;return{token:new o((function(e){t=e})),cancel:t}},t.exports=o},function(t,e,r){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,r){"use strict";e.decode=e.parse=r(36),e.encode=e.stringify=r(37)},function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,r,i){e=e||"&",r=r||"=";var s={};if("string"!=typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var u=1e3;i&&"number"==typeof i.maxKeys&&(u=i.maxKeys);var c=t.length;u>0&&c>u&&(c=u);for(var f=0;f<c;++f){var h,p,l,d,g=t[f].replace(a,"%20"),y=g.indexOf(r);y>=0?(h=g.substr(0,y),p=g.substr(y+1)):(h=g,p=""),l=decodeURIComponent(h),d=decodeURIComponent(p),n(s,l)?o(s[l])?s[l].push(d):s[l]=[s[l],d]:s[l]=d}return s};var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,r){"use strict";var n=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,r,a){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?i(s(t),(function(s){var a=encodeURIComponent(n(s))+r;return o(t[s])?i(t[s],(function(t){return a+encodeURIComponent(n(t))})).join(e):a+encodeURIComponent(n(t[s]))})).join(e):a?encodeURIComponent(n(a))+r+encodeURIComponent(n(t)):""};var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n<t.length;n++)r.push(e(t[n],n));return r}var s=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}},function(t,e,r){"use strict"; /* object-assign (c) Sindre Sorhus @license MIT */var n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function s(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,a,u=s(t),c=1;c<arguments.length;c++){for(var f in r=Object(arguments[c]))o.call(r,f)&&(u[f]=r[f]);if(n){a=n(r);for(var h=0;h<a.length;h++)i.call(r,a[h])&&(u[a[h]]=r[a[h]])}}return u}},function(t,e,r){(function(t){var n=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},o=/%[sdj%]/g;e.format=function(t){if(!m(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(a(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,i=n.length,s=String(t).replace(o,(function(t){if("%%"===t)return"%";if(r>=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),u=n[r];r<i;u=n[++r])g(u)||!b(u)?s+=" "+u:s+=" "+a(u);return s},e.deprecate=function(r,n){if(void 0!==t&&!0===t.noDeprecation)return r;if(void 0===t)return function(){return e.deprecate(r,n).apply(this,arguments)};var o=!1;return function(){if(!o){if(t.throwDeprecation)throw new Error(n);t.traceDeprecation?console.trace(n):console.error(n),o=!0}return r.apply(this,arguments)}};var i,s={};function a(t,r){var n={seen:[],stylize:c};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(r)?n.showHidden=r:r&&e._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),f(n,t,n.depth)}function u(t,e){var r=a.styles[e];return r?"["+a.colors[r][0]+"m"+t+"["+a.colors[r][1]+"m":t}function c(t,e){return t}function f(t,r,n){if(t.customInspect&&r&&R(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,t);return m(o)||(o=f(t,o,n)),o}var i=function(t,e){if(v(e))return t.stylize("undefined","undefined");if(m(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(y(e))return t.stylize(""+e,"number");if(d(e))return t.stylize(""+e,"boolean");if(g(e))return t.stylize("null","null")}(t,r);if(i)return i;var s=Object.keys(r),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),T(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return h(r);if(0===s.length){if(R(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(w(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(E(r))return t.stylize(Date.prototype.toString.call(r),"date");if(T(r))return h(r)}var c,b="",_=!1,S=["{","}"];(l(r)&&(_=!0,S=["[","]"]),R(r))&&(b=" [Function"+(r.name?": "+r.name:"")+"]");return w(r)&&(b=" "+RegExp.prototype.toString.call(r)),E(r)&&(b=" "+Date.prototype.toUTCString.call(r)),T(r)&&(b=" "+h(r)),0!==s.length||_&&0!=r.length?n<0?w(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=_?function(t,e,r,n,o){for(var i=[],s=0,a=e.length;s<a;++s)I(e,String(s))?i.push(p(t,e,r,n,String(s),!0)):i.push("");return o.forEach((function(o){o.match(/^\d+$/)||i.push(p(t,e,r,n,o,!0))})),i}(t,r,n,a,s):s.map((function(e){return p(t,r,n,a,e,_)})),t.seen.pop(),function(t,e,r){if(t.reduce((function(t,e){return e.indexOf("\n")>=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(c,b,S)):S[0]+b+S[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,r,n,o,i){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),I(n,o)||(s="["+o+"]"),a||(t.seen.indexOf(u.value)<0?(a=g(r)?f(t,u.value,null):f(t,u.value,r-1)).indexOf("\n")>-1&&(a=i?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),v(s)){if(i&&o.match(/^\d+$/))return a;(s=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function l(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function g(t){return null===t}function y(t){return"number"==typeof t}function m(t){return"string"==typeof t}function v(t){return void 0===t}function w(t){return b(t)&&"[object RegExp]"===_(t)}function b(t){return"object"==typeof t&&null!==t}function E(t){return b(t)&&"[object Date]"===_(t)}function T(t){return b(t)&&("[object Error]"===_(t)||t instanceof Error)}function R(t){return"function"==typeof t}function _(t){return Object.prototype.toString.call(t)}function S(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(r){if(v(i)&&(i=t.env.NODE_DEBUG||""),r=r.toUpperCase(),!s[r])if(new RegExp("\\b"+r+"\\b","i").test(i)){var n=t.pid;s[r]=function(){var t=e.format.apply(e,arguments);console.error("%s %d: %s",r,n,t)}}else s[r]=function(){};return s[r]},e.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=l,e.isBoolean=d,e.isNull=g,e.isNullOrUndefined=function(t){return null==t},e.isNumber=y,e.isString=m,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=v,e.isRegExp=w,e.isObject=b,e.isDate=E,e.isError=T,e.isFunction=R,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(40);var P=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function j(){var t=new Date,e=[S(t.getHours()),S(t.getMinutes()),S(t.getSeconds())].join(":");return[t.getDate(),P[t.getMonth()],e].join(" ")}function I(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",j(),e.format.apply(e,arguments))},e.inherits=r(41),e._extend=function(t,e){if(!e||!b(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var x="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function A(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(x&&t[x]){var e;if("function"!=typeof(e=t[x]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,x,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,o)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),x&&Object.defineProperty(e,x,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,n(t))},e.promisify.custom=x,e.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function r(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var o=r.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,s=function(){return o.apply(i,arguments)};e.apply(this,r).then((function(e){t.nextTick(s,null,e)}),(function(e){t.nextTick(A,e,s)}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),Object.defineProperties(r,n(e)),r}}).call(this,r(10))},function(t,e){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e,r){const n=r(1),o=r(4),i=r(2),s=(t={})=>{const e=t.headers;if(204!=t.status)throw{status:t.status,statusText:t.statusText||"Login Failure",headers:e,body:t.data};const r={"X-MSTR-AuthToken":e["x-mstr-authtoken"]};return e["set-cookie"]&&(r.Cookie=e["set-cookie"][0]),r};t.exports=class extends i{login(t,e=!0,r=!1){const n=this.getSessionCredentials();return r&&n&&(t=n),o(t),o(t,"username"),this._makeRequest("auth/login",t,"POST").then(r=>{const n=s(r);return e&&(this.setSessionCredentials(t),this.setSessionHeaders(n)),n})}logout(t,e=!1){return t?"string"==typeof t?this._makeRequest("auth/logout",!1,"POST",{"X-MSTR-AuthToken":t}):(o(t),o(t,"X-MSTR-AuthToken"),this._makeRequest("auth/logout",!1,"POST",t)):this._makeRequest("auth/logout",!1,"POST",this.getSessionHeaders()).then(t=>(204==t.status&&this.truncateStoredSession(e),t))}truncateStoredSession(t=!0){this.setSessionHeaders(),t&&this.setSessionCredentials()}clearCookies(){return this.setSessionHeaders({Cookie:""})}validateIdentityToken(t){o(t);const e={"X-MSTR-IdentityToken":t};return this._makeRequest("auth/identityToken",!1,"GET",e).then(t=>this.throwIfFailed(t,200)).catch(t=>this.throwExceptionResponse(t))}createIdentityToken(t=this.getAuthToken()){n(t,"No authToken provided and none found in-memory. Login first or provide auth token.");const e={"X-MSTR-AuthToken":t};return this._makeRequest("auth/identityToken",!1,"POST",e).then(t=>{const e=t.headers;if(201!=t.status)throw{status:t.status,statusText:t.statusText||"Failed to create token",headers:e,body:t.data};return e["x-mstr-identitytoken"]}).catch(t=>this.throwExceptionResponse(t))}restoreIdentityToken(t,e=!0){n(t,"No identityToken provided - nothing to restore.");const r={loginMode:-1,identityToken:t};return this._makeRequest("auth/delegate",r,"POST").then(t=>{const r=s(t);return e&&this.setSessionHeaders(r),r}).catch(t=>this.throwExceptionResponse(t))}keepAlive(){return this._makeRequest("sessions",!1,"PUT").then(t=>this.throwIfFailed(t,204)).catch(t=>this.throwExceptionResponse(t))}getConfigurationSessionInfo(){return this._makeRequest("sessions",!1,"GET").then(t=>this.throwIfFailed(t,200)).catch(t=>this.throwExceptionResponse(t))}getProjectSessionInfo(t){return this._makeRequest("sessions/projectId",!1,"GET",this.getProjectHeader(t)).then(t=>this.throwIfFailed(t,200)).catch(t=>this.throwExceptionResponse(t))}getUserInfo(){return this._makeRequest("sessions/userInfo",!1,"GET").then(t=>this.throwIfFailed(t,200)).catch(t=>this.throwExceptionResponse(t))}getPrivilegesList(){return this._makeRequest("sessions/privileges",!1,"GET").then(t=>this.throwIfFailed(t,200)).catch(t=>this.throwExceptionResponse(t))}getPrivilegeInfo(t){n(t,"Privilege ID is missing");const e="sessions/privileges/"+t;return this._makeRequest(e,!1,"GET").then(t=>this.throwIfFailed(t,200)).catch(t=>this.throwExceptionResponse(t))}}},function(t,e,r){const n=r(1),o=r(2),i=r(3);t.exports=class extends o{_getBase(){return"cubes"}getCubeDefinition(t){return n(t,"No cubeId provided"),this._makeRequest(`v2/${this._getBase()}/${t}`,!1,"GET",this.getProjectHeader()).then(t=>this.throwIfFailed(t,200))}createCubeInstance(t,e,r,o,s){n(t,"No cubeId provided");const a=i(s,r,o);return this._makeRequest(`v2/${this._getBase()}/${t}/instances`,e,"POST",this.getProjectHeader(),a).then(t=>this.throwIfFailed(t,200))}getInstanceResults(t,e,r,o,s){n(t,"No objectId provided"),n(e,"No instanceId provided");const a=i(s,r,o);return this._makeRequest(`v2/${this._getBase()}/${t}/instances/${e}`,a,"GET",this.getProjectHeader()).then(t=>this.throwIfFailed(t,200))}publishCube(t,e){n(t,"No cubeId provided");const r=i(e);return this._makeRequest(`${this._getBase()}/${t}`,!1,"POST",this.getProjectHeader(),r).then(t=>this.throwIfFailed(t,202))}getStatus(t){return n(t,"No cubeId provided"),this._makeRequest(`${this._getBase()}/${t}`,!1,"HEAD",this.getProjectHeader()).then(t=>{this.throwIfFailed(t,200);return t.headers["x-mstr-cubestatus"]})}getCubesInfo(t,e){n(t,"No cubeIds provided");const r=i(e);return r.id=t,this._makeRequest(""+this._getBase(),r,"GET",this.getProjectHeader()).then(t=>this.throwIfFailed(t,200))}getCubeAttributeElement(t,e,r,o,s,a){n(t,"No cubeId provided"),n(e,"No attributeId provided");const u=i(a,o,s);return r&&(u.baseFormIds=r),this._makeRequest(`${this._getBase()}/${t}/attributes/${e}/elements`,u,"GET",this.getProjectHeader()).then(t=>this.throwIfFailed(t,200))}getCubeInstanceAttributeElement(t,e,r,o,s,a,u){n(t,"No cubeId provided"),n(e,"No instanceId provided"),n(r,"No attributeId provided");const c=i(u,s,a);o&&(c.searchPattern=o);const f=`${this._getBase()}/${t}/instances/${e}/attributes/${r}/elements`;return this._makeRequest(f,c,"GET",this.getProjectHeader()).then(t=>this.throwIfFailed(t,200))}getCubeDefinitionV1(t){return n(t,"No cubeId provided"),this._makeRequest(`${this._getBase()}/${t}`,!1,"GET",this.getProjectHeader()).then(t=>this.throwIfFailed(t,200))}createCubeInstanceV1(t,e,r,o,s){n(t,"No cubeId provided");const a=i(s,r,o);return this._makeRequest(`${this._getBase()}/${t}/instances`,e,"POST",this.getProjectHeader(),a).then(t=>this.throwIfFailed(t,200))}getInstanceResultsV1(t,e,r,o,s){n(t,"No cubeId provided"),n(e,"No instanceId provided");const a=i(s,r,o);return this._makeRequest(`${this._getBase()}/${t}/instances/${e}`,a,"GET",this.getProjectHeader()).then(t=>this.throwIfFailed(t,200))}}},function(t,e,r){(function(e){const n=r(1),o=r(4),i=r(2),s=r(3);t.exports=class extends i{_getBase(){return"datasets"}_getUploadSessionBase(t){return this._getBase()+"/"+t+"/uploadSessions"}getDatasetDefinition(t,e){n(t,"No datasetId provided");const r=s(e);return this._makeRequest(`${this._getBase()}/${t}`,r,"GET",this.getProjectHeader()).then(t=>this.throwIfFailed(t,200))}createDataset(t={},e){o(t),o(t,"name"),o(t,"tables");const r=s(e);return this._makeRequest(this._getBase(),t,"POST",this.getProjectHeader(),r).then(t=>this.throwIfFailed(t,200))}createMultiTableDataset(t={},e){o(t),o(t,"name"),o(t,"tables");const r=s(e);return this._makeRequest(this._getBase()+"/models",t,"POST",this.getProjectHeader(),r).then(t=>this.throwIfFailed(t,200)).catch(t=>this.throwExceptionResponse(t))}updateDataset(t,e,r,i="Replace",a){n(t,"No datasetId provided"),n(e,"No tableId provided"),o(r),o(r,"name"),o(r,"data");const u={updatePolicy:i,...this.getProjectHeader()},c=s(a);return this._makeRequest(this._getBase()+`/${t}/tables/${e}`,r,"PATCH",u,c).then(t=>this.throwIfFailed(t,200))}createUploadSession(t,e){return n(t,"No datasetId provided"),n(e,"No tables formatting provided"),this._makeRequest(this._getUploadSessionBase(t),e,"POST",this.getProjectHeader()).then(t=>this.throwIfFailed(t,200)).then(t=>t.uploadSessionId||t).catch(t=>this.throwExceptionResponse(t))}uploadDataToUploadSession(t,r,o,i=1,s,a=!0){n(t,"No datasetId provided"),n(r,"No uploadSessionId provided"),n(o,"No tableName provided"),n(i,"No index provided"),n(s,"No rawData provided");const u=`${this._getUploadSessionBase(t)}/${r}`,c="string"==typeof s?s:JSON.stringify(s),f={tableName:o,index:i,data:a?e.from(c).toString("base64"):s};return this._makeRequest(u,f,"PUT",this.getProjectHeader()).then(t=>this.throwIfFailed(t,200)).catch(t=>this.throwExceptionResponse(t))}deleteUploadSession(t,e){n(t,"No datasetId provided"),n(e,"No uploadSessionId provided");const r=`${this._getUploadSessionBase(t)}/${e}`;return this._makeRequest(r,!1,"DELETE",this.getProjectHeader()).then(t=>this.throwIfFailed(t,200)).catch(t=>this.throwExceptionResponse(t))}publishUploadSessionDataset(t,e){n(t,"No datasetId provided"),n(e,"No uploadSessionId provided");const r=`${this._getUploadSessionBase(t)}/${e}/publish`;return this._makeRequest(r,!1,"POST",this.getProjectHeader()).then(t=>this.throwIfFailed(t,200)).catch(t=>this.throwExceptionResponse(t))}getUploadSessionStatus(t,e){n(t,"No datasetId provided"),n(e,"No uploadSessionId provided");const r=`${this._getUploadSessionBase(t)}/${e}/publishStatus`;return this._makeRequest(r,!1,"GET",this.getProjectHeader()).then(t=>this.throwIfFailed(t,200)).catch(t=>this.throwExceptionResponse(t))}}}).call(this,r(45).Buffer)},function(t,e,r){"use strict";(function(t){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <http://feross.org> * @license MIT */ var n=r(46),o=r(47),i=r(48);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}return c(this,t,e,r)}function c(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=p(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(e,r),o=(t=a(t,n)).write(e,r);o!==n&&(t=t.slice(0,o));return t}(t,e,r):function(t,e){if(u.isBuffer(e)){var r=0|l(e.length);return 0===(t=a(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?a(t,0):p(t,e);if("Buffer"===e.type&&i(e.data))return p(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(f(e),t=a(t,e<0?0:0|l(e)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function p(t,e){var r=e.length<0?0:0|l(e.length);t=a(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function l(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function d(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(t).length;default:if(n)return $(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,e,r);case"utf8":case"utf-8":return P(this,e,r);case"ascii":return j(this,e,r);case"latin1":case"binary":return I(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,o);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){var i,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var f=-1;for(i=r;i<a;i++)if(c(t,i)===c(e,-1===f?0:i-f)){if(-1===f&&(f=i),i-f+1===u)return f*s}else-1!==f&&(i-=i-f),f=-1}else for(r+u>a&&(r=a-u),i=r;i>=0;i--){for(var h=!0,p=0;p<u;p++)if(c(t,i+p)!==c(e,p)){h=!1;break}if(h)return i}return-1}function w(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[r+s]=a}return s}function b(t,e,r,n){return L($(e,t.length-r),t,r,n)}function E(t,e,r,n){return L(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function T(t,e,r,n){return E(t,e,r,n)}function R(t,e,r,n){return L(H(e),t,r,n)}function _(t,e,r,n){return L(function(t,e){for(var r,n,o,i=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function P(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,s,a,u,c=t[o],f=null,h=c>239?4:c>223?3:c>191?2:1;if(o+h<=r)switch(h){case 1:c<128&&(f=c);break;case 2:128==(192&(i=t[o+1]))&&(u=(31&c)<<6|63&i)>127&&(f=u);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(u=(15&c)<<12|(63&i)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:i=t[o+1],s=t[o+2],a=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(f=u)}null===f?(f=65533,h=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),o+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:fun