Socket
Socket
Sign inDemoInstall

@cubejs-client/core

Package Overview
Dependencies
Maintainers
3
Versions
223
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cubejs-client/core - npm Package Compare versions

Comparing version 0.33.47 to 0.33.55

50

dist/cubejs-client-core.esm.js

@@ -1501,15 +1501,39 @@ import { v4 } from 'uuid';

loadResponseInternal(response) {
if (response.results.length && response.results[0].query.responseFormat && response.results[0].query.responseFormat === ResultType.COMPACT) {
response.results.forEach((result, j) => {
const data = [];
result.data.dataset.forEach(r => {
const row = {};
result.data.members.forEach((m, i) => {
row[m] = r[i];
loadResponseInternal(response, options = {}) {
if (response.results.length) {
if (options.castNumerics) {
response.results.forEach(result => {
const numericMembers = Object.entries({ ...result.annotation.measures,
...result.annotation.dimensions
}).map(([k, v]) => {
if (v.type === 'number') {
return k;
}
return undefined;
}).filter(Boolean);
result.data = result.data.map(row => {
numericMembers.forEach(key => {
if (row[key] != null) {
row[key] = Number(row[key]);
}
});
return row;
});
data.push(row);
});
response.results[j].data = data;
});
}
if (response.results[0].query.responseFormat && response.results[0].query.responseFormat === ResultType.COMPACT) {
response.results.forEach((result, j) => {
const data = [];
result.data.dataset.forEach(r => {
const row = {};
result.data.members.forEach((m, i) => {
row[m] = r[i];
});
data.push(row);
});
response.results[j].data = data;
});
}
}

@@ -1534,3 +1558,3 @@

queryType: 'multi'
}), this.loadResponseInternal.bind(this), options, callback);
}), response => this.loadResponseInternal(response, options), options, callback);
}

@@ -1550,3 +1574,3 @@

queryType: 'multi'
}), this.loadResponseInternal.bind(this), { ...options,
}), response => this.loadResponseInternal(response, options), { ...options,
subscribe: true

@@ -1553,0 +1577,0 @@ }, callback);

@@ -99,6 +99,10 @@ /**

/**
* A Cube.js API instance. If not provided will be taken from `CubeProvider`
* A Cube API instance. If not provided will be taken from `CubeProvider`
*/
cubejsApi?: CubejsApi;
/**
* If enabled, all members of the 'number' type will be automatically converted to numerical values on the client side
*/
castNumerics?: boolean;
/**
* Function that receives `ProgressResult` on each `Continue wait` message.

@@ -105,0 +109,0 @@ */

{
"name": "@cubejs-client/core",
"version": "0.33.47",
"version": "0.33.55",
"engines": {},

@@ -48,3 +48,3 @@ "repository": {

},
"gitHead": "56fdafca61e135266bc19d2c34497f7affcdb4da"
"gitHead": "7cb9ace521ab59474e54e4f7cbfb98acb91c9008"
}

@@ -260,20 +260,47 @@ import { v4 as uuidv4 } from 'uuid';

*/
loadResponseInternal(response) {
loadResponseInternal(response, options = {}) {
if (
response.results.length &&
response.results[0].query.responseFormat &&
response.results[0].query.responseFormat === ResultType.COMPACT
response.results.length
) {
response.results.forEach((result, j) => {
const data = [];
result.data.dataset.forEach((r) => {
const row = {};
result.data.members.forEach((m, i) => {
row[m] = r[i];
if (options.castNumerics) {
response.results.forEach((result) => {
const numericMembers = Object.entries({
...result.annotation.measures,
...result.annotation.dimensions,
}).map(([k, v]) => {
if (v.type === 'number') {
return k;
}
return undefined;
}).filter(Boolean);
result.data = result.data.map((row) => {
numericMembers.forEach((key) => {
if (row[key] != null) {
row[key] = Number(row[key]);
}
});
return row;
});
data.push(row);
});
response.results[j].data = data;
});
}
if (response.results[0].query.responseFormat &&
response.results[0].query.responseFormat === ResultType.COMPACT) {
response.results.forEach((result, j) => {
const data = [];
result.data.dataset.forEach((r) => {
const row = {};
result.data.members.forEach((m, i) => {
row[m] = r[i];
});
data.push(row);
});
response.results[j].data = data;
});
}
}
return new ResultSet(response, {

@@ -297,3 +324,3 @@ parseDateMeasures: this.parseDateMeasures

}),
this.loadResponseInternal.bind(this),
(response) => this.loadResponseInternal(response, options),
options,

@@ -317,3 +344,3 @@ callback

}),
this.loadResponseInternal.bind(this),
(response) => this.loadResponseInternal(response, options),
{ ...options, subscribe: true },

@@ -320,0 +347,0 @@ callback

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc