electron-updater
Advanced tools
Comparing version 1.4.2 to 1.5.0
@@ -277,2 +277,7 @@ "use strict"; | ||
return new (_GitHubProvider || _load_GitHubProvider()).GitHubProvider(data); | ||
case "s3": | ||
return new (_GenericProvider || _load_GenericProvider()).GenericProvider({ | ||
url: `https://s3.amazonaws.com/${data.bucket || ""}`, | ||
channel: data.channel || "" | ||
}); | ||
case "generic": | ||
@@ -279,0 +284,0 @@ return new (_GenericProvider || _load_GenericProvider()).GenericProvider(data); |
@@ -32,6 +32,12 @@ "use strict"; | ||
var _CancellationToken; | ||
function _load_CancellationToken() { | ||
return _CancellationToken = require("electron-builder-http/out/CancellationToken"); | ||
} | ||
class BintrayProvider extends (_api || _load_api()).Provider { | ||
constructor(configuration) { | ||
super(); | ||
this.client = new (_bintray || _load_bintray()).BintrayClient(configuration); | ||
this.client = new (_bintray || _load_bintray()).BintrayClient(configuration, new (_CancellationToken || _load_CancellationToken()).CancellationToken()); | ||
} | ||
@@ -38,0 +44,0 @@ getLatestVersion() { |
@@ -88,6 +88,7 @@ declare module "electron-updater/out/api" { | ||
import { HttpExecutor, DownloadOptions } from "electron-builder-http" | ||
import { CancellationToken } from "electron-builder-http/out/CancellationToken" | ||
export class ElectronHttpExecutor extends HttpExecutor<Electron.RequestOptions, Electron.ClientRequest> { | ||
download(url: string, destination: string, options?: DownloadOptions | null): Promise<string> | ||
doApiRequest<T>(options: Electron.RequestOptions, requestProcessor: (request: Electron.ClientRequest, reject: (error: Error) => void) => void, redirectCount?: number): Promise<T> | ||
doApiRequest<T>(options: Electron.RequestOptions, cancellationToken: CancellationToken, requestProcessor: (request: Electron.ClientRequest, reject: (error: Error) => void) => void, redirectCount?: number): Promise<T> | ||
protected doRequest(options: any, callback: (response: any) => void): any | ||
@@ -102,3 +103,3 @@ } | ||
import { UpdateCheckResult, FileInfo, UpdaterSignal } from "electron-updater/out/api" | ||
import { BintrayOptions, PublishConfiguration, GithubOptions, GenericServerOptions, VersionInfo } from "electron-builder-http/out/publishOptions" | ||
import { PublishConfiguration, VersionInfo } from "electron-builder-http/out/publishOptions" | ||
@@ -132,5 +133,5 @@ export interface Logger { | ||
private fileInfo | ||
constructor(options: PublishConfiguration | BintrayOptions | GithubOptions | null | undefined) | ||
constructor(options: PublishConfiguration | null | undefined) | ||
getFeedURL(): string | null | undefined | ||
setFeedURL(value: PublishConfiguration | BintrayOptions | GithubOptions | GenericServerOptions | string): void | ||
setFeedURL(value: PublishConfiguration | string): void | ||
checkForUpdates(): Promise<UpdateCheckResult> | ||
@@ -154,3 +155,3 @@ private _checkForUpdates() | ||
import { AppUpdater } from "electron-updater/out/AppUpdater" | ||
import { BintrayOptions, PublishConfiguration, GithubOptions, VersionInfo } from "electron-builder-http/out/publishOptions" | ||
import { PublishConfiguration, VersionInfo } from "electron-builder-http/out/publishOptions" | ||
import BluebirdPromise from "bluebird-lst-c" | ||
@@ -161,3 +162,3 @@ import { FileInfo } from "electron-updater/out/api" | ||
private readonly nativeUpdater | ||
constructor(options?: PublishConfiguration | BintrayOptions | GithubOptions) | ||
constructor(options?: PublishConfiguration) | ||
protected onUpdateAvailable(versionInfo: VersionInfo, fileInfo: FileInfo): void | ||
@@ -171,3 +172,3 @@ protected doDownloadUpdate(versionInfo: VersionInfo, fileInfo: FileInfo): BluebirdPromise<void> | ||
import { FileInfo } from "electron-updater/out/api" | ||
import { BintrayOptions, PublishConfiguration, GithubOptions, VersionInfo } from "electron-builder-http/out/publishOptions" | ||
import { PublishConfiguration, VersionInfo } from "electron-builder-http/out/publishOptions" | ||
import { AppUpdater } from "electron-updater/out/AppUpdater" | ||
@@ -179,3 +180,3 @@ | ||
private quitHandlerAdded | ||
constructor(options?: PublishConfiguration | BintrayOptions | GithubOptions) | ||
constructor(options?: PublishConfiguration) | ||
/** | ||
@@ -182,0 +183,0 @@ * Start downloading update manually. You can use this method if `autoDownload` option is set to `false`. |
@@ -46,2 +46,8 @@ "use strict"; | ||
var _CancellationToken; | ||
function _load_CancellationToken() { | ||
return _CancellationToken = require("electron-builder-http/out/CancellationToken"); | ||
} | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
@@ -67,3 +73,3 @@ | ||
headers: (options == null ? null : options.headers) || undefined | ||
}), destination, 0, options || {}, function (error) { | ||
}), destination, 0, options || { cancellationToken: new (_CancellationToken || _load_CancellationToken()).CancellationToken() }, function (error) { | ||
if (error == null) { | ||
@@ -78,4 +84,4 @@ resolve(destination); | ||
} | ||
doApiRequest(options, requestProcessor) { | ||
let redirectCount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; | ||
doApiRequest(options, cancellationToken, requestProcessor) { | ||
let redirectCount = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; | ||
@@ -89,6 +95,6 @@ if (options.Protocol != null) { | ||
} | ||
return new (_bluebirdLstC2 || _load_bluebirdLstC2()).default((resolve, reject, onCancel) => { | ||
return cancellationToken.trackPromise(new (_bluebirdLstC2 || _load_bluebirdLstC2()).default((resolve, reject, onCancel) => { | ||
const request = (_electron || _load_electron()).net.request(options, response => { | ||
try { | ||
this.handleResponse(response, options, resolve, reject, redirectCount, requestProcessor); | ||
this.handleResponse(response, options, cancellationToken, resolve, reject, redirectCount, requestProcessor); | ||
} catch (e) { | ||
@@ -102,3 +108,3 @@ reject(e); | ||
onCancel(() => request.abort()); | ||
}); | ||
})); | ||
} | ||
@@ -105,0 +111,0 @@ doRequest(options, callback) { |
@@ -36,2 +36,8 @@ "use strict"; | ||
var _CancellationToken; | ||
function _load_CancellationToken() { | ||
return _CancellationToken = require("electron-builder-http/out/CancellationToken"); | ||
} | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
@@ -52,3 +58,3 @@ | ||
const channelFile = (0, (_api || _load_api()).getChannelFilename)(_this.channel); | ||
const pathname = _path.posix.resolve(_this.baseUrl.pathname || "/", `${channelFile}`); | ||
const pathname = _path.posix.resolve(_this.baseUrl.pathname || "/", channelFile); | ||
try { | ||
@@ -64,3 +70,3 @@ const options = { | ||
} | ||
result = yield (0, (_electronBuilderHttp || _load_electronBuilderHttp()).request)(options); | ||
result = yield (0, (_electronBuilderHttp || _load_electronBuilderHttp()).request)(options, new (_CancellationToken || _load_CancellationToken()).CancellationToken()); | ||
} catch (e) { | ||
@@ -67,0 +73,0 @@ if (e instanceof (_electronBuilderHttp || _load_electronBuilderHttp()).HttpError && e.response.statusCode === 404) { |
@@ -34,2 +34,8 @@ "use strict"; | ||
var _CancellationToken; | ||
function _load_CancellationToken() { | ||
return _CancellationToken = require("electron-builder-http/out/CancellationToken"); | ||
} | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
@@ -48,2 +54,3 @@ | ||
let version; | ||
const cancellationToken = new (_CancellationToken || _load_CancellationToken()).CancellationToken(); | ||
try { | ||
@@ -55,3 +62,3 @@ // do not use API to avoid limit | ||
headers: Object.assign({ Accept: "application/json" }, _this.requestHeaders) | ||
}); | ||
}, cancellationToken); | ||
version = releaseInfo.tag_name.startsWith("v") ? releaseInfo.tag_name.substring(1) : releaseInfo.tag_name; | ||
@@ -65,3 +72,3 @@ } catch (e) { | ||
try { | ||
result = yield (0, (_electronBuilderHttp || _load_electronBuilderHttp()).request)({ hostname: "github.com", path: channelFileUrlPath, headers: _this.requestHeaders || undefined }); | ||
result = yield (0, (_electronBuilderHttp || _load_electronBuilderHttp()).request)({ hostname: "github.com", path: channelFileUrlPath, headers: _this.requestHeaders || undefined }, cancellationToken); | ||
} catch (e) { | ||
@@ -68,0 +75,0 @@ if (e instanceof (_electronBuilderHttp || _load_electronBuilderHttp()).HttpError && e.response.statusCode === 404) { |
@@ -54,2 +54,8 @@ "use strict"; | ||
var _CancellationToken; | ||
function _load_CancellationToken() { | ||
return _CancellationToken = require("electron-builder-http/out/CancellationToken"); | ||
} | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
@@ -73,3 +79,5 @@ | ||
skipDirCreation: true, | ||
headers: _this.requestHeaders || undefined | ||
headers: _this.requestHeaders || undefined, | ||
cancellationToken: new (_CancellationToken || _load_CancellationToken()).CancellationToken(), | ||
sha2: fileInfo == null ? null : fileInfo.sha2 | ||
}; | ||
@@ -81,5 +89,2 @@ if (_this.listenerCount((_api || _load_api()).DOWNLOAD_PROGRESS) > 0) { | ||
} | ||
if (fileInfo != null && fileInfo.sha2 != null) { | ||
downloadOptions.sha2 = fileInfo.sha2; | ||
} | ||
const logger = _this.logger; | ||
@@ -86,0 +91,0 @@ const tempDir = yield (0, (_fsExtraP || _load_fsExtraP()).mkdtemp)(`${_path.join((0, (_os || _load_os()).tmpdir)(), "up")}-`); |
{ | ||
"name": "electron-updater", | ||
"version": "1.4.2", | ||
"version": "1.5.0", | ||
"description": "NSIS Auto Updater", | ||
@@ -17,8 +17,8 @@ "main": "out/main.js", | ||
"fs-extra-p": "^3.1.0", | ||
"js-yaml": "^3.7.0", | ||
"js-yaml": "^3.8.1", | ||
"semver": "^5.3.0", | ||
"source-map-support": "^0.4.11", | ||
"electron-builder-http": "12.3.0" | ||
"electron-builder-http": "13.2.0" | ||
}, | ||
"typings": "./out/electron-updater.d.ts" | ||
} |
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
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
102864
1168
+ Addedelectron-builder-http@13.2.0(transitive)
- Removedelectron-builder-http@12.3.0(transitive)
Updatedelectron-builder-http@13.2.0
Updatedjs-yaml@^3.8.1