@cubejs-client/core 1.6.41 → 1.6.43
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 +903 -462
- package/dist/cubejs-client-core.cjs.map +1 -1
- package/dist/cubejs-client-core.umd.js +899 -433
- package/dist/cubejs-client-core.umd.js.map +1 -1
- package/dist/format.cjs +1743 -0
- package/dist/format.cjs.map +1 -0
- package/dist/src/format.d.ts.map +1 -1
- package/dist/src/format.js +66 -2
- package/dist/src/types.d.ts +12 -2
- package/dist/src/types.d.ts.map +1 -1
- package/dist/test/format.test.js +51 -0
- package/package.json +5 -4
|
@@ -1,43 +1,551 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
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('
|
|
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', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.cubejs = factory(null, null, null, null,
|
|
5
|
-
})(this, (function (es_array_forEach_js, es_object_keys_js, es_object_toString_js, web_domCollections_forEach_js,
|
|
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('core-js/modules/es.array.concat.js'), require('core-js/modules/es.array.filter.js'), require('core-js/modules/es.array.includes.js'), require('core-js/modules/es.array.is-array.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.number.constructor.js'), require('core-js/modules/es.object.entries.js'), require('core-js/modules/es.promise.js'), require('core-js/modules/es.string.includes.js'), require('core-js/modules/es.string.trim.js'), require('core-js/modules/web.timers.js'), require('uuid'), require('core-js/modules/es.array.find.js'), require('core-js/modules/es.array.from.js'), require('core-js/modules/es.array.index-of.js'), require('core-js/modules/es.array.iterator.js'), require('core-js/modules/es.array.join.js'), require('core-js/modules/es.date.to-string.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.regexp.exec.js'), require('core-js/modules/es.regexp.to-string.js'), require('core-js/modules/es.set.js'), require('core-js/modules/es.string.iterator.js'), require('core-js/modules/es.string.match.js'), require('core-js/modules/web.dom-collections.iterator.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.js'), require('dayjs/plugin/duration.js'), require('dayjs/plugin/isoWeek.js'), require('dayjs/locale/en.js'), 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.symbol.async-iterator.js'), 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')) :
|
|
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', 'core-js/modules/es.array.concat.js', 'core-js/modules/es.array.filter.js', 'core-js/modules/es.array.includes.js', 'core-js/modules/es.array.is-array.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.number.constructor.js', 'core-js/modules/es.object.entries.js', 'core-js/modules/es.promise.js', 'core-js/modules/es.string.includes.js', 'core-js/modules/es.string.trim.js', 'core-js/modules/web.timers.js', 'uuid', 'core-js/modules/es.array.find.js', 'core-js/modules/es.array.from.js', 'core-js/modules/es.array.index-of.js', 'core-js/modules/es.array.iterator.js', 'core-js/modules/es.array.join.js', 'core-js/modules/es.date.to-string.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.regexp.exec.js', 'core-js/modules/es.regexp.to-string.js', 'core-js/modules/es.set.js', 'core-js/modules/es.string.iterator.js', 'core-js/modules/es.string.match.js', 'core-js/modules/web.dom-collections.iterator.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.js', 'dayjs/plugin/duration.js', 'dayjs/plugin/isoWeek.js', 'dayjs/locale/en.js', '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.symbol.async-iterator.js', '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'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.cubejs = factory(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, global.uuid, null, null, null, null, null, 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));
|
|
5
|
+
})(this, (function (es_array_forEach_js, es_object_keys_js, es_object_toString_js, web_domCollections_forEach_js, es_array_concat_js, es_array_filter_js, es_array_includes_js, es_array_isArray_js, es_array_map_js, es_array_reduce_js, es_array_slice_js, es_function_name_js, es_number_constructor_js, es_object_entries_js, es_promise_js, es_string_includes_js, es_string_trim_js, web_timers_js, uuid, es_array_find_js, es_array_from_js, es_array_indexOf_js, es_array_iterator_js, es_array_join_js, es_date_toString_js, es_map_js, es_number_isNan_js, es_number_parseFloat_js, es_object_values_js, es_regexp_exec_js, es_regexp_toString_js, es_set_js, es_string_iterator_js, es_string_match_js, web_domCollections_iterator_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) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
9
|
-
var _toArray__default = /*#__PURE__*/_interopDefaultLegacy(_toArray);
|
|
10
|
-
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
11
|
-
var _asyncToGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_asyncToGenerator);
|
|
12
|
-
var _typeof__default = /*#__PURE__*/_interopDefaultLegacy(_typeof);
|
|
13
|
-
var _classCallCheck__default = /*#__PURE__*/_interopDefaultLegacy(_classCallCheck);
|
|
14
|
-
var _createClass__default = /*#__PURE__*/_interopDefaultLegacy(_createClass);
|
|
15
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
16
|
-
var _awaitAsyncGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_awaitAsyncGenerator);
|
|
17
|
-
var _wrapAsyncGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_wrapAsyncGenerator);
|
|
18
|
-
var _regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(_regeneratorRuntime);
|
|
19
|
-
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
20
|
-
var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
|
|
21
9
|
var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
|
|
22
10
|
var quarterOfYear__default = /*#__PURE__*/_interopDefaultLegacy(quarterOfYear);
|
|
23
11
|
var duration__default = /*#__PURE__*/_interopDefaultLegacy(duration);
|
|
24
12
|
var isoWeek__default = /*#__PURE__*/_interopDefaultLegacy(isoWeek);
|
|
25
13
|
var en__default = /*#__PURE__*/_interopDefaultLegacy(en);
|
|
26
14
|
var fetch__default = /*#__PURE__*/_interopDefaultLegacy(fetch);
|
|
27
|
-
var _possibleConstructorReturn__default = /*#__PURE__*/_interopDefaultLegacy(_possibleConstructorReturn);
|
|
28
|
-
var _getPrototypeOf__default = /*#__PURE__*/_interopDefaultLegacy(_getPrototypeOf);
|
|
29
|
-
var _inherits__default = /*#__PURE__*/_interopDefaultLegacy(_inherits);
|
|
30
|
-
var _wrapNativeSuper__default = /*#__PURE__*/_interopDefaultLegacy(_wrapNativeSuper);
|
|
31
15
|
|
|
32
|
-
function
|
|
33
|
-
|
|
16
|
+
function _OverloadYield(e, d) {
|
|
17
|
+
this.v = e, this.k = d;
|
|
18
|
+
}
|
|
19
|
+
function _arrayLikeToArray(r, a) {
|
|
20
|
+
(null == a || a > r.length) && (a = r.length);
|
|
21
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
22
|
+
return n;
|
|
23
|
+
}
|
|
24
|
+
function _arrayWithHoles(r) {
|
|
25
|
+
if (Array.isArray(r)) return r;
|
|
26
|
+
}
|
|
27
|
+
function _arrayWithoutHoles(r) {
|
|
28
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
29
|
+
}
|
|
30
|
+
function _assertThisInitialized(e) {
|
|
31
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
32
|
+
return e;
|
|
33
|
+
}
|
|
34
|
+
function _asyncIterator(r) {
|
|
35
|
+
var n,
|
|
36
|
+
t,
|
|
37
|
+
o,
|
|
38
|
+
e = 2;
|
|
39
|
+
for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) {
|
|
40
|
+
if (t && null != (n = r[t])) return n.call(r);
|
|
41
|
+
if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r));
|
|
42
|
+
t = "@@asyncIterator", o = "@@iterator";
|
|
43
|
+
}
|
|
44
|
+
throw new TypeError("Object is not async iterable");
|
|
45
|
+
}
|
|
46
|
+
function AsyncFromSyncIterator(r) {
|
|
47
|
+
function AsyncFromSyncIteratorContinuation(r) {
|
|
48
|
+
if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object."));
|
|
49
|
+
var n = r.done;
|
|
50
|
+
return Promise.resolve(r.value).then(function (r) {
|
|
51
|
+
return {
|
|
52
|
+
value: r,
|
|
53
|
+
done: n
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return AsyncFromSyncIterator = function (r) {
|
|
58
|
+
this.s = r, this.n = r.next;
|
|
59
|
+
}, AsyncFromSyncIterator.prototype = {
|
|
60
|
+
s: null,
|
|
61
|
+
n: null,
|
|
62
|
+
next: function () {
|
|
63
|
+
return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));
|
|
64
|
+
},
|
|
65
|
+
return: function (r) {
|
|
66
|
+
var n = this.s.return;
|
|
67
|
+
return void 0 === n ? Promise.resolve({
|
|
68
|
+
value: r,
|
|
69
|
+
done: !0
|
|
70
|
+
}) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments));
|
|
71
|
+
},
|
|
72
|
+
throw: function (r) {
|
|
73
|
+
var n = this.s.return;
|
|
74
|
+
return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments));
|
|
75
|
+
}
|
|
76
|
+
}, new AsyncFromSyncIterator(r);
|
|
77
|
+
}
|
|
78
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
79
|
+
try {
|
|
80
|
+
var i = n[a](c),
|
|
81
|
+
u = i.value;
|
|
82
|
+
} catch (n) {
|
|
83
|
+
return void e(n);
|
|
84
|
+
}
|
|
85
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
86
|
+
}
|
|
87
|
+
function _asyncToGenerator(n) {
|
|
88
|
+
return function () {
|
|
89
|
+
var t = this,
|
|
90
|
+
e = arguments;
|
|
91
|
+
return new Promise(function (r, o) {
|
|
92
|
+
var a = n.apply(t, e);
|
|
93
|
+
function _next(n) {
|
|
94
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
95
|
+
}
|
|
96
|
+
function _throw(n) {
|
|
97
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
98
|
+
}
|
|
99
|
+
_next(void 0);
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function _awaitAsyncGenerator(e) {
|
|
104
|
+
return new _OverloadYield(e, 0);
|
|
105
|
+
}
|
|
106
|
+
function _callSuper(t, o, e) {
|
|
107
|
+
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
108
|
+
}
|
|
109
|
+
function _classCallCheck(a, n) {
|
|
110
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
111
|
+
}
|
|
112
|
+
function _construct(t, e, r) {
|
|
113
|
+
if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
|
|
114
|
+
var o = [null];
|
|
115
|
+
o.push.apply(o, e);
|
|
116
|
+
var p = new (t.bind.apply(t, o))();
|
|
117
|
+
return r && _setPrototypeOf(p, r.prototype), p;
|
|
118
|
+
}
|
|
119
|
+
function _defineProperties(e, r) {
|
|
120
|
+
for (var t = 0; t < r.length; t++) {
|
|
121
|
+
var o = r[t];
|
|
122
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function _createClass(e, r, t) {
|
|
126
|
+
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
127
|
+
writable: !1
|
|
128
|
+
}), e;
|
|
129
|
+
}
|
|
130
|
+
function _createForOfIteratorHelper(r, e) {
|
|
131
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
132
|
+
if (!t) {
|
|
133
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
134
|
+
t && (r = t);
|
|
135
|
+
var n = 0,
|
|
136
|
+
F = function () {};
|
|
137
|
+
return {
|
|
138
|
+
s: F,
|
|
139
|
+
n: function () {
|
|
140
|
+
return n >= r.length ? {
|
|
141
|
+
done: !0
|
|
142
|
+
} : {
|
|
143
|
+
done: !1,
|
|
144
|
+
value: r[n++]
|
|
145
|
+
};
|
|
146
|
+
},
|
|
147
|
+
e: function (r) {
|
|
148
|
+
throw r;
|
|
149
|
+
},
|
|
150
|
+
f: F
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
154
|
+
}
|
|
155
|
+
var o,
|
|
156
|
+
a = !0,
|
|
157
|
+
u = !1;
|
|
158
|
+
return {
|
|
159
|
+
s: function () {
|
|
160
|
+
t = t.call(r);
|
|
161
|
+
},
|
|
162
|
+
n: function () {
|
|
163
|
+
var r = t.next();
|
|
164
|
+
return a = r.done, r;
|
|
165
|
+
},
|
|
166
|
+
e: function (r) {
|
|
167
|
+
u = !0, o = r;
|
|
168
|
+
},
|
|
169
|
+
f: function () {
|
|
170
|
+
try {
|
|
171
|
+
a || null == t.return || t.return();
|
|
172
|
+
} finally {
|
|
173
|
+
if (u) throw o;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
function _defineProperty(e, r, t) {
|
|
179
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
180
|
+
value: t,
|
|
181
|
+
enumerable: !0,
|
|
182
|
+
configurable: !0,
|
|
183
|
+
writable: !0
|
|
184
|
+
}) : e[r] = t, e;
|
|
185
|
+
}
|
|
186
|
+
function _getPrototypeOf(t) {
|
|
187
|
+
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
188
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
189
|
+
}, _getPrototypeOf(t);
|
|
190
|
+
}
|
|
191
|
+
function _inherits(t, e) {
|
|
192
|
+
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
193
|
+
t.prototype = Object.create(e && e.prototype, {
|
|
194
|
+
constructor: {
|
|
195
|
+
value: t,
|
|
196
|
+
writable: !0,
|
|
197
|
+
configurable: !0
|
|
198
|
+
}
|
|
199
|
+
}), Object.defineProperty(t, "prototype", {
|
|
200
|
+
writable: !1
|
|
201
|
+
}), e && _setPrototypeOf(t, e);
|
|
202
|
+
}
|
|
203
|
+
function _isNativeFunction(t) {
|
|
204
|
+
try {
|
|
205
|
+
return -1 !== Function.toString.call(t).indexOf("[native code]");
|
|
206
|
+
} catch (n) {
|
|
207
|
+
return "function" == typeof t;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
function _isNativeReflectConstruct() {
|
|
211
|
+
try {
|
|
212
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
213
|
+
} catch (t) {}
|
|
214
|
+
return (_isNativeReflectConstruct = function () {
|
|
215
|
+
return !!t;
|
|
216
|
+
})();
|
|
217
|
+
}
|
|
218
|
+
function _iterableToArray(r) {
|
|
219
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
220
|
+
}
|
|
221
|
+
function _iterableToArrayLimit(r, l) {
|
|
222
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
223
|
+
if (null != t) {
|
|
224
|
+
var e,
|
|
225
|
+
n,
|
|
226
|
+
i,
|
|
227
|
+
u,
|
|
228
|
+
a = [],
|
|
229
|
+
f = !0,
|
|
230
|
+
o = !1;
|
|
231
|
+
try {
|
|
232
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
233
|
+
if (Object(t) !== t) return;
|
|
234
|
+
f = !1;
|
|
235
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
236
|
+
} catch (r) {
|
|
237
|
+
o = !0, n = r;
|
|
238
|
+
} finally {
|
|
239
|
+
try {
|
|
240
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
241
|
+
} finally {
|
|
242
|
+
if (o) throw n;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return a;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
function _nonIterableRest() {
|
|
249
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
250
|
+
}
|
|
251
|
+
function _nonIterableSpread() {
|
|
252
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
253
|
+
}
|
|
254
|
+
function ownKeys(e, r) {
|
|
255
|
+
var t = Object.keys(e);
|
|
256
|
+
if (Object.getOwnPropertySymbols) {
|
|
257
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
258
|
+
r && (o = o.filter(function (r) {
|
|
259
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
260
|
+
})), t.push.apply(t, o);
|
|
261
|
+
}
|
|
262
|
+
return t;
|
|
263
|
+
}
|
|
264
|
+
function _objectSpread2(e) {
|
|
265
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
266
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
267
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
268
|
+
_defineProperty(e, r, t[r]);
|
|
269
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
270
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
return e;
|
|
274
|
+
}
|
|
275
|
+
function _objectWithoutProperties(e, t) {
|
|
276
|
+
if (null == e) return {};
|
|
277
|
+
var o,
|
|
278
|
+
r,
|
|
279
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
280
|
+
if (Object.getOwnPropertySymbols) {
|
|
281
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
282
|
+
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
283
|
+
}
|
|
284
|
+
return i;
|
|
285
|
+
}
|
|
286
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
287
|
+
if (null == r) return {};
|
|
288
|
+
var t = {};
|
|
289
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
290
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
291
|
+
t[n] = r[n];
|
|
292
|
+
}
|
|
293
|
+
return t;
|
|
294
|
+
}
|
|
295
|
+
function _possibleConstructorReturn(t, e) {
|
|
296
|
+
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
|
297
|
+
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
298
|
+
return _assertThisInitialized(t);
|
|
299
|
+
}
|
|
300
|
+
function _regenerator() {
|
|
301
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
302
|
+
var e,
|
|
303
|
+
t,
|
|
304
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
305
|
+
n = r.iterator || "@@iterator",
|
|
306
|
+
o = r.toStringTag || "@@toStringTag";
|
|
307
|
+
function i(r, n, o, i) {
|
|
308
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
309
|
+
u = Object.create(c.prototype);
|
|
310
|
+
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
311
|
+
var i,
|
|
312
|
+
c,
|
|
313
|
+
u,
|
|
314
|
+
f = 0,
|
|
315
|
+
p = o || [],
|
|
316
|
+
y = !1,
|
|
317
|
+
G = {
|
|
318
|
+
p: 0,
|
|
319
|
+
n: 0,
|
|
320
|
+
v: e,
|
|
321
|
+
a: d,
|
|
322
|
+
f: d.bind(e, 4),
|
|
323
|
+
d: function (t, r) {
|
|
324
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
function d(r, n) {
|
|
328
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
329
|
+
var o,
|
|
330
|
+
i = p[t],
|
|
331
|
+
d = G.p,
|
|
332
|
+
l = i[2];
|
|
333
|
+
r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
|
|
334
|
+
}
|
|
335
|
+
if (o || r > 1) return a;
|
|
336
|
+
throw y = !0, n;
|
|
337
|
+
}
|
|
338
|
+
return function (o, p, l) {
|
|
339
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
340
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
341
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
342
|
+
try {
|
|
343
|
+
if (f = 2, i) {
|
|
344
|
+
if (c || (o = "next"), t = i[o]) {
|
|
345
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
346
|
+
if (!t.done) return t;
|
|
347
|
+
u = t.value, c < 2 && (c = 0);
|
|
348
|
+
} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
349
|
+
i = e;
|
|
350
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
351
|
+
} catch (t) {
|
|
352
|
+
i = e, c = 1, u = t;
|
|
353
|
+
} finally {
|
|
354
|
+
f = 1;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
return {
|
|
358
|
+
value: t,
|
|
359
|
+
done: y
|
|
360
|
+
};
|
|
361
|
+
};
|
|
362
|
+
}(r, o, i), !0), u;
|
|
363
|
+
}
|
|
364
|
+
var a = {};
|
|
365
|
+
function Generator() {}
|
|
366
|
+
function GeneratorFunction() {}
|
|
367
|
+
function GeneratorFunctionPrototype() {}
|
|
368
|
+
t = Object.getPrototypeOf;
|
|
369
|
+
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
370
|
+
return this;
|
|
371
|
+
}), t),
|
|
372
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
373
|
+
function f(e) {
|
|
374
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
375
|
+
}
|
|
376
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
|
|
377
|
+
return this;
|
|
378
|
+
}), _regeneratorDefine(u, "toString", function () {
|
|
379
|
+
return "[object Generator]";
|
|
380
|
+
}), (_regenerator = function () {
|
|
381
|
+
return {
|
|
382
|
+
w: i,
|
|
383
|
+
m: f
|
|
384
|
+
};
|
|
385
|
+
})();
|
|
386
|
+
}
|
|
387
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
388
|
+
var i = Object.defineProperty;
|
|
389
|
+
try {
|
|
390
|
+
i({}, "", {});
|
|
391
|
+
} catch (e) {
|
|
392
|
+
i = 0;
|
|
393
|
+
}
|
|
394
|
+
_regeneratorDefine = function (e, r, n, t) {
|
|
395
|
+
function o(r, n) {
|
|
396
|
+
_regeneratorDefine(e, r, function (e) {
|
|
397
|
+
return this._invoke(r, n, e);
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
r ? i ? i(e, r, {
|
|
401
|
+
value: n,
|
|
402
|
+
enumerable: !t,
|
|
403
|
+
configurable: !t,
|
|
404
|
+
writable: !t
|
|
405
|
+
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
|
|
406
|
+
}, _regeneratorDefine(e, r, n, t);
|
|
407
|
+
}
|
|
408
|
+
function _setPrototypeOf(t, e) {
|
|
409
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
410
|
+
return t.__proto__ = e, t;
|
|
411
|
+
}, _setPrototypeOf(t, e);
|
|
412
|
+
}
|
|
413
|
+
function _slicedToArray(r, e) {
|
|
414
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
415
|
+
}
|
|
416
|
+
function _toArray(r) {
|
|
417
|
+
return _arrayWithHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableRest();
|
|
418
|
+
}
|
|
419
|
+
function _toConsumableArray(r) {
|
|
420
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
421
|
+
}
|
|
422
|
+
function _toPrimitive(t, r) {
|
|
423
|
+
if ("object" != typeof t || !t) return t;
|
|
424
|
+
var e = t[Symbol.toPrimitive];
|
|
425
|
+
if (void 0 !== e) {
|
|
426
|
+
var i = e.call(t, r || "default");
|
|
427
|
+
if ("object" != typeof i) return i;
|
|
428
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
429
|
+
}
|
|
430
|
+
return ("string" === r ? String : Number)(t);
|
|
431
|
+
}
|
|
432
|
+
function _toPropertyKey(t) {
|
|
433
|
+
var i = _toPrimitive(t, "string");
|
|
434
|
+
return "symbol" == typeof i ? i : i + "";
|
|
435
|
+
}
|
|
436
|
+
function _typeof(o) {
|
|
437
|
+
"@babel/helpers - typeof";
|
|
438
|
+
|
|
439
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
440
|
+
return typeof o;
|
|
441
|
+
} : function (o) {
|
|
442
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
443
|
+
}, _typeof(o);
|
|
444
|
+
}
|
|
445
|
+
function _unsupportedIterableToArray(r, a) {
|
|
446
|
+
if (r) {
|
|
447
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
448
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
449
|
+
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;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
function _wrapAsyncGenerator(e) {
|
|
453
|
+
return function () {
|
|
454
|
+
return new AsyncGenerator(e.apply(this, arguments));
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
function AsyncGenerator(e) {
|
|
458
|
+
var r, t;
|
|
459
|
+
function resume(r, t) {
|
|
460
|
+
try {
|
|
461
|
+
var n = e[r](t),
|
|
462
|
+
o = n.value,
|
|
463
|
+
u = o instanceof _OverloadYield;
|
|
464
|
+
Promise.resolve(u ? o.v : o).then(function (t) {
|
|
465
|
+
if (u) {
|
|
466
|
+
var i = "return" === r ? "return" : "next";
|
|
467
|
+
if (!o.k || t.done) return resume(i, t);
|
|
468
|
+
t = e[i](t).value;
|
|
469
|
+
}
|
|
470
|
+
settle(n.done ? "return" : "normal", t);
|
|
471
|
+
}, function (e) {
|
|
472
|
+
resume("throw", e);
|
|
473
|
+
});
|
|
474
|
+
} catch (e) {
|
|
475
|
+
settle("throw", e);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
function settle(e, n) {
|
|
479
|
+
switch (e) {
|
|
480
|
+
case "return":
|
|
481
|
+
r.resolve({
|
|
482
|
+
value: n,
|
|
483
|
+
done: !0
|
|
484
|
+
});
|
|
485
|
+
break;
|
|
486
|
+
case "throw":
|
|
487
|
+
r.reject(n);
|
|
488
|
+
break;
|
|
489
|
+
default:
|
|
490
|
+
r.resolve({
|
|
491
|
+
value: n,
|
|
492
|
+
done: !1
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
(r = r.next) ? resume(r.key, r.arg) : t = null;
|
|
496
|
+
}
|
|
497
|
+
this._invoke = function (e, n) {
|
|
498
|
+
return new Promise(function (o, u) {
|
|
499
|
+
var i = {
|
|
500
|
+
key: e,
|
|
501
|
+
arg: n,
|
|
502
|
+
resolve: o,
|
|
503
|
+
reject: u,
|
|
504
|
+
next: null
|
|
505
|
+
};
|
|
506
|
+
t ? t = t.next = i : (r = t = i, resume(e, n));
|
|
507
|
+
});
|
|
508
|
+
}, "function" != typeof e.return && (this.return = void 0);
|
|
509
|
+
}
|
|
510
|
+
AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function () {
|
|
511
|
+
return this;
|
|
512
|
+
}, AsyncGenerator.prototype.next = function (e) {
|
|
513
|
+
return this._invoke("next", e);
|
|
514
|
+
}, AsyncGenerator.prototype.throw = function (e) {
|
|
515
|
+
return this._invoke("throw", e);
|
|
516
|
+
}, AsyncGenerator.prototype.return = function (e) {
|
|
517
|
+
return this._invoke("return", e);
|
|
518
|
+
};
|
|
519
|
+
function _wrapNativeSuper(t) {
|
|
520
|
+
var r = "function" == typeof Map ? new Map() : void 0;
|
|
521
|
+
return _wrapNativeSuper = function (t) {
|
|
522
|
+
if (null === t || !_isNativeFunction(t)) return t;
|
|
523
|
+
if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
|
|
524
|
+
if (void 0 !== r) {
|
|
525
|
+
if (r.has(t)) return r.get(t);
|
|
526
|
+
r.set(t, Wrapper);
|
|
527
|
+
}
|
|
528
|
+
function Wrapper() {
|
|
529
|
+
return _construct(t, arguments, _getPrototypeOf(this).constructor);
|
|
530
|
+
}
|
|
531
|
+
return Wrapper.prototype = Object.create(t.prototype, {
|
|
532
|
+
constructor: {
|
|
533
|
+
value: Wrapper,
|
|
534
|
+
enumerable: !1,
|
|
535
|
+
writable: !0,
|
|
536
|
+
configurable: !0
|
|
537
|
+
}
|
|
538
|
+
}), _setPrototypeOf(Wrapper, t);
|
|
539
|
+
}, _wrapNativeSuper(t);
|
|
540
|
+
}
|
|
541
|
+
|
|
34
542
|
dayjs__default["default"].extend(quarterOfYear__default["default"]);
|
|
35
543
|
dayjs__default["default"].extend(duration__default["default"]);
|
|
36
544
|
dayjs__default["default"].extend(isoWeek__default["default"]);
|
|
37
545
|
|
|
38
546
|
// A custom locale for internal use that doesn't affect the global dayjs instance
|
|
39
547
|
var cubeInternalLocale = 'cube-internal-en';
|
|
40
|
-
var customLocale =
|
|
548
|
+
var customLocale = _objectSpread2(_objectSpread2({}, en__default["default"]), {}, {
|
|
41
549
|
name: cubeInternalLocale,
|
|
42
550
|
weekStart: 1
|
|
43
551
|
});
|
|
@@ -163,7 +671,7 @@
|
|
|
163
671
|
function addInterval(date, interval) {
|
|
164
672
|
var res = date.clone();
|
|
165
673
|
Object.entries(interval).forEach(function (_ref) {
|
|
166
|
-
var _ref2 =
|
|
674
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
167
675
|
key = _ref2[0],
|
|
168
676
|
value = _ref2[1];
|
|
169
677
|
res = res.add(value, key);
|
|
@@ -182,7 +690,7 @@
|
|
|
182
690
|
function subtractInterval(date, interval) {
|
|
183
691
|
var res = date.clone();
|
|
184
692
|
Object.entries(interval).forEach(function (_ref3) {
|
|
185
|
-
var _ref4 =
|
|
693
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
186
694
|
key = _ref4[0],
|
|
187
695
|
value = _ref4[1];
|
|
188
696
|
res = res.subtract(value, key);
|
|
@@ -363,12 +871,10 @@
|
|
|
363
871
|
};
|
|
364
872
|
|
|
365
873
|
var _excluded$2 = ["query"];
|
|
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["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
874
|
function removeEmptyQueryFields(_query) {
|
|
369
875
|
var query = _query || {};
|
|
370
876
|
return ramda.fromPairs(ramda.toPairs(query).flatMap(function (_ref) {
|
|
371
|
-
var _ref2 =
|
|
877
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
372
878
|
key = _ref2[0],
|
|
373
879
|
value = _ref2[1];
|
|
374
880
|
if (['measures', 'dimensions', 'segments', 'timeDimensions', 'filters'].includes(key)) {
|
|
@@ -388,7 +894,7 @@
|
|
|
388
894
|
}
|
|
389
895
|
function validateQuery(_query) {
|
|
390
896
|
var query = _query || {};
|
|
391
|
-
return removeEmptyQueryFields(
|
|
897
|
+
return removeEmptyQueryFields(_objectSpread2(_objectSpread2({}, query), {}, {
|
|
392
898
|
filters: (query.filters || []).filter(function (f) {
|
|
393
899
|
return 'operator' in f;
|
|
394
900
|
}),
|
|
@@ -405,22 +911,22 @@
|
|
|
405
911
|
return d.granularity;
|
|
406
912
|
});
|
|
407
913
|
if (granularity) {
|
|
408
|
-
return
|
|
914
|
+
return _defineProperty({}, granularity.dimension, 'asc');
|
|
409
915
|
} else if ((query.measures || []).length > 0 && (query.dimensions || []).length > 0) {
|
|
410
|
-
return
|
|
916
|
+
return _defineProperty({}, query.measures[0], 'desc');
|
|
411
917
|
} else if ((query.dimensions || []).length > 0) {
|
|
412
|
-
return
|
|
918
|
+
return _defineProperty({}, query.dimensions[0], 'asc');
|
|
413
919
|
}
|
|
414
920
|
return {};
|
|
415
921
|
}
|
|
416
922
|
function defaultHeuristics(newState, oldQuery, options) {
|
|
417
923
|
var _clone = ramda.clone(newState),
|
|
418
924
|
query = _clone.query,
|
|
419
|
-
props =
|
|
925
|
+
props = _objectWithoutProperties(_clone, _excluded$2);
|
|
420
926
|
var meta = options.meta,
|
|
421
927
|
sessionGranularity = options.sessionGranularity;
|
|
422
928
|
var granularity = sessionGranularity || DEFAULT_GRANULARITY;
|
|
423
|
-
var state =
|
|
929
|
+
var state = _objectSpread2({
|
|
424
930
|
shouldApplyHeuristicOrder: false,
|
|
425
931
|
pivotConfig: null,
|
|
426
932
|
query: query
|
|
@@ -430,30 +936,30 @@
|
|
|
430
936
|
newQuery = query;
|
|
431
937
|
}
|
|
432
938
|
if (Array.isArray(newQuery) || Array.isArray(oldQuery)) {
|
|
433
|
-
return
|
|
939
|
+
return _objectSpread2({
|
|
434
940
|
shouldApplyHeuristicOrder: false,
|
|
435
941
|
pivotConfig: null
|
|
436
942
|
}, newState);
|
|
437
943
|
}
|
|
438
944
|
if (newQuery) {
|
|
439
945
|
if ((oldQuery.timeDimensions || []).length === 1 && (newQuery.timeDimensions || []).length === 1 && newQuery.timeDimensions[0].granularity && oldQuery.timeDimensions[0].granularity !== newQuery.timeDimensions[0].granularity) {
|
|
440
|
-
state =
|
|
946
|
+
state = _objectSpread2(_objectSpread2({}, state), {}, {
|
|
441
947
|
sessionGranularity: newQuery.timeDimensions[0].granularity
|
|
442
948
|
});
|
|
443
949
|
}
|
|
444
950
|
if ((oldQuery.measures || []).length === 0 && (newQuery.measures || []).length > 0 || (oldQuery.measures || []).length === 1 && (newQuery.measures || []).length === 1 && oldQuery.measures[0] !== newQuery.measures[0]) {
|
|
445
951
|
var _ref6 = newQuery.timeDimensions || [],
|
|
446
|
-
_ref7 =
|
|
952
|
+
_ref7 = _slicedToArray(_ref6, 1),
|
|
447
953
|
td = _ref7[0];
|
|
448
954
|
var defaultTimeDimension = meta.defaultTimeDimensionNameFor(newQuery.measures[0]);
|
|
449
|
-
newQuery =
|
|
955
|
+
newQuery = _objectSpread2(_objectSpread2({}, newQuery), {}, {
|
|
450
956
|
timeDimensions: defaultTimeDimension ? [{
|
|
451
957
|
dimension: defaultTimeDimension,
|
|
452
958
|
granularity: (td === null || td === void 0 ? void 0 : td.granularity) || granularity,
|
|
453
959
|
dateRange: td === null || td === void 0 ? void 0 : td.dateRange
|
|
454
960
|
}] : []
|
|
455
961
|
});
|
|
456
|
-
return
|
|
962
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
457
963
|
pivotConfig: null,
|
|
458
964
|
shouldApplyHeuristicOrder: true,
|
|
459
965
|
query: newQuery,
|
|
@@ -461,14 +967,14 @@
|
|
|
461
967
|
});
|
|
462
968
|
}
|
|
463
969
|
if ((oldQuery.dimensions || []).length === 0 && (newQuery.dimensions || []).length > 0) {
|
|
464
|
-
newQuery =
|
|
970
|
+
newQuery = _objectSpread2(_objectSpread2({}, newQuery), {}, {
|
|
465
971
|
timeDimensions: (newQuery.timeDimensions || []).map(function (td) {
|
|
466
|
-
return
|
|
972
|
+
return _objectSpread2(_objectSpread2({}, td), {}, {
|
|
467
973
|
granularity: undefined
|
|
468
974
|
});
|
|
469
975
|
})
|
|
470
976
|
});
|
|
471
|
-
return
|
|
977
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
472
978
|
pivotConfig: null,
|
|
473
979
|
shouldApplyHeuristicOrder: true,
|
|
474
980
|
query: newQuery,
|
|
@@ -476,14 +982,14 @@
|
|
|
476
982
|
});
|
|
477
983
|
}
|
|
478
984
|
if ((oldQuery.dimensions || []).length > 0 && (newQuery.dimensions || []).length === 0) {
|
|
479
|
-
newQuery =
|
|
985
|
+
newQuery = _objectSpread2(_objectSpread2({}, newQuery), {}, {
|
|
480
986
|
timeDimensions: (newQuery.timeDimensions || []).map(function (td) {
|
|
481
|
-
return
|
|
987
|
+
return _objectSpread2(_objectSpread2({}, td), {}, {
|
|
482
988
|
granularity: td.granularity || granularity
|
|
483
989
|
});
|
|
484
990
|
})
|
|
485
991
|
});
|
|
486
|
-
return
|
|
992
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
487
993
|
pivotConfig: null,
|
|
488
994
|
shouldApplyHeuristicOrder: true,
|
|
489
995
|
query: newQuery,
|
|
@@ -491,11 +997,11 @@
|
|
|
491
997
|
});
|
|
492
998
|
}
|
|
493
999
|
if (((oldQuery.dimensions || []).length > 0 || (oldQuery.measures || []).length > 0) && (newQuery.dimensions || []).length === 0 && (newQuery.measures || []).length === 0) {
|
|
494
|
-
newQuery =
|
|
1000
|
+
newQuery = _objectSpread2(_objectSpread2({}, newQuery), {}, {
|
|
495
1001
|
timeDimensions: [],
|
|
496
1002
|
filters: []
|
|
497
1003
|
});
|
|
498
|
-
return
|
|
1004
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
499
1005
|
pivotConfig: null,
|
|
500
1006
|
shouldApplyHeuristicOrder: true,
|
|
501
1007
|
query: newQuery,
|
|
@@ -508,12 +1014,12 @@
|
|
|
508
1014
|
var newChartType = state.chartType;
|
|
509
1015
|
if ((newChartType === 'line' || newChartType === 'area') && (oldQuery.timeDimensions || []).length === 1 && !oldQuery.timeDimensions[0].granularity) {
|
|
510
1016
|
var _ref8 = oldQuery.timeDimensions,
|
|
511
|
-
_ref9 =
|
|
1017
|
+
_ref9 = _slicedToArray(_ref8, 1),
|
|
512
1018
|
_td = _ref9[0];
|
|
513
|
-
return
|
|
1019
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
514
1020
|
pivotConfig: null,
|
|
515
|
-
query:
|
|
516
|
-
timeDimensions: [
|
|
1021
|
+
query: _objectSpread2(_objectSpread2({}, oldQuery), {}, {
|
|
1022
|
+
timeDimensions: [_objectSpread2(_objectSpread2({}, _td), {}, {
|
|
517
1023
|
granularity: granularity
|
|
518
1024
|
})]
|
|
519
1025
|
})
|
|
@@ -521,13 +1027,13 @@
|
|
|
521
1027
|
}
|
|
522
1028
|
if ((newChartType === 'pie' || newChartType === 'table' || newChartType === 'number') && (oldQuery.timeDimensions || []).length === 1 && oldQuery.timeDimensions[0].granularity) {
|
|
523
1029
|
var _ref0 = oldQuery.timeDimensions,
|
|
524
|
-
_ref1 =
|
|
1030
|
+
_ref1 = _slicedToArray(_ref0, 1),
|
|
525
1031
|
_td2 = _ref1[0];
|
|
526
|
-
return
|
|
1032
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
527
1033
|
pivotConfig: null,
|
|
528
1034
|
shouldApplyHeuristicOrder: true,
|
|
529
|
-
query:
|
|
530
|
-
timeDimensions: [
|
|
1035
|
+
query: _objectSpread2(_objectSpread2({}, oldQuery), {}, {
|
|
1036
|
+
timeDimensions: [_objectSpread2(_objectSpread2({}, _td2), {}, {
|
|
531
1037
|
granularity: undefined
|
|
532
1038
|
})]
|
|
533
1039
|
})
|
|
@@ -546,9 +1052,9 @@
|
|
|
546
1052
|
});
|
|
547
1053
|
}
|
|
548
1054
|
function movePivotItem(pivotConfig, sourceIndex, destinationIndex, sourceAxis, destinationAxis) {
|
|
549
|
-
var nextPivotConfig =
|
|
550
|
-
x:
|
|
551
|
-
y:
|
|
1055
|
+
var nextPivotConfig = _objectSpread2(_objectSpread2({}, pivotConfig), {}, {
|
|
1056
|
+
x: _toConsumableArray(pivotConfig.x || []),
|
|
1057
|
+
y: _toConsumableArray(pivotConfig.y || [])
|
|
552
1058
|
});
|
|
553
1059
|
var id = pivotConfig[sourceAxis][sourceIndex];
|
|
554
1060
|
var lastIndex = nextPivotConfig[destinationAxis].length - 1;
|
|
@@ -564,9 +1070,9 @@
|
|
|
564
1070
|
return nextPivotConfig;
|
|
565
1071
|
}
|
|
566
1072
|
function moveItemInArray(list, sourceIndex, destinationIndex) {
|
|
567
|
-
var result =
|
|
1073
|
+
var result = _toConsumableArray(list);
|
|
568
1074
|
var _result$splice = result.splice(sourceIndex, 1),
|
|
569
|
-
_result$splice2 =
|
|
1075
|
+
_result$splice2 = _slicedToArray(_result$splice, 1),
|
|
570
1076
|
removed = _result$splice2[0];
|
|
571
1077
|
result.splice(destinationIndex, 0, removed);
|
|
572
1078
|
return result;
|
|
@@ -575,12 +1081,12 @@
|
|
|
575
1081
|
var filters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
576
1082
|
return filters.reduce(function (memo, filter) {
|
|
577
1083
|
if ('or' in filter) {
|
|
578
|
-
return [].concat(
|
|
1084
|
+
return [].concat(_toConsumableArray(memo), _toConsumableArray(flattenFilters(filter.or)));
|
|
579
1085
|
}
|
|
580
1086
|
if ('and' in filter) {
|
|
581
|
-
return [].concat(
|
|
1087
|
+
return [].concat(_toConsumableArray(memo), _toConsumableArray(flattenFilters(filter.and)));
|
|
582
1088
|
}
|
|
583
|
-
return [].concat(
|
|
1089
|
+
return [].concat(_toConsumableArray(memo), [filter]);
|
|
584
1090
|
}, []);
|
|
585
1091
|
}
|
|
586
1092
|
function getQueryMembers() {
|
|
@@ -602,7 +1108,7 @@
|
|
|
602
1108
|
members.add(member);
|
|
603
1109
|
}
|
|
604
1110
|
});
|
|
605
|
-
return
|
|
1111
|
+
return _toConsumableArray(members);
|
|
606
1112
|
}
|
|
607
1113
|
function getOrderMembersFromOrder(orderMembers, order) {
|
|
608
1114
|
var ids = new Set();
|
|
@@ -610,19 +1116,19 @@
|
|
|
610
1116
|
var entries = Array.isArray(order) ? order : Object.entries(order || {});
|
|
611
1117
|
var nextOrderMembers = [];
|
|
612
1118
|
entries.forEach(function (_ref10) {
|
|
613
|
-
var _ref11 =
|
|
1119
|
+
var _ref11 = _slicedToArray(_ref10, 2),
|
|
614
1120
|
memberId = _ref11[0],
|
|
615
1121
|
currentOrder = _ref11[1];
|
|
616
1122
|
if (currentOrder !== 'none' && indexedOrderMembers[memberId]) {
|
|
617
1123
|
ids.add(memberId);
|
|
618
|
-
nextOrderMembers.push(
|
|
1124
|
+
nextOrderMembers.push(_objectSpread2(_objectSpread2({}, indexedOrderMembers[memberId]), {}, {
|
|
619
1125
|
order: currentOrder
|
|
620
1126
|
}));
|
|
621
1127
|
}
|
|
622
1128
|
});
|
|
623
1129
|
orderMembers.forEach(function (member) {
|
|
624
1130
|
if (!ids.has(member.id)) {
|
|
625
|
-
nextOrderMembers.push(
|
|
1131
|
+
nextOrderMembers.push(_objectSpread2(_objectSpread2({}, member), {}, {
|
|
626
1132
|
order: member.order || 'none'
|
|
627
1133
|
}));
|
|
628
1134
|
}
|
|
@@ -636,9 +1142,9 @@
|
|
|
636
1142
|
return value != null;
|
|
637
1143
|
});
|
|
638
1144
|
if (pivotConfig !== null && pivotConfig !== void 0 && (_pivotConfig$aliasSer = pivotConfig.aliasSeries) !== null && _pivotConfig$aliasSer !== void 0 && _pivotConfig$aliasSer[index]) {
|
|
639
|
-
return [pivotConfig.aliasSeries[index]].concat(
|
|
1145
|
+
return [pivotConfig.aliasSeries[index]].concat(_toConsumableArray(nonNullValues));
|
|
640
1146
|
} else if (duplicateMeasures.has(nonNullValues[0])) {
|
|
641
|
-
return [index].concat(
|
|
1147
|
+
return [index].concat(_toConsumableArray(nonNullValues));
|
|
642
1148
|
}
|
|
643
1149
|
return nonNullValues;
|
|
644
1150
|
}
|
|
@@ -646,8 +1152,6 @@
|
|
|
646
1152
|
var _excluded$1 = ["x"],
|
|
647
1153
|
_excluded2 = ["key"],
|
|
648
1154
|
_excluded3 = ["title", "shortTitle"];
|
|
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["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
1155
|
var groupByToPairs = function groupByToPairsImpl(keyFn) {
|
|
652
1156
|
var acc = new Map();
|
|
653
1157
|
return function (data) {
|
|
@@ -681,21 +1185,21 @@
|
|
|
681
1185
|
var ResultSet = /*#__PURE__*/function () {
|
|
682
1186
|
function ResultSet(loadResponse) {
|
|
683
1187
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
1188
|
+
_classCallCheck(this, ResultSet);
|
|
1189
|
+
_defineProperty(this, "loadResponse", void 0);
|
|
1190
|
+
_defineProperty(this, "loadResponses", void 0);
|
|
1191
|
+
_defineProperty(this, "queryType", void 0);
|
|
1192
|
+
_defineProperty(this, "parseDateMeasures", void 0);
|
|
1193
|
+
_defineProperty(this, "options", void 0);
|
|
1194
|
+
_defineProperty(this, "backwardCompatibleData", void 0);
|
|
691
1195
|
if ('queryType' in loadResponse && loadResponse.queryType != null) {
|
|
692
1196
|
this.loadResponse = loadResponse;
|
|
693
1197
|
this.queryType = loadResponse.queryType;
|
|
694
1198
|
this.loadResponses = loadResponse.results;
|
|
695
1199
|
} else {
|
|
696
1200
|
this.queryType = QUERY_TYPE.REGULAR_QUERY;
|
|
697
|
-
this.loadResponse =
|
|
698
|
-
pivotQuery:
|
|
1201
|
+
this.loadResponse = _objectSpread2(_objectSpread2({}, loadResponse), {}, {
|
|
1202
|
+
pivotQuery: _objectSpread2(_objectSpread2({}, loadResponse.query), {}, {
|
|
699
1203
|
queryType: this.queryType
|
|
700
1204
|
})
|
|
701
1205
|
});
|
|
@@ -768,7 +1272,7 @@
|
|
|
768
1272
|
* ```
|
|
769
1273
|
* @returns Drill down query
|
|
770
1274
|
*/
|
|
771
|
-
return
|
|
1275
|
+
return _createClass(ResultSet, [{
|
|
772
1276
|
key: "drillDown",
|
|
773
1277
|
value: function drillDown(drillDownLocator, pivotConfig) {
|
|
774
1278
|
var _drillDownLocator$xVa, _drillDownLocator$yVa, _measures$measureName, _measures$measureName2;
|
|
@@ -798,15 +1302,15 @@
|
|
|
798
1302
|
measures = _this$loadResponses$.measures,
|
|
799
1303
|
timeDimensionsAnnotation = _this$loadResponses$.timeDimensions;
|
|
800
1304
|
var _ref = values.find(function (_ref3) {
|
|
801
|
-
var _ref4 =
|
|
1305
|
+
var _ref4 = _slicedToArray(_ref3, 1),
|
|
802
1306
|
member = _ref4[0];
|
|
803
1307
|
return member === 'measures';
|
|
804
1308
|
}) || [],
|
|
805
|
-
_ref2 =
|
|
1309
|
+
_ref2 = _slicedToArray(_ref, 2),
|
|
806
1310
|
measureName = _ref2[1];
|
|
807
1311
|
if (measureName === undefined) {
|
|
808
1312
|
var _Object$keys = Object.keys(measures);
|
|
809
|
-
var _Object$keys2 =
|
|
1313
|
+
var _Object$keys2 = _slicedToArray(_Object$keys, 1);
|
|
810
1314
|
measureName = _Object$keys2[0];
|
|
811
1315
|
}
|
|
812
1316
|
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 +1319,18 @@
|
|
|
815
1319
|
var filters = [{
|
|
816
1320
|
member: measureName,
|
|
817
1321
|
operator: 'measureFilter'
|
|
818
|
-
}].concat(
|
|
1322
|
+
}].concat(_toConsumableArray(parentFilters));
|
|
819
1323
|
var timeDimensions = [];
|
|
820
1324
|
values.filter(function (_ref5) {
|
|
821
|
-
var _ref6 =
|
|
1325
|
+
var _ref6 = _slicedToArray(_ref5, 1),
|
|
822
1326
|
member = _ref6[0];
|
|
823
1327
|
return member !== 'measures';
|
|
824
1328
|
}).forEach(function (_ref7) {
|
|
825
|
-
var _ref8 =
|
|
1329
|
+
var _ref8 = _slicedToArray(_ref7, 2),
|
|
826
1330
|
member = _ref8[0],
|
|
827
1331
|
value = _ref8[1];
|
|
828
1332
|
var _member$split = member.split('.'),
|
|
829
|
-
_member$split2 =
|
|
1333
|
+
_member$split2 = _slicedToArray(_member$split, 3),
|
|
830
1334
|
cubeName = _member$split2[0],
|
|
831
1335
|
dimension = _member$split2[1],
|
|
832
1336
|
granularity = _member$split2[2];
|
|
@@ -839,7 +1343,7 @@
|
|
|
839
1343
|
});
|
|
840
1344
|
var dateRange = [range.start, range.end];
|
|
841
1345
|
if (originalTimeDimension !== null && originalTimeDimension !== void 0 && originalTimeDimension.dateRange) {
|
|
842
|
-
var _originalTimeDimensio =
|
|
1346
|
+
var _originalTimeDimensio = _slicedToArray(originalTimeDimension.dateRange, 2),
|
|
843
1347
|
originalStart = _originalTimeDimensio[0],
|
|
844
1348
|
originalEnd = _originalTimeDimensio[1];
|
|
845
1349
|
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];
|
|
@@ -866,7 +1370,7 @@
|
|
|
866
1370
|
if (timeDimensions.length === 0 && Array.isArray(query.timeDimensions) && query.timeDimensions.length > 0 && query.timeDimensions[0].granularity == null) {
|
|
867
1371
|
timeDimensions.push(query.timeDimensions[0]);
|
|
868
1372
|
}
|
|
869
|
-
return
|
|
1373
|
+
return _objectSpread2(_objectSpread2(_objectSpread2({}, measures[measureName].drillMembersGrouped), {}, {
|
|
870
1374
|
filters: filters
|
|
871
1375
|
}, segments.length > 0 ? {
|
|
872
1376
|
segments: segments
|
|
@@ -920,7 +1424,7 @@
|
|
|
920
1424
|
key: key,
|
|
921
1425
|
series: _this.chartPivot(pivotConfig).map(function (_ref0) {
|
|
922
1426
|
var x = _ref0.x,
|
|
923
|
-
obj =
|
|
1427
|
+
obj = _objectWithoutProperties(_ref0, _excluded$1);
|
|
924
1428
|
return {
|
|
925
1429
|
value: obj[key],
|
|
926
1430
|
x: x
|
|
@@ -1005,7 +1509,7 @@
|
|
|
1005
1509
|
return d.match(DateRegex);
|
|
1006
1510
|
}) : !['hour', 'minute', 'second'].includes(timeDimension.granularity);
|
|
1007
1511
|
var _dateRange = dateRange,
|
|
1008
|
-
_dateRange2 =
|
|
1512
|
+
_dateRange2 = _slicedToArray(_dateRange, 2),
|
|
1009
1513
|
start = _dateRange2[0],
|
|
1010
1514
|
end = _dateRange2[1];
|
|
1011
1515
|
var range = _dayRange(start, end, annotations);
|
|
@@ -1111,7 +1615,7 @@
|
|
|
1111
1615
|
}), unnest, groupByXAxis)(_this2.timeDimensionBackwardCompatibleData(resultIndex));
|
|
1112
1616
|
var yValuesMap = {};
|
|
1113
1617
|
xGrouped.forEach(function (_ref12) {
|
|
1114
|
-
var _ref13 =
|
|
1618
|
+
var _ref13 = _slicedToArray(_ref12, 2),
|
|
1115
1619
|
rows = _ref13[1];
|
|
1116
1620
|
rows.forEach(function (_ref14) {
|
|
1117
1621
|
var row = _ref14.row;
|
|
@@ -1125,7 +1629,7 @@
|
|
|
1125
1629
|
var allYValues = Object.values(yValuesMap);
|
|
1126
1630
|
var measureOnX = normalizedPivotConfig.x.includes('measures');
|
|
1127
1631
|
return xGrouped.map(function (_ref15) {
|
|
1128
|
-
var _ref16 =
|
|
1632
|
+
var _ref16 = _slicedToArray(_ref15, 2),
|
|
1129
1633
|
rows = _ref16[1];
|
|
1130
1634
|
var xValues = rows[0].xValues;
|
|
1131
1635
|
var yGrouped = {};
|
|
@@ -1288,12 +1792,12 @@
|
|
|
1288
1792
|
yValuesArray = _ref19.yValuesArray;
|
|
1289
1793
|
var yValuesMap = {};
|
|
1290
1794
|
yValuesArray.forEach(function (_ref20, i) {
|
|
1291
|
-
var _ref21 =
|
|
1795
|
+
var _ref21 = _slicedToArray(_ref20, 2),
|
|
1292
1796
|
yValues = _ref21[0],
|
|
1293
1797
|
m = _ref21[1];
|
|
1294
1798
|
yValuesMap[_this3.axisValuesString(aliasSeries(yValues, i, pivotConfig, duplicateMeasures), ',')] = m && validate(m);
|
|
1295
1799
|
});
|
|
1296
|
-
return
|
|
1800
|
+
return _objectSpread2({
|
|
1297
1801
|
x: _this3.axisValuesString(xValues, ','),
|
|
1298
1802
|
xValues: xValues
|
|
1299
1803
|
}, yValuesMap);
|
|
@@ -1335,10 +1839,10 @@
|
|
|
1335
1839
|
return this.pivot(normalizedPivotConfig).map(function (_ref22) {
|
|
1336
1840
|
var xValues = _ref22.xValues,
|
|
1337
1841
|
yValuesArray = _ref22.yValuesArray;
|
|
1338
|
-
return ramda.fromPairs([].concat(
|
|
1842
|
+
return ramda.fromPairs([].concat(_toConsumableArray(normalizedPivotConfig.x.map(function (key, index) {
|
|
1339
1843
|
return [key, xValues[index]];
|
|
1340
|
-
})),
|
|
1341
|
-
var _ref24 =
|
|
1844
|
+
})), _toConsumableArray(isMeasuresPresent ? yValuesArray.map(function (_ref23) {
|
|
1845
|
+
var _ref24 = _slicedToArray(_ref23, 2),
|
|
1342
1846
|
yValues = _ref24[0],
|
|
1343
1847
|
measure = _ref24[1];
|
|
1344
1848
|
return [yValues.length ? yValues.join() : 'value', measure];
|
|
@@ -1456,7 +1960,7 @@
|
|
|
1456
1960
|
segments: {}
|
|
1457
1961
|
});
|
|
1458
1962
|
var flatMeta = Object.values(annotations).reduce(function (a, b) {
|
|
1459
|
-
return
|
|
1963
|
+
return _objectSpread2(_objectSpread2({}, a), b);
|
|
1460
1964
|
}, {});
|
|
1461
1965
|
var schema = {};
|
|
1462
1966
|
var extractFields = function extractFields(key) {
|
|
@@ -1481,7 +1985,7 @@
|
|
|
1481
1985
|
};
|
|
1482
1986
|
var pivot = this.pivot(normalizedPivotConfig);
|
|
1483
1987
|
(((_pivot$ = pivot[0]) === null || _pivot$ === void 0 ? void 0 : _pivot$.yValuesArray) || []).forEach(function (_ref26) {
|
|
1484
|
-
var _ref27 =
|
|
1988
|
+
var _ref27 = _slicedToArray(_ref26, 1),
|
|
1485
1989
|
yValues = _ref27[0];
|
|
1486
1990
|
if (yValues.length > 0) {
|
|
1487
1991
|
var currentItem = schema;
|
|
@@ -1504,22 +2008,22 @@
|
|
|
1504
2008
|
}
|
|
1505
2009
|
return Object.values(item).map(function (_ref28) {
|
|
1506
2010
|
var key = _ref28.key,
|
|
1507
|
-
currentItem =
|
|
1508
|
-
var children = _toColumns(currentItem.children, [].concat(
|
|
2011
|
+
currentItem = _objectWithoutProperties(_ref28, _excluded2);
|
|
2012
|
+
var children = _toColumns(currentItem.children, [].concat(_toConsumableArray(path), [key]));
|
|
1509
2013
|
var _extractFields = extractFields(currentItem.memberId),
|
|
1510
2014
|
title = _extractFields.title,
|
|
1511
2015
|
shortTitle = _extractFields.shortTitle,
|
|
1512
|
-
fields =
|
|
2016
|
+
fields = _objectWithoutProperties(_extractFields, _excluded3);
|
|
1513
2017
|
var dimensionValue = key !== currentItem.memberId || title == null ? key : '';
|
|
1514
2018
|
if (!children.length) {
|
|
1515
|
-
return
|
|
2019
|
+
return _objectSpread2(_objectSpread2({}, fields), {}, {
|
|
1516
2020
|
key: key,
|
|
1517
|
-
dataIndex: [].concat(
|
|
2021
|
+
dataIndex: [].concat(_toConsumableArray(path), [key]).join(),
|
|
1518
2022
|
title: [title, dimensionValue].join(' ').trim(),
|
|
1519
2023
|
shortTitle: dimensionValue || shortTitle
|
|
1520
2024
|
});
|
|
1521
2025
|
}
|
|
1522
|
-
return
|
|
2026
|
+
return _objectSpread2(_objectSpread2({}, fields), {}, {
|
|
1523
2027
|
key: key,
|
|
1524
2028
|
title: [title, dimensionValue].join(' ').trim(),
|
|
1525
2029
|
shortTitle: dimensionValue || shortTitle,
|
|
@@ -1530,7 +2034,7 @@
|
|
|
1530
2034
|
var otherColumns = [];
|
|
1531
2035
|
if (!pivot.length && normalizedPivotConfig.y.includes('measures')) {
|
|
1532
2036
|
otherColumns = (this.loadResponses[0].query.measures || []).map(function (key) {
|
|
1533
|
-
return
|
|
2037
|
+
return _objectSpread2(_objectSpread2({}, extractFields(key)), {}, {
|
|
1534
2038
|
dataIndex: key
|
|
1535
2039
|
});
|
|
1536
2040
|
});
|
|
@@ -1556,7 +2060,7 @@
|
|
|
1556
2060
|
type: 'string'
|
|
1557
2061
|
};
|
|
1558
2062
|
}
|
|
1559
|
-
return
|
|
2063
|
+
return _objectSpread2(_objectSpread2({}, extractFields(key)), {}, {
|
|
1560
2064
|
dataIndex: key
|
|
1561
2065
|
});
|
|
1562
2066
|
}).concat(_toColumns(schema)).concat(otherColumns);
|
|
@@ -1605,7 +2109,7 @@
|
|
|
1605
2109
|
var measures = this.loadResponses.map(function (r) {
|
|
1606
2110
|
return r.annotation.measures;
|
|
1607
2111
|
}).reduce(function (acc, m) {
|
|
1608
|
-
return
|
|
2112
|
+
return _objectSpread2(_objectSpread2({}, acc), m);
|
|
1609
2113
|
}, {});
|
|
1610
2114
|
var seriesNames = unnest(this.loadResponses.map(function (_, index) {
|
|
1611
2115
|
return ramda.pipe(ramda.map(_this4.axisValues(normalizedPivotConfig.y, index)), unnest, ramda.uniq)(_this4.timeDimensionBackwardCompatibleData(index));
|
|
@@ -1689,7 +2193,7 @@
|
|
|
1689
2193
|
return Boolean(td.granularity);
|
|
1690
2194
|
});
|
|
1691
2195
|
this.backwardCompatibleData[resultIndex] = data.map(function (row) {
|
|
1692
|
-
return
|
|
2196
|
+
return _objectSpread2(_objectSpread2({}, row), ramda.fromPairs(Object.keys(row).filter(function (field) {
|
|
1693
2197
|
var foundTd = timeDimensions.find(function (d) {
|
|
1694
2198
|
return d.dimension === field;
|
|
1695
2199
|
});
|
|
@@ -1719,7 +2223,7 @@
|
|
|
1719
2223
|
return this.loadResponses.map(function (result) {
|
|
1720
2224
|
return new ResultSet({
|
|
1721
2225
|
queryType: QUERY_TYPE.REGULAR_QUERY,
|
|
1722
|
-
pivotQuery:
|
|
2226
|
+
pivotQuery: _objectSpread2(_objectSpread2({}, result.query), {}, {
|
|
1723
2227
|
queryType: QUERY_TYPE.REGULAR_QUERY
|
|
1724
2228
|
}),
|
|
1725
2229
|
results: [result]
|
|
@@ -1841,11 +2345,11 @@
|
|
|
1841
2345
|
|
|
1842
2346
|
var SqlQuery = /*#__PURE__*/function () {
|
|
1843
2347
|
function SqlQuery(sqlQuery) {
|
|
1844
|
-
|
|
1845
|
-
|
|
2348
|
+
_classCallCheck(this, SqlQuery);
|
|
2349
|
+
_defineProperty(this, "sqlQuery", void 0);
|
|
1846
2350
|
this.sqlQuery = sqlQuery;
|
|
1847
2351
|
}
|
|
1848
|
-
return
|
|
2352
|
+
return _createClass(SqlQuery, [{
|
|
1849
2353
|
key: "rawQuery",
|
|
1850
2354
|
value: function rawQuery() {
|
|
1851
2355
|
return this.sqlQuery.sql;
|
|
@@ -1952,19 +2456,19 @@
|
|
|
1952
2456
|
*/
|
|
1953
2457
|
var Meta = /*#__PURE__*/function () {
|
|
1954
2458
|
function Meta(metaResponse) {
|
|
1955
|
-
|
|
2459
|
+
_classCallCheck(this, Meta);
|
|
1956
2460
|
/**
|
|
1957
2461
|
* Raw meta response
|
|
1958
2462
|
*/
|
|
1959
|
-
|
|
2463
|
+
_defineProperty(this, "meta", void 0);
|
|
1960
2464
|
/**
|
|
1961
2465
|
* An array of all available cubes with their members
|
|
1962
2466
|
*/
|
|
1963
|
-
|
|
2467
|
+
_defineProperty(this, "cubes", void 0);
|
|
1964
2468
|
/**
|
|
1965
2469
|
* A map of all cubes where the key is a cube name
|
|
1966
2470
|
*/
|
|
1967
|
-
|
|
2471
|
+
_defineProperty(this, "cubesMap", void 0);
|
|
1968
2472
|
this.meta = metaResponse;
|
|
1969
2473
|
var cubes = this.meta.cubes;
|
|
1970
2474
|
this.cubes = cubes;
|
|
@@ -1983,7 +2487,7 @@
|
|
|
1983
2487
|
* @param _query - context query to provide filtering of members available to add to this query
|
|
1984
2488
|
* @param memberType
|
|
1985
2489
|
*/
|
|
1986
|
-
return
|
|
2490
|
+
return _createClass(Meta, [{
|
|
1987
2491
|
key: "membersForQuery",
|
|
1988
2492
|
value: function membersForQuery(_query, memberType) {
|
|
1989
2493
|
return ramda.unnest(this.cubes.map(function (c) {
|
|
@@ -2059,7 +2563,7 @@
|
|
|
2059
2563
|
value: function resolveMember(memberName, memberType) {
|
|
2060
2564
|
var _this = this;
|
|
2061
2565
|
var _memberName$split = memberName.split('.'),
|
|
2062
|
-
_memberName$split2 =
|
|
2566
|
+
_memberName$split2 = _slicedToArray(_memberName$split, 1),
|
|
2063
2567
|
cube = _memberName$split2[0];
|
|
2064
2568
|
if (!this.cubesMap[cube]) {
|
|
2065
2569
|
return {
|
|
@@ -2086,7 +2590,7 @@
|
|
|
2086
2590
|
value: function defaultTimeDimensionNameFor(memberName) {
|
|
2087
2591
|
var _this2 = this;
|
|
2088
2592
|
var _memberName$split3 = memberName.split('.'),
|
|
2089
|
-
_memberName$split4 =
|
|
2593
|
+
_memberName$split4 = _slicedToArray(_memberName$split3, 1),
|
|
2090
2594
|
cube = _memberName$split4[0];
|
|
2091
2595
|
if (!this.cubesMap[cube]) {
|
|
2092
2596
|
return null;
|
|
@@ -2109,11 +2613,11 @@
|
|
|
2109
2613
|
|
|
2110
2614
|
var ProgressResult = /*#__PURE__*/function () {
|
|
2111
2615
|
function ProgressResult(progressResponse) {
|
|
2112
|
-
|
|
2113
|
-
|
|
2616
|
+
_classCallCheck(this, ProgressResult);
|
|
2617
|
+
_defineProperty(this, "progressResponse", void 0);
|
|
2114
2618
|
this.progressResponse = progressResponse;
|
|
2115
2619
|
}
|
|
2116
|
-
return
|
|
2620
|
+
return _createClass(ProgressResult, [{
|
|
2117
2621
|
key: "stage",
|
|
2118
2622
|
value: function stage() {
|
|
2119
2623
|
return this.progressResponse.stage;
|
|
@@ -2126,131 +2630,126 @@
|
|
|
2126
2630
|
}]);
|
|
2127
2631
|
}();
|
|
2128
2632
|
|
|
2129
|
-
function _asyncIterator$1(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$1(n.call(r)); t = "@@asyncIterator", o = "@@iterator"; } throw new TypeError("Object is not async iterable"); }
|
|
2130
|
-
function AsyncFromSyncIterator$1(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$1 = function AsyncFromSyncIterator(r) { this.s = r, this.n = r.next; }, AsyncFromSyncIterator$1.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$1(r); }
|
|
2131
2633
|
function responseChunks(_x) {
|
|
2132
2634
|
return _responseChunks.apply(this, arguments);
|
|
2133
2635
|
}
|
|
2134
2636
|
function _responseChunks() {
|
|
2135
|
-
_responseChunks =
|
|
2637
|
+
_responseChunks = _wrapAsyncGenerator(/*#__PURE__*/_regenerator().m(function _callee(res) {
|
|
2136
2638
|
var body, reader, _yield$_awaitAsyncGen, done, value, _reader$releaseLock, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, chunk, _t;
|
|
2137
|
-
return
|
|
2138
|
-
while (1) switch (_context.
|
|
2639
|
+
return _regenerator().w(function (_context) {
|
|
2640
|
+
while (1) switch (_context.p = _context.n) {
|
|
2139
2641
|
case 0:
|
|
2140
2642
|
// eslint-disable-next-line prefer-destructuring
|
|
2141
2643
|
body = res.body;
|
|
2142
2644
|
if (!(body && typeof body.getReader === 'function')) {
|
|
2143
|
-
_context.
|
|
2645
|
+
_context.n = 8;
|
|
2144
2646
|
break;
|
|
2145
2647
|
}
|
|
2146
2648
|
reader = body.getReader(); // Browser / Node native fetch
|
|
2147
|
-
_context.
|
|
2649
|
+
_context.p = 1;
|
|
2148
2650
|
case 2:
|
|
2149
|
-
_context.
|
|
2150
|
-
return
|
|
2651
|
+
_context.n = 3;
|
|
2652
|
+
return _awaitAsyncGenerator(reader.read());
|
|
2151
2653
|
case 3:
|
|
2152
|
-
_yield$_awaitAsyncGen = _context.
|
|
2654
|
+
_yield$_awaitAsyncGen = _context.v;
|
|
2153
2655
|
done = _yield$_awaitAsyncGen.done;
|
|
2154
2656
|
value = _yield$_awaitAsyncGen.value;
|
|
2155
2657
|
if (!done) {
|
|
2156
|
-
_context.
|
|
2658
|
+
_context.n = 4;
|
|
2157
2659
|
break;
|
|
2158
2660
|
}
|
|
2159
|
-
return _context.
|
|
2661
|
+
return _context.a(3, 6);
|
|
2160
2662
|
case 4:
|
|
2161
2663
|
if (!value) {
|
|
2162
|
-
_context.
|
|
2664
|
+
_context.n = 5;
|
|
2163
2665
|
break;
|
|
2164
2666
|
}
|
|
2165
|
-
_context.
|
|
2667
|
+
_context.n = 5;
|
|
2166
2668
|
return value;
|
|
2167
2669
|
case 5:
|
|
2168
|
-
_context.
|
|
2670
|
+
_context.n = 2;
|
|
2169
2671
|
break;
|
|
2170
2672
|
case 6:
|
|
2171
|
-
_context.
|
|
2673
|
+
_context.p = 6;
|
|
2172
2674
|
(_reader$releaseLock = reader.releaseLock) === null || _reader$releaseLock === void 0 || _reader$releaseLock.call(reader);
|
|
2173
|
-
return _context.
|
|
2675
|
+
return _context.f(6);
|
|
2174
2676
|
case 7:
|
|
2175
|
-
return _context.
|
|
2677
|
+
return _context.a(2);
|
|
2176
2678
|
case 8:
|
|
2177
2679
|
if (!(body && Symbol.asyncIterator in body)) {
|
|
2178
|
-
_context.
|
|
2680
|
+
_context.n = 23;
|
|
2179
2681
|
break;
|
|
2180
2682
|
}
|
|
2181
2683
|
_iteratorAbruptCompletion = false;
|
|
2182
2684
|
_didIteratorError = false;
|
|
2183
|
-
_context.
|
|
2184
|
-
_iterator = _asyncIterator
|
|
2685
|
+
_context.p = 9;
|
|
2686
|
+
_iterator = _asyncIterator(body);
|
|
2185
2687
|
case 10:
|
|
2186
|
-
_context.
|
|
2187
|
-
return
|
|
2688
|
+
_context.n = 11;
|
|
2689
|
+
return _awaitAsyncGenerator(_iterator.next());
|
|
2188
2690
|
case 11:
|
|
2189
|
-
if (!(_iteratorAbruptCompletion = !(_step = _context.
|
|
2190
|
-
_context.
|
|
2691
|
+
if (!(_iteratorAbruptCompletion = !(_step = _context.v).done)) {
|
|
2692
|
+
_context.n = 15;
|
|
2191
2693
|
break;
|
|
2192
2694
|
}
|
|
2193
2695
|
chunk = _step.value;
|
|
2194
2696
|
if (!(typeof chunk === 'string')) {
|
|
2195
|
-
_context.
|
|
2697
|
+
_context.n = 13;
|
|
2196
2698
|
break;
|
|
2197
2699
|
}
|
|
2198
|
-
_context.
|
|
2700
|
+
_context.n = 12;
|
|
2199
2701
|
return new TextEncoder().encode(chunk);
|
|
2200
2702
|
case 12:
|
|
2201
|
-
_context.
|
|
2703
|
+
_context.n = 14;
|
|
2202
2704
|
break;
|
|
2203
2705
|
case 13:
|
|
2204
|
-
_context.
|
|
2706
|
+
_context.n = 14;
|
|
2205
2707
|
return new Uint8Array(chunk);
|
|
2206
2708
|
case 14:
|
|
2207
2709
|
_iteratorAbruptCompletion = false;
|
|
2208
|
-
_context.
|
|
2710
|
+
_context.n = 10;
|
|
2209
2711
|
break;
|
|
2210
2712
|
case 15:
|
|
2211
|
-
_context.
|
|
2713
|
+
_context.n = 17;
|
|
2212
2714
|
break;
|
|
2213
2715
|
case 16:
|
|
2214
|
-
_context.
|
|
2215
|
-
_t = _context
|
|
2716
|
+
_context.p = 16;
|
|
2717
|
+
_t = _context.v;
|
|
2216
2718
|
_didIteratorError = true;
|
|
2217
2719
|
_iteratorError = _t;
|
|
2218
2720
|
case 17:
|
|
2219
|
-
_context.
|
|
2220
|
-
_context.
|
|
2721
|
+
_context.p = 17;
|
|
2722
|
+
_context.p = 18;
|
|
2221
2723
|
if (!(_iteratorAbruptCompletion && _iterator["return"] != null)) {
|
|
2222
|
-
_context.
|
|
2724
|
+
_context.n = 19;
|
|
2223
2725
|
break;
|
|
2224
2726
|
}
|
|
2225
|
-
_context.
|
|
2226
|
-
return
|
|
2727
|
+
_context.n = 19;
|
|
2728
|
+
return _awaitAsyncGenerator(_iterator["return"]());
|
|
2227
2729
|
case 19:
|
|
2228
|
-
_context.
|
|
2730
|
+
_context.p = 19;
|
|
2229
2731
|
if (!_didIteratorError) {
|
|
2230
|
-
_context.
|
|
2732
|
+
_context.n = 20;
|
|
2231
2733
|
break;
|
|
2232
2734
|
}
|
|
2233
2735
|
throw _iteratorError;
|
|
2234
2736
|
case 20:
|
|
2235
|
-
return _context.
|
|
2737
|
+
return _context.f(19);
|
|
2236
2738
|
case 21:
|
|
2237
|
-
return _context.
|
|
2739
|
+
return _context.f(17);
|
|
2238
2740
|
case 22:
|
|
2239
|
-
return _context.
|
|
2741
|
+
return _context.a(2);
|
|
2240
2742
|
case 23:
|
|
2241
2743
|
throw new Error('Unsupported response body type for streaming');
|
|
2242
2744
|
case 24:
|
|
2243
|
-
|
|
2244
|
-
return _context.stop();
|
|
2745
|
+
return _context.a(2);
|
|
2245
2746
|
}
|
|
2246
|
-
}, _callee, null, [[
|
|
2747
|
+
}, _callee, null, [[18,, 19, 21], [9, 16, 17, 22], [1,, 6, 7]]);
|
|
2247
2748
|
}));
|
|
2248
2749
|
return _responseChunks.apply(this, arguments);
|
|
2249
2750
|
}
|
|
2250
2751
|
|
|
2251
2752
|
var _excluded = ["method", "fetchTimeout", "baseRequestId", "signal"];
|
|
2252
|
-
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; }
|
|
2253
|
-
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; }
|
|
2254
2753
|
/**
|
|
2255
2754
|
* Default transport implementation.
|
|
2256
2755
|
*/
|
|
@@ -2264,14 +2763,14 @@
|
|
|
2264
2763
|
credentials = _ref.credentials,
|
|
2265
2764
|
fetchTimeout = _ref.fetchTimeout,
|
|
2266
2765
|
signal = _ref.signal;
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2766
|
+
_classCallCheck(this, HttpTransport);
|
|
2767
|
+
_defineProperty(this, "authorization", void 0);
|
|
2768
|
+
_defineProperty(this, "apiUrl", void 0);
|
|
2769
|
+
_defineProperty(this, "method", void 0);
|
|
2770
|
+
_defineProperty(this, "headers", void 0);
|
|
2771
|
+
_defineProperty(this, "credentials", void 0);
|
|
2772
|
+
_defineProperty(this, "fetchTimeout", void 0);
|
|
2773
|
+
_defineProperty(this, "signal", void 0);
|
|
2275
2774
|
this.authorization = authorization;
|
|
2276
2775
|
this.apiUrl = apiUrl;
|
|
2277
2776
|
this.method = method;
|
|
@@ -2280,7 +2779,7 @@
|
|
|
2280
2779
|
this.fetchTimeout = fetchTimeout;
|
|
2281
2780
|
this.signal = signal;
|
|
2282
2781
|
}
|
|
2283
|
-
return
|
|
2782
|
+
return _createClass(HttpTransport, [{
|
|
2284
2783
|
key: "request",
|
|
2285
2784
|
value: function request(apiMethod, _ref2) {
|
|
2286
2785
|
var _ref4,
|
|
@@ -2289,12 +2788,12 @@
|
|
|
2289
2788
|
fetchTimeout = _ref2.fetchTimeout,
|
|
2290
2789
|
baseRequestId = _ref2.baseRequestId,
|
|
2291
2790
|
signal = _ref2.signal,
|
|
2292
|
-
params =
|
|
2791
|
+
params = _objectWithoutProperties(_ref2, _excluded);
|
|
2293
2792
|
var spanCounter = 1;
|
|
2294
2793
|
var searchParams = new URLSearchParams(params && Object.keys(params).map(function (k) {
|
|
2295
|
-
return
|
|
2794
|
+
return _defineProperty({}, k, _typeof(params[k]) === 'object' ? JSON.stringify(params[k]) : params[k]);
|
|
2296
2795
|
}).reduce(function (a, b) {
|
|
2297
|
-
return
|
|
2796
|
+
return _objectSpread2(_objectSpread2({}, a), b);
|
|
2298
2797
|
}, {}));
|
|
2299
2798
|
var url = "".concat(this.apiUrl, "/").concat(apiMethod).concat(searchParams.toString().length ? "?".concat(searchParams) : '');
|
|
2300
2799
|
var requestMethod = (_ref4 = method !== null && method !== void 0 ? method : this.method) !== null && _ref4 !== void 0 ? _ref4 : url.length < 2000 ? 'GET' : 'POST';
|
|
@@ -2310,7 +2809,7 @@
|
|
|
2310
2809
|
var runRequest = function runRequest() {
|
|
2311
2810
|
return fetch__default["default"](url, {
|
|
2312
2811
|
method: requestMethod,
|
|
2313
|
-
headers:
|
|
2812
|
+
headers: _objectSpread2({
|
|
2314
2813
|
Authorization: _this.authorization,
|
|
2315
2814
|
'x-request-id': baseRequestId && "".concat(baseRequestId, "-span-").concat(spanCounter++)
|
|
2316
2815
|
}, _this.headers),
|
|
@@ -2322,22 +2821,22 @@
|
|
|
2322
2821
|
return {
|
|
2323
2822
|
/* eslint no-unsafe-finally: off */subscribe: function subscribe(callback) {
|
|
2324
2823
|
var _this2 = this;
|
|
2325
|
-
return
|
|
2824
|
+
return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
2326
2825
|
var result, errorMessage, _actualSignal$reason, _result, _t;
|
|
2327
|
-
return
|
|
2328
|
-
while (1) switch (_context.
|
|
2826
|
+
return _regenerator().w(function (_context) {
|
|
2827
|
+
while (1) switch (_context.p = _context.n) {
|
|
2329
2828
|
case 0:
|
|
2330
|
-
_context.
|
|
2331
|
-
_context.
|
|
2829
|
+
_context.p = 0;
|
|
2830
|
+
_context.n = 1;
|
|
2332
2831
|
return runRequest();
|
|
2333
2832
|
case 1:
|
|
2334
|
-
result = _context.
|
|
2335
|
-
return _context.
|
|
2833
|
+
result = _context.v;
|
|
2834
|
+
return _context.a(2, callback(result, function () {
|
|
2336
2835
|
return _this2.subscribe(callback);
|
|
2337
2836
|
}));
|
|
2338
2837
|
case 2:
|
|
2339
|
-
_context.
|
|
2340
|
-
_t = _context
|
|
2838
|
+
_context.p = 2;
|
|
2839
|
+
_t = _context.v;
|
|
2341
2840
|
errorMessage = 'network Error';
|
|
2342
2841
|
if (_t.name === 'AbortError') {
|
|
2343
2842
|
if ((actualSignal === null || actualSignal === void 0 ? void 0 : actualSignal.reason) === 'TimeoutError' || (actualSignal === null || actualSignal === void 0 || (_actualSignal$reason = actualSignal.reason) === null || _actualSignal$reason === void 0 ? void 0 : _actualSignal$reason.name) === 'TimeoutError') {
|
|
@@ -2349,12 +2848,9 @@
|
|
|
2349
2848
|
_result = {
|
|
2350
2849
|
error: errorMessage
|
|
2351
2850
|
};
|
|
2352
|
-
return _context.
|
|
2851
|
+
return _context.a(2, callback(_result, function () {
|
|
2353
2852
|
return _this2.subscribe(callback);
|
|
2354
2853
|
}));
|
|
2355
|
-
case 3:
|
|
2356
|
-
case "end":
|
|
2357
|
-
return _context.stop();
|
|
2358
2854
|
}
|
|
2359
2855
|
}, _callee, null, [[0, 2]]);
|
|
2360
2856
|
}))();
|
|
@@ -2378,7 +2874,7 @@
|
|
|
2378
2874
|
Object.keys(params).forEach(function (k) {
|
|
2379
2875
|
var value = params[k];
|
|
2380
2876
|
if (value !== undefined) {
|
|
2381
|
-
processedParams[k] =
|
|
2877
|
+
processedParams[k] = _typeof(value) === 'object' ? JSON.stringify(value) : String(value);
|
|
2382
2878
|
}
|
|
2383
2879
|
});
|
|
2384
2880
|
}
|
|
@@ -2402,15 +2898,15 @@
|
|
|
2402
2898
|
}
|
|
2403
2899
|
return {
|
|
2404
2900
|
stream: function () {
|
|
2405
|
-
var _stream =
|
|
2901
|
+
var _stream = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
2406
2902
|
var response;
|
|
2407
|
-
return
|
|
2408
|
-
while (1) switch (_context2.
|
|
2903
|
+
return _regenerator().w(function (_context2) {
|
|
2904
|
+
while (1) switch (_context2.n) {
|
|
2409
2905
|
case 0:
|
|
2410
|
-
_context2.
|
|
2906
|
+
_context2.n = 1;
|
|
2411
2907
|
return fetch__default["default"](url, {
|
|
2412
2908
|
method: requestMethod,
|
|
2413
|
-
headers:
|
|
2909
|
+
headers: _objectSpread2({
|
|
2414
2910
|
Authorization: _this3.authorization,
|
|
2415
2911
|
'x-request-id': baseRequestId || 'stream-request'
|
|
2416
2912
|
}, _this3.headers),
|
|
@@ -2419,23 +2915,20 @@
|
|
|
2419
2915
|
signal: actualSignal
|
|
2420
2916
|
});
|
|
2421
2917
|
case 1:
|
|
2422
|
-
response = _context2.
|
|
2918
|
+
response = _context2.v;
|
|
2423
2919
|
if (response.ok) {
|
|
2424
|
-
_context2.
|
|
2920
|
+
_context2.n = 2;
|
|
2425
2921
|
break;
|
|
2426
2922
|
}
|
|
2427
2923
|
throw new Error("HTTP ".concat(response.status, ": ").concat(response.statusText));
|
|
2428
2924
|
case 2:
|
|
2429
2925
|
if (response.body) {
|
|
2430
|
-
_context2.
|
|
2926
|
+
_context2.n = 3;
|
|
2431
2927
|
break;
|
|
2432
2928
|
}
|
|
2433
2929
|
throw new Error('No response body available for streaming');
|
|
2434
2930
|
case 3:
|
|
2435
|
-
return _context2.
|
|
2436
|
-
case 4:
|
|
2437
|
-
case "end":
|
|
2438
|
-
return _context2.stop();
|
|
2931
|
+
return _context2.a(2, responseChunks(response));
|
|
2439
2932
|
}
|
|
2440
2933
|
}, _callee2);
|
|
2441
2934
|
}));
|
|
@@ -2445,16 +2938,15 @@
|
|
|
2445
2938
|
return stream;
|
|
2446
2939
|
}(),
|
|
2447
2940
|
unsubscribe: function () {
|
|
2448
|
-
var _unsubscribe =
|
|
2449
|
-
return
|
|
2450
|
-
while (1) switch (_context3.
|
|
2941
|
+
var _unsubscribe = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
|
|
2942
|
+
return _regenerator().w(function (_context3) {
|
|
2943
|
+
while (1) switch (_context3.n) {
|
|
2451
2944
|
case 0:
|
|
2452
2945
|
if (controller) {
|
|
2453
2946
|
controller.abort();
|
|
2454
2947
|
}
|
|
2455
2948
|
case 1:
|
|
2456
|
-
|
|
2457
|
-
return _context3.stop();
|
|
2949
|
+
return _context3.a(2);
|
|
2458
2950
|
}
|
|
2459
2951
|
}, _callee3);
|
|
2460
2952
|
}));
|
|
@@ -2468,30 +2960,20 @@
|
|
|
2468
2960
|
}]);
|
|
2469
2961
|
}();
|
|
2470
2962
|
|
|
2471
|
-
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)); }
|
|
2472
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
2473
2963
|
var RequestError = /*#__PURE__*/function (_Error) {
|
|
2474
2964
|
function RequestError(message, response, status) {
|
|
2475
2965
|
var _this;
|
|
2476
|
-
|
|
2966
|
+
_classCallCheck(this, RequestError);
|
|
2477
2967
|
_this = _callSuper(this, RequestError, [message]);
|
|
2478
|
-
|
|
2479
|
-
|
|
2968
|
+
_defineProperty(_this, "response", void 0);
|
|
2969
|
+
_defineProperty(_this, "status", void 0);
|
|
2480
2970
|
_this.response = response;
|
|
2481
2971
|
_this.status = status;
|
|
2482
2972
|
return _this;
|
|
2483
2973
|
}
|
|
2484
|
-
|
|
2485
|
-
return
|
|
2486
|
-
}(/*#__PURE__*/
|
|
2487
|
-
|
|
2488
|
-
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; } } }; }
|
|
2489
|
-
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; } }
|
|
2490
|
-
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; }
|
|
2491
|
-
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; }
|
|
2492
|
-
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; }
|
|
2493
|
-
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"); }
|
|
2494
|
-
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); }
|
|
2974
|
+
_inherits(RequestError, _Error);
|
|
2975
|
+
return _createClass(RequestError);
|
|
2976
|
+
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
2495
2977
|
|
|
2496
2978
|
// If we can't infer any members at all, then return any.
|
|
2497
2979
|
|
|
@@ -2537,19 +3019,19 @@
|
|
|
2537
3019
|
* ```
|
|
2538
3020
|
*/
|
|
2539
3021
|
function CubeApi(apiToken, options) {
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
if (apiToken && !Array.isArray(apiToken) &&
|
|
3022
|
+
_classCallCheck(this, CubeApi);
|
|
3023
|
+
_defineProperty(this, "apiToken", void 0);
|
|
3024
|
+
_defineProperty(this, "apiUrl", void 0);
|
|
3025
|
+
_defineProperty(this, "method", void 0);
|
|
3026
|
+
_defineProperty(this, "headers", void 0);
|
|
3027
|
+
_defineProperty(this, "credentials", void 0);
|
|
3028
|
+
_defineProperty(this, "transport", void 0);
|
|
3029
|
+
_defineProperty(this, "pollInterval", void 0);
|
|
3030
|
+
_defineProperty(this, "parseDateMeasures", void 0);
|
|
3031
|
+
_defineProperty(this, "castNumerics", void 0);
|
|
3032
|
+
_defineProperty(this, "networkErrorRetries", void 0);
|
|
3033
|
+
_defineProperty(this, "updateAuthorizationPromise", void 0);
|
|
3034
|
+
if (apiToken && !Array.isArray(apiToken) && _typeof(apiToken) === 'object') {
|
|
2553
3035
|
options = apiToken;
|
|
2554
3036
|
apiToken = undefined;
|
|
2555
3037
|
}
|
|
@@ -2576,10 +3058,10 @@
|
|
|
2576
3058
|
this.networkErrorRetries = options.networkErrorRetries || 0;
|
|
2577
3059
|
this.updateAuthorizationPromise = null;
|
|
2578
3060
|
}
|
|
2579
|
-
return
|
|
3061
|
+
return _createClass(CubeApi, [{
|
|
2580
3062
|
key: "request",
|
|
2581
3063
|
value: function request(method, params) {
|
|
2582
|
-
return this.transport.request(method,
|
|
3064
|
+
return this.transport.request(method, _objectSpread2(_objectSpread2({}, params), {}, {
|
|
2583
3065
|
baseRequestId: (params === null || params === void 0 ? void 0 : params.baseRequestId) || uuid.v4()
|
|
2584
3066
|
}));
|
|
2585
3067
|
}
|
|
@@ -2603,31 +3085,30 @@
|
|
|
2603
3085
|
var skipAuthorizationUpdate = true;
|
|
2604
3086
|
var unsubscribed = false;
|
|
2605
3087
|
var checkMutex = /*#__PURE__*/function () {
|
|
2606
|
-
var _ref =
|
|
3088
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
2607
3089
|
var requestInstance;
|
|
2608
|
-
return
|
|
2609
|
-
while (1) switch (_context.
|
|
3090
|
+
return _regenerator().w(function (_context) {
|
|
3091
|
+
while (1) switch (_context.n) {
|
|
2610
3092
|
case 0:
|
|
2611
|
-
_context.
|
|
3093
|
+
_context.n = 1;
|
|
2612
3094
|
return requestPromise;
|
|
2613
3095
|
case 1:
|
|
2614
|
-
requestInstance = _context.
|
|
3096
|
+
requestInstance = _context.v;
|
|
2615
3097
|
if (!(options && options.mutexObj && options.mutexObj[mutexKey] !== mutexValue)) {
|
|
2616
|
-
_context.
|
|
3098
|
+
_context.n = 3;
|
|
2617
3099
|
break;
|
|
2618
3100
|
}
|
|
2619
3101
|
unsubscribed = true;
|
|
2620
3102
|
if (!requestInstance.unsubscribe) {
|
|
2621
|
-
_context.
|
|
3103
|
+
_context.n = 2;
|
|
2622
3104
|
break;
|
|
2623
3105
|
}
|
|
2624
|
-
_context.
|
|
3106
|
+
_context.n = 2;
|
|
2625
3107
|
return requestInstance.unsubscribe();
|
|
2626
3108
|
case 2:
|
|
2627
3109
|
throw MUTEX_ERROR;
|
|
2628
3110
|
case 3:
|
|
2629
|
-
|
|
2630
|
-
return _context.stop();
|
|
3111
|
+
return _context.a(2);
|
|
2631
3112
|
}
|
|
2632
3113
|
}, _callee);
|
|
2633
3114
|
}));
|
|
@@ -2637,45 +3118,42 @@
|
|
|
2637
3118
|
}();
|
|
2638
3119
|
var networkRetries = this.networkErrorRetries;
|
|
2639
3120
|
var loadImpl = /*#__PURE__*/function () {
|
|
2640
|
-
var _ref2 =
|
|
3121
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(response, next) {
|
|
2641
3122
|
var _options2, _response$error, _body$error, _options5;
|
|
2642
3123
|
var requestInstance, subscribeNext, continueWait, body, text, _options3, _options4, _error, result;
|
|
2643
|
-
return
|
|
2644
|
-
while (1) switch (_context4.
|
|
3124
|
+
return _regenerator().w(function (_context4) {
|
|
3125
|
+
while (1) switch (_context4.p = _context4.n) {
|
|
2645
3126
|
case 0:
|
|
2646
|
-
_context4.
|
|
3127
|
+
_context4.n = 1;
|
|
2647
3128
|
return requestPromise;
|
|
2648
3129
|
case 1:
|
|
2649
|
-
requestInstance = _context4.
|
|
3130
|
+
requestInstance = _context4.v;
|
|
2650
3131
|
subscribeNext = /*#__PURE__*/function () {
|
|
2651
|
-
var _ref3 =
|
|
3132
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
2652
3133
|
var _options;
|
|
2653
|
-
return
|
|
2654
|
-
while (1) switch (_context2.
|
|
3134
|
+
return _regenerator().w(function (_context2) {
|
|
3135
|
+
while (1) switch (_context2.n) {
|
|
2655
3136
|
case 0:
|
|
2656
3137
|
if (!((_options = options) !== null && _options !== void 0 && _options.subscribe && !unsubscribed)) {
|
|
2657
|
-
_context2.
|
|
3138
|
+
_context2.n = 3;
|
|
2658
3139
|
break;
|
|
2659
3140
|
}
|
|
2660
3141
|
if (!requestInstance.unsubscribe) {
|
|
2661
|
-
_context2.
|
|
3142
|
+
_context2.n = 1;
|
|
2662
3143
|
break;
|
|
2663
3144
|
}
|
|
2664
|
-
return _context2.
|
|
3145
|
+
return _context2.a(2, next());
|
|
2665
3146
|
case 1:
|
|
2666
|
-
_context2.
|
|
3147
|
+
_context2.n = 2;
|
|
2667
3148
|
return new Promise(function (resolve) {
|
|
2668
3149
|
return setTimeout(function () {
|
|
2669
3150
|
return resolve();
|
|
2670
3151
|
}, _this2.pollInterval * 1000);
|
|
2671
3152
|
});
|
|
2672
3153
|
case 2:
|
|
2673
|
-
return _context2.
|
|
3154
|
+
return _context2.a(2, next());
|
|
2674
3155
|
case 3:
|
|
2675
|
-
return _context2.
|
|
2676
|
-
case 4:
|
|
2677
|
-
case "end":
|
|
2678
|
-
return _context2.stop();
|
|
3156
|
+
return _context2.a(2, null);
|
|
2679
3157
|
}
|
|
2680
3158
|
}, _callee2);
|
|
2681
3159
|
}));
|
|
@@ -2684,34 +3162,31 @@
|
|
|
2684
3162
|
};
|
|
2685
3163
|
}();
|
|
2686
3164
|
continueWait = /*#__PURE__*/function () {
|
|
2687
|
-
var _ref4 =
|
|
3165
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
|
|
2688
3166
|
var wait,
|
|
2689
3167
|
_args3 = arguments;
|
|
2690
|
-
return
|
|
2691
|
-
while (1) switch (_context3.
|
|
3168
|
+
return _regenerator().w(function (_context3) {
|
|
3169
|
+
while (1) switch (_context3.n) {
|
|
2692
3170
|
case 0:
|
|
2693
3171
|
wait = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : false;
|
|
2694
3172
|
if (unsubscribed) {
|
|
2695
|
-
_context3.
|
|
3173
|
+
_context3.n = 2;
|
|
2696
3174
|
break;
|
|
2697
3175
|
}
|
|
2698
3176
|
if (!wait) {
|
|
2699
|
-
_context3.
|
|
3177
|
+
_context3.n = 1;
|
|
2700
3178
|
break;
|
|
2701
3179
|
}
|
|
2702
|
-
_context3.
|
|
3180
|
+
_context3.n = 1;
|
|
2703
3181
|
return new Promise(function (resolve) {
|
|
2704
3182
|
return setTimeout(function () {
|
|
2705
3183
|
return resolve();
|
|
2706
3184
|
}, _this2.pollInterval * 1000);
|
|
2707
3185
|
});
|
|
2708
3186
|
case 1:
|
|
2709
|
-
return _context3.
|
|
3187
|
+
return _context3.a(2, next());
|
|
2710
3188
|
case 2:
|
|
2711
|
-
return _context3.
|
|
2712
|
-
case 3:
|
|
2713
|
-
case "end":
|
|
2714
|
-
return _context3.stop();
|
|
3189
|
+
return _context3.a(2, null);
|
|
2715
3190
|
}
|
|
2716
3191
|
}, _callee3);
|
|
2717
3192
|
}));
|
|
@@ -2720,103 +3195,100 @@
|
|
|
2720
3195
|
};
|
|
2721
3196
|
}();
|
|
2722
3197
|
if (!((_options2 = options) !== null && _options2 !== void 0 && _options2.subscribe && !skipAuthorizationUpdate)) {
|
|
2723
|
-
_context4.
|
|
3198
|
+
_context4.n = 2;
|
|
2724
3199
|
break;
|
|
2725
3200
|
}
|
|
2726
|
-
_context4.
|
|
3201
|
+
_context4.n = 2;
|
|
2727
3202
|
return _this2.updateTransportAuthorization();
|
|
2728
3203
|
case 2:
|
|
2729
3204
|
skipAuthorizationUpdate = false;
|
|
2730
3205
|
if (!('status' in response && response.status === 502 || 'error' in response && ((_response$error = response.error) === null || _response$error === void 0 ? void 0 : _response$error.toLowerCase()) === 'network error' && --networkRetries >= 0)) {
|
|
2731
|
-
_context4.
|
|
3206
|
+
_context4.n = 4;
|
|
2732
3207
|
break;
|
|
2733
3208
|
}
|
|
2734
|
-
_context4.
|
|
3209
|
+
_context4.n = 3;
|
|
2735
3210
|
return checkMutex();
|
|
2736
3211
|
case 3:
|
|
2737
|
-
return _context4.
|
|
3212
|
+
return _context4.a(2, continueWait(true));
|
|
2738
3213
|
case 4:
|
|
2739
3214
|
// From here we're sure that response is only fetch Response
|
|
2740
3215
|
response = response;
|
|
2741
3216
|
body = {};
|
|
2742
3217
|
text = '';
|
|
2743
|
-
_context4.
|
|
2744
|
-
_context4.
|
|
3218
|
+
_context4.p = 5;
|
|
3219
|
+
_context4.n = 6;
|
|
2745
3220
|
return response.text();
|
|
2746
3221
|
case 6:
|
|
2747
|
-
text = _context4.
|
|
3222
|
+
text = _context4.v;
|
|
2748
3223
|
body = JSON.parse(text);
|
|
2749
|
-
_context4.
|
|
3224
|
+
_context4.n = 8;
|
|
2750
3225
|
break;
|
|
2751
3226
|
case 7:
|
|
2752
|
-
_context4.
|
|
2753
|
-
_context4
|
|
3227
|
+
_context4.p = 7;
|
|
3228
|
+
_context4.v;
|
|
2754
3229
|
body.error = text;
|
|
2755
3230
|
case 8:
|
|
2756
3231
|
if (!((_body$error = body.error) !== null && _body$error !== void 0 && _body$error.includes('Continue wait'))) {
|
|
2757
|
-
_context4.
|
|
3232
|
+
_context4.n = 10;
|
|
2758
3233
|
break;
|
|
2759
3234
|
}
|
|
2760
|
-
_context4.
|
|
3235
|
+
_context4.n = 9;
|
|
2761
3236
|
return checkMutex();
|
|
2762
3237
|
case 9:
|
|
2763
3238
|
if ((_options3 = options) !== null && _options3 !== void 0 && _options3.progressCallback) {
|
|
2764
3239
|
options.progressCallback(new ProgressResult(body));
|
|
2765
3240
|
}
|
|
2766
|
-
return _context4.
|
|
3241
|
+
return _context4.a(2, continueWait());
|
|
2767
3242
|
case 10:
|
|
2768
3243
|
if (!(response.status !== 200)) {
|
|
2769
|
-
_context4.
|
|
3244
|
+
_context4.n = 15;
|
|
2770
3245
|
break;
|
|
2771
3246
|
}
|
|
2772
|
-
_context4.
|
|
3247
|
+
_context4.n = 11;
|
|
2773
3248
|
return checkMutex();
|
|
2774
3249
|
case 11:
|
|
2775
3250
|
if (!(!((_options4 = options) !== null && _options4 !== void 0 && _options4.subscribe) && requestInstance.unsubscribe)) {
|
|
2776
|
-
_context4.
|
|
3251
|
+
_context4.n = 12;
|
|
2777
3252
|
break;
|
|
2778
3253
|
}
|
|
2779
|
-
_context4.
|
|
3254
|
+
_context4.n = 12;
|
|
2780
3255
|
return requestInstance.unsubscribe();
|
|
2781
3256
|
case 12:
|
|
2782
3257
|
_error = new RequestError(body.error || response.error || '', body, response.status);
|
|
2783
3258
|
if (!callback) {
|
|
2784
|
-
_context4.
|
|
3259
|
+
_context4.n = 13;
|
|
2785
3260
|
break;
|
|
2786
3261
|
}
|
|
2787
3262
|
callback(_error);
|
|
2788
|
-
_context4.
|
|
3263
|
+
_context4.n = 14;
|
|
2789
3264
|
break;
|
|
2790
3265
|
case 13:
|
|
2791
3266
|
throw _error;
|
|
2792
3267
|
case 14:
|
|
2793
|
-
return _context4.
|
|
3268
|
+
return _context4.a(2, subscribeNext());
|
|
2794
3269
|
case 15:
|
|
2795
|
-
_context4.
|
|
3270
|
+
_context4.n = 16;
|
|
2796
3271
|
return checkMutex();
|
|
2797
3272
|
case 16:
|
|
2798
3273
|
if (!(!((_options5 = options) !== null && _options5 !== void 0 && _options5.subscribe) && requestInstance.unsubscribe)) {
|
|
2799
|
-
_context4.
|
|
3274
|
+
_context4.n = 17;
|
|
2800
3275
|
break;
|
|
2801
3276
|
}
|
|
2802
|
-
_context4.
|
|
3277
|
+
_context4.n = 17;
|
|
2803
3278
|
return requestInstance.unsubscribe();
|
|
2804
3279
|
case 17:
|
|
2805
3280
|
result = toResult(body);
|
|
2806
3281
|
if (!callback) {
|
|
2807
|
-
_context4.
|
|
3282
|
+
_context4.n = 18;
|
|
2808
3283
|
break;
|
|
2809
3284
|
}
|
|
2810
3285
|
callback(null, result);
|
|
2811
|
-
_context4.
|
|
3286
|
+
_context4.n = 19;
|
|
2812
3287
|
break;
|
|
2813
3288
|
case 18:
|
|
2814
|
-
return _context4.
|
|
3289
|
+
return _context4.a(2, result);
|
|
2815
3290
|
case 19:
|
|
2816
|
-
return _context4.
|
|
2817
|
-
case 20:
|
|
2818
|
-
case "end":
|
|
2819
|
-
return _context4.stop();
|
|
3291
|
+
return _context4.a(2, subscribeNext());
|
|
2820
3292
|
}
|
|
2821
3293
|
}, _callee4, null, [[5, 7]]);
|
|
2822
3294
|
}));
|
|
@@ -2830,26 +3302,23 @@
|
|
|
2830
3302
|
if (callback) {
|
|
2831
3303
|
return {
|
|
2832
3304
|
unsubscribe: function () {
|
|
2833
|
-
var _unsubscribe =
|
|
3305
|
+
var _unsubscribe = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
|
|
2834
3306
|
var requestInstance;
|
|
2835
|
-
return
|
|
2836
|
-
while (1) switch (_context5.
|
|
3307
|
+
return _regenerator().w(function (_context5) {
|
|
3308
|
+
while (1) switch (_context5.n) {
|
|
2837
3309
|
case 0:
|
|
2838
|
-
_context5.
|
|
3310
|
+
_context5.n = 1;
|
|
2839
3311
|
return requestPromise;
|
|
2840
3312
|
case 1:
|
|
2841
|
-
requestInstance = _context5.
|
|
3313
|
+
requestInstance = _context5.v;
|
|
2842
3314
|
unsubscribed = true;
|
|
2843
3315
|
if (!requestInstance.unsubscribe) {
|
|
2844
|
-
_context5.
|
|
3316
|
+
_context5.n = 2;
|
|
2845
3317
|
break;
|
|
2846
3318
|
}
|
|
2847
|
-
return _context5.
|
|
3319
|
+
return _context5.a(2, requestInstance.unsubscribe());
|
|
2848
3320
|
case 2:
|
|
2849
|
-
return _context5.
|
|
2850
|
-
case 3:
|
|
2851
|
-
case "end":
|
|
2852
|
-
return _context5.stop();
|
|
3321
|
+
return _context5.a(2, null);
|
|
2853
3322
|
}
|
|
2854
3323
|
}, _callee5);
|
|
2855
3324
|
}));
|
|
@@ -2866,55 +3335,53 @@
|
|
|
2866
3335
|
}, {
|
|
2867
3336
|
key: "updateTransportAuthorization",
|
|
2868
3337
|
value: function () {
|
|
2869
|
-
var _updateTransportAuthorization =
|
|
3338
|
+
var _updateTransportAuthorization = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {
|
|
2870
3339
|
var _this3 = this;
|
|
2871
3340
|
var tokenFetcher, promise;
|
|
2872
|
-
return
|
|
2873
|
-
while (1) switch (_context7.
|
|
3341
|
+
return _regenerator().w(function (_context7) {
|
|
3342
|
+
while (1) switch (_context7.n) {
|
|
2874
3343
|
case 0:
|
|
2875
3344
|
if (!this.updateAuthorizationPromise) {
|
|
2876
|
-
_context7.
|
|
3345
|
+
_context7.n = 2;
|
|
2877
3346
|
break;
|
|
2878
3347
|
}
|
|
2879
|
-
_context7.
|
|
3348
|
+
_context7.n = 1;
|
|
2880
3349
|
return this.updateAuthorizationPromise;
|
|
2881
3350
|
case 1:
|
|
2882
|
-
return _context7.
|
|
3351
|
+
return _context7.a(2);
|
|
2883
3352
|
case 2:
|
|
2884
3353
|
tokenFetcher = this.apiToken;
|
|
2885
3354
|
if (!(typeof tokenFetcher === 'function')) {
|
|
2886
|
-
_context7.
|
|
3355
|
+
_context7.n = 3;
|
|
2887
3356
|
break;
|
|
2888
3357
|
}
|
|
2889
|
-
promise =
|
|
3358
|
+
promise = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
|
|
2890
3359
|
var token;
|
|
2891
|
-
return
|
|
2892
|
-
while (1) switch (_context6.
|
|
3360
|
+
return _regenerator().w(function (_context6) {
|
|
3361
|
+
while (1) switch (_context6.p = _context6.n) {
|
|
2893
3362
|
case 0:
|
|
2894
|
-
_context6.
|
|
2895
|
-
_context6.
|
|
3363
|
+
_context6.p = 0;
|
|
3364
|
+
_context6.n = 1;
|
|
2896
3365
|
return tokenFetcher();
|
|
2897
3366
|
case 1:
|
|
2898
|
-
token = _context6.
|
|
3367
|
+
token = _context6.v;
|
|
2899
3368
|
if (_this3.transport.authorization !== token) {
|
|
2900
3369
|
_this3.transport.authorization = token;
|
|
2901
3370
|
}
|
|
2902
3371
|
case 2:
|
|
2903
|
-
_context6.
|
|
3372
|
+
_context6.p = 2;
|
|
2904
3373
|
_this3.updateAuthorizationPromise = null;
|
|
2905
|
-
return _context6.
|
|
3374
|
+
return _context6.f(2);
|
|
2906
3375
|
case 3:
|
|
2907
|
-
|
|
2908
|
-
return _context6.stop();
|
|
3376
|
+
return _context6.a(2);
|
|
2909
3377
|
}
|
|
2910
3378
|
}, _callee6, null, [[0,, 2, 3]]);
|
|
2911
3379
|
}))();
|
|
2912
3380
|
this.updateAuthorizationPromise = promise;
|
|
2913
|
-
_context7.
|
|
3381
|
+
_context7.n = 3;
|
|
2914
3382
|
return promise;
|
|
2915
3383
|
case 3:
|
|
2916
|
-
|
|
2917
|
-
return _context7.stop();
|
|
3384
|
+
return _context7.a(2);
|
|
2918
3385
|
}
|
|
2919
3386
|
}, _callee7, this);
|
|
2920
3387
|
}));
|
|
@@ -2930,7 +3397,7 @@
|
|
|
2930
3397
|
key: "patchQueryInternal",
|
|
2931
3398
|
value: function patchQueryInternal(query, responseFormat) {
|
|
2932
3399
|
if ((responseFormat === 'compact' || responseFormat === 'columnar') && query.responseFormat !== responseFormat) {
|
|
2933
|
-
return
|
|
3400
|
+
return _objectSpread2(_objectSpread2({}, query), {}, {
|
|
2934
3401
|
responseFormat: responseFormat
|
|
2935
3402
|
});
|
|
2936
3403
|
} else {
|
|
@@ -2949,8 +3416,8 @@
|
|
|
2949
3416
|
if (response.results.length) {
|
|
2950
3417
|
if (options !== null && options !== void 0 && options.castNumerics) {
|
|
2951
3418
|
response.results.forEach(function (result) {
|
|
2952
|
-
var numericMembers = Object.entries(
|
|
2953
|
-
var _ref7 =
|
|
3419
|
+
var numericMembers = Object.entries(_objectSpread2(_objectSpread2({}, result.annotation.measures), result.annotation.dimensions)).reduce(function (acc, _ref6) {
|
|
3420
|
+
var _ref7 = _slicedToArray(_ref6, 2),
|
|
2954
3421
|
k = _ref7[0],
|
|
2955
3422
|
v = _ref7[1];
|
|
2956
3423
|
if (v.type === 'number') {
|
|
@@ -3046,7 +3513,7 @@
|
|
|
3046
3513
|
_this4 = this;
|
|
3047
3514
|
var responseFormat = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'default';
|
|
3048
3515
|
var _this$prepareQueryOpt = this.prepareQueryOptions(query, options, responseFormat);
|
|
3049
|
-
var _this$prepareQueryOpt2 =
|
|
3516
|
+
var _this$prepareQueryOpt2 = _slicedToArray(_this$prepareQueryOpt, 2);
|
|
3050
3517
|
query = _this$prepareQueryOpt2[0];
|
|
3051
3518
|
options = _this$prepareQueryOpt2[1];
|
|
3052
3519
|
var params = {
|
|
@@ -3069,7 +3536,7 @@
|
|
|
3069
3536
|
value: function prepareQueryOptions(query, options) {
|
|
3070
3537
|
var _this5 = this;
|
|
3071
3538
|
var responseFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'default';
|
|
3072
|
-
options =
|
|
3539
|
+
options = _objectSpread2({
|
|
3073
3540
|
castNumerics: this.castNumerics
|
|
3074
3541
|
}, options);
|
|
3075
3542
|
if (responseFormat === 'compact' || responseFormat === 'columnar') {
|
|
@@ -3120,7 +3587,7 @@
|
|
|
3120
3587
|
var _this6 = this;
|
|
3121
3588
|
var responseFormat = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'default';
|
|
3122
3589
|
var _this$prepareQueryOpt3 = this.prepareQueryOptions(query, options, responseFormat);
|
|
3123
|
-
var _this$prepareQueryOpt4 =
|
|
3590
|
+
var _this$prepareQueryOpt4 = _slicedToArray(_this$prepareQueryOpt3, 2);
|
|
3124
3591
|
query = _this$prepareQueryOpt4[0];
|
|
3125
3592
|
options = _this$prepareQueryOpt4[1];
|
|
3126
3593
|
return this.loadMethod(function () {
|
|
@@ -3133,7 +3600,7 @@
|
|
|
3133
3600
|
});
|
|
3134
3601
|
}, function (response) {
|
|
3135
3602
|
return _this6.loadResponseInternal(response, options);
|
|
3136
|
-
},
|
|
3603
|
+
}, _objectSpread2(_objectSpread2({}, options), {}, {
|
|
3137
3604
|
subscribe: true
|
|
3138
3605
|
}), callback);
|
|
3139
3606
|
}
|
|
@@ -3229,12 +3696,12 @@
|
|
|
3229
3696
|
throw new Error('CubeSQL query was aborted');
|
|
3230
3697
|
}
|
|
3231
3698
|
var _response$error$split = response.error.split('\n'),
|
|
3232
|
-
_response$error$split2 =
|
|
3699
|
+
_response$error$split2 = _toArray(_response$error$split),
|
|
3233
3700
|
schema = _response$error$split2[0],
|
|
3234
3701
|
data = _arrayLikeToArray(_response$error$split2).slice(1);
|
|
3235
3702
|
try {
|
|
3236
3703
|
var parsedSchema = JSON.parse(schema);
|
|
3237
|
-
return
|
|
3704
|
+
return _objectSpread2({
|
|
3238
3705
|
schema: parsedSchema.schema,
|
|
3239
3706
|
data: data.filter(function (d) {
|
|
3240
3707
|
return d.trim().length;
|
|
@@ -3260,13 +3727,13 @@
|
|
|
3260
3727
|
key: "cubeSqlStream",
|
|
3261
3728
|
value: function cubeSqlStream(sqlQuery, options) {
|
|
3262
3729
|
var _this = this;
|
|
3263
|
-
return
|
|
3730
|
+
return _wrapAsyncGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {
|
|
3264
3731
|
var streamResponse, decoder, buffer, stream, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, chunk, lines, _iterator2, _step2, line, parsed, _parsed, _t3, _t4, _t6;
|
|
3265
|
-
return
|
|
3266
|
-
while (1) switch (_context8.
|
|
3732
|
+
return _regenerator().w(function (_context8) {
|
|
3733
|
+
while (1) switch (_context8.p = _context8.n) {
|
|
3267
3734
|
case 0:
|
|
3268
3735
|
if (_this.transport.requestStream) {
|
|
3269
|
-
_context8.
|
|
3736
|
+
_context8.n = 1;
|
|
3270
3737
|
break;
|
|
3271
3738
|
}
|
|
3272
3739
|
throw new Error('Transport does not support streaming');
|
|
@@ -3283,21 +3750,21 @@
|
|
|
3283
3750
|
});
|
|
3284
3751
|
decoder = new TextDecoder();
|
|
3285
3752
|
buffer = '';
|
|
3286
|
-
_context8.
|
|
3287
|
-
_context8.
|
|
3288
|
-
return
|
|
3753
|
+
_context8.p = 2;
|
|
3754
|
+
_context8.n = 3;
|
|
3755
|
+
return _awaitAsyncGenerator(streamResponse.stream());
|
|
3289
3756
|
case 3:
|
|
3290
|
-
stream = _context8.
|
|
3757
|
+
stream = _context8.v;
|
|
3291
3758
|
_iteratorAbruptCompletion = false;
|
|
3292
3759
|
_didIteratorError = false;
|
|
3293
|
-
_context8.
|
|
3760
|
+
_context8.p = 4;
|
|
3294
3761
|
_iterator = _asyncIterator(stream);
|
|
3295
3762
|
case 5:
|
|
3296
|
-
_context8.
|
|
3297
|
-
return
|
|
3763
|
+
_context8.n = 6;
|
|
3764
|
+
return _awaitAsyncGenerator(_iterator.next());
|
|
3298
3765
|
case 6:
|
|
3299
|
-
if (!(_iteratorAbruptCompletion = !(_step = _context8.
|
|
3300
|
-
_context8.
|
|
3766
|
+
if (!(_iteratorAbruptCompletion = !(_step = _context8.v).done)) {
|
|
3767
|
+
_context8.n = 21;
|
|
3301
3768
|
break;
|
|
3302
3769
|
}
|
|
3303
3770
|
chunk = _step.value;
|
|
@@ -3307,197 +3774,196 @@
|
|
|
3307
3774
|
lines = buffer.split('\n');
|
|
3308
3775
|
buffer = lines.pop() || '';
|
|
3309
3776
|
_iterator2 = _createForOfIteratorHelper(lines);
|
|
3310
|
-
_context8.
|
|
3777
|
+
_context8.p = 7;
|
|
3311
3778
|
_iterator2.s();
|
|
3312
3779
|
case 8:
|
|
3313
3780
|
if ((_step2 = _iterator2.n()).done) {
|
|
3314
|
-
_context8.
|
|
3781
|
+
_context8.n = 17;
|
|
3315
3782
|
break;
|
|
3316
3783
|
}
|
|
3317
3784
|
line = _step2.value;
|
|
3318
3785
|
if (!line.trim()) {
|
|
3319
|
-
_context8.
|
|
3786
|
+
_context8.n = 16;
|
|
3320
3787
|
break;
|
|
3321
3788
|
}
|
|
3322
|
-
_context8.
|
|
3789
|
+
_context8.p = 9;
|
|
3323
3790
|
parsed = JSON.parse(line);
|
|
3324
3791
|
if (!parsed.schema) {
|
|
3325
|
-
_context8.
|
|
3792
|
+
_context8.n = 11;
|
|
3326
3793
|
break;
|
|
3327
3794
|
}
|
|
3328
|
-
_context8.
|
|
3329
|
-
return
|
|
3795
|
+
_context8.n = 10;
|
|
3796
|
+
return _objectSpread2({
|
|
3330
3797
|
type: 'schema',
|
|
3331
3798
|
schema: parsed.schema
|
|
3332
3799
|
}, parsed.lastRefreshTime ? {
|
|
3333
3800
|
lastRefreshTime: parsed.lastRefreshTime
|
|
3334
3801
|
} : {});
|
|
3335
3802
|
case 10:
|
|
3336
|
-
_context8.
|
|
3803
|
+
_context8.n = 14;
|
|
3337
3804
|
break;
|
|
3338
3805
|
case 11:
|
|
3339
3806
|
if (!parsed.data) {
|
|
3340
|
-
_context8.
|
|
3807
|
+
_context8.n = 13;
|
|
3341
3808
|
break;
|
|
3342
3809
|
}
|
|
3343
|
-
_context8.
|
|
3810
|
+
_context8.n = 12;
|
|
3344
3811
|
return {
|
|
3345
3812
|
type: 'data',
|
|
3346
3813
|
data: parsed.data
|
|
3347
3814
|
};
|
|
3348
3815
|
case 12:
|
|
3349
|
-
_context8.
|
|
3816
|
+
_context8.n = 14;
|
|
3350
3817
|
break;
|
|
3351
3818
|
case 13:
|
|
3352
3819
|
if (!parsed.error) {
|
|
3353
|
-
_context8.
|
|
3820
|
+
_context8.n = 14;
|
|
3354
3821
|
break;
|
|
3355
3822
|
}
|
|
3356
|
-
_context8.
|
|
3823
|
+
_context8.n = 14;
|
|
3357
3824
|
return {
|
|
3358
3825
|
type: 'error',
|
|
3359
3826
|
error: parsed.error
|
|
3360
3827
|
};
|
|
3361
3828
|
case 14:
|
|
3362
|
-
_context8.
|
|
3829
|
+
_context8.n = 16;
|
|
3363
3830
|
break;
|
|
3364
3831
|
case 15:
|
|
3365
|
-
_context8.
|
|
3366
|
-
_context8
|
|
3367
|
-
_context8.
|
|
3832
|
+
_context8.p = 15;
|
|
3833
|
+
_context8.v;
|
|
3834
|
+
_context8.n = 16;
|
|
3368
3835
|
return {
|
|
3369
3836
|
type: 'error',
|
|
3370
3837
|
error: "Failed to parse JSON line: ".concat(line)
|
|
3371
3838
|
};
|
|
3372
3839
|
case 16:
|
|
3373
|
-
_context8.
|
|
3840
|
+
_context8.n = 8;
|
|
3374
3841
|
break;
|
|
3375
3842
|
case 17:
|
|
3376
|
-
_context8.
|
|
3843
|
+
_context8.n = 19;
|
|
3377
3844
|
break;
|
|
3378
3845
|
case 18:
|
|
3379
|
-
_context8.
|
|
3380
|
-
_t3 = _context8
|
|
3846
|
+
_context8.p = 18;
|
|
3847
|
+
_t3 = _context8.v;
|
|
3381
3848
|
_iterator2.e(_t3);
|
|
3382
3849
|
case 19:
|
|
3383
|
-
_context8.
|
|
3850
|
+
_context8.p = 19;
|
|
3384
3851
|
_iterator2.f();
|
|
3385
|
-
return _context8.
|
|
3852
|
+
return _context8.f(19);
|
|
3386
3853
|
case 20:
|
|
3387
3854
|
_iteratorAbruptCompletion = false;
|
|
3388
|
-
_context8.
|
|
3855
|
+
_context8.n = 5;
|
|
3389
3856
|
break;
|
|
3390
3857
|
case 21:
|
|
3391
|
-
_context8.
|
|
3858
|
+
_context8.n = 23;
|
|
3392
3859
|
break;
|
|
3393
3860
|
case 22:
|
|
3394
|
-
_context8.
|
|
3395
|
-
_t4 = _context8
|
|
3861
|
+
_context8.p = 22;
|
|
3862
|
+
_t4 = _context8.v;
|
|
3396
3863
|
_didIteratorError = true;
|
|
3397
3864
|
_iteratorError = _t4;
|
|
3398
3865
|
case 23:
|
|
3399
|
-
_context8.
|
|
3400
|
-
_context8.
|
|
3866
|
+
_context8.p = 23;
|
|
3867
|
+
_context8.p = 24;
|
|
3401
3868
|
if (!(_iteratorAbruptCompletion && _iterator["return"] != null)) {
|
|
3402
|
-
_context8.
|
|
3869
|
+
_context8.n = 25;
|
|
3403
3870
|
break;
|
|
3404
3871
|
}
|
|
3405
|
-
_context8.
|
|
3406
|
-
return
|
|
3872
|
+
_context8.n = 25;
|
|
3873
|
+
return _awaitAsyncGenerator(_iterator["return"]());
|
|
3407
3874
|
case 25:
|
|
3408
|
-
_context8.
|
|
3875
|
+
_context8.p = 25;
|
|
3409
3876
|
if (!_didIteratorError) {
|
|
3410
|
-
_context8.
|
|
3877
|
+
_context8.n = 26;
|
|
3411
3878
|
break;
|
|
3412
3879
|
}
|
|
3413
3880
|
throw _iteratorError;
|
|
3414
3881
|
case 26:
|
|
3415
|
-
return _context8.
|
|
3882
|
+
return _context8.f(25);
|
|
3416
3883
|
case 27:
|
|
3417
|
-
return _context8.
|
|
3884
|
+
return _context8.f(23);
|
|
3418
3885
|
case 28:
|
|
3419
3886
|
if (!buffer.trim()) {
|
|
3420
|
-
_context8.
|
|
3887
|
+
_context8.n = 36;
|
|
3421
3888
|
break;
|
|
3422
3889
|
}
|
|
3423
|
-
_context8.
|
|
3890
|
+
_context8.p = 29;
|
|
3424
3891
|
_parsed = JSON.parse(buffer);
|
|
3425
3892
|
if (!_parsed.schema) {
|
|
3426
|
-
_context8.
|
|
3893
|
+
_context8.n = 31;
|
|
3427
3894
|
break;
|
|
3428
3895
|
}
|
|
3429
|
-
_context8.
|
|
3430
|
-
return
|
|
3896
|
+
_context8.n = 30;
|
|
3897
|
+
return _objectSpread2({
|
|
3431
3898
|
type: 'schema',
|
|
3432
3899
|
schema: _parsed.schema
|
|
3433
3900
|
}, _parsed.lastRefreshTime ? {
|
|
3434
3901
|
lastRefreshTime: _parsed.lastRefreshTime
|
|
3435
3902
|
} : {});
|
|
3436
3903
|
case 30:
|
|
3437
|
-
_context8.
|
|
3904
|
+
_context8.n = 34;
|
|
3438
3905
|
break;
|
|
3439
3906
|
case 31:
|
|
3440
3907
|
if (!_parsed.data) {
|
|
3441
|
-
_context8.
|
|
3908
|
+
_context8.n = 33;
|
|
3442
3909
|
break;
|
|
3443
3910
|
}
|
|
3444
|
-
_context8.
|
|
3911
|
+
_context8.n = 32;
|
|
3445
3912
|
return {
|
|
3446
3913
|
type: 'data',
|
|
3447
3914
|
data: _parsed.data
|
|
3448
3915
|
};
|
|
3449
3916
|
case 32:
|
|
3450
|
-
_context8.
|
|
3917
|
+
_context8.n = 34;
|
|
3451
3918
|
break;
|
|
3452
3919
|
case 33:
|
|
3453
3920
|
if (!_parsed.error) {
|
|
3454
|
-
_context8.
|
|
3921
|
+
_context8.n = 34;
|
|
3455
3922
|
break;
|
|
3456
3923
|
}
|
|
3457
|
-
_context8.
|
|
3924
|
+
_context8.n = 34;
|
|
3458
3925
|
return {
|
|
3459
3926
|
type: 'error',
|
|
3460
3927
|
error: _parsed.error
|
|
3461
3928
|
};
|
|
3462
3929
|
case 34:
|
|
3463
|
-
_context8.
|
|
3930
|
+
_context8.n = 36;
|
|
3464
3931
|
break;
|
|
3465
3932
|
case 35:
|
|
3466
|
-
_context8.
|
|
3467
|
-
_context8
|
|
3468
|
-
_context8.
|
|
3933
|
+
_context8.p = 35;
|
|
3934
|
+
_context8.v;
|
|
3935
|
+
_context8.n = 36;
|
|
3469
3936
|
return {
|
|
3470
3937
|
type: 'error',
|
|
3471
3938
|
error: "Failed to parse remaining JSON: ".concat(buffer)
|
|
3472
3939
|
};
|
|
3473
3940
|
case 36:
|
|
3474
|
-
_context8.
|
|
3941
|
+
_context8.n = 39;
|
|
3475
3942
|
break;
|
|
3476
3943
|
case 37:
|
|
3477
|
-
_context8.
|
|
3478
|
-
_t6 = _context8
|
|
3944
|
+
_context8.p = 37;
|
|
3945
|
+
_t6 = _context8.v;
|
|
3479
3946
|
if (!(_t6.name === 'AbortError')) {
|
|
3480
|
-
_context8.
|
|
3947
|
+
_context8.n = 38;
|
|
3481
3948
|
break;
|
|
3482
3949
|
}
|
|
3483
3950
|
throw new Error('aborted');
|
|
3484
3951
|
case 38:
|
|
3485
3952
|
throw _t6;
|
|
3486
3953
|
case 39:
|
|
3487
|
-
_context8.
|
|
3954
|
+
_context8.p = 39;
|
|
3488
3955
|
if (!streamResponse.unsubscribe) {
|
|
3489
|
-
_context8.
|
|
3956
|
+
_context8.n = 40;
|
|
3490
3957
|
break;
|
|
3491
3958
|
}
|
|
3492
|
-
_context8.
|
|
3493
|
-
return
|
|
3959
|
+
_context8.n = 40;
|
|
3960
|
+
return _awaitAsyncGenerator(streamResponse.unsubscribe());
|
|
3494
3961
|
case 40:
|
|
3495
|
-
return _context8.
|
|
3962
|
+
return _context8.f(39);
|
|
3496
3963
|
case 41:
|
|
3497
|
-
|
|
3498
|
-
return _context8.stop();
|
|
3964
|
+
return _context8.a(2);
|
|
3499
3965
|
}
|
|
3500
|
-
}, _callee8, null, [[
|
|
3966
|
+
}, _callee8, null, [[29, 35], [24,, 25, 27], [9, 15], [7, 18, 19, 20], [4, 22, 23, 28], [2, 37, 39, 41]]);
|
|
3501
3967
|
}))();
|
|
3502
3968
|
}
|
|
3503
3969
|
}]);
|