@cubejs-client/core 0.35.0 → 0.35.23

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/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 = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cubejs-client/core",
3
- "version": "0.35.0",
3
+ "version": "0.35.23",
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": "75bc6c3d96392b7823e714d17ac85ab435e55b05"
48
+ "gitHead": "50ddcfc277feb55a8781129e7b3a5579e00ea334"
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));