@cubejs-client/core 1.6.17 → 1.6.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cubejs-client-core.cjs.js +170 -160
- package/dist/cubejs-client-core.cjs.js.map +1 -1
- package/dist/cubejs-client-core.umd.js +171 -161
- package/dist/cubejs-client-core.umd.js.map +1 -1
- package/dist/src/index.d.ts +4 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +15 -6
- package/dist/test/CubeApi.test.js +93 -0
- package/package.json +3 -3
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('core-js/modules/es.array.for-each.js'), require('core-js/modules/es.object.keys.js'), require('core-js/modules/es.object.to-string.js'), require('core-js/modules/web.dom-collections.for-each.js'), require('@babel/runtime/helpers/toArray'), require('@babel/runtime/helpers/slicedToArray'), require('@babel/runtime/helpers/asyncToGenerator'), require('@babel/runtime/helpers/typeof'), require('@babel/runtime/helpers/classCallCheck'), require('@babel/runtime/helpers/createClass'), require('@babel/runtime/helpers/defineProperty'), require('@babel/runtime/helpers/awaitAsyncGenerator'), require('@babel/runtime/helpers/wrapAsyncGenerator'), require('@babel/runtime/regenerator'), require('core-js/modules/es.symbol.js'), require('core-js/modules/es.symbol.description.js'), require('core-js/modules/es.symbol.async-iterator.js'), require('core-js/modules/es.symbol.iterator.js'), require('core-js/modules/es.array.concat.js'), require('core-js/modules/es.array.filter.js'), require('core-js/modules/es.array.from.js'), require('core-js/modules/es.array.is-array.js'), require('core-js/modules/es.array.iterator.js'), require('core-js/modules/es.array.map.js'), require('core-js/modules/es.array.reduce.js'), require('core-js/modules/es.array.slice.js'), require('core-js/modules/es.function.name.js'), require('core-js/modules/es.date.to-string.js'), require('core-js/modules/es.number.constructor.js'), require('core-js/modules/es.object.entries.js'), require('core-js/modules/es.object.define-properties.js'), require('core-js/modules/es.object.define-property.js'), require('core-js/modules/es.object.get-own-property-descriptor.js'), require('core-js/modules/es.object.get-own-property-descriptors.js'), require('core-js/modules/es.promise.js'), require('core-js/modules/es.regexp.exec.js'), require('core-js/modules/es.regexp.to-string.js'), require('core-js/modules/es.string.iterator.js'), require('core-js/modules/es.string.trim.js'), require('core-js/modules/web.dom-collections.iterator.js'), require('core-js/modules/web.timers.js'), require('uuid'), require('@babel/runtime/helpers/readOnlyError'), require('@babel/runtime/helpers/objectWithoutProperties'), require('@babel/runtime/helpers/toConsumableArray'), require('core-js/modules/es.array.find.js'), require('core-js/modules/es.array.includes.js'), require('core-js/modules/es.array.index-of.js'), require('core-js/modules/es.array.join.js'), require('core-js/modules/es.map.js'), require('core-js/modules/es.number.is-nan.js'), require('core-js/modules/es.number.parse-float.js'), require('core-js/modules/es.object.values.js'), require('core-js/modules/es.set.js'), require('core-js/modules/es.string.includes.js'), require('core-js/modules/es.string.match.js'), require('dayjs'), require('ramda'), require('core-js/modules/es.array.every.js'), require('core-js/modules/es.array.flat-map.js'), require('core-js/modules/es.array.splice.js'), require('core-js/modules/es.array.unscopables.flat-map.js'), require('core-js/modules/es.parse-int.js'), require('core-js/modules/es.string.ends-with.js'), require('core-js/modules/es.string.split.js'), require('dayjs/plugin/quarterOfYear'), require('dayjs/plugin/duration'), require('dayjs/plugin/isoWeek'), require('dayjs/locale/en'), require('core-js/modules/es.array.sort.js'), require('core-js/modules/es.date.to-json.js'), require('core-js/modules/web.url-search-params.js'), require('cross-fetch'), require('url-search-params-polyfill'), require('core-js/modules/es.array-buffer.constructor.js'), require('core-js/modules/es.array-buffer.slice.js'), require('core-js/modules/es.data-view.js'), require('core-js/modules/es.typed-array.uint8-array.js'), require('core-js/modules/es.typed-array.copy-within.js'), require('core-js/modules/es.typed-array.every.js'), require('core-js/modules/es.typed-array.fill.js'), require('core-js/modules/es.typed-array.filter.js'), require('core-js/modules/es.typed-array.find.js'), require('core-js/modules/es.typed-array.find-index.js'), require('core-js/modules/es.typed-array.for-each.js'), require('core-js/modules/es.typed-array.includes.js'), require('core-js/modules/es.typed-array.index-of.js'), require('core-js/modules/es.typed-array.iterator.js'), require('core-js/modules/es.typed-array.join.js'), require('core-js/modules/es.typed-array.last-index-of.js'), require('core-js/modules/es.typed-array.map.js'), require('core-js/modules/es.typed-array.reduce.js'), require('core-js/modules/es.typed-array.reduce-right.js'), require('core-js/modules/es.typed-array.reverse.js'), require('core-js/modules/es.typed-array.set.js'), require('core-js/modules/es.typed-array.slice.js'), require('core-js/modules/es.typed-array.some.js'), require('core-js/modules/es.typed-array.sort.js'), require('core-js/modules/es.typed-array.subarray.js'), require('core-js/modules/es.typed-array.to-locale-string.js'), require('core-js/modules/es.typed-array.to-string.js'), require('core-js/modules/es.reflect.construct.js'), require('@babel/runtime/helpers/possibleConstructorReturn'), require('@babel/runtime/helpers/getPrototypeOf'), require('@babel/runtime/helpers/inherits'), require('@babel/runtime/helpers/wrapNativeSuper')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define(['core-js/modules/es.array.for-each.js', 'core-js/modules/es.object.keys.js', 'core-js/modules/es.object.to-string.js', 'core-js/modules/web.dom-collections.for-each.js', '@babel/runtime/helpers/toArray', '@babel/runtime/helpers/slicedToArray', '@babel/runtime/helpers/asyncToGenerator', '@babel/runtime/helpers/typeof', '@babel/runtime/helpers/classCallCheck', '@babel/runtime/helpers/createClass', '@babel/runtime/helpers/defineProperty', '@babel/runtime/helpers/awaitAsyncGenerator', '@babel/runtime/helpers/wrapAsyncGenerator', '@babel/runtime/regenerator', 'core-js/modules/es.symbol.js', 'core-js/modules/es.symbol.description.js', 'core-js/modules/es.symbol.async-iterator.js', 'core-js/modules/es.symbol.iterator.js', 'core-js/modules/es.array.concat.js', 'core-js/modules/es.array.filter.js', 'core-js/modules/es.array.from.js', 'core-js/modules/es.array.is-array.js', 'core-js/modules/es.array.iterator.js', 'core-js/modules/es.array.map.js', 'core-js/modules/es.array.reduce.js', 'core-js/modules/es.array.slice.js', 'core-js/modules/es.function.name.js', 'core-js/modules/es.date.to-string.js', 'core-js/modules/es.number.constructor.js', 'core-js/modules/es.object.entries.js', 'core-js/modules/es.object.define-properties.js', 'core-js/modules/es.object.define-property.js', 'core-js/modules/es.object.get-own-property-descriptor.js', 'core-js/modules/es.object.get-own-property-descriptors.js', 'core-js/modules/es.promise.js', 'core-js/modules/es.regexp.exec.js', 'core-js/modules/es.regexp.to-string.js', 'core-js/modules/es.string.iterator.js', 'core-js/modules/es.string.trim.js', 'core-js/modules/web.dom-collections.iterator.js', 'core-js/modules/web.timers.js', 'uuid', '@babel/runtime/helpers/readOnlyError', '@babel/runtime/helpers/objectWithoutProperties', '@babel/runtime/helpers/toConsumableArray', 'core-js/modules/es.array.find.js', 'core-js/modules/es.array.includes.js', 'core-js/modules/es.array.index-of.js', 'core-js/modules/es.array.join.js', 'core-js/modules/es.map.js', 'core-js/modules/es.number.is-nan.js', 'core-js/modules/es.number.parse-float.js', 'core-js/modules/es.object.values.js', 'core-js/modules/es.set.js', 'core-js/modules/es.string.includes.js', 'core-js/modules/es.string.match.js', 'dayjs', 'ramda', 'core-js/modules/es.array.every.js', 'core-js/modules/es.array.flat-map.js', 'core-js/modules/es.array.splice.js', 'core-js/modules/es.array.unscopables.flat-map.js', 'core-js/modules/es.parse-int.js', 'core-js/modules/es.string.ends-with.js', 'core-js/modules/es.string.split.js', 'dayjs/plugin/quarterOfYear', 'dayjs/plugin/duration', 'dayjs/plugin/isoWeek', 'dayjs/locale/en', 'core-js/modules/es.array.sort.js', 'core-js/modules/es.date.to-json.js', 'core-js/modules/web.url-search-params.js', 'cross-fetch', 'url-search-params-polyfill', 'core-js/modules/es.array-buffer.constructor.js', 'core-js/modules/es.array-buffer.slice.js', 'core-js/modules/es.data-view.js', 'core-js/modules/es.typed-array.uint8-array.js', 'core-js/modules/es.typed-array.copy-within.js', 'core-js/modules/es.typed-array.every.js', 'core-js/modules/es.typed-array.fill.js', 'core-js/modules/es.typed-array.filter.js', 'core-js/modules/es.typed-array.find.js', 'core-js/modules/es.typed-array.find-index.js', 'core-js/modules/es.typed-array.for-each.js', 'core-js/modules/es.typed-array.includes.js', 'core-js/modules/es.typed-array.index-of.js', 'core-js/modules/es.typed-array.iterator.js', 'core-js/modules/es.typed-array.join.js', 'core-js/modules/es.typed-array.last-index-of.js', 'core-js/modules/es.typed-array.map.js', 'core-js/modules/es.typed-array.reduce.js', 'core-js/modules/es.typed-array.reduce-right.js', 'core-js/modules/es.typed-array.reverse.js', 'core-js/modules/es.typed-array.set.js', 'core-js/modules/es.typed-array.slice.js', 'core-js/modules/es.typed-array.some.js', 'core-js/modules/es.typed-array.sort.js', 'core-js/modules/es.typed-array.subarray.js', 'core-js/modules/es.typed-array.to-locale-string.js', 'core-js/modules/es.typed-array.to-string.js', 'core-js/modules/es.reflect.construct.js', '@babel/runtime/helpers/possibleConstructorReturn', '@babel/runtime/helpers/getPrototypeOf', '@babel/runtime/helpers/inherits', '@babel/runtime/helpers/wrapNativeSuper'], factory) :
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.cubejs = factory(null, null, null, null, global._toArray, global._slicedToArray, global._asyncToGenerator, global._typeof, global._classCallCheck, global._createClass, global._defineProperty, global._awaitAsyncGenerator, global._wrapAsyncGenerator, global._regeneratorRuntime, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, global.uuid, null, global._objectWithoutProperties, global._toConsumableArray, null, null, null, null, null, null, null, null, null, null, null, global.dayjs, global.ramda, null, null, null, null, null, null, null, global.quarterOfYear, global.duration, global.isoWeek, global.en, null, null, null, global.fetch, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, global._possibleConstructorReturn, global._getPrototypeOf, global._inherits, global._wrapNativeSuper));
|
|
5
|
-
}(this, (function (es_array_forEach_js, es_object_keys_js, es_object_toString_js, web_domCollections_forEach_js, _toArray, _slicedToArray, _asyncToGenerator, _typeof, _classCallCheck, _createClass, _defineProperty, _awaitAsyncGenerator, _wrapAsyncGenerator, _regeneratorRuntime, es_symbol_js, es_symbol_description_js, es_symbol_asyncIterator_js, es_symbol_iterator_js, es_array_concat_js, es_array_filter_js, es_array_from_js, es_array_isArray_js, es_array_iterator_js, es_array_map_js, es_array_reduce_js, es_array_slice_js, es_function_name_js, es_date_toString_js, es_number_constructor_js, es_object_entries_js, es_object_defineProperties_js, es_object_defineProperty_js, es_object_getOwnPropertyDescriptor_js, es_object_getOwnPropertyDescriptors_js, es_promise_js, es_regexp_exec_js, es_regexp_toString_js, es_string_iterator_js, es_string_trim_js, web_domCollections_iterator_js, web_timers_js, uuid, readOnlyError, _objectWithoutProperties, _toConsumableArray, es_array_find_js, es_array_includes_js, es_array_indexOf_js, es_array_join_js, es_map_js, es_number_isNan_js, es_number_parseFloat_js, es_object_values_js, es_set_js, es_string_includes_js, es_string_match_js, dayjs, ramda, es_array_every_js, es_array_flatMap_js, es_array_splice_js, es_array_unscopables_flatMap_js, es_parseInt_js, es_string_endsWith_js, es_string_split_js, quarterOfYear, duration, isoWeek, en, es_array_sort_js, es_date_toJson_js, web_urlSearchParams_js, fetch, urlSearchParamsPolyfill, es_arrayBuffer_constructor_js, es_arrayBuffer_slice_js, es_dataView_js, es_typedArray_uint8Array_js, es_typedArray_copyWithin_js, es_typedArray_every_js, es_typedArray_fill_js, es_typedArray_filter_js, es_typedArray_find_js, es_typedArray_findIndex_js, es_typedArray_forEach_js, es_typedArray_includes_js, es_typedArray_indexOf_js, es_typedArray_iterator_js, es_typedArray_join_js, es_typedArray_lastIndexOf_js, es_typedArray_map_js, es_typedArray_reduce_js, es_typedArray_reduceRight_js, es_typedArray_reverse_js, es_typedArray_set_js, es_typedArray_slice_js, es_typedArray_some_js, es_typedArray_sort_js, es_typedArray_subarray_js, es_typedArray_toLocaleString_js, es_typedArray_toString_js, es_reflect_construct_js, _possibleConstructorReturn, _getPrototypeOf, _inherits, _wrapNativeSuper) { 'use strict';
|
|
5
|
+
})(this, (function (es_array_forEach_js, es_object_keys_js, es_object_toString_js, web_domCollections_forEach_js, _toArray, _slicedToArray, _asyncToGenerator, _typeof, _classCallCheck, _createClass, _defineProperty, _awaitAsyncGenerator, _wrapAsyncGenerator, _regeneratorRuntime, es_symbol_js, es_symbol_description_js, es_symbol_asyncIterator_js, es_symbol_iterator_js, es_array_concat_js, es_array_filter_js, es_array_from_js, es_array_isArray_js, es_array_iterator_js, es_array_map_js, es_array_reduce_js, es_array_slice_js, es_function_name_js, es_date_toString_js, es_number_constructor_js, es_object_entries_js, es_object_defineProperties_js, es_object_defineProperty_js, es_object_getOwnPropertyDescriptor_js, es_object_getOwnPropertyDescriptors_js, es_promise_js, es_regexp_exec_js, es_regexp_toString_js, es_string_iterator_js, es_string_trim_js, web_domCollections_iterator_js, web_timers_js, uuid, readOnlyError, _objectWithoutProperties, _toConsumableArray, es_array_find_js, es_array_includes_js, es_array_indexOf_js, es_array_join_js, es_map_js, es_number_isNan_js, es_number_parseFloat_js, es_object_values_js, es_set_js, es_string_includes_js, es_string_match_js, dayjs, ramda, es_array_every_js, es_array_flatMap_js, es_array_splice_js, es_array_unscopables_flatMap_js, es_parseInt_js, es_string_endsWith_js, es_string_split_js, quarterOfYear, duration, isoWeek, en, es_array_sort_js, es_date_toJson_js, web_urlSearchParams_js, fetch, urlSearchParamsPolyfill, es_arrayBuffer_constructor_js, es_arrayBuffer_slice_js, es_dataView_js, es_typedArray_uint8Array_js, es_typedArray_copyWithin_js, es_typedArray_every_js, es_typedArray_fill_js, es_typedArray_filter_js, es_typedArray_find_js, es_typedArray_findIndex_js, es_typedArray_forEach_js, es_typedArray_includes_js, es_typedArray_indexOf_js, es_typedArray_iterator_js, es_typedArray_join_js, es_typedArray_lastIndexOf_js, es_typedArray_map_js, es_typedArray_reduce_js, es_typedArray_reduceRight_js, es_typedArray_reverse_js, es_typedArray_set_js, es_typedArray_slice_js, es_typedArray_some_js, es_typedArray_sort_js, es_typedArray_subarray_js, es_typedArray_toLocaleString_js, es_typedArray_toString_js, es_reflect_construct_js, _possibleConstructorReturn, _getPrototypeOf, _inherits, _wrapNativeSuper) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -30,18 +30,18 @@
|
|
|
30
30
|
var _wrapNativeSuper__default = /*#__PURE__*/_interopDefaultLegacy(_wrapNativeSuper);
|
|
31
31
|
|
|
32
32
|
function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
33
|
-
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty__default[
|
|
34
|
-
dayjs__default[
|
|
35
|
-
dayjs__default[
|
|
36
|
-
dayjs__default[
|
|
33
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
34
|
+
dayjs__default["default"].extend(quarterOfYear__default["default"]);
|
|
35
|
+
dayjs__default["default"].extend(duration__default["default"]);
|
|
36
|
+
dayjs__default["default"].extend(isoWeek__default["default"]);
|
|
37
37
|
|
|
38
38
|
// A custom locale for internal use that doesn't affect the global dayjs instance
|
|
39
39
|
var cubeInternalLocale = 'cube-internal-en';
|
|
40
|
-
var customLocale = _objectSpread$4(_objectSpread$4({}, en__default[
|
|
40
|
+
var customLocale = _objectSpread$4(_objectSpread$4({}, en__default["default"]), {}, {
|
|
41
41
|
name: cubeInternalLocale,
|
|
42
42
|
weekStart: 1
|
|
43
43
|
});
|
|
44
|
-
dayjs__default[
|
|
44
|
+
dayjs__default["default"].Ls[cubeInternalLocale] = customLocale;
|
|
45
45
|
|
|
46
46
|
// TODO: Define a better type as unitOfTime.DurationConstructor in moment.js
|
|
47
47
|
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
// When granularity is week, weekStart Value must be 1. However, since the client can change it globally
|
|
79
79
|
// (https://day.js.org/docs/en/i18n/changing-locale) So the function below has been added.
|
|
80
80
|
var internalDayjs = function internalDayjs() {
|
|
81
|
-
return dayjs__default[
|
|
81
|
+
return dayjs__default["default"].apply(void 0, arguments).locale(cubeInternalLocale);
|
|
82
82
|
};
|
|
83
83
|
var TIME_SERIES = {
|
|
84
84
|
day: function day(range) {
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
function addInterval(date, interval) {
|
|
164
164
|
var res = date.clone();
|
|
165
165
|
Object.entries(interval).forEach(function (_ref) {
|
|
166
|
-
var _ref2 = _slicedToArray__default[
|
|
166
|
+
var _ref2 = _slicedToArray__default["default"](_ref, 2),
|
|
167
167
|
key = _ref2[0],
|
|
168
168
|
value = _ref2[1];
|
|
169
169
|
res = res.add(value, key);
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
function subtractInterval(date, interval) {
|
|
183
183
|
var res = date.clone();
|
|
184
184
|
Object.entries(interval).forEach(function (_ref3) {
|
|
185
|
-
var _ref4 = _slicedToArray__default[
|
|
185
|
+
var _ref4 = _slicedToArray__default["default"](_ref3, 2),
|
|
186
186
|
key = _ref4[0],
|
|
187
187
|
value = _ref4[1];
|
|
188
188
|
res = res.subtract(value, key);
|
|
@@ -364,11 +364,11 @@
|
|
|
364
364
|
|
|
365
365
|
var _excluded$2 = ["query"];
|
|
366
366
|
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
367
|
-
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty__default[
|
|
367
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
368
368
|
function removeEmptyQueryFields(_query) {
|
|
369
369
|
var query = _query || {};
|
|
370
370
|
return ramda.fromPairs(ramda.toPairs(query).flatMap(function (_ref) {
|
|
371
|
-
var _ref2 = _slicedToArray__default[
|
|
371
|
+
var _ref2 = _slicedToArray__default["default"](_ref, 2),
|
|
372
372
|
key = _ref2[0],
|
|
373
373
|
value = _ref2[1];
|
|
374
374
|
if (['measures', 'dimensions', 'segments', 'timeDimensions', 'filters'].includes(key)) {
|
|
@@ -405,18 +405,18 @@
|
|
|
405
405
|
return d.granularity;
|
|
406
406
|
});
|
|
407
407
|
if (granularity) {
|
|
408
|
-
return _defineProperty__default[
|
|
408
|
+
return _defineProperty__default["default"]({}, granularity.dimension, 'asc');
|
|
409
409
|
} else if ((query.measures || []).length > 0 && (query.dimensions || []).length > 0) {
|
|
410
|
-
return _defineProperty__default[
|
|
410
|
+
return _defineProperty__default["default"]({}, query.measures[0], 'desc');
|
|
411
411
|
} else if ((query.dimensions || []).length > 0) {
|
|
412
|
-
return _defineProperty__default[
|
|
412
|
+
return _defineProperty__default["default"]({}, query.dimensions[0], 'asc');
|
|
413
413
|
}
|
|
414
414
|
return {};
|
|
415
415
|
}
|
|
416
416
|
function defaultHeuristics(newState, oldQuery, options) {
|
|
417
417
|
var _clone = ramda.clone(newState),
|
|
418
418
|
query = _clone.query,
|
|
419
|
-
props = _objectWithoutProperties__default[
|
|
419
|
+
props = _objectWithoutProperties__default["default"](_clone, _excluded$2);
|
|
420
420
|
var meta = options.meta,
|
|
421
421
|
sessionGranularity = options.sessionGranularity;
|
|
422
422
|
var granularity = sessionGranularity || DEFAULT_GRANULARITY;
|
|
@@ -443,7 +443,7 @@
|
|
|
443
443
|
}
|
|
444
444
|
if ((oldQuery.measures || []).length === 0 && (newQuery.measures || []).length > 0 || (oldQuery.measures || []).length === 1 && (newQuery.measures || []).length === 1 && oldQuery.measures[0] !== newQuery.measures[0]) {
|
|
445
445
|
var _ref6 = newQuery.timeDimensions || [],
|
|
446
|
-
_ref7 = _slicedToArray__default[
|
|
446
|
+
_ref7 = _slicedToArray__default["default"](_ref6, 1),
|
|
447
447
|
td = _ref7[0];
|
|
448
448
|
var defaultTimeDimension = meta.defaultTimeDimensionNameFor(newQuery.measures[0]);
|
|
449
449
|
newQuery = _objectSpread$3(_objectSpread$3({}, newQuery), {}, {
|
|
@@ -508,7 +508,7 @@
|
|
|
508
508
|
var newChartType = state.chartType;
|
|
509
509
|
if ((newChartType === 'line' || newChartType === 'area') && (oldQuery.timeDimensions || []).length === 1 && !oldQuery.timeDimensions[0].granularity) {
|
|
510
510
|
var _ref8 = oldQuery.timeDimensions,
|
|
511
|
-
_ref9 = _slicedToArray__default[
|
|
511
|
+
_ref9 = _slicedToArray__default["default"](_ref8, 1),
|
|
512
512
|
_td = _ref9[0];
|
|
513
513
|
return _objectSpread$3(_objectSpread$3({}, state), {}, {
|
|
514
514
|
pivotConfig: null,
|
|
@@ -521,7 +521,7 @@
|
|
|
521
521
|
}
|
|
522
522
|
if ((newChartType === 'pie' || newChartType === 'table' || newChartType === 'number') && (oldQuery.timeDimensions || []).length === 1 && oldQuery.timeDimensions[0].granularity) {
|
|
523
523
|
var _ref0 = oldQuery.timeDimensions,
|
|
524
|
-
_ref1 = _slicedToArray__default[
|
|
524
|
+
_ref1 = _slicedToArray__default["default"](_ref0, 1),
|
|
525
525
|
_td2 = _ref1[0];
|
|
526
526
|
return _objectSpread$3(_objectSpread$3({}, state), {}, {
|
|
527
527
|
pivotConfig: null,
|
|
@@ -547,8 +547,8 @@
|
|
|
547
547
|
}
|
|
548
548
|
function movePivotItem(pivotConfig, sourceIndex, destinationIndex, sourceAxis, destinationAxis) {
|
|
549
549
|
var nextPivotConfig = _objectSpread$3(_objectSpread$3({}, pivotConfig), {}, {
|
|
550
|
-
x: _toConsumableArray__default[
|
|
551
|
-
y: _toConsumableArray__default[
|
|
550
|
+
x: _toConsumableArray__default["default"](pivotConfig.x || []),
|
|
551
|
+
y: _toConsumableArray__default["default"](pivotConfig.y || [])
|
|
552
552
|
});
|
|
553
553
|
var id = pivotConfig[sourceAxis][sourceIndex];
|
|
554
554
|
var lastIndex = nextPivotConfig[destinationAxis].length - 1;
|
|
@@ -564,9 +564,9 @@
|
|
|
564
564
|
return nextPivotConfig;
|
|
565
565
|
}
|
|
566
566
|
function moveItemInArray(list, sourceIndex, destinationIndex) {
|
|
567
|
-
var result = _toConsumableArray__default[
|
|
567
|
+
var result = _toConsumableArray__default["default"](list);
|
|
568
568
|
var _result$splice = result.splice(sourceIndex, 1),
|
|
569
|
-
_result$splice2 = _slicedToArray__default[
|
|
569
|
+
_result$splice2 = _slicedToArray__default["default"](_result$splice, 1),
|
|
570
570
|
removed = _result$splice2[0];
|
|
571
571
|
result.splice(destinationIndex, 0, removed);
|
|
572
572
|
return result;
|
|
@@ -575,12 +575,12 @@
|
|
|
575
575
|
var filters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
576
576
|
return filters.reduce(function (memo, filter) {
|
|
577
577
|
if ('or' in filter) {
|
|
578
|
-
return [].concat(_toConsumableArray__default[
|
|
578
|
+
return [].concat(_toConsumableArray__default["default"](memo), _toConsumableArray__default["default"](flattenFilters(filter.or)));
|
|
579
579
|
}
|
|
580
580
|
if ('and' in filter) {
|
|
581
|
-
return [].concat(_toConsumableArray__default[
|
|
581
|
+
return [].concat(_toConsumableArray__default["default"](memo), _toConsumableArray__default["default"](flattenFilters(filter.and)));
|
|
582
582
|
}
|
|
583
|
-
return [].concat(_toConsumableArray__default[
|
|
583
|
+
return [].concat(_toConsumableArray__default["default"](memo), [filter]);
|
|
584
584
|
}, []);
|
|
585
585
|
}
|
|
586
586
|
function getQueryMembers() {
|
|
@@ -602,7 +602,7 @@
|
|
|
602
602
|
members.add(member);
|
|
603
603
|
}
|
|
604
604
|
});
|
|
605
|
-
return _toConsumableArray__default[
|
|
605
|
+
return _toConsumableArray__default["default"](members);
|
|
606
606
|
}
|
|
607
607
|
function getOrderMembersFromOrder(orderMembers, order) {
|
|
608
608
|
var ids = new Set();
|
|
@@ -610,7 +610,7 @@
|
|
|
610
610
|
var entries = Array.isArray(order) ? order : Object.entries(order || {});
|
|
611
611
|
var nextOrderMembers = [];
|
|
612
612
|
entries.forEach(function (_ref10) {
|
|
613
|
-
var _ref11 = _slicedToArray__default[
|
|
613
|
+
var _ref11 = _slicedToArray__default["default"](_ref10, 2),
|
|
614
614
|
memberId = _ref11[0],
|
|
615
615
|
currentOrder = _ref11[1];
|
|
616
616
|
if (currentOrder !== 'none' && indexedOrderMembers[memberId]) {
|
|
@@ -636,9 +636,9 @@
|
|
|
636
636
|
return value != null;
|
|
637
637
|
});
|
|
638
638
|
if (pivotConfig !== null && pivotConfig !== void 0 && (_pivotConfig$aliasSer = pivotConfig.aliasSeries) !== null && _pivotConfig$aliasSer !== void 0 && _pivotConfig$aliasSer[index]) {
|
|
639
|
-
return [pivotConfig.aliasSeries[index]].concat(_toConsumableArray__default[
|
|
639
|
+
return [pivotConfig.aliasSeries[index]].concat(_toConsumableArray__default["default"](nonNullValues));
|
|
640
640
|
} else if (duplicateMeasures.has(nonNullValues[0])) {
|
|
641
|
-
return [index].concat(_toConsumableArray__default[
|
|
641
|
+
return [index].concat(_toConsumableArray__default["default"](nonNullValues));
|
|
642
642
|
}
|
|
643
643
|
return nonNullValues;
|
|
644
644
|
}
|
|
@@ -647,7 +647,7 @@
|
|
|
647
647
|
_excluded2 = ["key"],
|
|
648
648
|
_excluded3 = ["title", "shortTitle"];
|
|
649
649
|
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
650
|
-
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty__default[
|
|
650
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
651
651
|
var groupByToPairs = function groupByToPairsImpl(keyFn) {
|
|
652
652
|
var acc = new Map();
|
|
653
653
|
return function (data) {
|
|
@@ -681,13 +681,13 @@
|
|
|
681
681
|
var ResultSet = /*#__PURE__*/function () {
|
|
682
682
|
function ResultSet(loadResponse) {
|
|
683
683
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
684
|
-
_classCallCheck__default[
|
|
685
|
-
_defineProperty__default[
|
|
686
|
-
_defineProperty__default[
|
|
687
|
-
_defineProperty__default[
|
|
688
|
-
_defineProperty__default[
|
|
689
|
-
_defineProperty__default[
|
|
690
|
-
_defineProperty__default[
|
|
684
|
+
_classCallCheck__default["default"](this, ResultSet);
|
|
685
|
+
_defineProperty__default["default"](this, "loadResponse", void 0);
|
|
686
|
+
_defineProperty__default["default"](this, "loadResponses", void 0);
|
|
687
|
+
_defineProperty__default["default"](this, "queryType", void 0);
|
|
688
|
+
_defineProperty__default["default"](this, "parseDateMeasures", void 0);
|
|
689
|
+
_defineProperty__default["default"](this, "options", void 0);
|
|
690
|
+
_defineProperty__default["default"](this, "backwardCompatibleData", void 0);
|
|
691
691
|
if ('queryType' in loadResponse && loadResponse.queryType != null) {
|
|
692
692
|
this.loadResponse = loadResponse;
|
|
693
693
|
this.queryType = loadResponse.queryType;
|
|
@@ -768,7 +768,7 @@
|
|
|
768
768
|
* ```
|
|
769
769
|
* @returns Drill down query
|
|
770
770
|
*/
|
|
771
|
-
return _createClass__default[
|
|
771
|
+
return _createClass__default["default"](ResultSet, [{
|
|
772
772
|
key: "drillDown",
|
|
773
773
|
value: function drillDown(drillDownLocator, pivotConfig) {
|
|
774
774
|
var _drillDownLocator$xVa, _drillDownLocator$yVa, _measures$measureName, _measures$measureName2;
|
|
@@ -798,15 +798,15 @@
|
|
|
798
798
|
measures = _this$loadResponses$.measures,
|
|
799
799
|
timeDimensionsAnnotation = _this$loadResponses$.timeDimensions;
|
|
800
800
|
var _ref = values.find(function (_ref3) {
|
|
801
|
-
var _ref4 = _slicedToArray__default[
|
|
801
|
+
var _ref4 = _slicedToArray__default["default"](_ref3, 1),
|
|
802
802
|
member = _ref4[0];
|
|
803
803
|
return member === 'measures';
|
|
804
804
|
}) || [],
|
|
805
|
-
_ref2 = _slicedToArray__default[
|
|
805
|
+
_ref2 = _slicedToArray__default["default"](_ref, 2),
|
|
806
806
|
measureName = _ref2[1];
|
|
807
807
|
if (measureName === undefined) {
|
|
808
808
|
var _Object$keys = Object.keys(measures);
|
|
809
|
-
var _Object$keys2 = _slicedToArray__default[
|
|
809
|
+
var _Object$keys2 = _slicedToArray__default["default"](_Object$keys, 1);
|
|
810
810
|
measureName = _Object$keys2[0];
|
|
811
811
|
}
|
|
812
812
|
if (!((_measures$measureName = (_measures$measureName2 = measures[measureName]) === null || _measures$measureName2 === void 0 || (_measures$measureName2 = _measures$measureName2.drillMembers) === null || _measures$measureName2 === void 0 ? void 0 : _measures$measureName2.length) !== null && _measures$measureName !== void 0 ? _measures$measureName : 0)) {
|
|
@@ -815,18 +815,18 @@
|
|
|
815
815
|
var filters = [{
|
|
816
816
|
member: measureName,
|
|
817
817
|
operator: 'measureFilter'
|
|
818
|
-
}].concat(_toConsumableArray__default[
|
|
818
|
+
}].concat(_toConsumableArray__default["default"](parentFilters));
|
|
819
819
|
var timeDimensions = [];
|
|
820
820
|
values.filter(function (_ref5) {
|
|
821
|
-
var _ref6 = _slicedToArray__default[
|
|
821
|
+
var _ref6 = _slicedToArray__default["default"](_ref5, 1),
|
|
822
822
|
member = _ref6[0];
|
|
823
823
|
return member !== 'measures';
|
|
824
824
|
}).forEach(function (_ref7) {
|
|
825
|
-
var _ref8 = _slicedToArray__default[
|
|
825
|
+
var _ref8 = _slicedToArray__default["default"](_ref7, 2),
|
|
826
826
|
member = _ref8[0],
|
|
827
827
|
value = _ref8[1];
|
|
828
828
|
var _member$split = member.split('.'),
|
|
829
|
-
_member$split2 = _slicedToArray__default[
|
|
829
|
+
_member$split2 = _slicedToArray__default["default"](_member$split, 3),
|
|
830
830
|
cubeName = _member$split2[0],
|
|
831
831
|
dimension = _member$split2[1],
|
|
832
832
|
granularity = _member$split2[2];
|
|
@@ -839,10 +839,10 @@
|
|
|
839
839
|
});
|
|
840
840
|
var dateRange = [range.start, range.end];
|
|
841
841
|
if (originalTimeDimension !== null && originalTimeDimension !== void 0 && originalTimeDimension.dateRange) {
|
|
842
|
-
var _originalTimeDimensio = _slicedToArray__default[
|
|
842
|
+
var _originalTimeDimensio = _slicedToArray__default["default"](originalTimeDimension.dateRange, 2),
|
|
843
843
|
originalStart = _originalTimeDimensio[0],
|
|
844
844
|
originalEnd = _originalTimeDimensio[1];
|
|
845
|
-
dateRange = [dayjs__default[
|
|
845
|
+
dateRange = [dayjs__default["default"](originalStart) > range.start ? dayjs__default["default"](originalStart) : range.start, dayjs__default["default"](originalEnd) < range.end ? dayjs__default["default"](originalEnd) : range.end];
|
|
846
846
|
}
|
|
847
847
|
timeDimensions.push({
|
|
848
848
|
dimension: [cubeName, dimension].join('.'),
|
|
@@ -920,7 +920,7 @@
|
|
|
920
920
|
key: key,
|
|
921
921
|
series: _this.chartPivot(pivotConfig).map(function (_ref0) {
|
|
922
922
|
var x = _ref0.x,
|
|
923
|
-
obj = _objectWithoutProperties__default[
|
|
923
|
+
obj = _objectWithoutProperties__default["default"](_ref0, _excluded$1);
|
|
924
924
|
return {
|
|
925
925
|
value: obj[key],
|
|
926
926
|
x: x
|
|
@@ -1001,7 +1001,7 @@
|
|
|
1001
1001
|
return d.match(DateRegex);
|
|
1002
1002
|
}) : !['hour', 'minute', 'second'].includes(timeDimension.granularity);
|
|
1003
1003
|
var _dateRange = dateRange,
|
|
1004
|
-
_dateRange2 = _slicedToArray__default[
|
|
1004
|
+
_dateRange2 = _slicedToArray__default["default"](_dateRange, 2),
|
|
1005
1005
|
start = _dateRange2[0],
|
|
1006
1006
|
end = _dateRange2[1];
|
|
1007
1007
|
var range = _dayRange(start, end, annotations);
|
|
@@ -1105,7 +1105,7 @@
|
|
|
1105
1105
|
}), unnest, groupByXAxis)(_this2.timeDimensionBackwardCompatibleData(resultIndex));
|
|
1106
1106
|
var yValuesMap = {};
|
|
1107
1107
|
xGrouped.forEach(function (_ref12) {
|
|
1108
|
-
var _ref13 = _slicedToArray__default[
|
|
1108
|
+
var _ref13 = _slicedToArray__default["default"](_ref12, 2),
|
|
1109
1109
|
rows = _ref13[1];
|
|
1110
1110
|
rows.forEach(function (_ref14) {
|
|
1111
1111
|
var row = _ref14.row;
|
|
@@ -1121,7 +1121,7 @@
|
|
|
1121
1121
|
return d === 'measures';
|
|
1122
1122
|
}));
|
|
1123
1123
|
return xGrouped.map(function (_ref15) {
|
|
1124
|
-
var _ref16 = _slicedToArray__default[
|
|
1124
|
+
var _ref16 = _slicedToArray__default["default"](_ref15, 2),
|
|
1125
1125
|
rows = _ref16[1];
|
|
1126
1126
|
var xValues = rows[0].xValues;
|
|
1127
1127
|
var yGrouped = {};
|
|
@@ -1284,7 +1284,7 @@
|
|
|
1284
1284
|
yValuesArray = _ref19.yValuesArray;
|
|
1285
1285
|
var yValuesMap = {};
|
|
1286
1286
|
yValuesArray.forEach(function (_ref20, i) {
|
|
1287
|
-
var _ref21 = _slicedToArray__default[
|
|
1287
|
+
var _ref21 = _slicedToArray__default["default"](_ref20, 2),
|
|
1288
1288
|
yValues = _ref21[0],
|
|
1289
1289
|
m = _ref21[1];
|
|
1290
1290
|
yValuesMap[_this3.axisValuesString(aliasSeries(yValues, i, pivotConfig, duplicateMeasures), ',')] = m && validate(m);
|
|
@@ -1331,10 +1331,10 @@
|
|
|
1331
1331
|
return this.pivot(normalizedPivotConfig).map(function (_ref22) {
|
|
1332
1332
|
var xValues = _ref22.xValues,
|
|
1333
1333
|
yValuesArray = _ref22.yValuesArray;
|
|
1334
|
-
return ramda.fromPairs([].concat(_toConsumableArray__default[
|
|
1334
|
+
return ramda.fromPairs([].concat(_toConsumableArray__default["default"](normalizedPivotConfig.x.map(function (key, index) {
|
|
1335
1335
|
return [key, xValues[index]];
|
|
1336
|
-
})), _toConsumableArray__default[
|
|
1337
|
-
var _ref24 = _slicedToArray__default[
|
|
1336
|
+
})), _toConsumableArray__default["default"](isMeasuresPresent ? yValuesArray.map(function (_ref23) {
|
|
1337
|
+
var _ref24 = _slicedToArray__default["default"](_ref23, 2),
|
|
1338
1338
|
yValues = _ref24[0],
|
|
1339
1339
|
measure = _ref24[1];
|
|
1340
1340
|
return [yValues.length ? yValues.join() : 'value', measure];
|
|
@@ -1473,7 +1473,7 @@
|
|
|
1473
1473
|
};
|
|
1474
1474
|
var pivot = this.pivot(normalizedPivotConfig);
|
|
1475
1475
|
(((_pivot$ = pivot[0]) === null || _pivot$ === void 0 ? void 0 : _pivot$.yValuesArray) || []).forEach(function (_ref26) {
|
|
1476
|
-
var _ref27 = _slicedToArray__default[
|
|
1476
|
+
var _ref27 = _slicedToArray__default["default"](_ref26, 1),
|
|
1477
1477
|
yValues = _ref27[0];
|
|
1478
1478
|
if (yValues.length > 0) {
|
|
1479
1479
|
var currentItem = schema;
|
|
@@ -1496,17 +1496,17 @@
|
|
|
1496
1496
|
}
|
|
1497
1497
|
return Object.values(item).map(function (_ref28) {
|
|
1498
1498
|
var key = _ref28.key,
|
|
1499
|
-
currentItem = _objectWithoutProperties__default[
|
|
1500
|
-
var children = _toColumns(currentItem.children, [].concat(_toConsumableArray__default[
|
|
1499
|
+
currentItem = _objectWithoutProperties__default["default"](_ref28, _excluded2);
|
|
1500
|
+
var children = _toColumns(currentItem.children, [].concat(_toConsumableArray__default["default"](path), [key]));
|
|
1501
1501
|
var _extractFields = extractFields(currentItem.memberId),
|
|
1502
1502
|
title = _extractFields.title,
|
|
1503
1503
|
shortTitle = _extractFields.shortTitle,
|
|
1504
|
-
fields = _objectWithoutProperties__default[
|
|
1504
|
+
fields = _objectWithoutProperties__default["default"](_extractFields, _excluded3);
|
|
1505
1505
|
var dimensionValue = key !== currentItem.memberId || title == null ? key : '';
|
|
1506
1506
|
if (!children.length) {
|
|
1507
1507
|
return _objectSpread$2(_objectSpread$2({}, fields), {}, {
|
|
1508
1508
|
key: key,
|
|
1509
|
-
dataIndex: [].concat(_toConsumableArray__default[
|
|
1509
|
+
dataIndex: [].concat(_toConsumableArray__default["default"](path), [key]).join(),
|
|
1510
1510
|
title: [title, dimensionValue].join(' ').trim(),
|
|
1511
1511
|
shortTitle: dimensionValue || shortTitle
|
|
1512
1512
|
});
|
|
@@ -1833,11 +1833,11 @@
|
|
|
1833
1833
|
|
|
1834
1834
|
var SqlQuery = /*#__PURE__*/function () {
|
|
1835
1835
|
function SqlQuery(sqlQuery) {
|
|
1836
|
-
_classCallCheck__default[
|
|
1837
|
-
_defineProperty__default[
|
|
1836
|
+
_classCallCheck__default["default"](this, SqlQuery);
|
|
1837
|
+
_defineProperty__default["default"](this, "sqlQuery", void 0);
|
|
1838
1838
|
this.sqlQuery = sqlQuery;
|
|
1839
1839
|
}
|
|
1840
|
-
return _createClass__default[
|
|
1840
|
+
return _createClass__default["default"](SqlQuery, [{
|
|
1841
1841
|
key: "rawQuery",
|
|
1842
1842
|
value: function rawQuery() {
|
|
1843
1843
|
return this.sqlQuery.sql;
|
|
@@ -1944,19 +1944,19 @@
|
|
|
1944
1944
|
*/
|
|
1945
1945
|
var Meta = /*#__PURE__*/function () {
|
|
1946
1946
|
function Meta(metaResponse) {
|
|
1947
|
-
_classCallCheck__default[
|
|
1947
|
+
_classCallCheck__default["default"](this, Meta);
|
|
1948
1948
|
/**
|
|
1949
1949
|
* Raw meta response
|
|
1950
1950
|
*/
|
|
1951
|
-
_defineProperty__default[
|
|
1951
|
+
_defineProperty__default["default"](this, "meta", void 0);
|
|
1952
1952
|
/**
|
|
1953
1953
|
* An array of all available cubes with their members
|
|
1954
1954
|
*/
|
|
1955
|
-
_defineProperty__default[
|
|
1955
|
+
_defineProperty__default["default"](this, "cubes", void 0);
|
|
1956
1956
|
/**
|
|
1957
1957
|
* A map of all cubes where the key is a cube name
|
|
1958
1958
|
*/
|
|
1959
|
-
_defineProperty__default[
|
|
1959
|
+
_defineProperty__default["default"](this, "cubesMap", void 0);
|
|
1960
1960
|
this.meta = metaResponse;
|
|
1961
1961
|
var cubes = this.meta.cubes;
|
|
1962
1962
|
this.cubes = cubes;
|
|
@@ -1975,7 +1975,7 @@
|
|
|
1975
1975
|
* @param _query - context query to provide filtering of members available to add to this query
|
|
1976
1976
|
* @param memberType
|
|
1977
1977
|
*/
|
|
1978
|
-
return _createClass__default[
|
|
1978
|
+
return _createClass__default["default"](Meta, [{
|
|
1979
1979
|
key: "membersForQuery",
|
|
1980
1980
|
value: function membersForQuery(_query, memberType) {
|
|
1981
1981
|
return ramda.unnest(this.cubes.map(function (c) {
|
|
@@ -2051,7 +2051,7 @@
|
|
|
2051
2051
|
value: function resolveMember(memberName, memberType) {
|
|
2052
2052
|
var _this = this;
|
|
2053
2053
|
var _memberName$split = memberName.split('.'),
|
|
2054
|
-
_memberName$split2 = _slicedToArray__default[
|
|
2054
|
+
_memberName$split2 = _slicedToArray__default["default"](_memberName$split, 1),
|
|
2055
2055
|
cube = _memberName$split2[0];
|
|
2056
2056
|
if (!this.cubesMap[cube]) {
|
|
2057
2057
|
return {
|
|
@@ -2078,7 +2078,7 @@
|
|
|
2078
2078
|
value: function defaultTimeDimensionNameFor(memberName) {
|
|
2079
2079
|
var _this2 = this;
|
|
2080
2080
|
var _memberName$split3 = memberName.split('.'),
|
|
2081
|
-
_memberName$split4 = _slicedToArray__default[
|
|
2081
|
+
_memberName$split4 = _slicedToArray__default["default"](_memberName$split3, 1),
|
|
2082
2082
|
cube = _memberName$split4[0];
|
|
2083
2083
|
if (!this.cubesMap[cube]) {
|
|
2084
2084
|
return null;
|
|
@@ -2101,11 +2101,11 @@
|
|
|
2101
2101
|
|
|
2102
2102
|
var ProgressResult = /*#__PURE__*/function () {
|
|
2103
2103
|
function ProgressResult(progressResponse) {
|
|
2104
|
-
_classCallCheck__default[
|
|
2105
|
-
_defineProperty__default[
|
|
2104
|
+
_classCallCheck__default["default"](this, ProgressResult);
|
|
2105
|
+
_defineProperty__default["default"](this, "progressResponse", void 0);
|
|
2106
2106
|
this.progressResponse = progressResponse;
|
|
2107
2107
|
}
|
|
2108
|
-
return _createClass__default[
|
|
2108
|
+
return _createClass__default["default"](ProgressResult, [{
|
|
2109
2109
|
key: "stage",
|
|
2110
2110
|
value: function stage() {
|
|
2111
2111
|
return this.progressResponse.stage;
|
|
@@ -2124,9 +2124,9 @@
|
|
|
2124
2124
|
return _responseChunks.apply(this, arguments);
|
|
2125
2125
|
}
|
|
2126
2126
|
function _responseChunks() {
|
|
2127
|
-
_responseChunks = _wrapAsyncGenerator__default[
|
|
2127
|
+
_responseChunks = _wrapAsyncGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(res) {
|
|
2128
2128
|
var body, reader, _yield$_awaitAsyncGen, done, value, _reader$releaseLock, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, chunk, _t;
|
|
2129
|
-
return _regeneratorRuntime__default[
|
|
2129
|
+
return _regeneratorRuntime__default["default"].wrap(function (_context) {
|
|
2130
2130
|
while (1) switch (_context.prev = _context.next) {
|
|
2131
2131
|
case 0:
|
|
2132
2132
|
// eslint-disable-next-line prefer-destructuring
|
|
@@ -2139,7 +2139,7 @@
|
|
|
2139
2139
|
_context.prev = 1;
|
|
2140
2140
|
case 2:
|
|
2141
2141
|
_context.next = 3;
|
|
2142
|
-
return _awaitAsyncGenerator__default[
|
|
2142
|
+
return _awaitAsyncGenerator__default["default"](reader.read());
|
|
2143
2143
|
case 3:
|
|
2144
2144
|
_yield$_awaitAsyncGen = _context.sent;
|
|
2145
2145
|
done = _yield$_awaitAsyncGen.done;
|
|
@@ -2176,7 +2176,7 @@
|
|
|
2176
2176
|
_iterator = _asyncIterator$1(body);
|
|
2177
2177
|
case 10:
|
|
2178
2178
|
_context.next = 11;
|
|
2179
|
-
return _awaitAsyncGenerator__default[
|
|
2179
|
+
return _awaitAsyncGenerator__default["default"](_iterator.next());
|
|
2180
2180
|
case 11:
|
|
2181
2181
|
if (!(_iteratorAbruptCompletion = !(_step = _context.sent).done)) {
|
|
2182
2182
|
_context.next = 15;
|
|
@@ -2215,7 +2215,7 @@
|
|
|
2215
2215
|
break;
|
|
2216
2216
|
}
|
|
2217
2217
|
_context.next = 19;
|
|
2218
|
-
return _awaitAsyncGenerator__default[
|
|
2218
|
+
return _awaitAsyncGenerator__default["default"](_iterator["return"]());
|
|
2219
2219
|
case 19:
|
|
2220
2220
|
_context.prev = 19;
|
|
2221
2221
|
if (!_didIteratorError) {
|
|
@@ -2242,7 +2242,7 @@
|
|
|
2242
2242
|
|
|
2243
2243
|
var _excluded = ["method", "fetchTimeout", "baseRequestId", "signal"];
|
|
2244
2244
|
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2245
|
-
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty__default[
|
|
2245
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2246
2246
|
/**
|
|
2247
2247
|
* Default transport implementation.
|
|
2248
2248
|
*/
|
|
@@ -2256,14 +2256,14 @@
|
|
|
2256
2256
|
credentials = _ref.credentials,
|
|
2257
2257
|
fetchTimeout = _ref.fetchTimeout,
|
|
2258
2258
|
signal = _ref.signal;
|
|
2259
|
-
_classCallCheck__default[
|
|
2260
|
-
_defineProperty__default[
|
|
2261
|
-
_defineProperty__default[
|
|
2262
|
-
_defineProperty__default[
|
|
2263
|
-
_defineProperty__default[
|
|
2264
|
-
_defineProperty__default[
|
|
2265
|
-
_defineProperty__default[
|
|
2266
|
-
_defineProperty__default[
|
|
2259
|
+
_classCallCheck__default["default"](this, HttpTransport);
|
|
2260
|
+
_defineProperty__default["default"](this, "authorization", void 0);
|
|
2261
|
+
_defineProperty__default["default"](this, "apiUrl", void 0);
|
|
2262
|
+
_defineProperty__default["default"](this, "method", void 0);
|
|
2263
|
+
_defineProperty__default["default"](this, "headers", void 0);
|
|
2264
|
+
_defineProperty__default["default"](this, "credentials", void 0);
|
|
2265
|
+
_defineProperty__default["default"](this, "fetchTimeout", void 0);
|
|
2266
|
+
_defineProperty__default["default"](this, "signal", void 0);
|
|
2267
2267
|
this.authorization = authorization;
|
|
2268
2268
|
this.apiUrl = apiUrl;
|
|
2269
2269
|
this.method = method;
|
|
@@ -2272,7 +2272,7 @@
|
|
|
2272
2272
|
this.fetchTimeout = fetchTimeout;
|
|
2273
2273
|
this.signal = signal;
|
|
2274
2274
|
}
|
|
2275
|
-
return _createClass__default[
|
|
2275
|
+
return _createClass__default["default"](HttpTransport, [{
|
|
2276
2276
|
key: "request",
|
|
2277
2277
|
value: function request(apiMethod, _ref2) {
|
|
2278
2278
|
var _ref4,
|
|
@@ -2281,10 +2281,10 @@
|
|
|
2281
2281
|
fetchTimeout = _ref2.fetchTimeout,
|
|
2282
2282
|
baseRequestId = _ref2.baseRequestId,
|
|
2283
2283
|
signal = _ref2.signal,
|
|
2284
|
-
params = _objectWithoutProperties__default[
|
|
2284
|
+
params = _objectWithoutProperties__default["default"](_ref2, _excluded);
|
|
2285
2285
|
var spanCounter = 1;
|
|
2286
2286
|
var searchParams = new URLSearchParams(params && Object.keys(params).map(function (k) {
|
|
2287
|
-
return _defineProperty__default[
|
|
2287
|
+
return _defineProperty__default["default"]({}, k, _typeof__default["default"](params[k]) === 'object' ? JSON.stringify(params[k]) : params[k]);
|
|
2288
2288
|
}).reduce(function (a, b) {
|
|
2289
2289
|
return _objectSpread$1(_objectSpread$1({}, a), b);
|
|
2290
2290
|
}, {}));
|
|
@@ -2300,7 +2300,7 @@
|
|
|
2300
2300
|
// Currently, all methods make GET requests. If a method makes a request with a body payload,
|
|
2301
2301
|
// remember to add {'Content-Type': 'application/json'} to the header.
|
|
2302
2302
|
var runRequest = function runRequest() {
|
|
2303
|
-
return fetch__default[
|
|
2303
|
+
return fetch__default["default"](url, {
|
|
2304
2304
|
method: requestMethod,
|
|
2305
2305
|
headers: _objectSpread$1({
|
|
2306
2306
|
Authorization: _this.authorization,
|
|
@@ -2314,9 +2314,9 @@
|
|
|
2314
2314
|
return {
|
|
2315
2315
|
/* eslint no-unsafe-finally: off */subscribe: function subscribe(callback) {
|
|
2316
2316
|
var _this2 = this;
|
|
2317
|
-
return _asyncToGenerator__default[
|
|
2317
|
+
return _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee() {
|
|
2318
2318
|
var result, errorMessage, _actualSignal$reason, _result, _t;
|
|
2319
|
-
return _regeneratorRuntime__default[
|
|
2319
|
+
return _regeneratorRuntime__default["default"].wrap(function (_context) {
|
|
2320
2320
|
while (1) switch (_context.prev = _context.next) {
|
|
2321
2321
|
case 0:
|
|
2322
2322
|
_context.prev = 0;
|
|
@@ -2370,7 +2370,7 @@
|
|
|
2370
2370
|
Object.keys(params).forEach(function (k) {
|
|
2371
2371
|
var value = params[k];
|
|
2372
2372
|
if (value !== undefined) {
|
|
2373
|
-
processedParams[k] = _typeof__default[
|
|
2373
|
+
processedParams[k] = _typeof__default["default"](value) === 'object' ? JSON.stringify(value) : String(value);
|
|
2374
2374
|
}
|
|
2375
2375
|
});
|
|
2376
2376
|
}
|
|
@@ -2394,13 +2394,13 @@
|
|
|
2394
2394
|
}
|
|
2395
2395
|
return {
|
|
2396
2396
|
stream: function () {
|
|
2397
|
-
var _stream = _asyncToGenerator__default[
|
|
2397
|
+
var _stream = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2() {
|
|
2398
2398
|
var response;
|
|
2399
|
-
return _regeneratorRuntime__default[
|
|
2399
|
+
return _regeneratorRuntime__default["default"].wrap(function (_context2) {
|
|
2400
2400
|
while (1) switch (_context2.prev = _context2.next) {
|
|
2401
2401
|
case 0:
|
|
2402
2402
|
_context2.next = 1;
|
|
2403
|
-
return fetch__default[
|
|
2403
|
+
return fetch__default["default"](url, {
|
|
2404
2404
|
method: requestMethod,
|
|
2405
2405
|
headers: _objectSpread$1({
|
|
2406
2406
|
Authorization: _this3.authorization,
|
|
@@ -2437,8 +2437,8 @@
|
|
|
2437
2437
|
return stream;
|
|
2438
2438
|
}(),
|
|
2439
2439
|
unsubscribe: function () {
|
|
2440
|
-
var _unsubscribe = _asyncToGenerator__default[
|
|
2441
|
-
return _regeneratorRuntime__default[
|
|
2440
|
+
var _unsubscribe = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee3() {
|
|
2441
|
+
return _regeneratorRuntime__default["default"].wrap(function (_context3) {
|
|
2442
2442
|
while (1) switch (_context3.prev = _context3.next) {
|
|
2443
2443
|
case 0:
|
|
2444
2444
|
if (controller) {
|
|
@@ -2460,28 +2460,28 @@
|
|
|
2460
2460
|
}]);
|
|
2461
2461
|
}();
|
|
2462
2462
|
|
|
2463
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf__default[
|
|
2463
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf__default["default"](o), _possibleConstructorReturn__default["default"](t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf__default["default"](t).constructor) : o.apply(t, e)); }
|
|
2464
2464
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
2465
2465
|
var RequestError = /*#__PURE__*/function (_Error) {
|
|
2466
2466
|
function RequestError(message, response, status) {
|
|
2467
2467
|
var _this;
|
|
2468
|
-
_classCallCheck__default[
|
|
2468
|
+
_classCallCheck__default["default"](this, RequestError);
|
|
2469
2469
|
_this = _callSuper(this, RequestError, [message]);
|
|
2470
|
-
_defineProperty__default[
|
|
2471
|
-
_defineProperty__default[
|
|
2470
|
+
_defineProperty__default["default"](_this, "response", void 0);
|
|
2471
|
+
_defineProperty__default["default"](_this, "status", void 0);
|
|
2472
2472
|
_this.response = response;
|
|
2473
2473
|
_this.status = status;
|
|
2474
2474
|
return _this;
|
|
2475
2475
|
}
|
|
2476
|
-
_inherits__default[
|
|
2477
|
-
return _createClass__default[
|
|
2478
|
-
}(/*#__PURE__*/_wrapNativeSuper__default[
|
|
2476
|
+
_inherits__default["default"](RequestError, _Error);
|
|
2477
|
+
return _createClass__default["default"](RequestError);
|
|
2478
|
+
}(/*#__PURE__*/_wrapNativeSuper__default["default"](Error));
|
|
2479
2479
|
|
|
2480
2480
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
2481
2481
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
2482
2482
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
2483
2483
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2484
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty__default[
|
|
2484
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2485
2485
|
function _asyncIterator(r) { var n, t, o, e = 2; for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { if (t && null != (n = r[t])) return n.call(r); if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); t = "@@asyncIterator", o = "@@iterator"; } throw new TypeError("Object is not async iterable"); }
|
|
2486
2486
|
function AsyncFromSyncIterator(r) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); var n = r.done; return Promise.resolve(r.value).then(function (r) { return { value: r, done: n }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(r) { this.s = r, this.n = r.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, "return": function _return(r) { var n = this.s["return"]; return void 0 === n ? Promise.resolve({ value: r, done: !0 }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); }, "throw": function _throw(r) { var n = this.s["return"]; return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(r); }
|
|
2487
2487
|
|
|
@@ -2500,6 +2500,7 @@
|
|
|
2500
2500
|
if (error !== MUTEX_ERROR) {
|
|
2501
2501
|
throw error;
|
|
2502
2502
|
}
|
|
2503
|
+
return null;
|
|
2503
2504
|
});
|
|
2504
2505
|
}
|
|
2505
2506
|
/**
|
|
@@ -2528,19 +2529,19 @@
|
|
|
2528
2529
|
* ```
|
|
2529
2530
|
*/
|
|
2530
2531
|
function CubeApi(apiToken, options) {
|
|
2531
|
-
_classCallCheck__default[
|
|
2532
|
-
_defineProperty__default[
|
|
2533
|
-
_defineProperty__default[
|
|
2534
|
-
_defineProperty__default[
|
|
2535
|
-
_defineProperty__default[
|
|
2536
|
-
_defineProperty__default[
|
|
2537
|
-
_defineProperty__default[
|
|
2538
|
-
_defineProperty__default[
|
|
2539
|
-
_defineProperty__default[
|
|
2540
|
-
_defineProperty__default[
|
|
2541
|
-
_defineProperty__default[
|
|
2542
|
-
_defineProperty__default[
|
|
2543
|
-
if (apiToken && !Array.isArray(apiToken) && _typeof__default[
|
|
2532
|
+
_classCallCheck__default["default"](this, CubeApi);
|
|
2533
|
+
_defineProperty__default["default"](this, "apiToken", void 0);
|
|
2534
|
+
_defineProperty__default["default"](this, "apiUrl", void 0);
|
|
2535
|
+
_defineProperty__default["default"](this, "method", void 0);
|
|
2536
|
+
_defineProperty__default["default"](this, "headers", void 0);
|
|
2537
|
+
_defineProperty__default["default"](this, "credentials", void 0);
|
|
2538
|
+
_defineProperty__default["default"](this, "transport", void 0);
|
|
2539
|
+
_defineProperty__default["default"](this, "pollInterval", void 0);
|
|
2540
|
+
_defineProperty__default["default"](this, "parseDateMeasures", void 0);
|
|
2541
|
+
_defineProperty__default["default"](this, "castNumerics", void 0);
|
|
2542
|
+
_defineProperty__default["default"](this, "networkErrorRetries", void 0);
|
|
2543
|
+
_defineProperty__default["default"](this, "updateAuthorizationPromise", void 0);
|
|
2544
|
+
if (apiToken && !Array.isArray(apiToken) && _typeof__default["default"](apiToken) === 'object') {
|
|
2544
2545
|
options = apiToken;
|
|
2545
2546
|
apiToken = undefined;
|
|
2546
2547
|
}
|
|
@@ -2567,7 +2568,7 @@
|
|
|
2567
2568
|
this.networkErrorRetries = options.networkErrorRetries || 0;
|
|
2568
2569
|
this.updateAuthorizationPromise = null;
|
|
2569
2570
|
}
|
|
2570
|
-
return _createClass__default[
|
|
2571
|
+
return _createClass__default["default"](CubeApi, [{
|
|
2571
2572
|
key: "request",
|
|
2572
2573
|
value: function request(method, params) {
|
|
2573
2574
|
return this.transport.request(method, _objectSpread(_objectSpread({}, params), {}, {
|
|
@@ -2594,9 +2595,9 @@
|
|
|
2594
2595
|
var skipAuthorizationUpdate = true;
|
|
2595
2596
|
var unsubscribed = false;
|
|
2596
2597
|
var checkMutex = /*#__PURE__*/function () {
|
|
2597
|
-
var _ref = _asyncToGenerator__default[
|
|
2598
|
+
var _ref = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee() {
|
|
2598
2599
|
var requestInstance;
|
|
2599
|
-
return _regeneratorRuntime__default[
|
|
2600
|
+
return _regeneratorRuntime__default["default"].wrap(function (_context) {
|
|
2600
2601
|
while (1) switch (_context.prev = _context.next) {
|
|
2601
2602
|
case 0:
|
|
2602
2603
|
_context.next = 1;
|
|
@@ -2628,10 +2629,10 @@
|
|
|
2628
2629
|
}();
|
|
2629
2630
|
var networkRetries = this.networkErrorRetries;
|
|
2630
2631
|
var loadImpl = /*#__PURE__*/function () {
|
|
2631
|
-
var _ref2 = _asyncToGenerator__default[
|
|
2632
|
+
var _ref2 = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee4(response, next) {
|
|
2632
2633
|
var _options2, _response$error, _options5;
|
|
2633
2634
|
var requestInstance, subscribeNext, continueWait, body, text, _options3, _options4, _error, result;
|
|
2634
|
-
return _regeneratorRuntime__default[
|
|
2635
|
+
return _regeneratorRuntime__default["default"].wrap(function (_context4) {
|
|
2635
2636
|
while (1) switch (_context4.prev = _context4.next) {
|
|
2636
2637
|
case 0:
|
|
2637
2638
|
_context4.next = 1;
|
|
@@ -2639,9 +2640,9 @@
|
|
|
2639
2640
|
case 1:
|
|
2640
2641
|
requestInstance = _context4.sent;
|
|
2641
2642
|
subscribeNext = /*#__PURE__*/function () {
|
|
2642
|
-
var _ref3 = _asyncToGenerator__default[
|
|
2643
|
+
var _ref3 = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2() {
|
|
2643
2644
|
var _options;
|
|
2644
|
-
return _regeneratorRuntime__default[
|
|
2645
|
+
return _regeneratorRuntime__default["default"].wrap(function (_context2) {
|
|
2645
2646
|
while (1) switch (_context2.prev = _context2.next) {
|
|
2646
2647
|
case 0:
|
|
2647
2648
|
if (!((_options = options) !== null && _options !== void 0 && _options.subscribe && !unsubscribed)) {
|
|
@@ -2675,10 +2676,10 @@
|
|
|
2675
2676
|
};
|
|
2676
2677
|
}();
|
|
2677
2678
|
continueWait = /*#__PURE__*/function () {
|
|
2678
|
-
var _ref4 = _asyncToGenerator__default[
|
|
2679
|
+
var _ref4 = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee3() {
|
|
2679
2680
|
var wait,
|
|
2680
2681
|
_args3 = arguments;
|
|
2681
|
-
return _regeneratorRuntime__default[
|
|
2682
|
+
return _regeneratorRuntime__default["default"].wrap(function (_context3) {
|
|
2682
2683
|
while (1) switch (_context3.prev = _context3.next) {
|
|
2683
2684
|
case 0:
|
|
2684
2685
|
wait = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : false;
|
|
@@ -2821,9 +2822,9 @@
|
|
|
2821
2822
|
if (callback) {
|
|
2822
2823
|
return {
|
|
2823
2824
|
unsubscribe: function () {
|
|
2824
|
-
var _unsubscribe = _asyncToGenerator__default[
|
|
2825
|
+
var _unsubscribe = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee5() {
|
|
2825
2826
|
var requestInstance;
|
|
2826
|
-
return _regeneratorRuntime__default[
|
|
2827
|
+
return _regeneratorRuntime__default["default"].wrap(function (_context5) {
|
|
2827
2828
|
while (1) switch (_context5.prev = _context5.next) {
|
|
2828
2829
|
case 0:
|
|
2829
2830
|
_context5.next = 1;
|
|
@@ -2857,10 +2858,10 @@
|
|
|
2857
2858
|
}, {
|
|
2858
2859
|
key: "updateTransportAuthorization",
|
|
2859
2860
|
value: function () {
|
|
2860
|
-
var _updateTransportAuthorization = _asyncToGenerator__default[
|
|
2861
|
+
var _updateTransportAuthorization = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee7() {
|
|
2861
2862
|
var _this3 = this;
|
|
2862
2863
|
var tokenFetcher, promise;
|
|
2863
|
-
return _regeneratorRuntime__default[
|
|
2864
|
+
return _regeneratorRuntime__default["default"].wrap(function (_context7) {
|
|
2864
2865
|
while (1) switch (_context7.prev = _context7.next) {
|
|
2865
2866
|
case 0:
|
|
2866
2867
|
if (!this.updateAuthorizationPromise) {
|
|
@@ -2877,9 +2878,9 @@
|
|
|
2877
2878
|
_context7.next = 3;
|
|
2878
2879
|
break;
|
|
2879
2880
|
}
|
|
2880
|
-
promise = _asyncToGenerator__default[
|
|
2881
|
+
promise = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee6() {
|
|
2881
2882
|
var token;
|
|
2882
|
-
return _regeneratorRuntime__default[
|
|
2883
|
+
return _regeneratorRuntime__default["default"].wrap(function (_context6) {
|
|
2883
2884
|
while (1) switch (_context6.prev = _context6.next) {
|
|
2884
2885
|
case 0:
|
|
2885
2886
|
_context6.prev = 0;
|
|
@@ -2941,7 +2942,7 @@
|
|
|
2941
2942
|
if (options !== null && options !== void 0 && options.castNumerics) {
|
|
2942
2943
|
response.results.forEach(function (result) {
|
|
2943
2944
|
var numericMembers = Object.entries(_objectSpread(_objectSpread({}, result.annotation.measures), result.annotation.dimensions)).reduce(function (acc, _ref6) {
|
|
2944
|
-
var _ref7 = _slicedToArray__default[
|
|
2945
|
+
var _ref7 = _slicedToArray__default["default"](_ref6, 2),
|
|
2945
2946
|
k = _ref7[0],
|
|
2946
2947
|
v = _ref7[1];
|
|
2947
2948
|
if (v.type === 'number') {
|
|
@@ -3011,20 +3012,26 @@
|
|
|
3011
3012
|
* @param responseFormat
|
|
3012
3013
|
*/
|
|
3013
3014
|
function load(query, options, callback) {
|
|
3014
|
-
var
|
|
3015
|
+
var _options6,
|
|
3016
|
+
_options7,
|
|
3017
|
+
_options8,
|
|
3018
|
+
_this4 = this;
|
|
3015
3019
|
var responseFormat = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'default';
|
|
3016
3020
|
var _this$prepareQueryOpt = this.prepareQueryOptions(query, options, responseFormat);
|
|
3017
|
-
var _this$prepareQueryOpt2 = _slicedToArray__default[
|
|
3021
|
+
var _this$prepareQueryOpt2 = _slicedToArray__default["default"](_this$prepareQueryOpt, 2);
|
|
3018
3022
|
query = _this$prepareQueryOpt2[0];
|
|
3019
3023
|
options = _this$prepareQueryOpt2[1];
|
|
3024
|
+
var params = {
|
|
3025
|
+
query: query,
|
|
3026
|
+
queryType: 'multi',
|
|
3027
|
+
signal: (_options6 = options) === null || _options6 === void 0 ? void 0 : _options6.signal,
|
|
3028
|
+
baseRequestId: (_options7 = options) === null || _options7 === void 0 ? void 0 : _options7.baseRequestId
|
|
3029
|
+
};
|
|
3030
|
+
if ((_options8 = options) !== null && _options8 !== void 0 && _options8.cache) {
|
|
3031
|
+
params.cache = options.cache;
|
|
3032
|
+
}
|
|
3020
3033
|
return this.loadMethod(function () {
|
|
3021
|
-
|
|
3022
|
-
return _this4.request('load', {
|
|
3023
|
-
query: query,
|
|
3024
|
-
queryType: 'multi',
|
|
3025
|
-
signal: (_options6 = options) === null || _options6 === void 0 ? void 0 : _options6.signal,
|
|
3026
|
-
baseRequestId: (_options7 = options) === null || _options7 === void 0 ? void 0 : _options7.baseRequestId
|
|
3027
|
-
});
|
|
3034
|
+
return _this4.request('load', params);
|
|
3028
3035
|
}, function (response) {
|
|
3029
3036
|
return _this4.loadResponseInternal(response, options);
|
|
3030
3037
|
}, options, callback);
|
|
@@ -3085,16 +3092,16 @@
|
|
|
3085
3092
|
var _this6 = this;
|
|
3086
3093
|
var responseFormat = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'default';
|
|
3087
3094
|
var _this$prepareQueryOpt3 = this.prepareQueryOptions(query, options, responseFormat);
|
|
3088
|
-
var _this$prepareQueryOpt4 = _slicedToArray__default[
|
|
3095
|
+
var _this$prepareQueryOpt4 = _slicedToArray__default["default"](_this$prepareQueryOpt3, 2);
|
|
3089
3096
|
query = _this$prepareQueryOpt4[0];
|
|
3090
3097
|
options = _this$prepareQueryOpt4[1];
|
|
3091
3098
|
return this.loadMethod(function () {
|
|
3092
|
-
var
|
|
3099
|
+
var _options9, _options0;
|
|
3093
3100
|
return _this6.request('subscribe', {
|
|
3094
3101
|
query: query,
|
|
3095
3102
|
queryType: 'multi',
|
|
3096
|
-
signal: (
|
|
3097
|
-
baseRequestId: (
|
|
3103
|
+
signal: (_options9 = options) === null || _options9 === void 0 ? void 0 : _options9.signal,
|
|
3104
|
+
baseRequestId: (_options0 = options) === null || _options0 === void 0 ? void 0 : _options0.baseRequestId
|
|
3098
3105
|
});
|
|
3099
3106
|
}, function (response) {
|
|
3100
3107
|
return _this6.loadResponseInternal(response, options);
|
|
@@ -3166,14 +3173,17 @@
|
|
|
3166
3173
|
function cubeSql(sqlQuery, options, callback) {
|
|
3167
3174
|
var _this0 = this;
|
|
3168
3175
|
return this.loadMethod(function () {
|
|
3169
|
-
var
|
|
3176
|
+
var cubesqlParams = {
|
|
3170
3177
|
query: sqlQuery,
|
|
3171
|
-
cache: options === null || options === void 0 ? void 0 : options.cache,
|
|
3172
3178
|
method: 'POST',
|
|
3173
3179
|
signal: options === null || options === void 0 ? void 0 : options.signal,
|
|
3174
3180
|
fetchTimeout: options === null || options === void 0 ? void 0 : options.timeout,
|
|
3175
3181
|
baseRequestId: options === null || options === void 0 ? void 0 : options.baseRequestId
|
|
3176
|
-
}
|
|
3182
|
+
};
|
|
3183
|
+
if (options !== null && options !== void 0 && options.cache) {
|
|
3184
|
+
cubesqlParams.cache = options.cache;
|
|
3185
|
+
}
|
|
3186
|
+
var request = _this0.request('cubesql', cubesqlParams);
|
|
3177
3187
|
return request;
|
|
3178
3188
|
}, function (response) {
|
|
3179
3189
|
// TODO: The response is sending both errors and successful results as `error`
|
|
@@ -3190,7 +3200,7 @@
|
|
|
3190
3200
|
throw new Error('CubeSQL query was aborted');
|
|
3191
3201
|
}
|
|
3192
3202
|
var _response$error$split = response.error.split('\n'),
|
|
3193
|
-
_response$error$split2 = _toArray__default[
|
|
3203
|
+
_response$error$split2 = _toArray__default["default"](_response$error$split),
|
|
3194
3204
|
schema = _response$error$split2[0],
|
|
3195
3205
|
data = _arrayLikeToArray(_response$error$split2).slice(1);
|
|
3196
3206
|
try {
|
|
@@ -3221,9 +3231,9 @@
|
|
|
3221
3231
|
key: "cubeSqlStream",
|
|
3222
3232
|
value: function cubeSqlStream(sqlQuery, options) {
|
|
3223
3233
|
var _this = this;
|
|
3224
|
-
return _wrapAsyncGenerator__default[
|
|
3234
|
+
return _wrapAsyncGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee8() {
|
|
3225
3235
|
var streamResponse, decoder, buffer, stream, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, chunk, lines, _iterator2, _step2, line, parsed, _parsed, _t3, _t4, _t6;
|
|
3226
|
-
return _regeneratorRuntime__default[
|
|
3236
|
+
return _regeneratorRuntime__default["default"].wrap(function (_context8) {
|
|
3227
3237
|
while (1) switch (_context8.prev = _context8.next) {
|
|
3228
3238
|
case 0:
|
|
3229
3239
|
if (_this.transport.requestStream) {
|
|
@@ -3246,7 +3256,7 @@
|
|
|
3246
3256
|
buffer = '';
|
|
3247
3257
|
_context8.prev = 2;
|
|
3248
3258
|
_context8.next = 3;
|
|
3249
|
-
return _awaitAsyncGenerator__default[
|
|
3259
|
+
return _awaitAsyncGenerator__default["default"](streamResponse.stream());
|
|
3250
3260
|
case 3:
|
|
3251
3261
|
stream = _context8.sent;
|
|
3252
3262
|
_iteratorAbruptCompletion = false;
|
|
@@ -3255,7 +3265,7 @@
|
|
|
3255
3265
|
_iterator = _asyncIterator(stream);
|
|
3256
3266
|
case 5:
|
|
3257
3267
|
_context8.next = 6;
|
|
3258
|
-
return _awaitAsyncGenerator__default[
|
|
3268
|
+
return _awaitAsyncGenerator__default["default"](_iterator.next());
|
|
3259
3269
|
case 6:
|
|
3260
3270
|
if (!(_iteratorAbruptCompletion = !(_step = _context8.sent).done)) {
|
|
3261
3271
|
_context8.next = 21;
|
|
@@ -3364,7 +3374,7 @@
|
|
|
3364
3374
|
break;
|
|
3365
3375
|
}
|
|
3366
3376
|
_context8.next = 25;
|
|
3367
|
-
return _awaitAsyncGenerator__default[
|
|
3377
|
+
return _awaitAsyncGenerator__default["default"](_iterator["return"]());
|
|
3368
3378
|
case 25:
|
|
3369
3379
|
_context8.prev = 25;
|
|
3370
3380
|
if (!_didIteratorError) {
|
|
@@ -3451,7 +3461,7 @@
|
|
|
3451
3461
|
break;
|
|
3452
3462
|
}
|
|
3453
3463
|
_context8.next = 40;
|
|
3454
|
-
return _awaitAsyncGenerator__default[
|
|
3464
|
+
return _awaitAsyncGenerator__default["default"](streamResponse.unsubscribe());
|
|
3455
3465
|
case 40:
|
|
3456
3466
|
return _context8.finish(39);
|
|
3457
3467
|
case 41:
|
|
@@ -3513,5 +3523,5 @@
|
|
|
3513
3523
|
|
|
3514
3524
|
return cubeAll;
|
|
3515
3525
|
|
|
3516
|
-
}))
|
|
3526
|
+
}));
|
|
3517
3527
|
//# sourceMappingURL=cubejs-client-core.umd.js.map
|