@cubejs-client/core 0.28.35 → 0.28.52
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 +46 -0
- package/dist/cubejs-client-core.esm.js +15 -10
- package/dist/cubejs-client-core.esm.js.map +1 -1
- package/dist/cubejs-client-core.js +15 -10
- package/dist/cubejs-client-core.js.map +1 -1
- package/dist/cubejs-client-core.umd.js +15 -10
- package/dist/cubejs-client-core.umd.js.map +1 -1
- package/index.d.ts +30 -8
- package/package.json +2 -2
- package/src/ResultSet.js +10 -10
- package/src/tests/granularity.test.js +110 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,52 @@
|
|
|
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.28.52](https://github.com/cube-js/cube.js/compare/v0.28.51...v0.28.52) (2021-11-03)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **client-core:** dayjs global locale conflict ([#3606](https://github.com/cube-js/cube.js/issues/3606)) Thanks @LvtLvt! ([de7471d](https://github.com/cube-js/cube.js/commit/de7471dfecd1c49f2e9554c92307d3f7c5b8eb9a))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [0.28.45](https://github.com/cube-js/cube.js/compare/v0.28.44...v0.28.45) (2021-10-19)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @cubejs-client/core
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [0.28.38](https://github.com/cube-js/cube.js/compare/v0.28.37...v0.28.38) (2021-09-20)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* **playground:** member visibility filter ([958fad1](https://github.com/cube-js/cube.js/commit/958fad1661d75fa7f387d837c209e5494ca94af4))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Features
|
|
34
|
+
|
|
35
|
+
* **playground:** time zone for cron expressions ([#3441](https://github.com/cube-js/cube.js/issues/3441)) ([b27f509](https://github.com/cube-js/cube.js/commit/b27f509c690c7970ea5443650a141a1bbfcc947b))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## [0.28.37](https://github.com/cube-js/cube.js/compare/v0.28.36...v0.28.37) (2021-09-17)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Features
|
|
45
|
+
|
|
46
|
+
* **playground:** add rollup button ([#3424](https://github.com/cube-js/cube.js/issues/3424)) ([a5db7f1](https://github.com/cube-js/cube.js/commit/a5db7f1905d1eb50bb6e78b4c6c54e03ba7499c9))
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
6
52
|
## [0.28.35](https://github.com/cube-js/cube.js/compare/v0.28.34...v0.28.35) (2021-09-13)
|
|
7
53
|
|
|
8
54
|
|
|
@@ -366,10 +366,15 @@ var _excluded$1 = ["x"],
|
|
|
366
366
|
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
367
367
|
|
|
368
368
|
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$2(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
369
|
-
dayjs.
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
369
|
+
dayjs.extend(quarterOfYear); // When granularity is week, weekStart Value must be 1. However, since the client can change it globally (https://day.js.org/docs/en/i18n/changing-locale)
|
|
370
|
+
// So the function below has been added.
|
|
371
|
+
|
|
372
|
+
var internalDayjs = function internalDayjs() {
|
|
373
|
+
return dayjs.apply(void 0, arguments).locale(_objectSpread$2(_objectSpread$2({}, en), {}, {
|
|
374
|
+
weekStart: 1
|
|
375
|
+
}));
|
|
376
|
+
};
|
|
377
|
+
|
|
373
378
|
var TIME_SERIES = {
|
|
374
379
|
day: function day(range) {
|
|
375
380
|
return range.by('d').map(function (d) {
|
|
@@ -445,8 +450,8 @@ var dayRange = function dayRange(from, to) {
|
|
|
445
450
|
return {
|
|
446
451
|
by: function by(value) {
|
|
447
452
|
var results = [];
|
|
448
|
-
var start =
|
|
449
|
-
var end =
|
|
453
|
+
var start = internalDayjs(from);
|
|
454
|
+
var end = internalDayjs(to);
|
|
450
455
|
|
|
451
456
|
while (start.isBefore(end) || start.isSame(end)) {
|
|
452
457
|
results.push(start);
|
|
@@ -456,10 +461,10 @@ var dayRange = function dayRange(from, to) {
|
|
|
456
461
|
return results;
|
|
457
462
|
},
|
|
458
463
|
snapTo: function snapTo(value) {
|
|
459
|
-
return dayRange(
|
|
464
|
+
return dayRange(internalDayjs(from).startOf(value), internalDayjs(to).endOf(value));
|
|
460
465
|
},
|
|
461
|
-
start:
|
|
462
|
-
end:
|
|
466
|
+
start: internalDayjs(from),
|
|
467
|
+
end: internalDayjs(to)
|
|
463
468
|
};
|
|
464
469
|
};
|
|
465
470
|
var QUERY_TYPE = {
|
|
@@ -685,7 +690,7 @@ var ResultSet = /*#__PURE__*/function () {
|
|
|
685
690
|
if (!dateRange) {
|
|
686
691
|
var member = ResultSet.timeDimensionMember(timeDimension);
|
|
687
692
|
var dates = pipe(map(function (row) {
|
|
688
|
-
return row[member] &&
|
|
693
|
+
return row[member] && internalDayjs(row[member]);
|
|
689
694
|
}), filter(Boolean))(this.timeDimensionBackwardCompatibleData(resultIndex));
|
|
690
695
|
dateRange = dates.length && [reduce(minBy(function (d) {
|
|
691
696
|
return d.toDate();
|