@cubejs-client/core 1.6.40 → 1.6.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{cubejs-client-core.cjs.js → cubejs-client-core.cjs} +909 -468
- package/dist/cubejs-client-core.cjs.map +1 -0
- package/dist/cubejs-client-core.umd.js +900 -434
- 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/HttpTransport.js +1 -1
- package/dist/src/Meta.d.ts +1 -2
- package/dist/src/Meta.d.ts.map +1 -1
- package/dist/src/ProgressResult.d.ts +1 -1
- package/dist/src/ProgressResult.d.ts.map +1 -1
- package/dist/src/ResultSet.d.ts +1 -1
- package/dist/src/ResultSet.d.ts.map +1 -1
- package/dist/src/ResultSet.js +2 -2
- package/dist/src/format.d.ts +1 -1
- package/dist/src/format.d.ts.map +1 -1
- package/dist/src/format.js +67 -3
- package/dist/src/index.d.ts +16 -19
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +16 -16
- package/dist/src/index.umd.js +1 -1
- package/dist/src/time.js +4 -4
- package/dist/src/types.d.ts +9 -4
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils.d.ts +2 -3
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +1 -1
- package/dist/test/CubeApi.test.js +5 -5
- package/dist/test/HttpTransport.test.js +1 -1
- package/dist/test/ResultSet.bench.js +1 -1
- package/dist/test/ResultSet.test.js +2 -2
- package/dist/test/SqlQuery.test.js +1 -1
- package/dist/test/compare-date-range.test.js +1 -1
- package/dist/test/data-blending.test.js +1 -1
- package/dist/test/dayjs-isolation.test.js +1 -1
- package/dist/test/default-heuristics.test.js +1 -1
- package/dist/test/drill-down.test.js +1 -1
- package/dist/test/format-no-intl.test.js +7 -7
- package/dist/test/format.test.js +52 -1
- package/dist/test/granularity.test.js +1 -1
- package/dist/test/index.test.js +2 -2
- package/dist/test/table.test.js +1 -1
- package/dist/test/utils.test.js +2 -2
- package/package.json +8 -6
- package/dist/cubejs-client-core.cjs.js.map +0 -1
|
@@ -2,62 +2,41 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var _toArray = require('@babel/runtime/helpers/toArray');
|
|
6
|
-
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
7
|
-
var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
|
8
|
-
var _typeof = require('@babel/runtime/helpers/typeof');
|
|
9
|
-
var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
|
|
10
|
-
var _createClass = require('@babel/runtime/helpers/createClass');
|
|
11
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
12
|
-
var _awaitAsyncGenerator = require('@babel/runtime/helpers/awaitAsyncGenerator');
|
|
13
|
-
var _wrapAsyncGenerator = require('@babel/runtime/helpers/wrapAsyncGenerator');
|
|
14
|
-
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
|
15
|
-
require('core-js/modules/es.symbol.js');
|
|
16
|
-
require('core-js/modules/es.symbol.description.js');
|
|
17
|
-
require('core-js/modules/es.symbol.async-iterator.js');
|
|
18
|
-
require('core-js/modules/es.symbol.iterator.js');
|
|
19
5
|
require('core-js/modules/es.array.concat.js');
|
|
20
6
|
require('core-js/modules/es.array.filter.js');
|
|
21
7
|
require('core-js/modules/es.array.for-each.js');
|
|
22
|
-
require('core-js/modules/es.array.from.js');
|
|
23
8
|
require('core-js/modules/es.array.includes.js');
|
|
24
9
|
require('core-js/modules/es.array.is-array.js');
|
|
25
|
-
require('core-js/modules/es.array.iterator.js');
|
|
26
10
|
require('core-js/modules/es.array.map.js');
|
|
27
11
|
require('core-js/modules/es.array.reduce.js');
|
|
28
12
|
require('core-js/modules/es.array.slice.js');
|
|
29
13
|
require('core-js/modules/es.function.name.js');
|
|
30
|
-
require('core-js/modules/es.date.to-string.js');
|
|
31
14
|
require('core-js/modules/es.number.constructor.js');
|
|
32
15
|
require('core-js/modules/es.object.entries.js');
|
|
33
16
|
require('core-js/modules/es.object.keys.js');
|
|
34
|
-
require('core-js/modules/es.object.define-properties.js');
|
|
35
|
-
require('core-js/modules/es.object.define-property.js');
|
|
36
|
-
require('core-js/modules/es.object.get-own-property-descriptor.js');
|
|
37
|
-
require('core-js/modules/es.object.get-own-property-descriptors.js');
|
|
38
17
|
require('core-js/modules/es.object.to-string.js');
|
|
39
18
|
require('core-js/modules/es.promise.js');
|
|
40
|
-
require('core-js/modules/es.regexp.exec.js');
|
|
41
|
-
require('core-js/modules/es.regexp.to-string.js');
|
|
42
19
|
require('core-js/modules/es.string.includes.js');
|
|
43
|
-
require('core-js/modules/es.string.iterator.js');
|
|
44
20
|
require('core-js/modules/es.string.trim.js');
|
|
45
21
|
require('core-js/modules/web.dom-collections.for-each.js');
|
|
46
|
-
require('core-js/modules/web.dom-collections.iterator.js');
|
|
47
22
|
require('core-js/modules/web.timers.js');
|
|
48
23
|
var uuid = require('uuid');
|
|
49
|
-
require('@babel/runtime/helpers/readOnlyError');
|
|
50
|
-
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
51
|
-
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
52
24
|
require('core-js/modules/es.array.find.js');
|
|
25
|
+
require('core-js/modules/es.array.from.js');
|
|
53
26
|
require('core-js/modules/es.array.index-of.js');
|
|
27
|
+
require('core-js/modules/es.array.iterator.js');
|
|
54
28
|
require('core-js/modules/es.array.join.js');
|
|
29
|
+
require('core-js/modules/es.date.to-string.js');
|
|
55
30
|
require('core-js/modules/es.map.js');
|
|
56
31
|
require('core-js/modules/es.number.is-nan.js');
|
|
57
32
|
require('core-js/modules/es.number.parse-float.js');
|
|
58
33
|
require('core-js/modules/es.object.values.js');
|
|
34
|
+
require('core-js/modules/es.regexp.exec.js');
|
|
35
|
+
require('core-js/modules/es.regexp.to-string.js');
|
|
59
36
|
require('core-js/modules/es.set.js');
|
|
37
|
+
require('core-js/modules/es.string.iterator.js');
|
|
60
38
|
require('core-js/modules/es.string.match.js');
|
|
39
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
61
40
|
var dayjs = require('dayjs');
|
|
62
41
|
var ramda = require('ramda');
|
|
63
42
|
require('core-js/modules/es.array.every.js');
|
|
@@ -67,15 +46,16 @@ require('core-js/modules/es.array.unscopables.flat-map.js');
|
|
|
67
46
|
require('core-js/modules/es.parse-int.js');
|
|
68
47
|
require('core-js/modules/es.string.ends-with.js');
|
|
69
48
|
require('core-js/modules/es.string.split.js');
|
|
70
|
-
var quarterOfYear = require('dayjs/plugin/quarterOfYear');
|
|
71
|
-
var duration = require('dayjs/plugin/duration');
|
|
72
|
-
var isoWeek = require('dayjs/plugin/isoWeek');
|
|
73
|
-
var en = require('dayjs/locale/en');
|
|
49
|
+
var quarterOfYear = require('dayjs/plugin/quarterOfYear.js');
|
|
50
|
+
var duration = require('dayjs/plugin/duration.js');
|
|
51
|
+
var isoWeek = require('dayjs/plugin/isoWeek.js');
|
|
52
|
+
var en = require('dayjs/locale/en.js');
|
|
74
53
|
require('core-js/modules/es.array.sort.js');
|
|
75
54
|
require('core-js/modules/es.date.to-json.js');
|
|
76
55
|
require('core-js/modules/web.url-search-params.js');
|
|
77
56
|
var fetch = require('cross-fetch');
|
|
78
57
|
require('url-search-params-polyfill');
|
|
58
|
+
require('core-js/modules/es.symbol.async-iterator.js');
|
|
79
59
|
require('core-js/modules/es.array-buffer.constructor.js');
|
|
80
60
|
require('core-js/modules/es.array-buffer.slice.js');
|
|
81
61
|
require('core-js/modules/es.data-view.js');
|
|
@@ -103,46 +83,549 @@ require('core-js/modules/es.typed-array.sort.js');
|
|
|
103
83
|
require('core-js/modules/es.typed-array.subarray.js');
|
|
104
84
|
require('core-js/modules/es.typed-array.to-locale-string.js');
|
|
105
85
|
require('core-js/modules/es.typed-array.to-string.js');
|
|
106
|
-
require('core-js/modules/es.reflect.construct.js');
|
|
107
|
-
var _possibleConstructorReturn = require('@babel/runtime/helpers/possibleConstructorReturn');
|
|
108
|
-
var _getPrototypeOf = require('@babel/runtime/helpers/getPrototypeOf');
|
|
109
|
-
var _inherits = require('@babel/runtime/helpers/inherits');
|
|
110
|
-
var _wrapNativeSuper = require('@babel/runtime/helpers/wrapNativeSuper');
|
|
111
86
|
|
|
112
87
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
113
88
|
|
|
114
|
-
var _toArray__default = /*#__PURE__*/_interopDefaultLegacy(_toArray);
|
|
115
|
-
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
116
|
-
var _asyncToGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_asyncToGenerator);
|
|
117
|
-
var _typeof__default = /*#__PURE__*/_interopDefaultLegacy(_typeof);
|
|
118
|
-
var _classCallCheck__default = /*#__PURE__*/_interopDefaultLegacy(_classCallCheck);
|
|
119
|
-
var _createClass__default = /*#__PURE__*/_interopDefaultLegacy(_createClass);
|
|
120
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
121
|
-
var _awaitAsyncGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_awaitAsyncGenerator);
|
|
122
|
-
var _wrapAsyncGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_wrapAsyncGenerator);
|
|
123
|
-
var _regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(_regeneratorRuntime);
|
|
124
|
-
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
125
|
-
var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
|
|
126
89
|
var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
|
|
127
90
|
var quarterOfYear__default = /*#__PURE__*/_interopDefaultLegacy(quarterOfYear);
|
|
128
91
|
var duration__default = /*#__PURE__*/_interopDefaultLegacy(duration);
|
|
129
92
|
var isoWeek__default = /*#__PURE__*/_interopDefaultLegacy(isoWeek);
|
|
130
93
|
var en__default = /*#__PURE__*/_interopDefaultLegacy(en);
|
|
131
94
|
var fetch__default = /*#__PURE__*/_interopDefaultLegacy(fetch);
|
|
132
|
-
var _possibleConstructorReturn__default = /*#__PURE__*/_interopDefaultLegacy(_possibleConstructorReturn);
|
|
133
|
-
var _getPrototypeOf__default = /*#__PURE__*/_interopDefaultLegacy(_getPrototypeOf);
|
|
134
|
-
var _inherits__default = /*#__PURE__*/_interopDefaultLegacy(_inherits);
|
|
135
|
-
var _wrapNativeSuper__default = /*#__PURE__*/_interopDefaultLegacy(_wrapNativeSuper);
|
|
136
95
|
|
|
137
|
-
function
|
|
138
|
-
|
|
96
|
+
function _OverloadYield(e, d) {
|
|
97
|
+
this.v = e, this.k = d;
|
|
98
|
+
}
|
|
99
|
+
function _arrayLikeToArray(r, a) {
|
|
100
|
+
(null == a || a > r.length) && (a = r.length);
|
|
101
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
102
|
+
return n;
|
|
103
|
+
}
|
|
104
|
+
function _arrayWithHoles(r) {
|
|
105
|
+
if (Array.isArray(r)) return r;
|
|
106
|
+
}
|
|
107
|
+
function _arrayWithoutHoles(r) {
|
|
108
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
109
|
+
}
|
|
110
|
+
function _assertThisInitialized(e) {
|
|
111
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
112
|
+
return e;
|
|
113
|
+
}
|
|
114
|
+
function _asyncIterator(r) {
|
|
115
|
+
var n,
|
|
116
|
+
t,
|
|
117
|
+
o,
|
|
118
|
+
e = 2;
|
|
119
|
+
for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) {
|
|
120
|
+
if (t && null != (n = r[t])) return n.call(r);
|
|
121
|
+
if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r));
|
|
122
|
+
t = "@@asyncIterator", o = "@@iterator";
|
|
123
|
+
}
|
|
124
|
+
throw new TypeError("Object is not async iterable");
|
|
125
|
+
}
|
|
126
|
+
function AsyncFromSyncIterator(r) {
|
|
127
|
+
function AsyncFromSyncIteratorContinuation(r) {
|
|
128
|
+
if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object."));
|
|
129
|
+
var n = r.done;
|
|
130
|
+
return Promise.resolve(r.value).then(function (r) {
|
|
131
|
+
return {
|
|
132
|
+
value: r,
|
|
133
|
+
done: n
|
|
134
|
+
};
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
return AsyncFromSyncIterator = function (r) {
|
|
138
|
+
this.s = r, this.n = r.next;
|
|
139
|
+
}, AsyncFromSyncIterator.prototype = {
|
|
140
|
+
s: null,
|
|
141
|
+
n: null,
|
|
142
|
+
next: function () {
|
|
143
|
+
return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));
|
|
144
|
+
},
|
|
145
|
+
return: function (r) {
|
|
146
|
+
var n = this.s.return;
|
|
147
|
+
return void 0 === n ? Promise.resolve({
|
|
148
|
+
value: r,
|
|
149
|
+
done: !0
|
|
150
|
+
}) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments));
|
|
151
|
+
},
|
|
152
|
+
throw: function (r) {
|
|
153
|
+
var n = this.s.return;
|
|
154
|
+
return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments));
|
|
155
|
+
}
|
|
156
|
+
}, new AsyncFromSyncIterator(r);
|
|
157
|
+
}
|
|
158
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
159
|
+
try {
|
|
160
|
+
var i = n[a](c),
|
|
161
|
+
u = i.value;
|
|
162
|
+
} catch (n) {
|
|
163
|
+
return void e(n);
|
|
164
|
+
}
|
|
165
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
166
|
+
}
|
|
167
|
+
function _asyncToGenerator(n) {
|
|
168
|
+
return function () {
|
|
169
|
+
var t = this,
|
|
170
|
+
e = arguments;
|
|
171
|
+
return new Promise(function (r, o) {
|
|
172
|
+
var a = n.apply(t, e);
|
|
173
|
+
function _next(n) {
|
|
174
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
175
|
+
}
|
|
176
|
+
function _throw(n) {
|
|
177
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
178
|
+
}
|
|
179
|
+
_next(void 0);
|
|
180
|
+
});
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
function _awaitAsyncGenerator(e) {
|
|
184
|
+
return new _OverloadYield(e, 0);
|
|
185
|
+
}
|
|
186
|
+
function _callSuper(t, o, e) {
|
|
187
|
+
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
188
|
+
}
|
|
189
|
+
function _classCallCheck(a, n) {
|
|
190
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
191
|
+
}
|
|
192
|
+
function _construct(t, e, r) {
|
|
193
|
+
if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
|
|
194
|
+
var o = [null];
|
|
195
|
+
o.push.apply(o, e);
|
|
196
|
+
var p = new (t.bind.apply(t, o))();
|
|
197
|
+
return r && _setPrototypeOf(p, r.prototype), p;
|
|
198
|
+
}
|
|
199
|
+
function _defineProperties(e, r) {
|
|
200
|
+
for (var t = 0; t < r.length; t++) {
|
|
201
|
+
var o = r[t];
|
|
202
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
function _createClass(e, r, t) {
|
|
206
|
+
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
207
|
+
writable: !1
|
|
208
|
+
}), e;
|
|
209
|
+
}
|
|
210
|
+
function _createForOfIteratorHelper(r, e) {
|
|
211
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
212
|
+
if (!t) {
|
|
213
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
214
|
+
t && (r = t);
|
|
215
|
+
var n = 0,
|
|
216
|
+
F = function () {};
|
|
217
|
+
return {
|
|
218
|
+
s: F,
|
|
219
|
+
n: function () {
|
|
220
|
+
return n >= r.length ? {
|
|
221
|
+
done: !0
|
|
222
|
+
} : {
|
|
223
|
+
done: !1,
|
|
224
|
+
value: r[n++]
|
|
225
|
+
};
|
|
226
|
+
},
|
|
227
|
+
e: function (r) {
|
|
228
|
+
throw r;
|
|
229
|
+
},
|
|
230
|
+
f: F
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
234
|
+
}
|
|
235
|
+
var o,
|
|
236
|
+
a = !0,
|
|
237
|
+
u = !1;
|
|
238
|
+
return {
|
|
239
|
+
s: function () {
|
|
240
|
+
t = t.call(r);
|
|
241
|
+
},
|
|
242
|
+
n: function () {
|
|
243
|
+
var r = t.next();
|
|
244
|
+
return a = r.done, r;
|
|
245
|
+
},
|
|
246
|
+
e: function (r) {
|
|
247
|
+
u = !0, o = r;
|
|
248
|
+
},
|
|
249
|
+
f: function () {
|
|
250
|
+
try {
|
|
251
|
+
a || null == t.return || t.return();
|
|
252
|
+
} finally {
|
|
253
|
+
if (u) throw o;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
function _defineProperty(e, r, t) {
|
|
259
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
260
|
+
value: t,
|
|
261
|
+
enumerable: !0,
|
|
262
|
+
configurable: !0,
|
|
263
|
+
writable: !0
|
|
264
|
+
}) : e[r] = t, e;
|
|
265
|
+
}
|
|
266
|
+
function _getPrototypeOf(t) {
|
|
267
|
+
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
268
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
269
|
+
}, _getPrototypeOf(t);
|
|
270
|
+
}
|
|
271
|
+
function _inherits(t, e) {
|
|
272
|
+
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
273
|
+
t.prototype = Object.create(e && e.prototype, {
|
|
274
|
+
constructor: {
|
|
275
|
+
value: t,
|
|
276
|
+
writable: !0,
|
|
277
|
+
configurable: !0
|
|
278
|
+
}
|
|
279
|
+
}), Object.defineProperty(t, "prototype", {
|
|
280
|
+
writable: !1
|
|
281
|
+
}), e && _setPrototypeOf(t, e);
|
|
282
|
+
}
|
|
283
|
+
function _isNativeFunction(t) {
|
|
284
|
+
try {
|
|
285
|
+
return -1 !== Function.toString.call(t).indexOf("[native code]");
|
|
286
|
+
} catch (n) {
|
|
287
|
+
return "function" == typeof t;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
function _isNativeReflectConstruct() {
|
|
291
|
+
try {
|
|
292
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
293
|
+
} catch (t) {}
|
|
294
|
+
return (_isNativeReflectConstruct = function () {
|
|
295
|
+
return !!t;
|
|
296
|
+
})();
|
|
297
|
+
}
|
|
298
|
+
function _iterableToArray(r) {
|
|
299
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
300
|
+
}
|
|
301
|
+
function _iterableToArrayLimit(r, l) {
|
|
302
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
303
|
+
if (null != t) {
|
|
304
|
+
var e,
|
|
305
|
+
n,
|
|
306
|
+
i,
|
|
307
|
+
u,
|
|
308
|
+
a = [],
|
|
309
|
+
f = !0,
|
|
310
|
+
o = !1;
|
|
311
|
+
try {
|
|
312
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
313
|
+
if (Object(t) !== t) return;
|
|
314
|
+
f = !1;
|
|
315
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
316
|
+
} catch (r) {
|
|
317
|
+
o = !0, n = r;
|
|
318
|
+
} finally {
|
|
319
|
+
try {
|
|
320
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
321
|
+
} finally {
|
|
322
|
+
if (o) throw n;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return a;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
function _nonIterableRest() {
|
|
329
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
330
|
+
}
|
|
331
|
+
function _nonIterableSpread() {
|
|
332
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
333
|
+
}
|
|
334
|
+
function ownKeys(e, r) {
|
|
335
|
+
var t = Object.keys(e);
|
|
336
|
+
if (Object.getOwnPropertySymbols) {
|
|
337
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
338
|
+
r && (o = o.filter(function (r) {
|
|
339
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
340
|
+
})), t.push.apply(t, o);
|
|
341
|
+
}
|
|
342
|
+
return t;
|
|
343
|
+
}
|
|
344
|
+
function _objectSpread2(e) {
|
|
345
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
346
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
347
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
348
|
+
_defineProperty(e, r, t[r]);
|
|
349
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
350
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
return e;
|
|
354
|
+
}
|
|
355
|
+
function _objectWithoutProperties(e, t) {
|
|
356
|
+
if (null == e) return {};
|
|
357
|
+
var o,
|
|
358
|
+
r,
|
|
359
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
360
|
+
if (Object.getOwnPropertySymbols) {
|
|
361
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
362
|
+
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
363
|
+
}
|
|
364
|
+
return i;
|
|
365
|
+
}
|
|
366
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
367
|
+
if (null == r) return {};
|
|
368
|
+
var t = {};
|
|
369
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
370
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
371
|
+
t[n] = r[n];
|
|
372
|
+
}
|
|
373
|
+
return t;
|
|
374
|
+
}
|
|
375
|
+
function _possibleConstructorReturn(t, e) {
|
|
376
|
+
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
|
377
|
+
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
378
|
+
return _assertThisInitialized(t);
|
|
379
|
+
}
|
|
380
|
+
function _regenerator() {
|
|
381
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
382
|
+
var e,
|
|
383
|
+
t,
|
|
384
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
385
|
+
n = r.iterator || "@@iterator",
|
|
386
|
+
o = r.toStringTag || "@@toStringTag";
|
|
387
|
+
function i(r, n, o, i) {
|
|
388
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
389
|
+
u = Object.create(c.prototype);
|
|
390
|
+
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
391
|
+
var i,
|
|
392
|
+
c,
|
|
393
|
+
u,
|
|
394
|
+
f = 0,
|
|
395
|
+
p = o || [],
|
|
396
|
+
y = !1,
|
|
397
|
+
G = {
|
|
398
|
+
p: 0,
|
|
399
|
+
n: 0,
|
|
400
|
+
v: e,
|
|
401
|
+
a: d,
|
|
402
|
+
f: d.bind(e, 4),
|
|
403
|
+
d: function (t, r) {
|
|
404
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
405
|
+
}
|
|
406
|
+
};
|
|
407
|
+
function d(r, n) {
|
|
408
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
409
|
+
var o,
|
|
410
|
+
i = p[t],
|
|
411
|
+
d = G.p,
|
|
412
|
+
l = i[2];
|
|
413
|
+
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));
|
|
414
|
+
}
|
|
415
|
+
if (o || r > 1) return a;
|
|
416
|
+
throw y = !0, n;
|
|
417
|
+
}
|
|
418
|
+
return function (o, p, l) {
|
|
419
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
420
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
421
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
422
|
+
try {
|
|
423
|
+
if (f = 2, i) {
|
|
424
|
+
if (c || (o = "next"), t = i[o]) {
|
|
425
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
426
|
+
if (!t.done) return t;
|
|
427
|
+
u = t.value, c < 2 && (c = 0);
|
|
428
|
+
} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
429
|
+
i = e;
|
|
430
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
431
|
+
} catch (t) {
|
|
432
|
+
i = e, c = 1, u = t;
|
|
433
|
+
} finally {
|
|
434
|
+
f = 1;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
return {
|
|
438
|
+
value: t,
|
|
439
|
+
done: y
|
|
440
|
+
};
|
|
441
|
+
};
|
|
442
|
+
}(r, o, i), !0), u;
|
|
443
|
+
}
|
|
444
|
+
var a = {};
|
|
445
|
+
function Generator() {}
|
|
446
|
+
function GeneratorFunction() {}
|
|
447
|
+
function GeneratorFunctionPrototype() {}
|
|
448
|
+
t = Object.getPrototypeOf;
|
|
449
|
+
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
450
|
+
return this;
|
|
451
|
+
}), t),
|
|
452
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
453
|
+
function f(e) {
|
|
454
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
455
|
+
}
|
|
456
|
+
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 () {
|
|
457
|
+
return this;
|
|
458
|
+
}), _regeneratorDefine(u, "toString", function () {
|
|
459
|
+
return "[object Generator]";
|
|
460
|
+
}), (_regenerator = function () {
|
|
461
|
+
return {
|
|
462
|
+
w: i,
|
|
463
|
+
m: f
|
|
464
|
+
};
|
|
465
|
+
})();
|
|
466
|
+
}
|
|
467
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
468
|
+
var i = Object.defineProperty;
|
|
469
|
+
try {
|
|
470
|
+
i({}, "", {});
|
|
471
|
+
} catch (e) {
|
|
472
|
+
i = 0;
|
|
473
|
+
}
|
|
474
|
+
_regeneratorDefine = function (e, r, n, t) {
|
|
475
|
+
function o(r, n) {
|
|
476
|
+
_regeneratorDefine(e, r, function (e) {
|
|
477
|
+
return this._invoke(r, n, e);
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
r ? i ? i(e, r, {
|
|
481
|
+
value: n,
|
|
482
|
+
enumerable: !t,
|
|
483
|
+
configurable: !t,
|
|
484
|
+
writable: !t
|
|
485
|
+
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
|
|
486
|
+
}, _regeneratorDefine(e, r, n, t);
|
|
487
|
+
}
|
|
488
|
+
function _setPrototypeOf(t, e) {
|
|
489
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
490
|
+
return t.__proto__ = e, t;
|
|
491
|
+
}, _setPrototypeOf(t, e);
|
|
492
|
+
}
|
|
493
|
+
function _slicedToArray(r, e) {
|
|
494
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
495
|
+
}
|
|
496
|
+
function _toArray(r) {
|
|
497
|
+
return _arrayWithHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableRest();
|
|
498
|
+
}
|
|
499
|
+
function _toConsumableArray(r) {
|
|
500
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
501
|
+
}
|
|
502
|
+
function _toPrimitive(t, r) {
|
|
503
|
+
if ("object" != typeof t || !t) return t;
|
|
504
|
+
var e = t[Symbol.toPrimitive];
|
|
505
|
+
if (void 0 !== e) {
|
|
506
|
+
var i = e.call(t, r || "default");
|
|
507
|
+
if ("object" != typeof i) return i;
|
|
508
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
509
|
+
}
|
|
510
|
+
return ("string" === r ? String : Number)(t);
|
|
511
|
+
}
|
|
512
|
+
function _toPropertyKey(t) {
|
|
513
|
+
var i = _toPrimitive(t, "string");
|
|
514
|
+
return "symbol" == typeof i ? i : i + "";
|
|
515
|
+
}
|
|
516
|
+
function _typeof(o) {
|
|
517
|
+
"@babel/helpers - typeof";
|
|
518
|
+
|
|
519
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
520
|
+
return typeof o;
|
|
521
|
+
} : function (o) {
|
|
522
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
523
|
+
}, _typeof(o);
|
|
524
|
+
}
|
|
525
|
+
function _unsupportedIterableToArray(r, a) {
|
|
526
|
+
if (r) {
|
|
527
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
528
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
529
|
+
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;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
function _wrapAsyncGenerator(e) {
|
|
533
|
+
return function () {
|
|
534
|
+
return new AsyncGenerator(e.apply(this, arguments));
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
function AsyncGenerator(e) {
|
|
538
|
+
var r, t;
|
|
539
|
+
function resume(r, t) {
|
|
540
|
+
try {
|
|
541
|
+
var n = e[r](t),
|
|
542
|
+
o = n.value,
|
|
543
|
+
u = o instanceof _OverloadYield;
|
|
544
|
+
Promise.resolve(u ? o.v : o).then(function (t) {
|
|
545
|
+
if (u) {
|
|
546
|
+
var i = "return" === r ? "return" : "next";
|
|
547
|
+
if (!o.k || t.done) return resume(i, t);
|
|
548
|
+
t = e[i](t).value;
|
|
549
|
+
}
|
|
550
|
+
settle(n.done ? "return" : "normal", t);
|
|
551
|
+
}, function (e) {
|
|
552
|
+
resume("throw", e);
|
|
553
|
+
});
|
|
554
|
+
} catch (e) {
|
|
555
|
+
settle("throw", e);
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
function settle(e, n) {
|
|
559
|
+
switch (e) {
|
|
560
|
+
case "return":
|
|
561
|
+
r.resolve({
|
|
562
|
+
value: n,
|
|
563
|
+
done: !0
|
|
564
|
+
});
|
|
565
|
+
break;
|
|
566
|
+
case "throw":
|
|
567
|
+
r.reject(n);
|
|
568
|
+
break;
|
|
569
|
+
default:
|
|
570
|
+
r.resolve({
|
|
571
|
+
value: n,
|
|
572
|
+
done: !1
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
(r = r.next) ? resume(r.key, r.arg) : t = null;
|
|
576
|
+
}
|
|
577
|
+
this._invoke = function (e, n) {
|
|
578
|
+
return new Promise(function (o, u) {
|
|
579
|
+
var i = {
|
|
580
|
+
key: e,
|
|
581
|
+
arg: n,
|
|
582
|
+
resolve: o,
|
|
583
|
+
reject: u,
|
|
584
|
+
next: null
|
|
585
|
+
};
|
|
586
|
+
t ? t = t.next = i : (r = t = i, resume(e, n));
|
|
587
|
+
});
|
|
588
|
+
}, "function" != typeof e.return && (this.return = void 0);
|
|
589
|
+
}
|
|
590
|
+
AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function () {
|
|
591
|
+
return this;
|
|
592
|
+
}, AsyncGenerator.prototype.next = function (e) {
|
|
593
|
+
return this._invoke("next", e);
|
|
594
|
+
}, AsyncGenerator.prototype.throw = function (e) {
|
|
595
|
+
return this._invoke("throw", e);
|
|
596
|
+
}, AsyncGenerator.prototype.return = function (e) {
|
|
597
|
+
return this._invoke("return", e);
|
|
598
|
+
};
|
|
599
|
+
function _wrapNativeSuper(t) {
|
|
600
|
+
var r = "function" == typeof Map ? new Map() : void 0;
|
|
601
|
+
return _wrapNativeSuper = function (t) {
|
|
602
|
+
if (null === t || !_isNativeFunction(t)) return t;
|
|
603
|
+
if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
|
|
604
|
+
if (void 0 !== r) {
|
|
605
|
+
if (r.has(t)) return r.get(t);
|
|
606
|
+
r.set(t, Wrapper);
|
|
607
|
+
}
|
|
608
|
+
function Wrapper() {
|
|
609
|
+
return _construct(t, arguments, _getPrototypeOf(this).constructor);
|
|
610
|
+
}
|
|
611
|
+
return Wrapper.prototype = Object.create(t.prototype, {
|
|
612
|
+
constructor: {
|
|
613
|
+
value: Wrapper,
|
|
614
|
+
enumerable: !1,
|
|
615
|
+
writable: !0,
|
|
616
|
+
configurable: !0
|
|
617
|
+
}
|
|
618
|
+
}), _setPrototypeOf(Wrapper, t);
|
|
619
|
+
}, _wrapNativeSuper(t);
|
|
620
|
+
}
|
|
621
|
+
|
|
139
622
|
dayjs__default["default"].extend(quarterOfYear__default["default"]);
|
|
140
623
|
dayjs__default["default"].extend(duration__default["default"]);
|
|
141
624
|
dayjs__default["default"].extend(isoWeek__default["default"]);
|
|
142
625
|
|
|
143
626
|
// A custom locale for internal use that doesn't affect the global dayjs instance
|
|
144
627
|
var cubeInternalLocale = 'cube-internal-en';
|
|
145
|
-
var customLocale =
|
|
628
|
+
var customLocale = _objectSpread2(_objectSpread2({}, en__default["default"]), {}, {
|
|
146
629
|
name: cubeInternalLocale,
|
|
147
630
|
weekStart: 1
|
|
148
631
|
});
|
|
@@ -268,7 +751,7 @@ function parseSqlInterval(intervalStr) {
|
|
|
268
751
|
function addInterval(date, interval) {
|
|
269
752
|
var res = date.clone();
|
|
270
753
|
Object.entries(interval).forEach(function (_ref) {
|
|
271
|
-
var _ref2 =
|
|
754
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
272
755
|
key = _ref2[0],
|
|
273
756
|
value = _ref2[1];
|
|
274
757
|
res = res.add(value, key);
|
|
@@ -287,7 +770,7 @@ function addInterval(date, interval) {
|
|
|
287
770
|
function subtractInterval(date, interval) {
|
|
288
771
|
var res = date.clone();
|
|
289
772
|
Object.entries(interval).forEach(function (_ref3) {
|
|
290
|
-
var _ref4 =
|
|
773
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
291
774
|
key = _ref4[0],
|
|
292
775
|
value = _ref4[1];
|
|
293
776
|
res = res.subtract(value, key);
|
|
@@ -468,12 +951,10 @@ var granularityFor = function granularityFor(dateStr) {
|
|
|
468
951
|
};
|
|
469
952
|
|
|
470
953
|
var _excluded$2 = ["query"];
|
|
471
|
-
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; }
|
|
472
|
-
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; }
|
|
473
954
|
function removeEmptyQueryFields(_query) {
|
|
474
955
|
var query = _query || {};
|
|
475
956
|
return ramda.fromPairs(ramda.toPairs(query).flatMap(function (_ref) {
|
|
476
|
-
var _ref2 =
|
|
957
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
477
958
|
key = _ref2[0],
|
|
478
959
|
value = _ref2[1];
|
|
479
960
|
if (['measures', 'dimensions', 'segments', 'timeDimensions', 'filters'].includes(key)) {
|
|
@@ -493,7 +974,7 @@ function removeEmptyQueryFields(_query) {
|
|
|
493
974
|
}
|
|
494
975
|
function validateQuery(_query) {
|
|
495
976
|
var query = _query || {};
|
|
496
|
-
return removeEmptyQueryFields(
|
|
977
|
+
return removeEmptyQueryFields(_objectSpread2(_objectSpread2({}, query), {}, {
|
|
497
978
|
filters: (query.filters || []).filter(function (f) {
|
|
498
979
|
return 'operator' in f;
|
|
499
980
|
}),
|
|
@@ -510,22 +991,22 @@ function defaultOrder(query) {
|
|
|
510
991
|
return d.granularity;
|
|
511
992
|
});
|
|
512
993
|
if (granularity) {
|
|
513
|
-
return
|
|
994
|
+
return _defineProperty({}, granularity.dimension, 'asc');
|
|
514
995
|
} else if ((query.measures || []).length > 0 && (query.dimensions || []).length > 0) {
|
|
515
|
-
return
|
|
996
|
+
return _defineProperty({}, query.measures[0], 'desc');
|
|
516
997
|
} else if ((query.dimensions || []).length > 0) {
|
|
517
|
-
return
|
|
998
|
+
return _defineProperty({}, query.dimensions[0], 'asc');
|
|
518
999
|
}
|
|
519
1000
|
return {};
|
|
520
1001
|
}
|
|
521
1002
|
function defaultHeuristics(newState, oldQuery, options) {
|
|
522
1003
|
var _clone = ramda.clone(newState),
|
|
523
1004
|
query = _clone.query,
|
|
524
|
-
props =
|
|
1005
|
+
props = _objectWithoutProperties(_clone, _excluded$2);
|
|
525
1006
|
var meta = options.meta,
|
|
526
1007
|
sessionGranularity = options.sessionGranularity;
|
|
527
1008
|
var granularity = sessionGranularity || DEFAULT_GRANULARITY;
|
|
528
|
-
var state =
|
|
1009
|
+
var state = _objectSpread2({
|
|
529
1010
|
shouldApplyHeuristicOrder: false,
|
|
530
1011
|
pivotConfig: null,
|
|
531
1012
|
query: query
|
|
@@ -535,30 +1016,30 @@ function defaultHeuristics(newState, oldQuery, options) {
|
|
|
535
1016
|
newQuery = query;
|
|
536
1017
|
}
|
|
537
1018
|
if (Array.isArray(newQuery) || Array.isArray(oldQuery)) {
|
|
538
|
-
return
|
|
1019
|
+
return _objectSpread2({
|
|
539
1020
|
shouldApplyHeuristicOrder: false,
|
|
540
1021
|
pivotConfig: null
|
|
541
1022
|
}, newState);
|
|
542
1023
|
}
|
|
543
1024
|
if (newQuery) {
|
|
544
1025
|
if ((oldQuery.timeDimensions || []).length === 1 && (newQuery.timeDimensions || []).length === 1 && newQuery.timeDimensions[0].granularity && oldQuery.timeDimensions[0].granularity !== newQuery.timeDimensions[0].granularity) {
|
|
545
|
-
state =
|
|
1026
|
+
state = _objectSpread2(_objectSpread2({}, state), {}, {
|
|
546
1027
|
sessionGranularity: newQuery.timeDimensions[0].granularity
|
|
547
1028
|
});
|
|
548
1029
|
}
|
|
549
1030
|
if ((oldQuery.measures || []).length === 0 && (newQuery.measures || []).length > 0 || (oldQuery.measures || []).length === 1 && (newQuery.measures || []).length === 1 && oldQuery.measures[0] !== newQuery.measures[0]) {
|
|
550
1031
|
var _ref6 = newQuery.timeDimensions || [],
|
|
551
|
-
_ref7 =
|
|
1032
|
+
_ref7 = _slicedToArray(_ref6, 1),
|
|
552
1033
|
td = _ref7[0];
|
|
553
1034
|
var defaultTimeDimension = meta.defaultTimeDimensionNameFor(newQuery.measures[0]);
|
|
554
|
-
newQuery =
|
|
1035
|
+
newQuery = _objectSpread2(_objectSpread2({}, newQuery), {}, {
|
|
555
1036
|
timeDimensions: defaultTimeDimension ? [{
|
|
556
1037
|
dimension: defaultTimeDimension,
|
|
557
1038
|
granularity: (td === null || td === void 0 ? void 0 : td.granularity) || granularity,
|
|
558
1039
|
dateRange: td === null || td === void 0 ? void 0 : td.dateRange
|
|
559
1040
|
}] : []
|
|
560
1041
|
});
|
|
561
|
-
return
|
|
1042
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
562
1043
|
pivotConfig: null,
|
|
563
1044
|
shouldApplyHeuristicOrder: true,
|
|
564
1045
|
query: newQuery,
|
|
@@ -566,14 +1047,14 @@ function defaultHeuristics(newState, oldQuery, options) {
|
|
|
566
1047
|
});
|
|
567
1048
|
}
|
|
568
1049
|
if ((oldQuery.dimensions || []).length === 0 && (newQuery.dimensions || []).length > 0) {
|
|
569
|
-
newQuery =
|
|
1050
|
+
newQuery = _objectSpread2(_objectSpread2({}, newQuery), {}, {
|
|
570
1051
|
timeDimensions: (newQuery.timeDimensions || []).map(function (td) {
|
|
571
|
-
return
|
|
1052
|
+
return _objectSpread2(_objectSpread2({}, td), {}, {
|
|
572
1053
|
granularity: undefined
|
|
573
1054
|
});
|
|
574
1055
|
})
|
|
575
1056
|
});
|
|
576
|
-
return
|
|
1057
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
577
1058
|
pivotConfig: null,
|
|
578
1059
|
shouldApplyHeuristicOrder: true,
|
|
579
1060
|
query: newQuery,
|
|
@@ -581,14 +1062,14 @@ function defaultHeuristics(newState, oldQuery, options) {
|
|
|
581
1062
|
});
|
|
582
1063
|
}
|
|
583
1064
|
if ((oldQuery.dimensions || []).length > 0 && (newQuery.dimensions || []).length === 0) {
|
|
584
|
-
newQuery =
|
|
1065
|
+
newQuery = _objectSpread2(_objectSpread2({}, newQuery), {}, {
|
|
585
1066
|
timeDimensions: (newQuery.timeDimensions || []).map(function (td) {
|
|
586
|
-
return
|
|
1067
|
+
return _objectSpread2(_objectSpread2({}, td), {}, {
|
|
587
1068
|
granularity: td.granularity || granularity
|
|
588
1069
|
});
|
|
589
1070
|
})
|
|
590
1071
|
});
|
|
591
|
-
return
|
|
1072
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
592
1073
|
pivotConfig: null,
|
|
593
1074
|
shouldApplyHeuristicOrder: true,
|
|
594
1075
|
query: newQuery,
|
|
@@ -596,11 +1077,11 @@ function defaultHeuristics(newState, oldQuery, options) {
|
|
|
596
1077
|
});
|
|
597
1078
|
}
|
|
598
1079
|
if (((oldQuery.dimensions || []).length > 0 || (oldQuery.measures || []).length > 0) && (newQuery.dimensions || []).length === 0 && (newQuery.measures || []).length === 0) {
|
|
599
|
-
newQuery =
|
|
1080
|
+
newQuery = _objectSpread2(_objectSpread2({}, newQuery), {}, {
|
|
600
1081
|
timeDimensions: [],
|
|
601
1082
|
filters: []
|
|
602
1083
|
});
|
|
603
|
-
return
|
|
1084
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
604
1085
|
pivotConfig: null,
|
|
605
1086
|
shouldApplyHeuristicOrder: true,
|
|
606
1087
|
query: newQuery,
|
|
@@ -613,12 +1094,12 @@ function defaultHeuristics(newState, oldQuery, options) {
|
|
|
613
1094
|
var newChartType = state.chartType;
|
|
614
1095
|
if ((newChartType === 'line' || newChartType === 'area') && (oldQuery.timeDimensions || []).length === 1 && !oldQuery.timeDimensions[0].granularity) {
|
|
615
1096
|
var _ref8 = oldQuery.timeDimensions,
|
|
616
|
-
_ref9 =
|
|
1097
|
+
_ref9 = _slicedToArray(_ref8, 1),
|
|
617
1098
|
_td = _ref9[0];
|
|
618
|
-
return
|
|
1099
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
619
1100
|
pivotConfig: null,
|
|
620
|
-
query:
|
|
621
|
-
timeDimensions: [
|
|
1101
|
+
query: _objectSpread2(_objectSpread2({}, oldQuery), {}, {
|
|
1102
|
+
timeDimensions: [_objectSpread2(_objectSpread2({}, _td), {}, {
|
|
622
1103
|
granularity: granularity
|
|
623
1104
|
})]
|
|
624
1105
|
})
|
|
@@ -626,13 +1107,13 @@ function defaultHeuristics(newState, oldQuery, options) {
|
|
|
626
1107
|
}
|
|
627
1108
|
if ((newChartType === 'pie' || newChartType === 'table' || newChartType === 'number') && (oldQuery.timeDimensions || []).length === 1 && oldQuery.timeDimensions[0].granularity) {
|
|
628
1109
|
var _ref0 = oldQuery.timeDimensions,
|
|
629
|
-
_ref1 =
|
|
1110
|
+
_ref1 = _slicedToArray(_ref0, 1),
|
|
630
1111
|
_td2 = _ref1[0];
|
|
631
|
-
return
|
|
1112
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
632
1113
|
pivotConfig: null,
|
|
633
1114
|
shouldApplyHeuristicOrder: true,
|
|
634
|
-
query:
|
|
635
|
-
timeDimensions: [
|
|
1115
|
+
query: _objectSpread2(_objectSpread2({}, oldQuery), {}, {
|
|
1116
|
+
timeDimensions: [_objectSpread2(_objectSpread2({}, _td2), {}, {
|
|
636
1117
|
granularity: undefined
|
|
637
1118
|
})]
|
|
638
1119
|
})
|
|
@@ -651,9 +1132,9 @@ function isQueryPresent(query) {
|
|
|
651
1132
|
});
|
|
652
1133
|
}
|
|
653
1134
|
function movePivotItem(pivotConfig, sourceIndex, destinationIndex, sourceAxis, destinationAxis) {
|
|
654
|
-
var nextPivotConfig =
|
|
655
|
-
x:
|
|
656
|
-
y:
|
|
1135
|
+
var nextPivotConfig = _objectSpread2(_objectSpread2({}, pivotConfig), {}, {
|
|
1136
|
+
x: _toConsumableArray(pivotConfig.x || []),
|
|
1137
|
+
y: _toConsumableArray(pivotConfig.y || [])
|
|
657
1138
|
});
|
|
658
1139
|
var id = pivotConfig[sourceAxis][sourceIndex];
|
|
659
1140
|
var lastIndex = nextPivotConfig[destinationAxis].length - 1;
|
|
@@ -669,9 +1150,9 @@ function movePivotItem(pivotConfig, sourceIndex, destinationIndex, sourceAxis, d
|
|
|
669
1150
|
return nextPivotConfig;
|
|
670
1151
|
}
|
|
671
1152
|
function moveItemInArray(list, sourceIndex, destinationIndex) {
|
|
672
|
-
var result =
|
|
1153
|
+
var result = _toConsumableArray(list);
|
|
673
1154
|
var _result$splice = result.splice(sourceIndex, 1),
|
|
674
|
-
_result$splice2 =
|
|
1155
|
+
_result$splice2 = _slicedToArray(_result$splice, 1),
|
|
675
1156
|
removed = _result$splice2[0];
|
|
676
1157
|
result.splice(destinationIndex, 0, removed);
|
|
677
1158
|
return result;
|
|
@@ -680,12 +1161,12 @@ function flattenFilters() {
|
|
|
680
1161
|
var filters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
681
1162
|
return filters.reduce(function (memo, filter) {
|
|
682
1163
|
if ('or' in filter) {
|
|
683
|
-
return [].concat(
|
|
1164
|
+
return [].concat(_toConsumableArray(memo), _toConsumableArray(flattenFilters(filter.or)));
|
|
684
1165
|
}
|
|
685
1166
|
if ('and' in filter) {
|
|
686
|
-
return [].concat(
|
|
1167
|
+
return [].concat(_toConsumableArray(memo), _toConsumableArray(flattenFilters(filter.and)));
|
|
687
1168
|
}
|
|
688
|
-
return [].concat(
|
|
1169
|
+
return [].concat(_toConsumableArray(memo), [filter]);
|
|
689
1170
|
}, []);
|
|
690
1171
|
}
|
|
691
1172
|
function getQueryMembers() {
|
|
@@ -707,7 +1188,7 @@ function getQueryMembers() {
|
|
|
707
1188
|
members.add(member);
|
|
708
1189
|
}
|
|
709
1190
|
});
|
|
710
|
-
return
|
|
1191
|
+
return _toConsumableArray(members);
|
|
711
1192
|
}
|
|
712
1193
|
function getOrderMembersFromOrder(orderMembers, order) {
|
|
713
1194
|
var ids = new Set();
|
|
@@ -715,19 +1196,19 @@ function getOrderMembersFromOrder(orderMembers, order) {
|
|
|
715
1196
|
var entries = Array.isArray(order) ? order : Object.entries(order || {});
|
|
716
1197
|
var nextOrderMembers = [];
|
|
717
1198
|
entries.forEach(function (_ref10) {
|
|
718
|
-
var _ref11 =
|
|
1199
|
+
var _ref11 = _slicedToArray(_ref10, 2),
|
|
719
1200
|
memberId = _ref11[0],
|
|
720
1201
|
currentOrder = _ref11[1];
|
|
721
1202
|
if (currentOrder !== 'none' && indexedOrderMembers[memberId]) {
|
|
722
1203
|
ids.add(memberId);
|
|
723
|
-
nextOrderMembers.push(
|
|
1204
|
+
nextOrderMembers.push(_objectSpread2(_objectSpread2({}, indexedOrderMembers[memberId]), {}, {
|
|
724
1205
|
order: currentOrder
|
|
725
1206
|
}));
|
|
726
1207
|
}
|
|
727
1208
|
});
|
|
728
1209
|
orderMembers.forEach(function (member) {
|
|
729
1210
|
if (!ids.has(member.id)) {
|
|
730
|
-
nextOrderMembers.push(
|
|
1211
|
+
nextOrderMembers.push(_objectSpread2(_objectSpread2({}, member), {}, {
|
|
731
1212
|
order: member.order || 'none'
|
|
732
1213
|
}));
|
|
733
1214
|
}
|
|
@@ -741,9 +1222,9 @@ function aliasSeries(values, index, pivotConfig) {
|
|
|
741
1222
|
return value != null;
|
|
742
1223
|
});
|
|
743
1224
|
if (pivotConfig !== null && pivotConfig !== void 0 && (_pivotConfig$aliasSer = pivotConfig.aliasSeries) !== null && _pivotConfig$aliasSer !== void 0 && _pivotConfig$aliasSer[index]) {
|
|
744
|
-
return [pivotConfig.aliasSeries[index]].concat(
|
|
1225
|
+
return [pivotConfig.aliasSeries[index]].concat(_toConsumableArray(nonNullValues));
|
|
745
1226
|
} else if (duplicateMeasures.has(nonNullValues[0])) {
|
|
746
|
-
return [index].concat(
|
|
1227
|
+
return [index].concat(_toConsumableArray(nonNullValues));
|
|
747
1228
|
}
|
|
748
1229
|
return nonNullValues;
|
|
749
1230
|
}
|
|
@@ -751,8 +1232,6 @@ function aliasSeries(values, index, pivotConfig) {
|
|
|
751
1232
|
var _excluded$1 = ["x"],
|
|
752
1233
|
_excluded2 = ["key"],
|
|
753
1234
|
_excluded3 = ["title", "shortTitle"];
|
|
754
|
-
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; }
|
|
755
|
-
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; }
|
|
756
1235
|
var groupByToPairs = function groupByToPairsImpl(keyFn) {
|
|
757
1236
|
var acc = new Map();
|
|
758
1237
|
return function (data) {
|
|
@@ -786,21 +1265,21 @@ var QUERY_TYPE = {
|
|
|
786
1265
|
var ResultSet = /*#__PURE__*/function () {
|
|
787
1266
|
function ResultSet(loadResponse) {
|
|
788
1267
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
1268
|
+
_classCallCheck(this, ResultSet);
|
|
1269
|
+
_defineProperty(this, "loadResponse", void 0);
|
|
1270
|
+
_defineProperty(this, "loadResponses", void 0);
|
|
1271
|
+
_defineProperty(this, "queryType", void 0);
|
|
1272
|
+
_defineProperty(this, "parseDateMeasures", void 0);
|
|
1273
|
+
_defineProperty(this, "options", void 0);
|
|
1274
|
+
_defineProperty(this, "backwardCompatibleData", void 0);
|
|
796
1275
|
if ('queryType' in loadResponse && loadResponse.queryType != null) {
|
|
797
1276
|
this.loadResponse = loadResponse;
|
|
798
1277
|
this.queryType = loadResponse.queryType;
|
|
799
1278
|
this.loadResponses = loadResponse.results;
|
|
800
1279
|
} else {
|
|
801
1280
|
this.queryType = QUERY_TYPE.REGULAR_QUERY;
|
|
802
|
-
this.loadResponse =
|
|
803
|
-
pivotQuery:
|
|
1281
|
+
this.loadResponse = _objectSpread2(_objectSpread2({}, loadResponse), {}, {
|
|
1282
|
+
pivotQuery: _objectSpread2(_objectSpread2({}, loadResponse.query), {}, {
|
|
804
1283
|
queryType: this.queryType
|
|
805
1284
|
})
|
|
806
1285
|
});
|
|
@@ -873,7 +1352,7 @@ var ResultSet = /*#__PURE__*/function () {
|
|
|
873
1352
|
* ```
|
|
874
1353
|
* @returns Drill down query
|
|
875
1354
|
*/
|
|
876
|
-
return
|
|
1355
|
+
return _createClass(ResultSet, [{
|
|
877
1356
|
key: "drillDown",
|
|
878
1357
|
value: function drillDown(drillDownLocator, pivotConfig) {
|
|
879
1358
|
var _drillDownLocator$xVa, _drillDownLocator$yVa, _measures$measureName, _measures$measureName2;
|
|
@@ -903,15 +1382,15 @@ var ResultSet = /*#__PURE__*/function () {
|
|
|
903
1382
|
measures = _this$loadResponses$.measures,
|
|
904
1383
|
timeDimensionsAnnotation = _this$loadResponses$.timeDimensions;
|
|
905
1384
|
var _ref = values.find(function (_ref3) {
|
|
906
|
-
var _ref4 =
|
|
1385
|
+
var _ref4 = _slicedToArray(_ref3, 1),
|
|
907
1386
|
member = _ref4[0];
|
|
908
1387
|
return member === 'measures';
|
|
909
1388
|
}) || [],
|
|
910
|
-
_ref2 =
|
|
1389
|
+
_ref2 = _slicedToArray(_ref, 2),
|
|
911
1390
|
measureName = _ref2[1];
|
|
912
1391
|
if (measureName === undefined) {
|
|
913
1392
|
var _Object$keys = Object.keys(measures);
|
|
914
|
-
var _Object$keys2 =
|
|
1393
|
+
var _Object$keys2 = _slicedToArray(_Object$keys, 1);
|
|
915
1394
|
measureName = _Object$keys2[0];
|
|
916
1395
|
}
|
|
917
1396
|
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)) {
|
|
@@ -920,18 +1399,18 @@ var ResultSet = /*#__PURE__*/function () {
|
|
|
920
1399
|
var filters = [{
|
|
921
1400
|
member: measureName,
|
|
922
1401
|
operator: 'measureFilter'
|
|
923
|
-
}].concat(
|
|
1402
|
+
}].concat(_toConsumableArray(parentFilters));
|
|
924
1403
|
var timeDimensions = [];
|
|
925
1404
|
values.filter(function (_ref5) {
|
|
926
|
-
var _ref6 =
|
|
1405
|
+
var _ref6 = _slicedToArray(_ref5, 1),
|
|
927
1406
|
member = _ref6[0];
|
|
928
1407
|
return member !== 'measures';
|
|
929
1408
|
}).forEach(function (_ref7) {
|
|
930
|
-
var _ref8 =
|
|
1409
|
+
var _ref8 = _slicedToArray(_ref7, 2),
|
|
931
1410
|
member = _ref8[0],
|
|
932
1411
|
value = _ref8[1];
|
|
933
1412
|
var _member$split = member.split('.'),
|
|
934
|
-
_member$split2 =
|
|
1413
|
+
_member$split2 = _slicedToArray(_member$split, 3),
|
|
935
1414
|
cubeName = _member$split2[0],
|
|
936
1415
|
dimension = _member$split2[1],
|
|
937
1416
|
granularity = _member$split2[2];
|
|
@@ -944,7 +1423,7 @@ var ResultSet = /*#__PURE__*/function () {
|
|
|
944
1423
|
});
|
|
945
1424
|
var dateRange = [range.start, range.end];
|
|
946
1425
|
if (originalTimeDimension !== null && originalTimeDimension !== void 0 && originalTimeDimension.dateRange) {
|
|
947
|
-
var _originalTimeDimensio =
|
|
1426
|
+
var _originalTimeDimensio = _slicedToArray(originalTimeDimension.dateRange, 2),
|
|
948
1427
|
originalStart = _originalTimeDimensio[0],
|
|
949
1428
|
originalEnd = _originalTimeDimensio[1];
|
|
950
1429
|
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];
|
|
@@ -971,7 +1450,7 @@ var ResultSet = /*#__PURE__*/function () {
|
|
|
971
1450
|
if (timeDimensions.length === 0 && Array.isArray(query.timeDimensions) && query.timeDimensions.length > 0 && query.timeDimensions[0].granularity == null) {
|
|
972
1451
|
timeDimensions.push(query.timeDimensions[0]);
|
|
973
1452
|
}
|
|
974
|
-
return
|
|
1453
|
+
return _objectSpread2(_objectSpread2(_objectSpread2({}, measures[measureName].drillMembersGrouped), {}, {
|
|
975
1454
|
filters: filters
|
|
976
1455
|
}, segments.length > 0 ? {
|
|
977
1456
|
segments: segments
|
|
@@ -1025,7 +1504,7 @@ var ResultSet = /*#__PURE__*/function () {
|
|
|
1025
1504
|
key: key,
|
|
1026
1505
|
series: _this.chartPivot(pivotConfig).map(function (_ref0) {
|
|
1027
1506
|
var x = _ref0.x,
|
|
1028
|
-
obj =
|
|
1507
|
+
obj = _objectWithoutProperties(_ref0, _excluded$1);
|
|
1029
1508
|
return {
|
|
1030
1509
|
value: obj[key],
|
|
1031
1510
|
x: x
|
|
@@ -1110,7 +1589,7 @@ var ResultSet = /*#__PURE__*/function () {
|
|
|
1110
1589
|
return d.match(DateRegex);
|
|
1111
1590
|
}) : !['hour', 'minute', 'second'].includes(timeDimension.granularity);
|
|
1112
1591
|
var _dateRange = dateRange,
|
|
1113
|
-
_dateRange2 =
|
|
1592
|
+
_dateRange2 = _slicedToArray(_dateRange, 2),
|
|
1114
1593
|
start = _dateRange2[0],
|
|
1115
1594
|
end = _dateRange2[1];
|
|
1116
1595
|
var range = _dayRange(start, end, annotations);
|
|
@@ -1216,7 +1695,7 @@ var ResultSet = /*#__PURE__*/function () {
|
|
|
1216
1695
|
}), unnest, groupByXAxis)(_this2.timeDimensionBackwardCompatibleData(resultIndex));
|
|
1217
1696
|
var yValuesMap = {};
|
|
1218
1697
|
xGrouped.forEach(function (_ref12) {
|
|
1219
|
-
var _ref13 =
|
|
1698
|
+
var _ref13 = _slicedToArray(_ref12, 2),
|
|
1220
1699
|
rows = _ref13[1];
|
|
1221
1700
|
rows.forEach(function (_ref14) {
|
|
1222
1701
|
var row = _ref14.row;
|
|
@@ -1230,7 +1709,7 @@ var ResultSet = /*#__PURE__*/function () {
|
|
|
1230
1709
|
var allYValues = Object.values(yValuesMap);
|
|
1231
1710
|
var measureOnX = normalizedPivotConfig.x.includes('measures');
|
|
1232
1711
|
return xGrouped.map(function (_ref15) {
|
|
1233
|
-
var _ref16 =
|
|
1712
|
+
var _ref16 = _slicedToArray(_ref15, 2),
|
|
1234
1713
|
rows = _ref16[1];
|
|
1235
1714
|
var xValues = rows[0].xValues;
|
|
1236
1715
|
var yGrouped = {};
|
|
@@ -1393,12 +1872,12 @@ var ResultSet = /*#__PURE__*/function () {
|
|
|
1393
1872
|
yValuesArray = _ref19.yValuesArray;
|
|
1394
1873
|
var yValuesMap = {};
|
|
1395
1874
|
yValuesArray.forEach(function (_ref20, i) {
|
|
1396
|
-
var _ref21 =
|
|
1875
|
+
var _ref21 = _slicedToArray(_ref20, 2),
|
|
1397
1876
|
yValues = _ref21[0],
|
|
1398
1877
|
m = _ref21[1];
|
|
1399
1878
|
yValuesMap[_this3.axisValuesString(aliasSeries(yValues, i, pivotConfig, duplicateMeasures), ',')] = m && validate(m);
|
|
1400
1879
|
});
|
|
1401
|
-
return
|
|
1880
|
+
return _objectSpread2({
|
|
1402
1881
|
x: _this3.axisValuesString(xValues, ','),
|
|
1403
1882
|
xValues: xValues
|
|
1404
1883
|
}, yValuesMap);
|
|
@@ -1440,10 +1919,10 @@ var ResultSet = /*#__PURE__*/function () {
|
|
|
1440
1919
|
return this.pivot(normalizedPivotConfig).map(function (_ref22) {
|
|
1441
1920
|
var xValues = _ref22.xValues,
|
|
1442
1921
|
yValuesArray = _ref22.yValuesArray;
|
|
1443
|
-
return ramda.fromPairs([].concat(
|
|
1922
|
+
return ramda.fromPairs([].concat(_toConsumableArray(normalizedPivotConfig.x.map(function (key, index) {
|
|
1444
1923
|
return [key, xValues[index]];
|
|
1445
|
-
})),
|
|
1446
|
-
var _ref24 =
|
|
1924
|
+
})), _toConsumableArray(isMeasuresPresent ? yValuesArray.map(function (_ref23) {
|
|
1925
|
+
var _ref24 = _slicedToArray(_ref23, 2),
|
|
1447
1926
|
yValues = _ref24[0],
|
|
1448
1927
|
measure = _ref24[1];
|
|
1449
1928
|
return [yValues.length ? yValues.join() : 'value', measure];
|
|
@@ -1561,7 +2040,7 @@ var ResultSet = /*#__PURE__*/function () {
|
|
|
1561
2040
|
segments: {}
|
|
1562
2041
|
});
|
|
1563
2042
|
var flatMeta = Object.values(annotations).reduce(function (a, b) {
|
|
1564
|
-
return
|
|
2043
|
+
return _objectSpread2(_objectSpread2({}, a), b);
|
|
1565
2044
|
}, {});
|
|
1566
2045
|
var schema = {};
|
|
1567
2046
|
var extractFields = function extractFields(key) {
|
|
@@ -1586,7 +2065,7 @@ var ResultSet = /*#__PURE__*/function () {
|
|
|
1586
2065
|
};
|
|
1587
2066
|
var pivot = this.pivot(normalizedPivotConfig);
|
|
1588
2067
|
(((_pivot$ = pivot[0]) === null || _pivot$ === void 0 ? void 0 : _pivot$.yValuesArray) || []).forEach(function (_ref26) {
|
|
1589
|
-
var _ref27 =
|
|
2068
|
+
var _ref27 = _slicedToArray(_ref26, 1),
|
|
1590
2069
|
yValues = _ref27[0];
|
|
1591
2070
|
if (yValues.length > 0) {
|
|
1592
2071
|
var currentItem = schema;
|
|
@@ -1609,22 +2088,22 @@ var ResultSet = /*#__PURE__*/function () {
|
|
|
1609
2088
|
}
|
|
1610
2089
|
return Object.values(item).map(function (_ref28) {
|
|
1611
2090
|
var key = _ref28.key,
|
|
1612
|
-
currentItem =
|
|
1613
|
-
var children = _toColumns(currentItem.children, [].concat(
|
|
2091
|
+
currentItem = _objectWithoutProperties(_ref28, _excluded2);
|
|
2092
|
+
var children = _toColumns(currentItem.children, [].concat(_toConsumableArray(path), [key]));
|
|
1614
2093
|
var _extractFields = extractFields(currentItem.memberId),
|
|
1615
2094
|
title = _extractFields.title,
|
|
1616
2095
|
shortTitle = _extractFields.shortTitle,
|
|
1617
|
-
fields =
|
|
2096
|
+
fields = _objectWithoutProperties(_extractFields, _excluded3);
|
|
1618
2097
|
var dimensionValue = key !== currentItem.memberId || title == null ? key : '';
|
|
1619
2098
|
if (!children.length) {
|
|
1620
|
-
return
|
|
2099
|
+
return _objectSpread2(_objectSpread2({}, fields), {}, {
|
|
1621
2100
|
key: key,
|
|
1622
|
-
dataIndex: [].concat(
|
|
2101
|
+
dataIndex: [].concat(_toConsumableArray(path), [key]).join(),
|
|
1623
2102
|
title: [title, dimensionValue].join(' ').trim(),
|
|
1624
2103
|
shortTitle: dimensionValue || shortTitle
|
|
1625
2104
|
});
|
|
1626
2105
|
}
|
|
1627
|
-
return
|
|
2106
|
+
return _objectSpread2(_objectSpread2({}, fields), {}, {
|
|
1628
2107
|
key: key,
|
|
1629
2108
|
title: [title, dimensionValue].join(' ').trim(),
|
|
1630
2109
|
shortTitle: dimensionValue || shortTitle,
|
|
@@ -1635,7 +2114,7 @@ var ResultSet = /*#__PURE__*/function () {
|
|
|
1635
2114
|
var otherColumns = [];
|
|
1636
2115
|
if (!pivot.length && normalizedPivotConfig.y.includes('measures')) {
|
|
1637
2116
|
otherColumns = (this.loadResponses[0].query.measures || []).map(function (key) {
|
|
1638
|
-
return
|
|
2117
|
+
return _objectSpread2(_objectSpread2({}, extractFields(key)), {}, {
|
|
1639
2118
|
dataIndex: key
|
|
1640
2119
|
});
|
|
1641
2120
|
});
|
|
@@ -1661,7 +2140,7 @@ var ResultSet = /*#__PURE__*/function () {
|
|
|
1661
2140
|
type: 'string'
|
|
1662
2141
|
};
|
|
1663
2142
|
}
|
|
1664
|
-
return
|
|
2143
|
+
return _objectSpread2(_objectSpread2({}, extractFields(key)), {}, {
|
|
1665
2144
|
dataIndex: key
|
|
1666
2145
|
});
|
|
1667
2146
|
}).concat(_toColumns(schema)).concat(otherColumns);
|
|
@@ -1710,7 +2189,7 @@ var ResultSet = /*#__PURE__*/function () {
|
|
|
1710
2189
|
var measures = this.loadResponses.map(function (r) {
|
|
1711
2190
|
return r.annotation.measures;
|
|
1712
2191
|
}).reduce(function (acc, m) {
|
|
1713
|
-
return
|
|
2192
|
+
return _objectSpread2(_objectSpread2({}, acc), m);
|
|
1714
2193
|
}, {});
|
|
1715
2194
|
var seriesNames = unnest(this.loadResponses.map(function (_, index) {
|
|
1716
2195
|
return ramda.pipe(ramda.map(_this4.axisValues(normalizedPivotConfig.y, index)), unnest, ramda.uniq)(_this4.timeDimensionBackwardCompatibleData(index));
|
|
@@ -1794,7 +2273,7 @@ var ResultSet = /*#__PURE__*/function () {
|
|
|
1794
2273
|
return Boolean(td.granularity);
|
|
1795
2274
|
});
|
|
1796
2275
|
this.backwardCompatibleData[resultIndex] = data.map(function (row) {
|
|
1797
|
-
return
|
|
2276
|
+
return _objectSpread2(_objectSpread2({}, row), ramda.fromPairs(Object.keys(row).filter(function (field) {
|
|
1798
2277
|
var foundTd = timeDimensions.find(function (d) {
|
|
1799
2278
|
return d.dimension === field;
|
|
1800
2279
|
});
|
|
@@ -1824,7 +2303,7 @@ var ResultSet = /*#__PURE__*/function () {
|
|
|
1824
2303
|
return this.loadResponses.map(function (result) {
|
|
1825
2304
|
return new ResultSet({
|
|
1826
2305
|
queryType: QUERY_TYPE.REGULAR_QUERY,
|
|
1827
|
-
pivotQuery:
|
|
2306
|
+
pivotQuery: _objectSpread2(_objectSpread2({}, result.query), {}, {
|
|
1828
2307
|
queryType: QUERY_TYPE.REGULAR_QUERY
|
|
1829
2308
|
}),
|
|
1830
2309
|
results: [result]
|
|
@@ -1946,11 +2425,11 @@ var ResultSet = /*#__PURE__*/function () {
|
|
|
1946
2425
|
|
|
1947
2426
|
var SqlQuery = /*#__PURE__*/function () {
|
|
1948
2427
|
function SqlQuery(sqlQuery) {
|
|
1949
|
-
|
|
1950
|
-
|
|
2428
|
+
_classCallCheck(this, SqlQuery);
|
|
2429
|
+
_defineProperty(this, "sqlQuery", void 0);
|
|
1951
2430
|
this.sqlQuery = sqlQuery;
|
|
1952
2431
|
}
|
|
1953
|
-
return
|
|
2432
|
+
return _createClass(SqlQuery, [{
|
|
1954
2433
|
key: "rawQuery",
|
|
1955
2434
|
value: function rawQuery() {
|
|
1956
2435
|
return this.sqlQuery.sql;
|
|
@@ -2057,19 +2536,19 @@ var operators = {
|
|
|
2057
2536
|
*/
|
|
2058
2537
|
var Meta = /*#__PURE__*/function () {
|
|
2059
2538
|
function Meta(metaResponse) {
|
|
2060
|
-
|
|
2539
|
+
_classCallCheck(this, Meta);
|
|
2061
2540
|
/**
|
|
2062
2541
|
* Raw meta response
|
|
2063
2542
|
*/
|
|
2064
|
-
|
|
2543
|
+
_defineProperty(this, "meta", void 0);
|
|
2065
2544
|
/**
|
|
2066
2545
|
* An array of all available cubes with their members
|
|
2067
2546
|
*/
|
|
2068
|
-
|
|
2547
|
+
_defineProperty(this, "cubes", void 0);
|
|
2069
2548
|
/**
|
|
2070
2549
|
* A map of all cubes where the key is a cube name
|
|
2071
2550
|
*/
|
|
2072
|
-
|
|
2551
|
+
_defineProperty(this, "cubesMap", void 0);
|
|
2073
2552
|
this.meta = metaResponse;
|
|
2074
2553
|
var cubes = this.meta.cubes;
|
|
2075
2554
|
this.cubes = cubes;
|
|
@@ -2088,7 +2567,7 @@ var Meta = /*#__PURE__*/function () {
|
|
|
2088
2567
|
* @param _query - context query to provide filtering of members available to add to this query
|
|
2089
2568
|
* @param memberType
|
|
2090
2569
|
*/
|
|
2091
|
-
return
|
|
2570
|
+
return _createClass(Meta, [{
|
|
2092
2571
|
key: "membersForQuery",
|
|
2093
2572
|
value: function membersForQuery(_query, memberType) {
|
|
2094
2573
|
return ramda.unnest(this.cubes.map(function (c) {
|
|
@@ -2164,7 +2643,7 @@ var Meta = /*#__PURE__*/function () {
|
|
|
2164
2643
|
value: function resolveMember(memberName, memberType) {
|
|
2165
2644
|
var _this = this;
|
|
2166
2645
|
var _memberName$split = memberName.split('.'),
|
|
2167
|
-
_memberName$split2 =
|
|
2646
|
+
_memberName$split2 = _slicedToArray(_memberName$split, 1),
|
|
2168
2647
|
cube = _memberName$split2[0];
|
|
2169
2648
|
if (!this.cubesMap[cube]) {
|
|
2170
2649
|
return {
|
|
@@ -2191,7 +2670,7 @@ var Meta = /*#__PURE__*/function () {
|
|
|
2191
2670
|
value: function defaultTimeDimensionNameFor(memberName) {
|
|
2192
2671
|
var _this2 = this;
|
|
2193
2672
|
var _memberName$split3 = memberName.split('.'),
|
|
2194
|
-
_memberName$split4 =
|
|
2673
|
+
_memberName$split4 = _slicedToArray(_memberName$split3, 1),
|
|
2195
2674
|
cube = _memberName$split4[0];
|
|
2196
2675
|
if (!this.cubesMap[cube]) {
|
|
2197
2676
|
return null;
|
|
@@ -2214,11 +2693,11 @@ var Meta = /*#__PURE__*/function () {
|
|
|
2214
2693
|
|
|
2215
2694
|
var ProgressResult = /*#__PURE__*/function () {
|
|
2216
2695
|
function ProgressResult(progressResponse) {
|
|
2217
|
-
|
|
2218
|
-
|
|
2696
|
+
_classCallCheck(this, ProgressResult);
|
|
2697
|
+
_defineProperty(this, "progressResponse", void 0);
|
|
2219
2698
|
this.progressResponse = progressResponse;
|
|
2220
2699
|
}
|
|
2221
|
-
return
|
|
2700
|
+
return _createClass(ProgressResult, [{
|
|
2222
2701
|
key: "stage",
|
|
2223
2702
|
value: function stage() {
|
|
2224
2703
|
return this.progressResponse.stage;
|
|
@@ -2231,131 +2710,126 @@ var ProgressResult = /*#__PURE__*/function () {
|
|
|
2231
2710
|
}]);
|
|
2232
2711
|
}();
|
|
2233
2712
|
|
|
2234
|
-
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"); }
|
|
2235
|
-
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); }
|
|
2236
2713
|
function responseChunks(_x) {
|
|
2237
2714
|
return _responseChunks.apply(this, arguments);
|
|
2238
2715
|
}
|
|
2239
2716
|
function _responseChunks() {
|
|
2240
|
-
_responseChunks =
|
|
2717
|
+
_responseChunks = _wrapAsyncGenerator(/*#__PURE__*/_regenerator().m(function _callee(res) {
|
|
2241
2718
|
var body, reader, _yield$_awaitAsyncGen, done, value, _reader$releaseLock, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, chunk, _t;
|
|
2242
|
-
return
|
|
2243
|
-
while (1) switch (_context.
|
|
2719
|
+
return _regenerator().w(function (_context) {
|
|
2720
|
+
while (1) switch (_context.p = _context.n) {
|
|
2244
2721
|
case 0:
|
|
2245
2722
|
// eslint-disable-next-line prefer-destructuring
|
|
2246
2723
|
body = res.body;
|
|
2247
2724
|
if (!(body && typeof body.getReader === 'function')) {
|
|
2248
|
-
_context.
|
|
2725
|
+
_context.n = 8;
|
|
2249
2726
|
break;
|
|
2250
2727
|
}
|
|
2251
2728
|
reader = body.getReader(); // Browser / Node native fetch
|
|
2252
|
-
_context.
|
|
2729
|
+
_context.p = 1;
|
|
2253
2730
|
case 2:
|
|
2254
|
-
_context.
|
|
2255
|
-
return
|
|
2731
|
+
_context.n = 3;
|
|
2732
|
+
return _awaitAsyncGenerator(reader.read());
|
|
2256
2733
|
case 3:
|
|
2257
|
-
_yield$_awaitAsyncGen = _context.
|
|
2734
|
+
_yield$_awaitAsyncGen = _context.v;
|
|
2258
2735
|
done = _yield$_awaitAsyncGen.done;
|
|
2259
2736
|
value = _yield$_awaitAsyncGen.value;
|
|
2260
2737
|
if (!done) {
|
|
2261
|
-
_context.
|
|
2738
|
+
_context.n = 4;
|
|
2262
2739
|
break;
|
|
2263
2740
|
}
|
|
2264
|
-
return _context.
|
|
2741
|
+
return _context.a(3, 6);
|
|
2265
2742
|
case 4:
|
|
2266
2743
|
if (!value) {
|
|
2267
|
-
_context.
|
|
2744
|
+
_context.n = 5;
|
|
2268
2745
|
break;
|
|
2269
2746
|
}
|
|
2270
|
-
_context.
|
|
2747
|
+
_context.n = 5;
|
|
2271
2748
|
return value;
|
|
2272
2749
|
case 5:
|
|
2273
|
-
_context.
|
|
2750
|
+
_context.n = 2;
|
|
2274
2751
|
break;
|
|
2275
2752
|
case 6:
|
|
2276
|
-
_context.
|
|
2753
|
+
_context.p = 6;
|
|
2277
2754
|
(_reader$releaseLock = reader.releaseLock) === null || _reader$releaseLock === void 0 || _reader$releaseLock.call(reader);
|
|
2278
|
-
return _context.
|
|
2755
|
+
return _context.f(6);
|
|
2279
2756
|
case 7:
|
|
2280
|
-
return _context.
|
|
2757
|
+
return _context.a(2);
|
|
2281
2758
|
case 8:
|
|
2282
2759
|
if (!(body && Symbol.asyncIterator in body)) {
|
|
2283
|
-
_context.
|
|
2760
|
+
_context.n = 23;
|
|
2284
2761
|
break;
|
|
2285
2762
|
}
|
|
2286
2763
|
_iteratorAbruptCompletion = false;
|
|
2287
2764
|
_didIteratorError = false;
|
|
2288
|
-
_context.
|
|
2289
|
-
_iterator = _asyncIterator
|
|
2765
|
+
_context.p = 9;
|
|
2766
|
+
_iterator = _asyncIterator(body);
|
|
2290
2767
|
case 10:
|
|
2291
|
-
_context.
|
|
2292
|
-
return
|
|
2768
|
+
_context.n = 11;
|
|
2769
|
+
return _awaitAsyncGenerator(_iterator.next());
|
|
2293
2770
|
case 11:
|
|
2294
|
-
if (!(_iteratorAbruptCompletion = !(_step = _context.
|
|
2295
|
-
_context.
|
|
2771
|
+
if (!(_iteratorAbruptCompletion = !(_step = _context.v).done)) {
|
|
2772
|
+
_context.n = 15;
|
|
2296
2773
|
break;
|
|
2297
2774
|
}
|
|
2298
2775
|
chunk = _step.value;
|
|
2299
2776
|
if (!(typeof chunk === 'string')) {
|
|
2300
|
-
_context.
|
|
2777
|
+
_context.n = 13;
|
|
2301
2778
|
break;
|
|
2302
2779
|
}
|
|
2303
|
-
_context.
|
|
2780
|
+
_context.n = 12;
|
|
2304
2781
|
return new TextEncoder().encode(chunk);
|
|
2305
2782
|
case 12:
|
|
2306
|
-
_context.
|
|
2783
|
+
_context.n = 14;
|
|
2307
2784
|
break;
|
|
2308
2785
|
case 13:
|
|
2309
|
-
_context.
|
|
2786
|
+
_context.n = 14;
|
|
2310
2787
|
return new Uint8Array(chunk);
|
|
2311
2788
|
case 14:
|
|
2312
2789
|
_iteratorAbruptCompletion = false;
|
|
2313
|
-
_context.
|
|
2790
|
+
_context.n = 10;
|
|
2314
2791
|
break;
|
|
2315
2792
|
case 15:
|
|
2316
|
-
_context.
|
|
2793
|
+
_context.n = 17;
|
|
2317
2794
|
break;
|
|
2318
2795
|
case 16:
|
|
2319
|
-
_context.
|
|
2320
|
-
_t = _context
|
|
2796
|
+
_context.p = 16;
|
|
2797
|
+
_t = _context.v;
|
|
2321
2798
|
_didIteratorError = true;
|
|
2322
2799
|
_iteratorError = _t;
|
|
2323
2800
|
case 17:
|
|
2324
|
-
_context.
|
|
2325
|
-
_context.
|
|
2801
|
+
_context.p = 17;
|
|
2802
|
+
_context.p = 18;
|
|
2326
2803
|
if (!(_iteratorAbruptCompletion && _iterator["return"] != null)) {
|
|
2327
|
-
_context.
|
|
2804
|
+
_context.n = 19;
|
|
2328
2805
|
break;
|
|
2329
2806
|
}
|
|
2330
|
-
_context.
|
|
2331
|
-
return
|
|
2807
|
+
_context.n = 19;
|
|
2808
|
+
return _awaitAsyncGenerator(_iterator["return"]());
|
|
2332
2809
|
case 19:
|
|
2333
|
-
_context.
|
|
2810
|
+
_context.p = 19;
|
|
2334
2811
|
if (!_didIteratorError) {
|
|
2335
|
-
_context.
|
|
2812
|
+
_context.n = 20;
|
|
2336
2813
|
break;
|
|
2337
2814
|
}
|
|
2338
2815
|
throw _iteratorError;
|
|
2339
2816
|
case 20:
|
|
2340
|
-
return _context.
|
|
2817
|
+
return _context.f(19);
|
|
2341
2818
|
case 21:
|
|
2342
|
-
return _context.
|
|
2819
|
+
return _context.f(17);
|
|
2343
2820
|
case 22:
|
|
2344
|
-
return _context.
|
|
2821
|
+
return _context.a(2);
|
|
2345
2822
|
case 23:
|
|
2346
2823
|
throw new Error('Unsupported response body type for streaming');
|
|
2347
2824
|
case 24:
|
|
2348
|
-
|
|
2349
|
-
return _context.stop();
|
|
2825
|
+
return _context.a(2);
|
|
2350
2826
|
}
|
|
2351
|
-
}, _callee, null, [[
|
|
2827
|
+
}, _callee, null, [[18,, 19, 21], [9, 16, 17, 22], [1,, 6, 7]]);
|
|
2352
2828
|
}));
|
|
2353
2829
|
return _responseChunks.apply(this, arguments);
|
|
2354
2830
|
}
|
|
2355
2831
|
|
|
2356
2832
|
var _excluded = ["method", "fetchTimeout", "baseRequestId", "signal"];
|
|
2357
|
-
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; }
|
|
2358
|
-
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; }
|
|
2359
2833
|
/**
|
|
2360
2834
|
* Default transport implementation.
|
|
2361
2835
|
*/
|
|
@@ -2369,14 +2843,14 @@ var HttpTransport = /*#__PURE__*/function () {
|
|
|
2369
2843
|
credentials = _ref.credentials,
|
|
2370
2844
|
fetchTimeout = _ref.fetchTimeout,
|
|
2371
2845
|
signal = _ref.signal;
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2846
|
+
_classCallCheck(this, HttpTransport);
|
|
2847
|
+
_defineProperty(this, "authorization", void 0);
|
|
2848
|
+
_defineProperty(this, "apiUrl", void 0);
|
|
2849
|
+
_defineProperty(this, "method", void 0);
|
|
2850
|
+
_defineProperty(this, "headers", void 0);
|
|
2851
|
+
_defineProperty(this, "credentials", void 0);
|
|
2852
|
+
_defineProperty(this, "fetchTimeout", void 0);
|
|
2853
|
+
_defineProperty(this, "signal", void 0);
|
|
2380
2854
|
this.authorization = authorization;
|
|
2381
2855
|
this.apiUrl = apiUrl;
|
|
2382
2856
|
this.method = method;
|
|
@@ -2385,7 +2859,7 @@ var HttpTransport = /*#__PURE__*/function () {
|
|
|
2385
2859
|
this.fetchTimeout = fetchTimeout;
|
|
2386
2860
|
this.signal = signal;
|
|
2387
2861
|
}
|
|
2388
|
-
return
|
|
2862
|
+
return _createClass(HttpTransport, [{
|
|
2389
2863
|
key: "request",
|
|
2390
2864
|
value: function request(apiMethod, _ref2) {
|
|
2391
2865
|
var _ref4,
|
|
@@ -2394,12 +2868,12 @@ var HttpTransport = /*#__PURE__*/function () {
|
|
|
2394
2868
|
fetchTimeout = _ref2.fetchTimeout,
|
|
2395
2869
|
baseRequestId = _ref2.baseRequestId,
|
|
2396
2870
|
signal = _ref2.signal,
|
|
2397
|
-
params =
|
|
2871
|
+
params = _objectWithoutProperties(_ref2, _excluded);
|
|
2398
2872
|
var spanCounter = 1;
|
|
2399
2873
|
var searchParams = new URLSearchParams(params && Object.keys(params).map(function (k) {
|
|
2400
|
-
return
|
|
2874
|
+
return _defineProperty({}, k, _typeof(params[k]) === 'object' ? JSON.stringify(params[k]) : params[k]);
|
|
2401
2875
|
}).reduce(function (a, b) {
|
|
2402
|
-
return
|
|
2876
|
+
return _objectSpread2(_objectSpread2({}, a), b);
|
|
2403
2877
|
}, {}));
|
|
2404
2878
|
var url = "".concat(this.apiUrl, "/").concat(apiMethod).concat(searchParams.toString().length ? "?".concat(searchParams) : '');
|
|
2405
2879
|
var requestMethod = (_ref4 = method !== null && method !== void 0 ? method : this.method) !== null && _ref4 !== void 0 ? _ref4 : url.length < 2000 ? 'GET' : 'POST';
|
|
@@ -2415,7 +2889,7 @@ var HttpTransport = /*#__PURE__*/function () {
|
|
|
2415
2889
|
var runRequest = function runRequest() {
|
|
2416
2890
|
return fetch__default["default"](url, {
|
|
2417
2891
|
method: requestMethod,
|
|
2418
|
-
headers:
|
|
2892
|
+
headers: _objectSpread2({
|
|
2419
2893
|
Authorization: _this.authorization,
|
|
2420
2894
|
'x-request-id': baseRequestId && "".concat(baseRequestId, "-span-").concat(spanCounter++)
|
|
2421
2895
|
}, _this.headers),
|
|
@@ -2427,22 +2901,22 @@ var HttpTransport = /*#__PURE__*/function () {
|
|
|
2427
2901
|
return {
|
|
2428
2902
|
/* eslint no-unsafe-finally: off */subscribe: function subscribe(callback) {
|
|
2429
2903
|
var _this2 = this;
|
|
2430
|
-
return
|
|
2904
|
+
return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
2431
2905
|
var result, errorMessage, _actualSignal$reason, _result, _t;
|
|
2432
|
-
return
|
|
2433
|
-
while (1) switch (_context.
|
|
2906
|
+
return _regenerator().w(function (_context) {
|
|
2907
|
+
while (1) switch (_context.p = _context.n) {
|
|
2434
2908
|
case 0:
|
|
2435
|
-
_context.
|
|
2436
|
-
_context.
|
|
2909
|
+
_context.p = 0;
|
|
2910
|
+
_context.n = 1;
|
|
2437
2911
|
return runRequest();
|
|
2438
2912
|
case 1:
|
|
2439
|
-
result = _context.
|
|
2440
|
-
return _context.
|
|
2913
|
+
result = _context.v;
|
|
2914
|
+
return _context.a(2, callback(result, function () {
|
|
2441
2915
|
return _this2.subscribe(callback);
|
|
2442
2916
|
}));
|
|
2443
2917
|
case 2:
|
|
2444
|
-
_context.
|
|
2445
|
-
_t = _context
|
|
2918
|
+
_context.p = 2;
|
|
2919
|
+
_t = _context.v;
|
|
2446
2920
|
errorMessage = 'network Error';
|
|
2447
2921
|
if (_t.name === 'AbortError') {
|
|
2448
2922
|
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') {
|
|
@@ -2454,12 +2928,9 @@ var HttpTransport = /*#__PURE__*/function () {
|
|
|
2454
2928
|
_result = {
|
|
2455
2929
|
error: errorMessage
|
|
2456
2930
|
};
|
|
2457
|
-
return _context.
|
|
2931
|
+
return _context.a(2, callback(_result, function () {
|
|
2458
2932
|
return _this2.subscribe(callback);
|
|
2459
2933
|
}));
|
|
2460
|
-
case 3:
|
|
2461
|
-
case "end":
|
|
2462
|
-
return _context.stop();
|
|
2463
2934
|
}
|
|
2464
2935
|
}, _callee, null, [[0, 2]]);
|
|
2465
2936
|
}))();
|
|
@@ -2483,7 +2954,7 @@ var HttpTransport = /*#__PURE__*/function () {
|
|
|
2483
2954
|
Object.keys(params).forEach(function (k) {
|
|
2484
2955
|
var value = params[k];
|
|
2485
2956
|
if (value !== undefined) {
|
|
2486
|
-
processedParams[k] =
|
|
2957
|
+
processedParams[k] = _typeof(value) === 'object' ? JSON.stringify(value) : String(value);
|
|
2487
2958
|
}
|
|
2488
2959
|
});
|
|
2489
2960
|
}
|
|
@@ -2507,15 +2978,15 @@ var HttpTransport = /*#__PURE__*/function () {
|
|
|
2507
2978
|
}
|
|
2508
2979
|
return {
|
|
2509
2980
|
stream: function () {
|
|
2510
|
-
var _stream =
|
|
2981
|
+
var _stream = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
2511
2982
|
var response;
|
|
2512
|
-
return
|
|
2513
|
-
while (1) switch (_context2.
|
|
2983
|
+
return _regenerator().w(function (_context2) {
|
|
2984
|
+
while (1) switch (_context2.n) {
|
|
2514
2985
|
case 0:
|
|
2515
|
-
_context2.
|
|
2986
|
+
_context2.n = 1;
|
|
2516
2987
|
return fetch__default["default"](url, {
|
|
2517
2988
|
method: requestMethod,
|
|
2518
|
-
headers:
|
|
2989
|
+
headers: _objectSpread2({
|
|
2519
2990
|
Authorization: _this3.authorization,
|
|
2520
2991
|
'x-request-id': baseRequestId || 'stream-request'
|
|
2521
2992
|
}, _this3.headers),
|
|
@@ -2524,23 +2995,20 @@ var HttpTransport = /*#__PURE__*/function () {
|
|
|
2524
2995
|
signal: actualSignal
|
|
2525
2996
|
});
|
|
2526
2997
|
case 1:
|
|
2527
|
-
response = _context2.
|
|
2998
|
+
response = _context2.v;
|
|
2528
2999
|
if (response.ok) {
|
|
2529
|
-
_context2.
|
|
3000
|
+
_context2.n = 2;
|
|
2530
3001
|
break;
|
|
2531
3002
|
}
|
|
2532
3003
|
throw new Error("HTTP ".concat(response.status, ": ").concat(response.statusText));
|
|
2533
3004
|
case 2:
|
|
2534
3005
|
if (response.body) {
|
|
2535
|
-
_context2.
|
|
3006
|
+
_context2.n = 3;
|
|
2536
3007
|
break;
|
|
2537
3008
|
}
|
|
2538
3009
|
throw new Error('No response body available for streaming');
|
|
2539
3010
|
case 3:
|
|
2540
|
-
return _context2.
|
|
2541
|
-
case 4:
|
|
2542
|
-
case "end":
|
|
2543
|
-
return _context2.stop();
|
|
3011
|
+
return _context2.a(2, responseChunks(response));
|
|
2544
3012
|
}
|
|
2545
3013
|
}, _callee2);
|
|
2546
3014
|
}));
|
|
@@ -2550,16 +3018,15 @@ var HttpTransport = /*#__PURE__*/function () {
|
|
|
2550
3018
|
return stream;
|
|
2551
3019
|
}(),
|
|
2552
3020
|
unsubscribe: function () {
|
|
2553
|
-
var _unsubscribe =
|
|
2554
|
-
return
|
|
2555
|
-
while (1) switch (_context3.
|
|
3021
|
+
var _unsubscribe = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
|
|
3022
|
+
return _regenerator().w(function (_context3) {
|
|
3023
|
+
while (1) switch (_context3.n) {
|
|
2556
3024
|
case 0:
|
|
2557
3025
|
if (controller) {
|
|
2558
3026
|
controller.abort();
|
|
2559
3027
|
}
|
|
2560
3028
|
case 1:
|
|
2561
|
-
|
|
2562
|
-
return _context3.stop();
|
|
3029
|
+
return _context3.a(2);
|
|
2563
3030
|
}
|
|
2564
3031
|
}, _callee3);
|
|
2565
3032
|
}));
|
|
@@ -2573,30 +3040,20 @@ var HttpTransport = /*#__PURE__*/function () {
|
|
|
2573
3040
|
}]);
|
|
2574
3041
|
}();
|
|
2575
3042
|
|
|
2576
|
-
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)); }
|
|
2577
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
2578
3043
|
var RequestError = /*#__PURE__*/function (_Error) {
|
|
2579
3044
|
function RequestError(message, response, status) {
|
|
2580
3045
|
var _this;
|
|
2581
|
-
|
|
3046
|
+
_classCallCheck(this, RequestError);
|
|
2582
3047
|
_this = _callSuper(this, RequestError, [message]);
|
|
2583
|
-
|
|
2584
|
-
|
|
3048
|
+
_defineProperty(_this, "response", void 0);
|
|
3049
|
+
_defineProperty(_this, "status", void 0);
|
|
2585
3050
|
_this.response = response;
|
|
2586
3051
|
_this.status = status;
|
|
2587
3052
|
return _this;
|
|
2588
3053
|
}
|
|
2589
|
-
|
|
2590
|
-
return
|
|
2591
|
-
}(/*#__PURE__*/
|
|
2592
|
-
|
|
2593
|
-
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; } } }; }
|
|
2594
|
-
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; } }
|
|
2595
|
-
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; }
|
|
2596
|
-
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; }
|
|
2597
|
-
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; }
|
|
2598
|
-
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"); }
|
|
2599
|
-
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); }
|
|
3054
|
+
_inherits(RequestError, _Error);
|
|
3055
|
+
return _createClass(RequestError);
|
|
3056
|
+
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
2600
3057
|
|
|
2601
3058
|
// If we can't infer any members at all, then return any.
|
|
2602
3059
|
|
|
@@ -2642,19 +3099,19 @@ var CubeApi = /*#__PURE__*/function () {
|
|
|
2642
3099
|
* ```
|
|
2643
3100
|
*/
|
|
2644
3101
|
function CubeApi(apiToken, options) {
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
if (apiToken && !Array.isArray(apiToken) &&
|
|
3102
|
+
_classCallCheck(this, CubeApi);
|
|
3103
|
+
_defineProperty(this, "apiToken", void 0);
|
|
3104
|
+
_defineProperty(this, "apiUrl", void 0);
|
|
3105
|
+
_defineProperty(this, "method", void 0);
|
|
3106
|
+
_defineProperty(this, "headers", void 0);
|
|
3107
|
+
_defineProperty(this, "credentials", void 0);
|
|
3108
|
+
_defineProperty(this, "transport", void 0);
|
|
3109
|
+
_defineProperty(this, "pollInterval", void 0);
|
|
3110
|
+
_defineProperty(this, "parseDateMeasures", void 0);
|
|
3111
|
+
_defineProperty(this, "castNumerics", void 0);
|
|
3112
|
+
_defineProperty(this, "networkErrorRetries", void 0);
|
|
3113
|
+
_defineProperty(this, "updateAuthorizationPromise", void 0);
|
|
3114
|
+
if (apiToken && !Array.isArray(apiToken) && _typeof(apiToken) === 'object') {
|
|
2658
3115
|
options = apiToken;
|
|
2659
3116
|
apiToken = undefined;
|
|
2660
3117
|
}
|
|
@@ -2681,10 +3138,10 @@ var CubeApi = /*#__PURE__*/function () {
|
|
|
2681
3138
|
this.networkErrorRetries = options.networkErrorRetries || 0;
|
|
2682
3139
|
this.updateAuthorizationPromise = null;
|
|
2683
3140
|
}
|
|
2684
|
-
return
|
|
3141
|
+
return _createClass(CubeApi, [{
|
|
2685
3142
|
key: "request",
|
|
2686
3143
|
value: function request(method, params) {
|
|
2687
|
-
return this.transport.request(method,
|
|
3144
|
+
return this.transport.request(method, _objectSpread2(_objectSpread2({}, params), {}, {
|
|
2688
3145
|
baseRequestId: (params === null || params === void 0 ? void 0 : params.baseRequestId) || uuid.v4()
|
|
2689
3146
|
}));
|
|
2690
3147
|
}
|
|
@@ -2708,31 +3165,30 @@ var CubeApi = /*#__PURE__*/function () {
|
|
|
2708
3165
|
var skipAuthorizationUpdate = true;
|
|
2709
3166
|
var unsubscribed = false;
|
|
2710
3167
|
var checkMutex = /*#__PURE__*/function () {
|
|
2711
|
-
var _ref =
|
|
3168
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
2712
3169
|
var requestInstance;
|
|
2713
|
-
return
|
|
2714
|
-
while (1) switch (_context.
|
|
3170
|
+
return _regenerator().w(function (_context) {
|
|
3171
|
+
while (1) switch (_context.n) {
|
|
2715
3172
|
case 0:
|
|
2716
|
-
_context.
|
|
3173
|
+
_context.n = 1;
|
|
2717
3174
|
return requestPromise;
|
|
2718
3175
|
case 1:
|
|
2719
|
-
requestInstance = _context.
|
|
3176
|
+
requestInstance = _context.v;
|
|
2720
3177
|
if (!(options && options.mutexObj && options.mutexObj[mutexKey] !== mutexValue)) {
|
|
2721
|
-
_context.
|
|
3178
|
+
_context.n = 3;
|
|
2722
3179
|
break;
|
|
2723
3180
|
}
|
|
2724
3181
|
unsubscribed = true;
|
|
2725
3182
|
if (!requestInstance.unsubscribe) {
|
|
2726
|
-
_context.
|
|
3183
|
+
_context.n = 2;
|
|
2727
3184
|
break;
|
|
2728
3185
|
}
|
|
2729
|
-
_context.
|
|
3186
|
+
_context.n = 2;
|
|
2730
3187
|
return requestInstance.unsubscribe();
|
|
2731
3188
|
case 2:
|
|
2732
3189
|
throw MUTEX_ERROR;
|
|
2733
3190
|
case 3:
|
|
2734
|
-
|
|
2735
|
-
return _context.stop();
|
|
3191
|
+
return _context.a(2);
|
|
2736
3192
|
}
|
|
2737
3193
|
}, _callee);
|
|
2738
3194
|
}));
|
|
@@ -2742,45 +3198,42 @@ var CubeApi = /*#__PURE__*/function () {
|
|
|
2742
3198
|
}();
|
|
2743
3199
|
var networkRetries = this.networkErrorRetries;
|
|
2744
3200
|
var loadImpl = /*#__PURE__*/function () {
|
|
2745
|
-
var _ref2 =
|
|
3201
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(response, next) {
|
|
2746
3202
|
var _options2, _response$error, _body$error, _options5;
|
|
2747
3203
|
var requestInstance, subscribeNext, continueWait, body, text, _options3, _options4, _error, result;
|
|
2748
|
-
return
|
|
2749
|
-
while (1) switch (_context4.
|
|
3204
|
+
return _regenerator().w(function (_context4) {
|
|
3205
|
+
while (1) switch (_context4.p = _context4.n) {
|
|
2750
3206
|
case 0:
|
|
2751
|
-
_context4.
|
|
3207
|
+
_context4.n = 1;
|
|
2752
3208
|
return requestPromise;
|
|
2753
3209
|
case 1:
|
|
2754
|
-
requestInstance = _context4.
|
|
3210
|
+
requestInstance = _context4.v;
|
|
2755
3211
|
subscribeNext = /*#__PURE__*/function () {
|
|
2756
|
-
var _ref3 =
|
|
3212
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
2757
3213
|
var _options;
|
|
2758
|
-
return
|
|
2759
|
-
while (1) switch (_context2.
|
|
3214
|
+
return _regenerator().w(function (_context2) {
|
|
3215
|
+
while (1) switch (_context2.n) {
|
|
2760
3216
|
case 0:
|
|
2761
3217
|
if (!((_options = options) !== null && _options !== void 0 && _options.subscribe && !unsubscribed)) {
|
|
2762
|
-
_context2.
|
|
3218
|
+
_context2.n = 3;
|
|
2763
3219
|
break;
|
|
2764
3220
|
}
|
|
2765
3221
|
if (!requestInstance.unsubscribe) {
|
|
2766
|
-
_context2.
|
|
3222
|
+
_context2.n = 1;
|
|
2767
3223
|
break;
|
|
2768
3224
|
}
|
|
2769
|
-
return _context2.
|
|
3225
|
+
return _context2.a(2, next());
|
|
2770
3226
|
case 1:
|
|
2771
|
-
_context2.
|
|
3227
|
+
_context2.n = 2;
|
|
2772
3228
|
return new Promise(function (resolve) {
|
|
2773
3229
|
return setTimeout(function () {
|
|
2774
3230
|
return resolve();
|
|
2775
3231
|
}, _this2.pollInterval * 1000);
|
|
2776
3232
|
});
|
|
2777
3233
|
case 2:
|
|
2778
|
-
return _context2.
|
|
3234
|
+
return _context2.a(2, next());
|
|
2779
3235
|
case 3:
|
|
2780
|
-
return _context2.
|
|
2781
|
-
case 4:
|
|
2782
|
-
case "end":
|
|
2783
|
-
return _context2.stop();
|
|
3236
|
+
return _context2.a(2, null);
|
|
2784
3237
|
}
|
|
2785
3238
|
}, _callee2);
|
|
2786
3239
|
}));
|
|
@@ -2789,34 +3242,31 @@ var CubeApi = /*#__PURE__*/function () {
|
|
|
2789
3242
|
};
|
|
2790
3243
|
}();
|
|
2791
3244
|
continueWait = /*#__PURE__*/function () {
|
|
2792
|
-
var _ref4 =
|
|
3245
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
|
|
2793
3246
|
var wait,
|
|
2794
3247
|
_args3 = arguments;
|
|
2795
|
-
return
|
|
2796
|
-
while (1) switch (_context3.
|
|
3248
|
+
return _regenerator().w(function (_context3) {
|
|
3249
|
+
while (1) switch (_context3.n) {
|
|
2797
3250
|
case 0:
|
|
2798
3251
|
wait = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : false;
|
|
2799
3252
|
if (unsubscribed) {
|
|
2800
|
-
_context3.
|
|
3253
|
+
_context3.n = 2;
|
|
2801
3254
|
break;
|
|
2802
3255
|
}
|
|
2803
3256
|
if (!wait) {
|
|
2804
|
-
_context3.
|
|
3257
|
+
_context3.n = 1;
|
|
2805
3258
|
break;
|
|
2806
3259
|
}
|
|
2807
|
-
_context3.
|
|
3260
|
+
_context3.n = 1;
|
|
2808
3261
|
return new Promise(function (resolve) {
|
|
2809
3262
|
return setTimeout(function () {
|
|
2810
3263
|
return resolve();
|
|
2811
3264
|
}, _this2.pollInterval * 1000);
|
|
2812
3265
|
});
|
|
2813
3266
|
case 1:
|
|
2814
|
-
return _context3.
|
|
3267
|
+
return _context3.a(2, next());
|
|
2815
3268
|
case 2:
|
|
2816
|
-
return _context3.
|
|
2817
|
-
case 3:
|
|
2818
|
-
case "end":
|
|
2819
|
-
return _context3.stop();
|
|
3269
|
+
return _context3.a(2, null);
|
|
2820
3270
|
}
|
|
2821
3271
|
}, _callee3);
|
|
2822
3272
|
}));
|
|
@@ -2825,103 +3275,100 @@ var CubeApi = /*#__PURE__*/function () {
|
|
|
2825
3275
|
};
|
|
2826
3276
|
}();
|
|
2827
3277
|
if (!((_options2 = options) !== null && _options2 !== void 0 && _options2.subscribe && !skipAuthorizationUpdate)) {
|
|
2828
|
-
_context4.
|
|
3278
|
+
_context4.n = 2;
|
|
2829
3279
|
break;
|
|
2830
3280
|
}
|
|
2831
|
-
_context4.
|
|
3281
|
+
_context4.n = 2;
|
|
2832
3282
|
return _this2.updateTransportAuthorization();
|
|
2833
3283
|
case 2:
|
|
2834
3284
|
skipAuthorizationUpdate = false;
|
|
2835
3285
|
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)) {
|
|
2836
|
-
_context4.
|
|
3286
|
+
_context4.n = 4;
|
|
2837
3287
|
break;
|
|
2838
3288
|
}
|
|
2839
|
-
_context4.
|
|
3289
|
+
_context4.n = 3;
|
|
2840
3290
|
return checkMutex();
|
|
2841
3291
|
case 3:
|
|
2842
|
-
return _context4.
|
|
3292
|
+
return _context4.a(2, continueWait(true));
|
|
2843
3293
|
case 4:
|
|
2844
3294
|
// From here we're sure that response is only fetch Response
|
|
2845
3295
|
response = response;
|
|
2846
3296
|
body = {};
|
|
2847
3297
|
text = '';
|
|
2848
|
-
_context4.
|
|
2849
|
-
_context4.
|
|
3298
|
+
_context4.p = 5;
|
|
3299
|
+
_context4.n = 6;
|
|
2850
3300
|
return response.text();
|
|
2851
3301
|
case 6:
|
|
2852
|
-
text = _context4.
|
|
3302
|
+
text = _context4.v;
|
|
2853
3303
|
body = JSON.parse(text);
|
|
2854
|
-
_context4.
|
|
3304
|
+
_context4.n = 8;
|
|
2855
3305
|
break;
|
|
2856
3306
|
case 7:
|
|
2857
|
-
_context4.
|
|
2858
|
-
_context4
|
|
3307
|
+
_context4.p = 7;
|
|
3308
|
+
_context4.v;
|
|
2859
3309
|
body.error = text;
|
|
2860
3310
|
case 8:
|
|
2861
3311
|
if (!((_body$error = body.error) !== null && _body$error !== void 0 && _body$error.includes('Continue wait'))) {
|
|
2862
|
-
_context4.
|
|
3312
|
+
_context4.n = 10;
|
|
2863
3313
|
break;
|
|
2864
3314
|
}
|
|
2865
|
-
_context4.
|
|
3315
|
+
_context4.n = 9;
|
|
2866
3316
|
return checkMutex();
|
|
2867
3317
|
case 9:
|
|
2868
3318
|
if ((_options3 = options) !== null && _options3 !== void 0 && _options3.progressCallback) {
|
|
2869
3319
|
options.progressCallback(new ProgressResult(body));
|
|
2870
3320
|
}
|
|
2871
|
-
return _context4.
|
|
3321
|
+
return _context4.a(2, continueWait());
|
|
2872
3322
|
case 10:
|
|
2873
3323
|
if (!(response.status !== 200)) {
|
|
2874
|
-
_context4.
|
|
3324
|
+
_context4.n = 15;
|
|
2875
3325
|
break;
|
|
2876
3326
|
}
|
|
2877
|
-
_context4.
|
|
3327
|
+
_context4.n = 11;
|
|
2878
3328
|
return checkMutex();
|
|
2879
3329
|
case 11:
|
|
2880
3330
|
if (!(!((_options4 = options) !== null && _options4 !== void 0 && _options4.subscribe) && requestInstance.unsubscribe)) {
|
|
2881
|
-
_context4.
|
|
3331
|
+
_context4.n = 12;
|
|
2882
3332
|
break;
|
|
2883
3333
|
}
|
|
2884
|
-
_context4.
|
|
3334
|
+
_context4.n = 12;
|
|
2885
3335
|
return requestInstance.unsubscribe();
|
|
2886
3336
|
case 12:
|
|
2887
3337
|
_error = new RequestError(body.error || response.error || '', body, response.status);
|
|
2888
3338
|
if (!callback) {
|
|
2889
|
-
_context4.
|
|
3339
|
+
_context4.n = 13;
|
|
2890
3340
|
break;
|
|
2891
3341
|
}
|
|
2892
3342
|
callback(_error);
|
|
2893
|
-
_context4.
|
|
3343
|
+
_context4.n = 14;
|
|
2894
3344
|
break;
|
|
2895
3345
|
case 13:
|
|
2896
3346
|
throw _error;
|
|
2897
3347
|
case 14:
|
|
2898
|
-
return _context4.
|
|
3348
|
+
return _context4.a(2, subscribeNext());
|
|
2899
3349
|
case 15:
|
|
2900
|
-
_context4.
|
|
3350
|
+
_context4.n = 16;
|
|
2901
3351
|
return checkMutex();
|
|
2902
3352
|
case 16:
|
|
2903
3353
|
if (!(!((_options5 = options) !== null && _options5 !== void 0 && _options5.subscribe) && requestInstance.unsubscribe)) {
|
|
2904
|
-
_context4.
|
|
3354
|
+
_context4.n = 17;
|
|
2905
3355
|
break;
|
|
2906
3356
|
}
|
|
2907
|
-
_context4.
|
|
3357
|
+
_context4.n = 17;
|
|
2908
3358
|
return requestInstance.unsubscribe();
|
|
2909
3359
|
case 17:
|
|
2910
3360
|
result = toResult(body);
|
|
2911
3361
|
if (!callback) {
|
|
2912
|
-
_context4.
|
|
3362
|
+
_context4.n = 18;
|
|
2913
3363
|
break;
|
|
2914
3364
|
}
|
|
2915
3365
|
callback(null, result);
|
|
2916
|
-
_context4.
|
|
3366
|
+
_context4.n = 19;
|
|
2917
3367
|
break;
|
|
2918
3368
|
case 18:
|
|
2919
|
-
return _context4.
|
|
3369
|
+
return _context4.a(2, result);
|
|
2920
3370
|
case 19:
|
|
2921
|
-
return _context4.
|
|
2922
|
-
case 20:
|
|
2923
|
-
case "end":
|
|
2924
|
-
return _context4.stop();
|
|
3371
|
+
return _context4.a(2, subscribeNext());
|
|
2925
3372
|
}
|
|
2926
3373
|
}, _callee4, null, [[5, 7]]);
|
|
2927
3374
|
}));
|
|
@@ -2935,26 +3382,23 @@ var CubeApi = /*#__PURE__*/function () {
|
|
|
2935
3382
|
if (callback) {
|
|
2936
3383
|
return {
|
|
2937
3384
|
unsubscribe: function () {
|
|
2938
|
-
var _unsubscribe =
|
|
3385
|
+
var _unsubscribe = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
|
|
2939
3386
|
var requestInstance;
|
|
2940
|
-
return
|
|
2941
|
-
while (1) switch (_context5.
|
|
3387
|
+
return _regenerator().w(function (_context5) {
|
|
3388
|
+
while (1) switch (_context5.n) {
|
|
2942
3389
|
case 0:
|
|
2943
|
-
_context5.
|
|
3390
|
+
_context5.n = 1;
|
|
2944
3391
|
return requestPromise;
|
|
2945
3392
|
case 1:
|
|
2946
|
-
requestInstance = _context5.
|
|
3393
|
+
requestInstance = _context5.v;
|
|
2947
3394
|
unsubscribed = true;
|
|
2948
3395
|
if (!requestInstance.unsubscribe) {
|
|
2949
|
-
_context5.
|
|
3396
|
+
_context5.n = 2;
|
|
2950
3397
|
break;
|
|
2951
3398
|
}
|
|
2952
|
-
return _context5.
|
|
3399
|
+
return _context5.a(2, requestInstance.unsubscribe());
|
|
2953
3400
|
case 2:
|
|
2954
|
-
return _context5.
|
|
2955
|
-
case 3:
|
|
2956
|
-
case "end":
|
|
2957
|
-
return _context5.stop();
|
|
3401
|
+
return _context5.a(2, null);
|
|
2958
3402
|
}
|
|
2959
3403
|
}, _callee5);
|
|
2960
3404
|
}));
|
|
@@ -2971,55 +3415,53 @@ var CubeApi = /*#__PURE__*/function () {
|
|
|
2971
3415
|
}, {
|
|
2972
3416
|
key: "updateTransportAuthorization",
|
|
2973
3417
|
value: function () {
|
|
2974
|
-
var _updateTransportAuthorization =
|
|
3418
|
+
var _updateTransportAuthorization = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {
|
|
2975
3419
|
var _this3 = this;
|
|
2976
3420
|
var tokenFetcher, promise;
|
|
2977
|
-
return
|
|
2978
|
-
while (1) switch (_context7.
|
|
3421
|
+
return _regenerator().w(function (_context7) {
|
|
3422
|
+
while (1) switch (_context7.n) {
|
|
2979
3423
|
case 0:
|
|
2980
3424
|
if (!this.updateAuthorizationPromise) {
|
|
2981
|
-
_context7.
|
|
3425
|
+
_context7.n = 2;
|
|
2982
3426
|
break;
|
|
2983
3427
|
}
|
|
2984
|
-
_context7.
|
|
3428
|
+
_context7.n = 1;
|
|
2985
3429
|
return this.updateAuthorizationPromise;
|
|
2986
3430
|
case 1:
|
|
2987
|
-
return _context7.
|
|
3431
|
+
return _context7.a(2);
|
|
2988
3432
|
case 2:
|
|
2989
3433
|
tokenFetcher = this.apiToken;
|
|
2990
3434
|
if (!(typeof tokenFetcher === 'function')) {
|
|
2991
|
-
_context7.
|
|
3435
|
+
_context7.n = 3;
|
|
2992
3436
|
break;
|
|
2993
3437
|
}
|
|
2994
|
-
promise =
|
|
3438
|
+
promise = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
|
|
2995
3439
|
var token;
|
|
2996
|
-
return
|
|
2997
|
-
while (1) switch (_context6.
|
|
3440
|
+
return _regenerator().w(function (_context6) {
|
|
3441
|
+
while (1) switch (_context6.p = _context6.n) {
|
|
2998
3442
|
case 0:
|
|
2999
|
-
_context6.
|
|
3000
|
-
_context6.
|
|
3443
|
+
_context6.p = 0;
|
|
3444
|
+
_context6.n = 1;
|
|
3001
3445
|
return tokenFetcher();
|
|
3002
3446
|
case 1:
|
|
3003
|
-
token = _context6.
|
|
3447
|
+
token = _context6.v;
|
|
3004
3448
|
if (_this3.transport.authorization !== token) {
|
|
3005
3449
|
_this3.transport.authorization = token;
|
|
3006
3450
|
}
|
|
3007
3451
|
case 2:
|
|
3008
|
-
_context6.
|
|
3452
|
+
_context6.p = 2;
|
|
3009
3453
|
_this3.updateAuthorizationPromise = null;
|
|
3010
|
-
return _context6.
|
|
3454
|
+
return _context6.f(2);
|
|
3011
3455
|
case 3:
|
|
3012
|
-
|
|
3013
|
-
return _context6.stop();
|
|
3456
|
+
return _context6.a(2);
|
|
3014
3457
|
}
|
|
3015
3458
|
}, _callee6, null, [[0,, 2, 3]]);
|
|
3016
3459
|
}))();
|
|
3017
3460
|
this.updateAuthorizationPromise = promise;
|
|
3018
|
-
_context7.
|
|
3461
|
+
_context7.n = 3;
|
|
3019
3462
|
return promise;
|
|
3020
3463
|
case 3:
|
|
3021
|
-
|
|
3022
|
-
return _context7.stop();
|
|
3464
|
+
return _context7.a(2);
|
|
3023
3465
|
}
|
|
3024
3466
|
}, _callee7, this);
|
|
3025
3467
|
}));
|
|
@@ -3035,7 +3477,7 @@ var CubeApi = /*#__PURE__*/function () {
|
|
|
3035
3477
|
key: "patchQueryInternal",
|
|
3036
3478
|
value: function patchQueryInternal(query, responseFormat) {
|
|
3037
3479
|
if ((responseFormat === 'compact' || responseFormat === 'columnar') && query.responseFormat !== responseFormat) {
|
|
3038
|
-
return
|
|
3480
|
+
return _objectSpread2(_objectSpread2({}, query), {}, {
|
|
3039
3481
|
responseFormat: responseFormat
|
|
3040
3482
|
});
|
|
3041
3483
|
} else {
|
|
@@ -3054,8 +3496,8 @@ var CubeApi = /*#__PURE__*/function () {
|
|
|
3054
3496
|
if (response.results.length) {
|
|
3055
3497
|
if (options !== null && options !== void 0 && options.castNumerics) {
|
|
3056
3498
|
response.results.forEach(function (result) {
|
|
3057
|
-
var numericMembers = Object.entries(
|
|
3058
|
-
var _ref7 =
|
|
3499
|
+
var numericMembers = Object.entries(_objectSpread2(_objectSpread2({}, result.annotation.measures), result.annotation.dimensions)).reduce(function (acc, _ref6) {
|
|
3500
|
+
var _ref7 = _slicedToArray(_ref6, 2),
|
|
3059
3501
|
k = _ref7[0],
|
|
3060
3502
|
v = _ref7[1];
|
|
3061
3503
|
if (v.type === 'number') {
|
|
@@ -3151,7 +3593,7 @@ var CubeApi = /*#__PURE__*/function () {
|
|
|
3151
3593
|
_this4 = this;
|
|
3152
3594
|
var responseFormat = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'default';
|
|
3153
3595
|
var _this$prepareQueryOpt = this.prepareQueryOptions(query, options, responseFormat);
|
|
3154
|
-
var _this$prepareQueryOpt2 =
|
|
3596
|
+
var _this$prepareQueryOpt2 = _slicedToArray(_this$prepareQueryOpt, 2);
|
|
3155
3597
|
query = _this$prepareQueryOpt2[0];
|
|
3156
3598
|
options = _this$prepareQueryOpt2[1];
|
|
3157
3599
|
var params = {
|
|
@@ -3174,7 +3616,7 @@ var CubeApi = /*#__PURE__*/function () {
|
|
|
3174
3616
|
value: function prepareQueryOptions(query, options) {
|
|
3175
3617
|
var _this5 = this;
|
|
3176
3618
|
var responseFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'default';
|
|
3177
|
-
options =
|
|
3619
|
+
options = _objectSpread2({
|
|
3178
3620
|
castNumerics: this.castNumerics
|
|
3179
3621
|
}, options);
|
|
3180
3622
|
if (responseFormat === 'compact' || responseFormat === 'columnar') {
|
|
@@ -3225,7 +3667,7 @@ var CubeApi = /*#__PURE__*/function () {
|
|
|
3225
3667
|
var _this6 = this;
|
|
3226
3668
|
var responseFormat = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'default';
|
|
3227
3669
|
var _this$prepareQueryOpt3 = this.prepareQueryOptions(query, options, responseFormat);
|
|
3228
|
-
var _this$prepareQueryOpt4 =
|
|
3670
|
+
var _this$prepareQueryOpt4 = _slicedToArray(_this$prepareQueryOpt3, 2);
|
|
3229
3671
|
query = _this$prepareQueryOpt4[0];
|
|
3230
3672
|
options = _this$prepareQueryOpt4[1];
|
|
3231
3673
|
return this.loadMethod(function () {
|
|
@@ -3238,7 +3680,7 @@ var CubeApi = /*#__PURE__*/function () {
|
|
|
3238
3680
|
});
|
|
3239
3681
|
}, function (response) {
|
|
3240
3682
|
return _this6.loadResponseInternal(response, options);
|
|
3241
|
-
},
|
|
3683
|
+
}, _objectSpread2(_objectSpread2({}, options), {}, {
|
|
3242
3684
|
subscribe: true
|
|
3243
3685
|
}), callback);
|
|
3244
3686
|
}
|
|
@@ -3334,12 +3776,12 @@ var CubeApi = /*#__PURE__*/function () {
|
|
|
3334
3776
|
throw new Error('CubeSQL query was aborted');
|
|
3335
3777
|
}
|
|
3336
3778
|
var _response$error$split = response.error.split('\n'),
|
|
3337
|
-
_response$error$split2 =
|
|
3779
|
+
_response$error$split2 = _toArray(_response$error$split),
|
|
3338
3780
|
schema = _response$error$split2[0],
|
|
3339
3781
|
data = _arrayLikeToArray(_response$error$split2).slice(1);
|
|
3340
3782
|
try {
|
|
3341
3783
|
var parsedSchema = JSON.parse(schema);
|
|
3342
|
-
return
|
|
3784
|
+
return _objectSpread2({
|
|
3343
3785
|
schema: parsedSchema.schema,
|
|
3344
3786
|
data: data.filter(function (d) {
|
|
3345
3787
|
return d.trim().length;
|
|
@@ -3365,13 +3807,13 @@ var CubeApi = /*#__PURE__*/function () {
|
|
|
3365
3807
|
key: "cubeSqlStream",
|
|
3366
3808
|
value: function cubeSqlStream(sqlQuery, options) {
|
|
3367
3809
|
var _this = this;
|
|
3368
|
-
return
|
|
3810
|
+
return _wrapAsyncGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {
|
|
3369
3811
|
var streamResponse, decoder, buffer, stream, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, chunk, lines, _iterator2, _step2, line, parsed, _parsed, _t3, _t4, _t6;
|
|
3370
|
-
return
|
|
3371
|
-
while (1) switch (_context8.
|
|
3812
|
+
return _regenerator().w(function (_context8) {
|
|
3813
|
+
while (1) switch (_context8.p = _context8.n) {
|
|
3372
3814
|
case 0:
|
|
3373
3815
|
if (_this.transport.requestStream) {
|
|
3374
|
-
_context8.
|
|
3816
|
+
_context8.n = 1;
|
|
3375
3817
|
break;
|
|
3376
3818
|
}
|
|
3377
3819
|
throw new Error('Transport does not support streaming');
|
|
@@ -3388,21 +3830,21 @@ var CubeApi = /*#__PURE__*/function () {
|
|
|
3388
3830
|
});
|
|
3389
3831
|
decoder = new TextDecoder();
|
|
3390
3832
|
buffer = '';
|
|
3391
|
-
_context8.
|
|
3392
|
-
_context8.
|
|
3393
|
-
return
|
|
3833
|
+
_context8.p = 2;
|
|
3834
|
+
_context8.n = 3;
|
|
3835
|
+
return _awaitAsyncGenerator(streamResponse.stream());
|
|
3394
3836
|
case 3:
|
|
3395
|
-
stream = _context8.
|
|
3837
|
+
stream = _context8.v;
|
|
3396
3838
|
_iteratorAbruptCompletion = false;
|
|
3397
3839
|
_didIteratorError = false;
|
|
3398
|
-
_context8.
|
|
3840
|
+
_context8.p = 4;
|
|
3399
3841
|
_iterator = _asyncIterator(stream);
|
|
3400
3842
|
case 5:
|
|
3401
|
-
_context8.
|
|
3402
|
-
return
|
|
3843
|
+
_context8.n = 6;
|
|
3844
|
+
return _awaitAsyncGenerator(_iterator.next());
|
|
3403
3845
|
case 6:
|
|
3404
|
-
if (!(_iteratorAbruptCompletion = !(_step = _context8.
|
|
3405
|
-
_context8.
|
|
3846
|
+
if (!(_iteratorAbruptCompletion = !(_step = _context8.v).done)) {
|
|
3847
|
+
_context8.n = 21;
|
|
3406
3848
|
break;
|
|
3407
3849
|
}
|
|
3408
3850
|
chunk = _step.value;
|
|
@@ -3412,197 +3854,196 @@ var CubeApi = /*#__PURE__*/function () {
|
|
|
3412
3854
|
lines = buffer.split('\n');
|
|
3413
3855
|
buffer = lines.pop() || '';
|
|
3414
3856
|
_iterator2 = _createForOfIteratorHelper(lines);
|
|
3415
|
-
_context8.
|
|
3857
|
+
_context8.p = 7;
|
|
3416
3858
|
_iterator2.s();
|
|
3417
3859
|
case 8:
|
|
3418
3860
|
if ((_step2 = _iterator2.n()).done) {
|
|
3419
|
-
_context8.
|
|
3861
|
+
_context8.n = 17;
|
|
3420
3862
|
break;
|
|
3421
3863
|
}
|
|
3422
3864
|
line = _step2.value;
|
|
3423
3865
|
if (!line.trim()) {
|
|
3424
|
-
_context8.
|
|
3866
|
+
_context8.n = 16;
|
|
3425
3867
|
break;
|
|
3426
3868
|
}
|
|
3427
|
-
_context8.
|
|
3869
|
+
_context8.p = 9;
|
|
3428
3870
|
parsed = JSON.parse(line);
|
|
3429
3871
|
if (!parsed.schema) {
|
|
3430
|
-
_context8.
|
|
3872
|
+
_context8.n = 11;
|
|
3431
3873
|
break;
|
|
3432
3874
|
}
|
|
3433
|
-
_context8.
|
|
3434
|
-
return
|
|
3875
|
+
_context8.n = 10;
|
|
3876
|
+
return _objectSpread2({
|
|
3435
3877
|
type: 'schema',
|
|
3436
3878
|
schema: parsed.schema
|
|
3437
3879
|
}, parsed.lastRefreshTime ? {
|
|
3438
3880
|
lastRefreshTime: parsed.lastRefreshTime
|
|
3439
3881
|
} : {});
|
|
3440
3882
|
case 10:
|
|
3441
|
-
_context8.
|
|
3883
|
+
_context8.n = 14;
|
|
3442
3884
|
break;
|
|
3443
3885
|
case 11:
|
|
3444
3886
|
if (!parsed.data) {
|
|
3445
|
-
_context8.
|
|
3887
|
+
_context8.n = 13;
|
|
3446
3888
|
break;
|
|
3447
3889
|
}
|
|
3448
|
-
_context8.
|
|
3890
|
+
_context8.n = 12;
|
|
3449
3891
|
return {
|
|
3450
3892
|
type: 'data',
|
|
3451
3893
|
data: parsed.data
|
|
3452
3894
|
};
|
|
3453
3895
|
case 12:
|
|
3454
|
-
_context8.
|
|
3896
|
+
_context8.n = 14;
|
|
3455
3897
|
break;
|
|
3456
3898
|
case 13:
|
|
3457
3899
|
if (!parsed.error) {
|
|
3458
|
-
_context8.
|
|
3900
|
+
_context8.n = 14;
|
|
3459
3901
|
break;
|
|
3460
3902
|
}
|
|
3461
|
-
_context8.
|
|
3903
|
+
_context8.n = 14;
|
|
3462
3904
|
return {
|
|
3463
3905
|
type: 'error',
|
|
3464
3906
|
error: parsed.error
|
|
3465
3907
|
};
|
|
3466
3908
|
case 14:
|
|
3467
|
-
_context8.
|
|
3909
|
+
_context8.n = 16;
|
|
3468
3910
|
break;
|
|
3469
3911
|
case 15:
|
|
3470
|
-
_context8.
|
|
3471
|
-
_context8
|
|
3472
|
-
_context8.
|
|
3912
|
+
_context8.p = 15;
|
|
3913
|
+
_context8.v;
|
|
3914
|
+
_context8.n = 16;
|
|
3473
3915
|
return {
|
|
3474
3916
|
type: 'error',
|
|
3475
3917
|
error: "Failed to parse JSON line: ".concat(line)
|
|
3476
3918
|
};
|
|
3477
3919
|
case 16:
|
|
3478
|
-
_context8.
|
|
3920
|
+
_context8.n = 8;
|
|
3479
3921
|
break;
|
|
3480
3922
|
case 17:
|
|
3481
|
-
_context8.
|
|
3923
|
+
_context8.n = 19;
|
|
3482
3924
|
break;
|
|
3483
3925
|
case 18:
|
|
3484
|
-
_context8.
|
|
3485
|
-
_t3 = _context8
|
|
3926
|
+
_context8.p = 18;
|
|
3927
|
+
_t3 = _context8.v;
|
|
3486
3928
|
_iterator2.e(_t3);
|
|
3487
3929
|
case 19:
|
|
3488
|
-
_context8.
|
|
3930
|
+
_context8.p = 19;
|
|
3489
3931
|
_iterator2.f();
|
|
3490
|
-
return _context8.
|
|
3932
|
+
return _context8.f(19);
|
|
3491
3933
|
case 20:
|
|
3492
3934
|
_iteratorAbruptCompletion = false;
|
|
3493
|
-
_context8.
|
|
3935
|
+
_context8.n = 5;
|
|
3494
3936
|
break;
|
|
3495
3937
|
case 21:
|
|
3496
|
-
_context8.
|
|
3938
|
+
_context8.n = 23;
|
|
3497
3939
|
break;
|
|
3498
3940
|
case 22:
|
|
3499
|
-
_context8.
|
|
3500
|
-
_t4 = _context8
|
|
3941
|
+
_context8.p = 22;
|
|
3942
|
+
_t4 = _context8.v;
|
|
3501
3943
|
_didIteratorError = true;
|
|
3502
3944
|
_iteratorError = _t4;
|
|
3503
3945
|
case 23:
|
|
3504
|
-
_context8.
|
|
3505
|
-
_context8.
|
|
3946
|
+
_context8.p = 23;
|
|
3947
|
+
_context8.p = 24;
|
|
3506
3948
|
if (!(_iteratorAbruptCompletion && _iterator["return"] != null)) {
|
|
3507
|
-
_context8.
|
|
3949
|
+
_context8.n = 25;
|
|
3508
3950
|
break;
|
|
3509
3951
|
}
|
|
3510
|
-
_context8.
|
|
3511
|
-
return
|
|
3952
|
+
_context8.n = 25;
|
|
3953
|
+
return _awaitAsyncGenerator(_iterator["return"]());
|
|
3512
3954
|
case 25:
|
|
3513
|
-
_context8.
|
|
3955
|
+
_context8.p = 25;
|
|
3514
3956
|
if (!_didIteratorError) {
|
|
3515
|
-
_context8.
|
|
3957
|
+
_context8.n = 26;
|
|
3516
3958
|
break;
|
|
3517
3959
|
}
|
|
3518
3960
|
throw _iteratorError;
|
|
3519
3961
|
case 26:
|
|
3520
|
-
return _context8.
|
|
3962
|
+
return _context8.f(25);
|
|
3521
3963
|
case 27:
|
|
3522
|
-
return _context8.
|
|
3964
|
+
return _context8.f(23);
|
|
3523
3965
|
case 28:
|
|
3524
3966
|
if (!buffer.trim()) {
|
|
3525
|
-
_context8.
|
|
3967
|
+
_context8.n = 36;
|
|
3526
3968
|
break;
|
|
3527
3969
|
}
|
|
3528
|
-
_context8.
|
|
3970
|
+
_context8.p = 29;
|
|
3529
3971
|
_parsed = JSON.parse(buffer);
|
|
3530
3972
|
if (!_parsed.schema) {
|
|
3531
|
-
_context8.
|
|
3973
|
+
_context8.n = 31;
|
|
3532
3974
|
break;
|
|
3533
3975
|
}
|
|
3534
|
-
_context8.
|
|
3535
|
-
return
|
|
3976
|
+
_context8.n = 30;
|
|
3977
|
+
return _objectSpread2({
|
|
3536
3978
|
type: 'schema',
|
|
3537
3979
|
schema: _parsed.schema
|
|
3538
3980
|
}, _parsed.lastRefreshTime ? {
|
|
3539
3981
|
lastRefreshTime: _parsed.lastRefreshTime
|
|
3540
3982
|
} : {});
|
|
3541
3983
|
case 30:
|
|
3542
|
-
_context8.
|
|
3984
|
+
_context8.n = 34;
|
|
3543
3985
|
break;
|
|
3544
3986
|
case 31:
|
|
3545
3987
|
if (!_parsed.data) {
|
|
3546
|
-
_context8.
|
|
3988
|
+
_context8.n = 33;
|
|
3547
3989
|
break;
|
|
3548
3990
|
}
|
|
3549
|
-
_context8.
|
|
3991
|
+
_context8.n = 32;
|
|
3550
3992
|
return {
|
|
3551
3993
|
type: 'data',
|
|
3552
3994
|
data: _parsed.data
|
|
3553
3995
|
};
|
|
3554
3996
|
case 32:
|
|
3555
|
-
_context8.
|
|
3997
|
+
_context8.n = 34;
|
|
3556
3998
|
break;
|
|
3557
3999
|
case 33:
|
|
3558
4000
|
if (!_parsed.error) {
|
|
3559
|
-
_context8.
|
|
4001
|
+
_context8.n = 34;
|
|
3560
4002
|
break;
|
|
3561
4003
|
}
|
|
3562
|
-
_context8.
|
|
4004
|
+
_context8.n = 34;
|
|
3563
4005
|
return {
|
|
3564
4006
|
type: 'error',
|
|
3565
4007
|
error: _parsed.error
|
|
3566
4008
|
};
|
|
3567
4009
|
case 34:
|
|
3568
|
-
_context8.
|
|
4010
|
+
_context8.n = 36;
|
|
3569
4011
|
break;
|
|
3570
4012
|
case 35:
|
|
3571
|
-
_context8.
|
|
3572
|
-
_context8
|
|
3573
|
-
_context8.
|
|
4013
|
+
_context8.p = 35;
|
|
4014
|
+
_context8.v;
|
|
4015
|
+
_context8.n = 36;
|
|
3574
4016
|
return {
|
|
3575
4017
|
type: 'error',
|
|
3576
4018
|
error: "Failed to parse remaining JSON: ".concat(buffer)
|
|
3577
4019
|
};
|
|
3578
4020
|
case 36:
|
|
3579
|
-
_context8.
|
|
4021
|
+
_context8.n = 39;
|
|
3580
4022
|
break;
|
|
3581
4023
|
case 37:
|
|
3582
|
-
_context8.
|
|
3583
|
-
_t6 = _context8
|
|
4024
|
+
_context8.p = 37;
|
|
4025
|
+
_t6 = _context8.v;
|
|
3584
4026
|
if (!(_t6.name === 'AbortError')) {
|
|
3585
|
-
_context8.
|
|
4027
|
+
_context8.n = 38;
|
|
3586
4028
|
break;
|
|
3587
4029
|
}
|
|
3588
4030
|
throw new Error('aborted');
|
|
3589
4031
|
case 38:
|
|
3590
4032
|
throw _t6;
|
|
3591
4033
|
case 39:
|
|
3592
|
-
_context8.
|
|
4034
|
+
_context8.p = 39;
|
|
3593
4035
|
if (!streamResponse.unsubscribe) {
|
|
3594
|
-
_context8.
|
|
4036
|
+
_context8.n = 40;
|
|
3595
4037
|
break;
|
|
3596
4038
|
}
|
|
3597
|
-
_context8.
|
|
3598
|
-
return
|
|
4039
|
+
_context8.n = 40;
|
|
4040
|
+
return _awaitAsyncGenerator(streamResponse.unsubscribe());
|
|
3599
4041
|
case 40:
|
|
3600
|
-
return _context8.
|
|
4042
|
+
return _context8.f(39);
|
|
3601
4043
|
case 41:
|
|
3602
|
-
|
|
3603
|
-
return _context8.stop();
|
|
4044
|
+
return _context8.a(2);
|
|
3604
4045
|
}
|
|
3605
|
-
}, _callee8, null, [[
|
|
4046
|
+
}, _callee8, null, [[29, 35], [24,, 25, 27], [9, 15], [7, 18, 19, 20], [4, 22, 23, 28], [2, 37, 39, 41]]);
|
|
3606
4047
|
}))();
|
|
3607
4048
|
}
|
|
3608
4049
|
}]);
|
|
@@ -3611,7 +4052,7 @@ var index = (function (apiToken, options) {
|
|
|
3611
4052
|
return new CubeApi(apiToken, options);
|
|
3612
4053
|
});
|
|
3613
4054
|
// We don't export it for now, because size of builds for cjs/umd users will be affected
|
|
3614
|
-
// export * from './format';
|
|
4055
|
+
// export * from './format.js';
|
|
3615
4056
|
|
|
3616
4057
|
exports.CubeApi = CubeApi;
|
|
3617
4058
|
exports.DEFAULT_GRANULARITY = DEFAULT_GRANULARITY;
|
|
@@ -3648,4 +4089,4 @@ exports.removeEmptyQueryFields = removeEmptyQueryFields;
|
|
|
3648
4089
|
exports.subtractInterval = subtractInterval;
|
|
3649
4090
|
exports.timeSeriesFromCustomInterval = timeSeriesFromCustomInterval;
|
|
3650
4091
|
exports.validateQuery = validateQuery;
|
|
3651
|
-
//# sourceMappingURL=cubejs-client-core.cjs.
|
|
4092
|
+
//# sourceMappingURL=cubejs-client-core.cjs.map
|