@cubejs-client/core 0.29.43 → 0.29.53
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/CHANGELOG.md +40 -0
- package/dist/cubejs-client-core.esm.js +28 -14
- package/dist/cubejs-client-core.esm.js.map +1 -1
- package/dist/cubejs-client-core.js +28 -14
- package/dist/cubejs-client-core.js.map +1 -1
- package/dist/cubejs-client-core.umd.js +41 -27
- package/dist/cubejs-client-core.umd.js.map +1 -1
- package/index.d.ts +24 -16
- package/package.json +2 -2
- package/src/HttpTransport.js +9 -2
- package/src/RequestError.js +2 -1
- package/src/index.js +17 -16
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,46 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.29.53](https://github.com/cube-js/cube.js/compare/v0.29.52...v0.29.53) (2022-04-29)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **@cubejs-client/core:** Correct LogicalAndFilter/LogicalOrFilter types: allow any filter types in and / or ([#4343](https://github.com/cube-js/cube.js/issues/4343)) Thanks [@tchell](https://github.com/tchell) ! ([699a2f4](https://github.com/cube-js/cube.js/commit/699a2f45910785fb62d4abbeffff35b0b9708dd5))
|
|
12
|
+
* **@cubejs-client/core:** fix HTTP poll not working if Cube API stops and recovers ([#3506](https://github.com/cube-js/cube.js/issues/3506)) Thanks [@rongfengliang](https://github.com/rongfengliang) ! ([c207c3c](https://github.com/cube-js/cube.js/commit/c207c3c9e22242e8a4c6e01a2f60d10949a75366))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **@cubejs-client/core:** Accept immutable queries ([#4366](https://github.com/cube-js/cube.js/issues/4366)) Thanks [@reify-thomas-smith](https://github.com/reify-thomas-smith)! ([19b1514](https://github.com/cube-js/cube.js/commit/19b1514d75cc47e0f081dd02e8de0a34aed118bb)), closes [#4160](https://github.com/cube-js/cube.js/issues/4160)
|
|
18
|
+
* **client-core:** Add HTTP status code to RequestError ([#4412](https://github.com/cube-js/cube.js/issues/4412)) ([6ec4fdf](https://github.com/cube-js/cube.js/commit/6ec4fdf6921db90bd64cb29f466fa1680f3b7eb4))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## [0.29.51](https://github.com/cube-js/cube.js/compare/v0.29.50...v0.29.51) (2022-04-22)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Features
|
|
28
|
+
|
|
29
|
+
* **query-language:** "startsWith", "endsWith" filters support ([#4128](https://github.com/cube-js/cube.js/issues/4128)) ([e8c72d6](https://github.com/cube-js/cube.js/commit/e8c72d630eecd930a8fd36fc52f9b594a45d59c0))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
## [0.29.48](https://github.com/cube-js/cube.js/compare/v0.29.47...v0.29.48) (2022-04-14)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Features
|
|
39
|
+
|
|
40
|
+
* **query-language:** "total" flag support ([#4134](https://github.com/cube-js/cube.js/issues/4134)) ([51aef5e](https://github.com/cube-js/cube.js/commit/51aef5ede6e9b0c0e0e8749119e98102f168b8ca))
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
6
46
|
## [0.29.43](https://github.com/cube-js/cube.js/compare/v0.29.42...v0.29.43) (2022-04-07)
|
|
7
47
|
|
|
8
48
|
**Note:** Version bump only for package @cubejs-client/core
|
|
@@ -17,8 +17,8 @@ import 'core-js/modules/es.array.is-array.js';
|
|
|
17
17
|
import 'core-js/modules/web.timers.js';
|
|
18
18
|
import 'core-js/modules/es.array.for-each.js';
|
|
19
19
|
import 'core-js/modules/web.dom-collections.for-each.js';
|
|
20
|
-
import 'core-js/modules/es.function.bind.js';
|
|
21
20
|
import 'core-js/modules/es.array.map.js';
|
|
21
|
+
import 'core-js/modules/es.function.bind.js';
|
|
22
22
|
import { v4 } from 'uuid';
|
|
23
23
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
24
24
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
@@ -1563,6 +1563,7 @@ var HttpTransport = /*#__PURE__*/function () {
|
|
|
1563
1563
|
};
|
|
1564
1564
|
|
|
1565
1565
|
return {
|
|
1566
|
+
/* eslint no-unsafe-finally: off */
|
|
1566
1567
|
subscribe: function subscribe(callback) {
|
|
1567
1568
|
var _this2 = this;
|
|
1568
1569
|
|
|
@@ -1572,21 +1573,29 @@ var HttpTransport = /*#__PURE__*/function () {
|
|
|
1572
1573
|
while (1) {
|
|
1573
1574
|
switch (_context.prev = _context.next) {
|
|
1574
1575
|
case 0:
|
|
1575
|
-
|
|
1576
|
+
result = {
|
|
1577
|
+
error: 'network Error' // add default error message
|
|
1578
|
+
|
|
1579
|
+
};
|
|
1580
|
+
_context.prev = 1;
|
|
1581
|
+
_context.next = 4;
|
|
1576
1582
|
return runRequest();
|
|
1577
1583
|
|
|
1578
|
-
case
|
|
1584
|
+
case 4:
|
|
1579
1585
|
result = _context.sent;
|
|
1586
|
+
|
|
1587
|
+
case 5:
|
|
1588
|
+
_context.prev = 5;
|
|
1580
1589
|
return _context.abrupt("return", callback(result, function () {
|
|
1581
1590
|
return _this2.subscribe(callback);
|
|
1582
1591
|
}));
|
|
1583
1592
|
|
|
1584
|
-
case
|
|
1593
|
+
case 8:
|
|
1585
1594
|
case "end":
|
|
1586
1595
|
return _context.stop();
|
|
1587
1596
|
}
|
|
1588
1597
|
}
|
|
1589
|
-
}, _callee);
|
|
1598
|
+
}, _callee, null, [[1,, 5, 8]]);
|
|
1590
1599
|
}))();
|
|
1591
1600
|
}
|
|
1592
1601
|
};
|
|
@@ -1605,13 +1614,14 @@ var RequestError = /*#__PURE__*/function (_Error) {
|
|
|
1605
1614
|
|
|
1606
1615
|
var _super = _createSuper(RequestError);
|
|
1607
1616
|
|
|
1608
|
-
function RequestError(message, response) {
|
|
1617
|
+
function RequestError(message, response, status) {
|
|
1609
1618
|
var _this;
|
|
1610
1619
|
|
|
1611
1620
|
_classCallCheck(this, RequestError);
|
|
1612
1621
|
|
|
1613
1622
|
_this = _super.call(this, message);
|
|
1614
1623
|
_this.response = response;
|
|
1624
|
+
_this.status = status;
|
|
1615
1625
|
return _this;
|
|
1616
1626
|
}
|
|
1617
1627
|
|
|
@@ -1955,7 +1965,7 @@ var CubejsApi = /*#__PURE__*/function () {
|
|
|
1955
1965
|
return requestInstance.unsubscribe();
|
|
1956
1966
|
|
|
1957
1967
|
case 36:
|
|
1958
|
-
error = new RequestError(body.error, body); // TODO error class
|
|
1968
|
+
error = new RequestError(body.error, body, response.status); // TODO error class
|
|
1959
1969
|
|
|
1960
1970
|
if (!callback) {
|
|
1961
1971
|
_context5.next = 41;
|
|
@@ -2165,7 +2175,11 @@ var CubejsApi = /*#__PURE__*/function () {
|
|
|
2165
2175
|
key: "patchQueryInternal",
|
|
2166
2176
|
value: function patchQueryInternal(query, responseFormat) {
|
|
2167
2177
|
if (responseFormat === ResultType.COMPACT && query.responseFormat !== ResultType.COMPACT) {
|
|
2168
|
-
query
|
|
2178
|
+
return _objectSpread(_objectSpread({}, query), {}, {
|
|
2179
|
+
responseFormat: ResultType.COMPACT
|
|
2180
|
+
});
|
|
2181
|
+
} else {
|
|
2182
|
+
return query;
|
|
2169
2183
|
}
|
|
2170
2184
|
}
|
|
2171
2185
|
/**
|
|
@@ -2216,11 +2230,11 @@ var CubejsApi = /*#__PURE__*/function () {
|
|
|
2216
2230
|
|
|
2217
2231
|
if (responseFormat === ResultType.COMPACT) {
|
|
2218
2232
|
if (Array.isArray(query)) {
|
|
2219
|
-
query.
|
|
2220
|
-
_this3.patchQueryInternal(q, ResultType.COMPACT);
|
|
2233
|
+
query = query.map(function (q) {
|
|
2234
|
+
return _this3.patchQueryInternal(q, ResultType.COMPACT);
|
|
2221
2235
|
});
|
|
2222
2236
|
} else {
|
|
2223
|
-
this.patchQueryInternal(query, ResultType.COMPACT);
|
|
2237
|
+
query = this.patchQueryInternal(query, ResultType.COMPACT);
|
|
2224
2238
|
}
|
|
2225
2239
|
}
|
|
2226
2240
|
|
|
@@ -2251,11 +2265,11 @@ var CubejsApi = /*#__PURE__*/function () {
|
|
|
2251
2265
|
|
|
2252
2266
|
if (responseFormat === ResultType.COMPACT) {
|
|
2253
2267
|
if (Array.isArray(query)) {
|
|
2254
|
-
query.
|
|
2255
|
-
_this4.patchQueryInternal(q, ResultType.COMPACT);
|
|
2268
|
+
query = query.map(function (q) {
|
|
2269
|
+
return _this4.patchQueryInternal(q, ResultType.COMPACT);
|
|
2256
2270
|
});
|
|
2257
2271
|
} else {
|
|
2258
|
-
this.patchQueryInternal(query, ResultType.COMPACT);
|
|
2272
|
+
query = this.patchQueryInternal(query, ResultType.COMPACT);
|
|
2259
2273
|
}
|
|
2260
2274
|
}
|
|
2261
2275
|
|