UNPKG

electron-builder-http

Version:

Part of [electron-builder](https://github.com/electron-userland/electron-builder).

143 lines (142 loc) 5.13 kB
export declare type PublishProvider = "github" | "bintray" | "s3" | "generic"; export declare type AllPublishOptions = string | GithubOptions | S3Options | GenericServerOptions | BintrayOptions; export declare type Publish = AllPublishOptions | Array<AllPublishOptions> | null; export interface PublishConfiguration { /** * The provider. */ readonly provider: PublishProvider; /** * @private */ readonly publisherName?: Array<string> | null; } /** * GitHub options. * * GitHub [personal access token](https://help.github.com/articles/creating-an-access-token-for-command-line-use/) is required. You can generate by going to [https://github.com/settings/tokens/new](https://github.com/settings/tokens/new). The access token should have the repo scope/permission. * Define `GH_TOKEN` environment variable. */ export interface GithubOptions extends PublishConfiguration { /** * The repository name. [Detected automatically](#github-repository-and-bintray-package). */ readonly repo?: string | null; /** * The owner. */ readonly owner?: string | null; /** * Whether to use `v`-prefixed tag name. * @default true */ readonly vPrefixedTagName?: boolean; /** * The host (including the port if need). * @default github.com */ readonly host?: string | null; /** * The protocol. GitHub Publisher supports only `https`. * @default https */ readonly protocol?: "https" | "http" | null; /** * The access token to support auto-update from private github repositories. Never specify it in the configuration files. Only for [setFeedURL](/auto-update.md#appupdatersetfeedurloptions). */ readonly token?: string | null; /** * Whether to use private github auto-update provider if `GH_TOKEN` environment variable is set. See [Private GitHub Update Repo](/auto-update.md#private-github-update-repo). */ readonly private?: boolean | null; } /** @private */ export declare function githubUrl(options: GithubOptions, defaultHost?: string): string; /** * Generic (any HTTP(S) server) options. */ export interface GenericServerOptions extends PublishConfiguration { /** * The base url. e.g. `https://bucket_name.s3.amazonaws.com`. You can use `${os}` (expanded to `mac`, `linux` or `win` according to target platform) and `${arch}` macros. */ readonly url: string; /** * The channel. * @default latest */ readonly channel?: string | null; } /** * Amazon S3 options. `https` must be used, so, if you use direct Amazon S3 endpoints, format `https://s3.amazonaws.com/bucket_name` [must be used](http://stackoverflow.com/a/11203685/1910191). And do not forget to make files/directories public. * * AWS credentials are required, please see [getting your credentials](http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/getting-your-credentials.html). * Define `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` [environment variables](http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-environment.html). * Or in the [~/.aws/credentials](http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-shared.html). */ export interface S3Options extends PublishConfiguration { /** * The bucket name. */ readonly bucket: string; /** * The directory path. * @default / */ readonly path?: string | null; /** * The region. Is determined and set automatically when publishing. */ readonly region?: string | null; /** * The channel. * @default latest */ readonly channel?: string | null; /** * The ACL. Set to `null` to not [add](https://github.com/electron-userland/electron-builder/issues/1822). * * Please see [required permissions for the S3 provider](https://github.com/electron-userland/electron-builder/issues/1618#issuecomment-314679128). * * @default public-read */ readonly acl?: "private" | "public-read" | null; /** * The type of storage to use for the object. * @default STANDARD */ readonly storageClass?: "STANDARD" | "REDUCED_REDUNDANCY" | "STANDARD_IA" | null; } /** @private */ export declare function s3Url(options: S3Options): string; /** * Bintray options. */ export interface BintrayOptions extends PublishConfiguration { /** * The Bintray package name. */ readonly package?: string | null; /** * The Bintray repository name. * @default generic */ readonly repo?: string | null; /** * The owner. */ readonly owner?: string | null; /** * The Bintray component (Debian only). */ readonly component?: string | null; /** * The Bintray distribution (Debian only). * @default stable */ readonly distribution?: string | null; /** * The Bintray user account. Used in cases where the owner is an organization. */ readonly user?: string | null; readonly token?: string | null; }