builder-util-runtime
Advanced tools
Comparing version 3.4.1 to 3.5.0
export declare const BLOCK_MAP_FILE_NAME = "_blockMap.blockmap"; | ||
export declare const SIGNATURE_HEADER_SIZE: number; | ||
export interface FileChunks { | ||
@@ -15,2 +14,2 @@ checksums: Array<string>; | ||
} | ||
export declare function readBlockMapDataFromAppImage(file: string): Promise<any>; | ||
export declare function readEmbeddedBlockMapData(file: string): Promise<any>; |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.readBlockMapDataFromAppImage = exports.SIGNATURE_HEADER_SIZE = exports.BLOCK_MAP_FILE_NAME = undefined; | ||
exports.readEmbeddedBlockMapData = exports.BLOCK_MAP_FILE_NAME = undefined; | ||
@@ -21,3 +21,3 @@ var _bluebirdLst; | ||
let readBlockMapDataFromAppImage = exports.readBlockMapDataFromAppImage = (() => { | ||
let readEmbeddedBlockMapData = exports.readEmbeddedBlockMapData = (() => { | ||
var _ref = (0, (_bluebirdLst || _load_bluebirdLst()).coroutine)(function* (file) { | ||
@@ -40,3 +40,3 @@ const fd = yield (0, (_fsExtraP || _load_fsExtraP()).open)(file, "r"); | ||
return function readBlockMapDataFromAppImage(_x) { | ||
return function readEmbeddedBlockMapData(_x) { | ||
return _ref.apply(this, arguments); | ||
@@ -56,3 +56,2 @@ }; | ||
const BLOCK_MAP_FILE_NAME = exports.BLOCK_MAP_FILE_NAME = "_blockMap.blockmap"; | ||
const SIGNATURE_HEADER_SIZE = exports.SIGNATURE_HEADER_SIZE = 12 /* signature + 2 bytes version + 4 bytes CRC */ + 20; | ||
const BLOCK_MAP_FILE_NAME = exports.BLOCK_MAP_FILE_NAME = "_blockMap.blockmap"; |
@@ -30,3 +30,3 @@ /// <reference types="node" /> | ||
doApiRequest(options: RequestOptions, cancellationToken: CancellationToken, requestProcessor: (request: REQUEST, reject: (error: Error) => void) => void, redirectCount?: number): Promise<string>; | ||
protected addRedirectHandlers(request: any, options: RequestOptions, cancellationToken: CancellationToken, resolve: (data?: any) => void, reject: (error: Error) => void, redirectCount: number, requestProcessor: (request: REQUEST, reject: (error: Error) => void) => void): void; | ||
protected addRedirectHandlers(request: any, options: RequestOptions, reject: (error: Error) => void, redirectCount: number, handler: (options: RequestOptions) => void): void; | ||
addErrorAndTimeoutHandlers(request: any, reject: (error: Error) => void): void; | ||
@@ -37,3 +37,3 @@ 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; | ||
protected addTimeOutHandler(request: any, callback: (error: Error) => void): void; | ||
protected prepareRedirectUrlOptions(redirectUrl: string, options: RequestOptions): RequestOptions; | ||
static prepareRedirectUrlOptions(redirectUrl: string, options: RequestOptions): RequestOptions; | ||
} | ||
@@ -40,0 +40,0 @@ export declare function configureRequestOptionsFromUrl(url: string, options: RequestOptions): RequestOptions; |
@@ -98,3 +98,5 @@ "use strict"; | ||
this.addErrorAndTimeoutHandlers(request, reject); | ||
this.addRedirectHandlers(request, options, cancellationToken, resolve, reject, redirectCount, requestProcessor); | ||
this.addRedirectHandlers(request, options, reject, redirectCount, options => { | ||
this.doApiRequest(options, cancellationToken, requestProcessor, redirectCount).then(resolve).catch(reject); | ||
}); | ||
requestProcessor(request, reject); | ||
@@ -104,3 +106,4 @@ onCancel(() => request.abort()); | ||
} | ||
addRedirectHandlers(request, options, cancellationToken, resolve, reject, redirectCount, requestProcessor) { | ||
// noinspection JSUnusedLocalSymbols | ||
addRedirectHandlers(request, options, reject, redirectCount, handler) { | ||
// not required for NodeJS | ||
@@ -138,3 +141,3 @@ } | ||
} | ||
this.doApiRequest(this.prepareRedirectUrlOptions(redirectUrl, options), cancellationToken, requestProcessor, redirectCount).then(resolve).catch(reject); | ||
this.doApiRequest(HttpExecutor.prepareRedirectUrlOptions(redirectUrl, options), cancellationToken, requestProcessor, redirectCount).then(resolve).catch(reject); | ||
return; | ||
@@ -168,3 +171,3 @@ } | ||
if (redirectCount < this.maxRedirects) { | ||
this.doDownload(this.prepareRedirectUrlOptions(redirectUrl, requestOptions), destination, redirectCount++, options, callback, onCancel); | ||
this.doDownload(HttpExecutor.prepareRedirectUrlOptions(redirectUrl, requestOptions), destination, redirectCount++, options, callback, onCancel); | ||
} else { | ||
@@ -178,2 +181,5 @@ callback(new Error(`Too many redirects (> ${this.maxRedirects})`)); | ||
this.addErrorAndTimeoutHandlers(request, callback); | ||
this.addRedirectHandlers(request, requestOptions, callback, redirectCount, requestOptions => { | ||
this.doDownload(requestOptions, destination, redirectCount++, options, callback, onCancel); | ||
}); | ||
onCancel(() => request.abort()); | ||
@@ -190,3 +196,3 @@ request.end(); | ||
} | ||
prepareRedirectUrlOptions(redirectUrl, options) { | ||
static prepareRedirectUrlOptions(redirectUrl, options) { | ||
const newOptions = configureRequestOptionsFromUrl(redirectUrl, Object.assign({}, options)); | ||
@@ -226,5 +232,7 @@ if (newOptions.headers != null && newOptions.headers.Authorization != null && newOptions.headers.Authorization.startsWith("token")) { | ||
} | ||
// noinspection JSUnusedGlobalSymbols | ||
get actual() { | ||
return this._actual; | ||
} | ||
// noinspection JSUnusedGlobalSymbols | ||
_transform(chunk, encoding, callback) { | ||
@@ -234,2 +242,3 @@ this.digester.update(chunk); | ||
} | ||
// noinspection JSUnusedGlobalSymbols | ||
_flush(callback) { | ||
@@ -236,0 +245,0 @@ this._actual = this.digester.digest(this.encoding); |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" /> | ||
export interface ReleaseNoteInfo { | ||
@@ -30,13 +29,3 @@ /** | ||
export interface PackageFileInfo extends BlockMapDataHolder { | ||
readonly size: number; | ||
readonly path: string; | ||
/** | ||
* The header size. This number of bytes are downloaded as is and not included into the block map. | ||
*/ | ||
headerSize?: number; | ||
/** | ||
* Used and not null only during build time. | ||
* We cannot pack blockMap file as part of package file because of chicken and egg problem — we build blockMap for package file (and we don't to complicate). | ||
*/ | ||
blockMapData?: Buffer; | ||
} | ||
@@ -43,0 +32,0 @@ export interface UpdateFileInfo extends BlockMapDataHolder { |
{ | ||
"name": "builder-util-runtime", | ||
"version": "3.4.1", | ||
"version": "3.5.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
149983
1665