@cubejs-client/core 0.35.0 → 0.36.0
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.esm.js +91 -253
- package/dist/cubejs-client-core.esm.js.map +1 -1
- package/dist/cubejs-client-core.js +104 -395
- package/dist/cubejs-client-core.js.map +1 -1
- package/dist/cubejs-client-core.umd.js +104 -395
- package/dist/cubejs-client-core.umd.js.map +1 -1
- package/index.d.ts +4 -1
- package/package.json +2 -2
- package/src/index.js +11 -0
package/index.d.ts
CHANGED
|
@@ -80,6 +80,7 @@ declare module '@cubejs-client/core' {
|
|
|
80
80
|
credentials?: 'omit' | 'same-origin' | 'include';
|
|
81
81
|
parseDateMeasures?: boolean;
|
|
82
82
|
resType?: 'default' | 'compact';
|
|
83
|
+
castNumerics?: boolean;
|
|
83
84
|
};
|
|
84
85
|
|
|
85
86
|
export type LoadMethodOptions = {
|
|
@@ -786,7 +787,9 @@ declare module '@cubejs-client/core' {
|
|
|
786
787
|
| 'afterDate'
|
|
787
788
|
| 'afterOrOnDate';
|
|
788
789
|
|
|
789
|
-
export type
|
|
790
|
+
export type TimeDimensionPredefinedGranularity = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
791
|
+
|
|
792
|
+
export type TimeDimensionGranularity = TimeDimensionPredefinedGranularity | string;
|
|
790
793
|
|
|
791
794
|
export type DateRange = string | [string, string];
|
|
792
795
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cubejs-client/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"engines": {},
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"eslint-plugin-node": "^5.2.1",
|
|
46
46
|
"jest": "^27"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "84c176ca957c71efe09d2049acd863b68532cf88"
|
|
49
49
|
}
|
package/src/index.js
CHANGED
|
@@ -56,6 +56,7 @@ class CubeApi {
|
|
|
56
56
|
});
|
|
57
57
|
this.pollInterval = options.pollInterval || 5;
|
|
58
58
|
this.parseDateMeasures = options.parseDateMeasures;
|
|
59
|
+
this.castNumerics = typeof options.castNumerics === 'boolean' ? options.castNumerics : false;
|
|
59
60
|
|
|
60
61
|
this.updateAuthorizationPromise = null;
|
|
61
62
|
}
|
|
@@ -308,6 +309,11 @@ class CubeApi {
|
|
|
308
309
|
}
|
|
309
310
|
|
|
310
311
|
load(query, options, callback, responseFormat = ResultType.DEFAULT) {
|
|
312
|
+
options = {
|
|
313
|
+
castNumerics: this.castNumerics,
|
|
314
|
+
...options
|
|
315
|
+
};
|
|
316
|
+
|
|
311
317
|
if (responseFormat === ResultType.COMPACT) {
|
|
312
318
|
if (Array.isArray(query)) {
|
|
313
319
|
query = query.map((q) => this.patchQueryInternal(q, ResultType.COMPACT));
|
|
@@ -327,6 +333,11 @@ class CubeApi {
|
|
|
327
333
|
}
|
|
328
334
|
|
|
329
335
|
subscribe(query, options, callback, responseFormat = ResultType.DEFAULT) {
|
|
336
|
+
options = {
|
|
337
|
+
castNumerics: this.castNumerics,
|
|
338
|
+
...options
|
|
339
|
+
};
|
|
340
|
+
|
|
330
341
|
if (responseFormat === ResultType.COMPACT) {
|
|
331
342
|
if (Array.isArray(query)) {
|
|
332
343
|
query = query.map((q) => this.patchQueryInternal(q, ResultType.COMPACT));
|