builder-util-runtime
Advanced tools
Comparing version 4.2.2 to 4.3.0
@@ -1,2 +0,1 @@ | ||
export declare const BLOCK_MAP_FILE_NAME = "_blockMap.blockmap"; | ||
export interface FileChunks { | ||
@@ -3,0 +2,0 @@ checksums: Array<string>; |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.readEmbeddedBlockMapData = exports.BLOCK_MAP_FILE_NAME = void 0; | ||
exports.readEmbeddedBlockMapData = void 0; | ||
@@ -31,5 +31,2 @@ function _bluebirdLst() { | ||
const BLOCK_MAP_FILE_NAME = "_blockMap.blockmap"; | ||
exports.BLOCK_MAP_FILE_NAME = BLOCK_MAP_FILE_NAME; | ||
let readEmbeddedBlockMapData = (() => { | ||
@@ -36,0 +33,0 @@ var _ref = (0, _bluebirdLst().coroutine)(function* (file) { |
@@ -32,3 +32,3 @@ /// <reference types="node" /> | ||
addErrorAndTimeoutHandlers(request: any, reject: (error: Error) => void): void; | ||
protected handleResponse(response: IncomingMessage, options: RequestOptions, cancellationToken: CancellationToken, resolve: (data?: any) => void, reject: (error: Error) => void, redirectCount: number, requestProcessor: (request: REQUEST, reject: (error: Error) => void) => void): void; | ||
private handleResponse; | ||
abstract doRequest(options: any, callback: (response: any) => void): any; | ||
@@ -35,0 +35,0 @@ protected doDownload(requestOptions: any, destination: string, redirectCount: number, options: DownloadOptions, callback: (error: Error | null) => void, onCancel: (callback: () => void) => void): void; |
@@ -86,2 +86,12 @@ "use strict"; | ||
function _zlib() { | ||
const data = require("zlib"); | ||
_zlib = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -128,3 +138,5 @@ | ||
return this.doApiRequest(options, cancellationToken, it => it.end(encodedData)); | ||
return this.doApiRequest(options, cancellationToken, it => { | ||
it.end(encodedData); | ||
}); | ||
} | ||
@@ -197,6 +209,15 @@ | ||
let stream = response; | ||
if (options.gzip) { | ||
const gUnzip = (0, _zlib().createGunzip)(); | ||
gUnzip.on("error", reject); | ||
response.pipe(gUnzip); | ||
stream = gUnzip; | ||
} | ||
stream.setEncoding("utf8"); | ||
let data = ""; | ||
response.setEncoding("utf8"); | ||
response.on("data", chunk => data += chunk); | ||
response.on("end", () => { | ||
stream.on("data", chunk => data += chunk); | ||
stream.on("end", () => { | ||
try { | ||
@@ -256,8 +277,9 @@ if (response.statusCode != null && response.statusCode >= 400) { | ||
const newOptions = configureRequestOptionsFromUrl(redirectUrl, Object.assign({}, options)); | ||
const headers = newOptions.headers; | ||
if (newOptions.headers != null && newOptions.headers.Authorization != null && newOptions.headers.Authorization.startsWith("token")) { | ||
if (headers != null && headers.authorization != null && headers.authorization.startsWith("token")) { | ||
const parsedNewUrl = new (_url().URL)(redirectUrl); | ||
if (parsedNewUrl.hostname.endsWith(".amazonaws.com")) { | ||
delete newOptions.headers.Authorization; | ||
delete headers.authorization; | ||
} | ||
@@ -264,0 +286,0 @@ } |
@@ -9,3 +9,4 @@ export { CancellationToken, CancellationError } from "./CancellationToken"; | ||
export { parseXml, XElement } from "./xml"; | ||
export { BlockMap } from "./blockMapApi"; | ||
export declare function asArray<T>(v: null | undefined | T | Array<T>): Array<T>; | ||
export declare function newError(message: string, code: string): Error; |
{ | ||
"name": "builder-util-runtime", | ||
"version": "4.2.2", | ||
"version": "4.3.0", | ||
"main": "out/index.js", | ||
@@ -5,0 +5,0 @@ "author": "Vladimir Krivosheev", |
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
139275
1789