New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@cubejs-backend/shared

Package Overview
Dependencies
Maintainers
2
Versions
212
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cubejs-backend/shared - npm Package Compare versions

Comparing version 0.26.79 to 0.26.81

12

CHANGELOG.md

@@ -6,2 +6,14 @@ # Change Log

## [0.26.81](https://github.com/cube-js/cube.js/compare/v0.26.80...v0.26.81) (2021-04-07)
### Features
* Dev mode and live preview ([#2440](https://github.com/cube-js/cube.js/issues/2440)) ([1a7cde8](https://github.com/cube-js/cube.js/commit/1a7cde816ee231ea00d1a952f5000dcc5a8c0ca4))
* Introduce databricks-jdbc-driver ([bb0b31f](https://github.com/cube-js/cube.js/commit/bb0b31fb333f2aa379f11f6733c4efc17ec12dde))
## [0.26.79](https://github.com/cube-js/cube.js/compare/v0.26.78...v0.26.79) (2021-04-06)

@@ -8,0 +20,0 @@

37

dist/src/env.d.ts

@@ -6,40 +6,7 @@ export declare class InvalidConfiguration extends Error {

export declare function asPortNumber(input: number, envName: string): number;
declare const variables: {
devMode: () => boolean;
port: () => string | number;
tls: () => boolean;
webSockets: () => boolean;
refreshTimer: () => number | boolean;
scheduledRefresh: () => boolean | undefined;
gracefulShutdown: () => number | undefined;
dockerImageVersion: () => string | undefined;
internalExceptions: () => "false" | "exit" | "log";
preAggregationsSchema: () => string | undefined;
dbPollTimeout: () => number;
dbPollMaxInterval: () => number;
bigQueryLocation: () => string | undefined;
redisPoolMin: () => number;
redisPoolMax: () => number;
redisUseIORedis: () => boolean;
redisUrl: () => string | undefined;
dbSsl: () => boolean;
dbSslRejectUnauthorized: () => boolean;
nodeEnv: () => string | undefined;
cacheAndQueueDriver: () => string | undefined;
redisPassword: () => string | undefined;
redisTls: () => boolean;
jwkKey: () => string | undefined;
jwkUrl: () => string | undefined;
jwtAlgorithms: () => string[] | undefined;
jwtAudience: () => string | undefined;
jwtIssuer: () => string[] | undefined;
jwtSubject: () => string | undefined;
jwtClaimsNamespace: () => string | undefined;
playgroundAuthSecret: () => string | undefined;
agentFrameSize: () => number;
};
declare const variables: Record<string, (...args: any) => any>;
declare type Vars = typeof variables;
export declare function getEnv<T extends keyof Vars>(key: T): ReturnType<Vars[T]>;
export declare function getEnv<T extends keyof Vars>(key: T, opts?: Parameters<Vars[T]>): ReturnType<Vars[T]>;
export declare function isDockerImage(): boolean;
export {};
//# sourceMappingURL=env.d.ts.map

@@ -94,5 +94,15 @@ "use strict";

},
// Common db options
dbName: ({ required }) => env_var_1.get('CUBEJS_DB_NAME')
.required(required)
.asString(),
// BigQuery Driver
bigQueryLocation: () => env_var_1.get('CUBEJS_DB_BQ_LOCATION')
.asString(),
// Databricks
databrickUrl: () => env_var_1.get('CUBEJS_DB_DATABRICKS_URL')
.required()
.asString(),
databrickAcceptPolicy: () => env_var_1.get('CUBEJS_DB_DATABRICKS_ACCEPT_POLICY')
.asString(),
// Redis

@@ -144,6 +154,9 @@ redisPoolMin: () => env_var_1.get('CUBEJS_REDIS_POOL_MIN')

.asInt(),
livePreview: () => env_var_1.get('CUBEJS_LIVE_PREVIEW')
.default('false')
.asBoolStrict(),
};
function getEnv(key) {
function getEnv(key, opts) {
if (key in variables) {
return variables[key]();
return variables[key](opts);
}

@@ -150,0 +163,0 @@ throw new Error(`Unsupported env variable: "${key}"`);

@@ -1,3 +0,1 @@

/// <reference types="node" />
import fs from 'fs';
import { Response } from 'node-fetch';

@@ -9,3 +7,3 @@ declare type ByteProgressCallback = (info: {

}) => void;
export declare function streamWithProgress(response: Response, writer: fs.WriteStream, progressCallback: ByteProgressCallback): Promise<void>;
export declare function streamWithProgress(response: Response, progressCallback: ByteProgressCallback): Promise<string>;
declare type DownloadAndExtractFile = {

@@ -12,0 +10,0 @@ showProgress: boolean;

@@ -26,3 +26,3 @@ "use strict";

exports.downloadAndExtractFile = exports.streamWithProgress = void 0;
const tar_1 = __importDefault(require("tar"));
const decompress_1 = __importDefault(require("decompress"));
const node_fetch_1 = __importStar(require("node-fetch"));

@@ -33,4 +33,8 @@ const bytes_1 = __importDefault(require("bytes"));

const fs_extra_1 = require("fs-extra");
const fs_1 = __importDefault(require("fs"));
const os = __importStar(require("os"));
const crypto_1 = __importDefault(require("crypto"));
const path = __importStar(require("path"));
const errors_1 = require("./errors");
async function streamWithProgress(response, writer, progressCallback) {
async function streamWithProgress(response, progressCallback) {
const total = parseInt(response.headers.get('Content-Length') || '0', 10);

@@ -52,2 +56,4 @@ const startedAt = Date.now();

});
const saveFilePath = path.join(os.tmpdir(), crypto_1.default.randomBytes(16).toString('hex'));
const writer = fs_1.default.createWriteStream(saveFilePath);
response.body.pipe(writer);

@@ -61,3 +67,3 @@ response.body.on('data', (chunk) => {

writer.on('finish', () => {
resolve();
resolve(saveFilePath);
});

@@ -78,3 +84,3 @@ });

const bar = new cli_progress_1.SingleBar({
format: 'Downloading from GitHub [{bar}] {percentage}% | Speed: {speed}',
format: 'Downloading [{bar}] {percentage}% | Speed: {speed}',
});

@@ -88,6 +94,3 @@ bar.start(100, 0);

}
const writer = tar_1.default.x({
cwd,
});
await streamWithProgress(response, writer, ({ progress, speed, eta }) => {
const savedFilePath = await streamWithProgress(response, ({ progress, speed, eta }) => {
bar.update(progress, {

@@ -98,2 +101,11 @@ speed,

});
await decompress_1.default(savedFilePath, cwd, {
strip: 1,
});
try {
fs_1.default.unlinkSync(savedFilePath);
}
catch (e) {
errors_1.internalExceptions(e);
}
bar.stop();

@@ -100,0 +112,0 @@ }

{
"name": "@cubejs-backend/shared",
"version": "0.26.79",
"version": "0.26.81",
"description": "Shared code for Cube.js backend packages",

@@ -28,5 +28,5 @@ "main": "dist/src/index.js",

"@types/cli-progress": "^3.9.1",
"@types/decompress": "^4.2.3",
"@types/jest": "^26.0.16",
"@types/node-fetch": "^2.5.8",
"@types/tar": "^4.0.4",
"@types/throttle-debounce": "^2.1.0",

@@ -40,6 +40,6 @@ "jest": "^26.6.3",

"cli-progress": "^3.9.0",
"decompress": "^4.2.1",
"env-var": "^6.3.0",
"fs-extra": "^9.1.0",
"node-fetch": "^2.6.1",
"tar": "^6.1.0",
"throttle-debounce": "^3.0.1"

@@ -65,3 +65,3 @@ },

},
"gitHead": "786fa29d96cc289f9f51b18dd926b5a5c4813956"
"gitHead": "6a4c7f538a48bf37bb1df02cdc1308574863ce9b"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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