@cubejs-backend/shared
Advanced tools
Comparing version 0.29.23 to 0.29.28
@@ -6,2 +6,13 @@ # Change Log | ||
## [0.29.28](https://github.com/cube-js/cube.js/compare/v0.29.27...v0.29.28) (2022-02-10) | ||
### Bug Fixes | ||
* **@cubejs-backend/athena-driver:** Batching and export support ([#4039](https://github.com/cube-js/cube.js/issues/4039)) ([108f42a](https://github.com/cube-js/cube.js/commit/108f42afdd58ae0027b1b81730f7ca9e72ab9122)) | ||
## [0.29.23](https://github.com/cube-js/cube.js/compare/v0.29.22...v0.29.23) (2022-01-26) | ||
@@ -8,0 +19,0 @@ |
@@ -0,3 +1,9 @@ | ||
/// <reference types="node" /> | ||
import { Readable } from 'stream'; | ||
export declare function getRealType(value: any): string; | ||
export declare function executeCommand(command: string, args: string | string[], options?: {}): Promise<void>; | ||
export declare function assertNonNullable<T>(name: string, x: T): asserts x is NonNullable<T>; | ||
export declare function checkNonNullable<T>(name: string, x: T): NonNullable<T>; | ||
export declare function streamToArray<T>(stream: Readable): Promise<T[]>; | ||
export declare function oldStreamToArray<T>(stream: NodeJS.ReadableStream): Promise<T[]>; | ||
//# sourceMappingURL=helpers.d.ts.map |
@@ -6,4 +6,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.executeCommand = exports.getRealType = void 0; | ||
exports.oldStreamToArray = exports.streamToArray = exports.checkNonNullable = exports.assertNonNullable = exports.executeCommand = exports.getRealType = void 0; | ||
const cross_spawn_1 = __importDefault(require("cross-spawn")); | ||
const stream_1 = require("stream"); | ||
function getRealType(value) { | ||
@@ -30,2 +31,28 @@ if (value === null) { | ||
exports.executeCommand = executeCommand; | ||
function assertNonNullable(name, x) { | ||
if (x === undefined || x === null) { | ||
throw new Error(`${name} is not defined.`); | ||
} | ||
} | ||
exports.assertNonNullable = assertNonNullable; | ||
// If x is nullable, throws and error, else return x with a nonnulable type. | ||
function checkNonNullable(name, x) { | ||
assertNonNullable(name, x); | ||
return x; | ||
} | ||
exports.checkNonNullable = checkNonNullable; | ||
async function streamToArray(stream) { | ||
const result = []; | ||
for await (const x of stream) { | ||
result.push(x); | ||
} | ||
return result; | ||
} | ||
exports.streamToArray = streamToArray; | ||
// https://nodejs.org/api/stream.html#readablewrapstream | ||
// https://nodejs.org/api/stream.html#compatibility-with-older-nodejs-versions | ||
async function oldStreamToArray(stream) { | ||
return streamToArray(new stream_1.Readable().wrap(stream)); | ||
} | ||
exports.oldStreamToArray = oldStreamToArray; | ||
//# sourceMappingURL=helpers.js.map |
@@ -13,3 +13,4 @@ import { Response } from 'node-fetch'; | ||
export declare function downloadAndExtractFile(url: string, { cwd }: DownloadAndExtractFile): Promise<void>; | ||
export declare function downloadAndGunzip(url: string): Promise<string>; | ||
export {}; | ||
//# sourceMappingURL=http-utils.d.ts.map |
@@ -25,3 +25,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.downloadAndExtractFile = exports.streamWithProgress = void 0; | ||
exports.downloadAndGunzip = exports.downloadAndExtractFile = exports.streamWithProgress = void 0; | ||
const decompress_1 = __importDefault(require("decompress")); | ||
@@ -37,2 +37,3 @@ const node_fetch_1 = __importStar(require("node-fetch")); | ||
const path = __importStar(require("path")); | ||
const zlib_1 = require("zlib"); | ||
const errors_1 = require("./errors"); | ||
@@ -109,2 +110,9 @@ const proxy_1 = require("./proxy"); | ||
exports.downloadAndExtractFile = downloadAndExtractFile; | ||
async function downloadAndGunzip(url) { | ||
const response = await node_fetch_1.default(url); | ||
const gz = await response.arrayBuffer(); | ||
const buffer = await zlib_1.gunzipSync(gz); | ||
return buffer.toString(); | ||
} | ||
exports.downloadAndGunzip = downloadAndGunzip; | ||
//# sourceMappingURL=http-utils.js.map |
{ | ||
"name": "@cubejs-backend/shared", | ||
"version": "0.29.23", | ||
"version": "0.29.28", | ||
"description": "Shared code for Cube.js backend packages", | ||
@@ -71,3 +71,3 @@ "main": "dist/src/index.js", | ||
}, | ||
"gitHead": "da516571691c103ecbd035c3319653766622b083" | ||
"gitHead": "a258a9e046cbf0f4d60c3c0e694a8dc03ccad363" | ||
} |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
146197
1492