Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cubejs-backend/api-gateway

Package Overview
Dependencies
Maintainers
1
Versions
587
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cubejs-backend/api-gateway - npm Package Compare versions

Comparing version 0.0.20 to 0.0.26

23

index.js
const jwt = require('jsonwebtoken');
const R = require('ramda');
const Joi = require('joi');
const moment = require('moment');

@@ -60,8 +61,17 @@ class UserError extends Error {}

const transformValue = (value) => value && value.value ? value.value : value; // TODO move to sql adapter
const transformValue = (value, type) => {
if (value && type === 'time') {
return moment(value).format(moment.HTML5_FMT.DATETIME_LOCAL_MS);
}
return value && value.value ? value.value : value // TODO move to sql adapter
};
const transformData = (aliasToMemberNameMap, data) => {
const transformData = (aliasToMemberNameMap, annotation, data) => {
return data.map(r => R.pipe(
R.toPairs,
R.map(p => [aliasToMemberNameMap[p[0]], transformValue(p[1])]),
R.map(p => [
aliasToMemberNameMap[p[0]],
transformValue(p[1], annotation[aliasToMemberNameMap[p[0]]].type)
]),
R.fromPairs

@@ -206,5 +216,10 @@ )(r));

});
const flattenAnnotation = {
...annotation.measures,
...annotation.dimensions,
...annotation.timeDimensions
};
res.json({
query: normalizedQuery,
data: transformData(aliasToMemberNameMap, response.data),
data: transformData(aliasToMemberNameMap, flattenAnnotation, response.data),
annotation

@@ -211,0 +226,0 @@ });

3

package.json

@@ -5,3 +5,3 @@ {

"author": "Statsbot, Inc.",
"version": "0.0.20",
"version": "0.0.26",
"engines": {

@@ -17,2 +17,3 @@ "node": ">=8.11.1"

"jsonwebtoken": "^8.3.0",
"moment": "^2.24.0",
"ramda": "^0.25.0"

@@ -19,0 +20,0 @@ },

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc