Skip to main content

Class: GitHubProvider

Extends​

  • BaseGitHubProvider<GithubUpdateInfo>

Constructors​

Constructor​

new GitHubProvider(options, updater, runtimeOptions): GitHubProvider

Parameters​

options​

GithubOptions

updater​

AppUpdater

runtimeOptions​

ProviderRuntimeOptions

Returns​

GitHubProvider

Overrides​

BaseGitHubProvider<GithubUpdateInfo>.constructor

Properties​

baseApiUrl​

protected readonly baseApiUrl: URL

Inherited from​

BaseGitHubProvider.baseApiUrl


baseUrl​

protected readonly baseUrl: URL

Inherited from​

BaseGitHubProvider.baseUrl


executor​

protected readonly executor: ElectronHttpExecutor

Inherited from​

BaseGitHubProvider.executor


options​

protected readonly options: GithubOptions

Inherited from​

BaseGitHubProvider.options

Accessors​

feedBaseUrl​

Get Signature​

get feedBaseUrl(): URL

Required. Base URL of the update feed: download URLs, and the URLs of the provider's own update info requests (e.g. the channel file), on its origin get every request header. Any other origin gets only the headers the app's crossOriginHeaders keeps, with this URL as the hop's from. Anything but a URL fails the update check with ERR_UPDATER_FEED_BASE_URL_NOT_DECLARED.

Returns​

URL

Overrides​

BaseGitHubProvider.feedBaseUrl


fileExtraDownloadHeaders​

Get Signature​

get fileExtraDownloadHeaders(): OutgoingHttpHeaders | null

Returns​

OutgoingHttpHeaders | null

Inherited from​

BaseGitHubProvider.fileExtraDownloadHeaders


isUseMultipleRangeRequest​

Get Signature​

get isUseMultipleRangeRequest(): boolean

Returns​

boolean

Inherited from​

BaseGitHubProvider.isUseMultipleRangeRequest

Methods​

channelFileRequest()​

protected channelFileRequest(url, headers?, cancellationToken?): Promise<string | null>

httpRequest for a channel file (latest*.yml), which is read into memory and parsed before anything verifies it: a response larger than maxUpdateInfoSize fails with ERR_UPDATER_RESPONSE_TOO_LARGE (see ApiRequestOptions.maxResponseSize). Channel files are a few KB. Release feeds and API responses (release listings and lookups) are not limited: their size depends on the release history.

Parameters​

url​

URL

headers?​

OutgoingHttpHeaders | null

cancellationToken?​

CancellationToken

Returns​

Promise<string | null>

Inherited from​

BaseGitHubProvider.channelFileRequest


computeGithubBasePath()​

protected computeGithubBasePath(result): string

Parameters​

result​

string

Returns​

string

Inherited from​

BaseGitHubProvider.computeGithubBasePath


createRequestOptions()​

protected createRequestOptions(url, headers?): ApiRequestOptions

Options for an update info request to url, with the updater's request headers and headers, the provider's own for this request (an Accept, a token). On another origin than feedBaseUrl all of them go through the app's crossOriginHeaders, and the Accept of headers is added back (see ApiRequestOptions.ownHeaders), also on a redirect to another origin.

Parameters​

url​

URL

headers?​

OutgoingHttpHeaders | null

Returns​

ApiRequestOptions

Inherited from​

BaseGitHubProvider.createRequestOptions


getBlockMapFiles()​

getBlockMapFiles(baseUrl, oldVersion, newVersion, oldBlockMapFileBaseUrl?): URL[] | Promise<URL[]>

Parameters​

baseUrl​

URL

oldVersion​

string

newVersion​

string

oldBlockMapFileBaseUrl?​

string | null

Returns​

URL[] | Promise<URL[]>

Inherited from​

BaseGitHubProvider.getBlockMapFiles


getCustomChannelName()​

protected getCustomChannelName(channel): string

Parameters​

channel​

string

Returns​

string

Inherited from​

BaseGitHubProvider.getCustomChannelName


getDefaultChannelName()​

protected getDefaultChannelName(): string

Returns​

string

Inherited from​

BaseGitHubProvider.getDefaultChannelName


getLatestVersion()​

getLatestVersion(): Promise<GithubUpdateInfo>

Returns​

Promise<GithubUpdateInfo>

Overrides​

BaseGitHubProvider.getLatestVersion


httpRequest()​

protected httpRequest(url, headers?, cancellationToken?): Promise<string | null>

Method to perform API request only to resolve update info, but not to download update.

Parameters​

url​

URL

headers?​

OutgoingHttpHeaders | null

cancellationToken?​

CancellationToken

Returns​

Promise<string | null>

Inherited from​

BaseGitHubProvider.httpRequest


resolveFiles()​

resolveFiles(updateInfo): ResolvedUpdateFileInfo[]

Parameters​

updateInfo​

GithubUpdateInfo

Returns​

ResolvedUpdateFileInfo[]

Overrides​

BaseGitHubProvider.resolveFiles


setMaxUpdateInfoSize()​

setMaxUpdateInfoSize(value): void

The largest channel file (latest*.yml) read, in bytes (0 for no limit). Set by AppUpdater before each update check, from autoUpdater.maxUpdateInfoSize or the maxUpdateInfoSize of the publish configuration.

Parameters​

value​

number

Returns​

void

Inherited from​

BaseGitHubProvider.setMaxUpdateInfoSize


setRequestHeaders()​

setRequestHeaders(value): void

Parameters​

value​

OutgoingHttpHeaders | null

Returns​

void

Inherited from​

BaseGitHubProvider.setRequestHeaders