builder-util-runtime
Advanced tools
| export declare function hashFile(file: string, algorithm?: string, encoding?: "base64" | "hex", options?: any): Promise<string>; | ||
| //# sourceMappingURL=hash.d.ts.map |
| {"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../src/hash.ts"],"names":[],"mappings":"AAGA,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,SAAW,EAAE,QAAQ,GAAE,QAAQ,GAAG,KAAgB,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,CAalI"} |
+16
| import { createHash } from "crypto"; | ||
| import { createReadStream } from "fs"; | ||
| export function hashFile(file, algorithm = "sha512", encoding = "base64", options) { | ||
| return new Promise((resolve, reject) => { | ||
| const hash = createHash(algorithm); | ||
| hash.on("error", reject).setEncoding(encoding); | ||
| createReadStream(file, { ...options, highWaterMark: 1024 * 1024 /* better to use more memory but hash faster */ }) | ||
| .on("error", reject) | ||
| .on("end", () => { | ||
| hash.end(); | ||
| resolve(hash.read()); | ||
| }) | ||
| .pipe(hash, { end: false }); | ||
| }); | ||
| } | ||
| //# sourceMappingURL=hash.js.map |
| {"version":3,"file":"hash.js","sourceRoot":"","sources":["../src/hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAA;AAErC,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,SAAS,GAAG,QAAQ,EAAE,WAA6B,QAAQ,EAAE,OAAa;IAC/G,OAAO,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC7C,MAAM,IAAI,GAAG,UAAU,CAAC,SAAS,CAAC,CAAA;QAClC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;QAE9C,gBAAgB,CAAC,IAAI,EAAE,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,IAAI,GAAG,IAAI,CAAC,+CAA+C,EAAE,CAAC;aAC/G,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;aACnB,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;YACd,IAAI,CAAC,GAAG,EAAE,CAAA;YACV,OAAO,CAAC,IAAI,CAAC,IAAI,EAAY,CAAC,CAAA;QAChC,CAAC,CAAC;aACD,IAAI,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAA;IAC/B,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { createHash } from \"crypto\"\nimport { createReadStream } from \"fs\"\n\nexport function hashFile(file: string, algorithm = \"sha512\", encoding: \"base64\" | \"hex\" = \"base64\", options?: any): Promise<string> {\n return new Promise<string>((resolve, reject) => {\n const hash = createHash(algorithm)\n hash.on(\"error\", reject).setEncoding(encoding)\n\n createReadStream(file, { ...options, highWaterMark: 1024 * 1024 /* better to use more memory but hash faster */ })\n .on(\"error\", reject)\n .on(\"end\", () => {\n hash.end()\n resolve(hash.read() as string)\n })\n .pipe(hash, { end: false })\n })\n}\n"]} |
+2
-1
| export { BlockMap } from "./blockMapApi.js"; | ||
| export { CancellationError, CancellationToken } from "./CancellationToken.js"; | ||
| export { newError } from "./error.js"; | ||
| export { hashFile } from "./hash.js"; | ||
| export { configureRequestOptions, configureRequestOptionsFromUrl, configureRequestUrl, createHttpError, DigestTransform, DownloadOptions, HttpError, hashSensitiveValue, HttpExecutor, isSensitiveFieldName, parseJson, RequestHeaders, safeGetHeader, safeStringifyJson, } from "./httpExecutor.js"; | ||
| export { MemoLazy } from "./MemoLazy.js"; | ||
| export { ProgressCallbackTransform, ProgressInfo } from "./ProgressCallbackTransform.js"; | ||
| export { AllPublishOptions, BaseS3Options, BitbucketOptions, CustomPublishOptions, GenericServerOptions, getS3LikeProviderBaseUrl, GithubOptions, githubUrl, githubTagPrefix, GitlabOptions, KeygenOptions, PublishConfiguration, PublishProvider, S3Options, SnapStoreOptions, SpacesOptions, GitlabReleaseInfo, GitlabReleaseAsset, } from "./publishOptions.js"; | ||
| export { AllPublishOptions, BaseS3Options, BitbucketOptions, CustomPublishOptions, GenericServerOptions, getS3LikeProviderBaseUrl, getGitlabAuthHeaders, GithubOptions, githubUrl, githubTagPrefix, GitlabOptions, KeygenOptions, PublishConfiguration, PublishProvider, S3Options, SnapStoreOptions, SpacesOptions, GitlabReleaseInfo, GitlabReleaseAsset, } from "./publishOptions.js"; | ||
| export { retry, sleep } from "./retry.js"; | ||
@@ -9,0 +10,0 @@ export { parseDn } from "./rfc2253Parser.js"; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EACL,uBAAuB,EACvB,8BAA8B,EAC9B,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,eAAe,EACf,SAAS,EACT,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,EACpB,SAAS,EACT,cAAc,EACd,aAAa,EACb,iBAAiB,GAClB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,yBAAyB,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AACxF,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,aAAa,EACb,SAAS,EACT,eAAe,EACf,aAAa,EACb,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,qBAAqB,CAA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B,wBAAwB,EACxB,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,eAAe,EACf,aAAa,EACb,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACrI,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAGlG,eAAO,MAAM,+BAA+B,kBAAkB,CAAA;AAE9D,eAAO,MAAM,6BAA6B,eAAe,CAAA"} |
+2
-1
| export { CancellationError, CancellationToken } from "./CancellationToken.js"; | ||
| export { newError } from "./error.js"; | ||
| export { hashFile } from "./hash.js"; | ||
| export { configureRequestOptions, configureRequestOptionsFromUrl, configureRequestUrl, createHttpError, DigestTransform, HttpError, hashSensitiveValue, HttpExecutor, isSensitiveFieldName, parseJson, safeGetHeader, safeStringifyJson, } from "./httpExecutor.js"; | ||
| export { MemoLazy } from "./MemoLazy.js"; | ||
| export { ProgressCallbackTransform } from "./ProgressCallbackTransform.js"; | ||
| export { getS3LikeProviderBaseUrl, githubUrl, githubTagPrefix, } from "./publishOptions.js"; | ||
| export { getS3LikeProviderBaseUrl, getGitlabAuthHeaders, githubUrl, githubTagPrefix, } from "./publishOptions.js"; | ||
| export { retry, sleep } from "./retry.js"; | ||
@@ -8,0 +9,0 @@ export { parseDn } from "./rfc2253Parser.js"; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EACL,uBAAuB,EACvB,8BAA8B,EAC9B,mBAAmB,EACnB,eAAe,EACf,eAAe,EAEf,SAAS,EACT,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,EACpB,SAAS,EAET,aAAa,EACb,iBAAiB,GAClB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,yBAAyB,EAAgB,MAAM,gCAAgC,CAAA;AACxF,OAAO,EAML,wBAAwB,EAExB,SAAS,EACT,eAAe,GAUhB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAE5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAW,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAElG,OAAO;AACP,MAAM,CAAC,MAAM,+BAA+B,GAAG,eAAe,CAAA;AAC9D,WAAW;AACX,MAAM,CAAC,MAAM,6BAA6B,GAAG,YAAY,CAAA","sourcesContent":["export { BlockMap } from \"./blockMapApi.js\"\nexport { CancellationError, CancellationToken } from \"./CancellationToken.js\"\nexport { newError } from \"./error.js\"\nexport {\n configureRequestOptions,\n configureRequestOptionsFromUrl,\n configureRequestUrl,\n createHttpError,\n DigestTransform,\n DownloadOptions,\n HttpError,\n hashSensitiveValue,\n HttpExecutor,\n isSensitiveFieldName,\n parseJson,\n RequestHeaders,\n safeGetHeader,\n safeStringifyJson,\n} from \"./httpExecutor.js\"\nexport { MemoLazy } from \"./MemoLazy.js\"\nexport { ProgressCallbackTransform, ProgressInfo } from \"./ProgressCallbackTransform.js\"\nexport {\n AllPublishOptions,\n BaseS3Options,\n BitbucketOptions,\n CustomPublishOptions,\n GenericServerOptions,\n getS3LikeProviderBaseUrl,\n GithubOptions,\n githubUrl,\n githubTagPrefix,\n GitlabOptions,\n KeygenOptions,\n PublishConfiguration,\n PublishProvider,\n S3Options,\n SnapStoreOptions,\n SpacesOptions,\n GitlabReleaseInfo,\n GitlabReleaseAsset,\n} from \"./publishOptions.js\"\nexport { retry, sleep } from \"./retry.js\"\nexport { parseDn } from \"./rfc2253Parser.js\"\nexport { BlockMapDataHolder, PackageFileInfo, ReleaseNoteInfo, UpdateFileInfo, UpdateInfo, WindowsUpdateInfo } from \"./updateInfo.js\"\nexport { UUID } from \"./uuid.js\"\nexport { parseXml, XElement } from \"./xml.js\"\nexport { isValidKey, mapToObject, asArray, Nullish, deepAssign, objectToArgs } from \"./objects.js\"\n\n// nsis\nexport const CURRENT_APP_INSTALLER_FILE_NAME = \"installer.exe\"\n// nsis-web\nexport const CURRENT_APP_PACKAGE_FILE_NAME = \"package.7z\"\n"]} | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EACL,uBAAuB,EACvB,8BAA8B,EAC9B,mBAAmB,EACnB,eAAe,EACf,eAAe,EAEf,SAAS,EACT,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,EACpB,SAAS,EAET,aAAa,EACb,iBAAiB,GAClB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,yBAAyB,EAAgB,MAAM,gCAAgC,CAAA;AACxF,OAAO,EAML,wBAAwB,EACxB,oBAAoB,EAEpB,SAAS,EACT,eAAe,GAUhB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAE5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAW,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAElG,OAAO;AACP,MAAM,CAAC,MAAM,+BAA+B,GAAG,eAAe,CAAA;AAC9D,WAAW;AACX,MAAM,CAAC,MAAM,6BAA6B,GAAG,YAAY,CAAA","sourcesContent":["export { BlockMap } from \"./blockMapApi.js\"\nexport { CancellationError, CancellationToken } from \"./CancellationToken.js\"\nexport { newError } from \"./error.js\"\nexport { hashFile } from \"./hash.js\"\nexport {\n configureRequestOptions,\n configureRequestOptionsFromUrl,\n configureRequestUrl,\n createHttpError,\n DigestTransform,\n DownloadOptions,\n HttpError,\n hashSensitiveValue,\n HttpExecutor,\n isSensitiveFieldName,\n parseJson,\n RequestHeaders,\n safeGetHeader,\n safeStringifyJson,\n} from \"./httpExecutor.js\"\nexport { MemoLazy } from \"./MemoLazy.js\"\nexport { ProgressCallbackTransform, ProgressInfo } from \"./ProgressCallbackTransform.js\"\nexport {\n AllPublishOptions,\n BaseS3Options,\n BitbucketOptions,\n CustomPublishOptions,\n GenericServerOptions,\n getS3LikeProviderBaseUrl,\n getGitlabAuthHeaders,\n GithubOptions,\n githubUrl,\n githubTagPrefix,\n GitlabOptions,\n KeygenOptions,\n PublishConfiguration,\n PublishProvider,\n S3Options,\n SnapStoreOptions,\n SpacesOptions,\n GitlabReleaseInfo,\n GitlabReleaseAsset,\n} from \"./publishOptions.js\"\nexport { retry, sleep } from \"./retry.js\"\nexport { parseDn } from \"./rfc2253Parser.js\"\nexport { BlockMapDataHolder, PackageFileInfo, ReleaseNoteInfo, UpdateFileInfo, UpdateInfo, WindowsUpdateInfo } from \"./updateInfo.js\"\nexport { UUID } from \"./uuid.js\"\nexport { parseXml, XElement } from \"./xml.js\"\nexport { isValidKey, mapToObject, asArray, Nullish, deepAssign, objectToArgs } from \"./objects.js\"\n\n// nsis\nexport const CURRENT_APP_INSTALLER_FILE_NAME = \"installer.exe\"\n// nsis-web\nexport const CURRENT_APP_PACKAGE_FILE_NAME = \"package.7z\"\n"]} |
@@ -110,2 +110,5 @@ import { OutgoingHttpHeaders } from "http"; | ||
| export declare function githubTagPrefix(options: GithubOptions): string; | ||
| export declare function getGitlabAuthHeaders(token: string | null): { | ||
| [key: string]: string; | ||
| }; | ||
| /** | ||
@@ -112,0 +115,0 @@ * [GitLab](https://docs.gitlab.com/ee/user/project/releases/) options. |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"publishOptions.d.ts","sourceRoot":"","sources":["../src/publishOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAA;AAG1C,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,GAAG,IAAI,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAA;AAGjI,MAAM,MAAM,iBAAiB,GACzB,MAAM,GACN,aAAa,GACb,aAAa,GACb,SAAS,GACT,aAAa,GACb,oBAAoB,GACpB,oBAAoB,GACpB,aAAa,GACb,gBAAgB,GAChB,gBAAgB,CAAA;AAEpB,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,QAAQ,CAAC,QAA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ACH,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;IAE3B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IAErB;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,gBAAgB,EAAE,OAAO,CAAA;IACzB,MAAM,EAAE,kBAAkB,CAAA;CAC3B;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,KAAK,CAAC;QACb,MAAM,EAAE,MAAM,CAAA;QACd,GAAG,EAAE,MAAM,CAAA;KACZ,CAAC,CAAA;IACF,KAAK,EAAE,KAAK,CAAC;QACX,EAAE,EAAE,MAAM,CAAA;QACV,IAAI,EAAE,MAAM,CAAA;QACZ,GAAG,EAAE,MAAM,CAAA;QACX,gBAAgB,EAAE,MAAM,CAAA;QACxB,SAAS,EAAE,MAAM,CAAA;KAClB,CAAC,CAAA;CACH;AAED,wBAAgB,wBAAwB,CAAC,aAAa,EAAE,oBAAoB,UAS3E"} |
@@ -8,2 +8,17 @@ /** @private */ | ||
| } | ||
| export function getGitlabAuthHeaders(token) { | ||
| const headers = {}; | ||
| if (token != null) { | ||
| // If the token starts with "Bearer", it is an OAuth application secret | ||
| // Note that the original gitlab token would not start with "Bearer" | ||
| // it might start with "gloas-", if so user needs to add "Bearer " prefix to the token | ||
| if (token.startsWith("Bearer")) { | ||
| headers.authorization = token; | ||
| } | ||
| else { | ||
| headers["PRIVATE-TOKEN"] = token; | ||
| } | ||
| } | ||
| return headers; | ||
| } | ||
| export function getS3LikeProviderBaseUrl(configuration) { |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CAAC,WAAW,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,MAAM,yBAAyB,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;AACrG,CAAC","sourcesContent":["import { OutgoingHttpHeaders } from \"http\"\nimport { Nullish } from \"./index.js\"\n\nexport type PublishProvider = \"github\" | \"gitlab\" | \"s3\" | \"spaces\" | \"generic\" | \"custom\" | \"snapStore\" | \"keygen\" | \"bitbucket\"\n\n// typescript-json-schema generates only PublishConfiguration if it is specified in the list, so, it is not added here\nexport type AllPublishOptions =\n | string\n | GithubOptions\n | GitlabOptions\n | S3Options\n | SpacesOptions\n | GenericServerOptions\n | CustomPublishOptions\n | KeygenOptions\n | SnapStoreOptions\n | BitbucketOptions\n\nexport interface PublishConfiguration {\n /**\n * The provider.\n */\n readonly provider: PublishProvider\n\n /**\n * @private\n * win-only\n */\n publisherName?: Array<string> | null\n\n /**\n * @private\n * win-only\n */\n readonly updaterCacheDirName?: string | null\n\n /**\n * Whether to publish auto update info files.\n *\n * Auto update relies only on the first provider in the list (you can specify several publishers).\n * Thus, probably, there`s no need to upload the metadata files for the other configured providers. But by default will be uploaded.\n *\n * @default true\n */\n readonly publishAutoUpdate?: boolean\n\n /**\n * Any custom request headers\n */\n readonly requestHeaders?: OutgoingHttpHeaders\n\n /**\n * Request timeout in milliseconds. (Default is 2 minutes; O is ignored)\n *\n * @default 120000\n */\n readonly timeout?: number | null\n}\n\n// https://github.com/electron-userland/electron-builder/issues/3261\nexport interface CustomPublishOptions extends PublishConfiguration {\n /**\n * The provider. Must be `custom`.\n */\n readonly provider: \"custom\"\n\n /**\n * The Provider to provide UpdateInfo regarding available updates. Required\n * to use custom providers with electron-updater.\n */\n updateProvider?: new (options: CustomPublishOptions, updater: any, runtimeOptions: any) => any\n\n [index: string]: any\n}\n\n/**\n * [GitHub](https://help.github.com/articles/about-releases/) options.\n *\n * 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.\n * Define `GH_TOKEN` environment variable.\n */\nexport interface GithubOptions extends PublishConfiguration {\n /**\n * The provider. Must be `github`.\n */\n readonly provider: \"github\"\n\n /**\n * The repository name. [Detected automatically](#github-repository-and-bintray-package).\n */\n readonly repo?: string | null\n\n /**\n * The owner.\n */\n readonly owner?: string | null\n\n /**\n * If defined, sets the prefix of the tag name that comes before the semver number.\n * e.g. \"v\" in \"v1.2.3\" or \"test\" of \"test1.2.3\".\n * @default \"v\"\n */\n readonly tagNamePrefix?: string\n\n /**\n * The host (including the port if need).\n * @default github.com\n */\n readonly host?: string | null\n\n /**\n * The protocol. GitHub Publisher supports only `https`.\n * @default https\n */\n readonly protocol?: \"https\" | \"http\" | null\n\n /**\n * The access token to support auto-update from private github repositories. Never specify it in the configuration files. Only for [setFeedURL](https://www.electron.build/auto-update#appupdatersetfeedurloptions).\n */\n readonly token?: string | null\n\n /**\n * Whether to use private github auto-update provider if `GH_TOKEN` environment variable is defined. See [Private GitHub Update Repo](https://www.electron.build/auto-update#private-github-update-repo).\n */\n readonly private?: boolean | null\n\n /**\n * The channel.\n * @default latest\n */\n readonly channel?: string | null\n\n /**\n * The type of release. By default `draft` release will be created.\n *\n * Also you can set release type using environment variable. If `EP_DRAFT`is set to `true` — `draft`, if `EP_PRE_RELEASE`is set to `true` — `prerelease`.\n * @default draft\n */\n releaseType?: \"draft\" | \"prerelease\" | \"release\" | null\n}\n\n/** @private */\nexport function githubUrl(options: GithubOptions, defaultHost = \"github.com\") {\n return `${options.protocol || \"https\"}://${options.host || defaultHost}`\n}\n\nexport function githubTagPrefix(options: GithubOptions) {\n return options.tagNamePrefix ?? \"v\"\n}\n\n/**\n * [GitLab](https://docs.gitlab.com/ee/user/project/releases/) options.\n *\n * GitLab [personal access token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html) is required for private repositories. You can generate one by going to your GitLab profile settings.\n * Define `GITLAB_TOKEN` environment variable.\n */\nexport interface GitlabOptions extends PublishConfiguration {\n /**\n * The provider. Must be `gitlab`.\n */\n readonly provider: \"gitlab\"\n\n /**\n * The GitLab project ID or path (e.g., \"12345678\" or \"namespace/project\").\n */\n readonly projectId?: string | number | null\n\n /**\n * The GitLab host (including the port if need).\n * @default gitlab.com\n */\n readonly host?: string | null\n\n /**\n * The access token to support auto-update from private GitLab repositories. Never specify it in the configuration files.\n */\n readonly token?: string | null\n\n /**\n * Whether to use `v`-prefixed tag name.\n * @default true\n */\n readonly vPrefixedTagName?: boolean\n\n /**\n * The channel.\n * @default latest\n */\n readonly channel?: string | null\n\n /**\n * Upload target method. Can be \"project_upload\" for GitLab project uploads or \"generic_package\" for GitLab generic packages.\n * @default \"project_upload\"\n */\n readonly uploadTarget?: \"project_upload\" | \"generic_package\" | null\n}\n\n/**\n * Generic (any HTTP(S) server) options.\n * In all publish options [File Macros](https://www.electron.build/file-patterns#file-macros) are supported.\n */\nexport interface GenericServerOptions extends PublishConfiguration {\n /**\n * The provider. Must be `generic`.\n */\n readonly provider: \"generic\"\n\n /**\n * The base url. e.g. `https://bucket_name.s3.amazonaws.com`.\n */\n readonly url: string\n\n /**\n * The channel.\n * @default latest\n */\n readonly channel?: string | null\n\n /**\n * Whether to use multiple range requests for differential update. Defaults to `true` if `url` doesn't contain `s3.amazonaws.com`.\n */\n readonly useMultipleRangeRequest?: boolean\n}\n\n/**\n * Keygen options.\n * https://keygen.sh/\n * Define `KEYGEN_TOKEN` environment variable.\n */\nexport interface KeygenOptions extends PublishConfiguration {\n /**\n * The provider. Must be `keygen`.\n */\n readonly provider: \"keygen\"\n\n /**\n * Keygen host for self-hosted instances\n * @default \"api.keygen.sh\"\n */\n readonly host?: string\n\n /**\n * Keygen account's UUID\n */\n readonly account: string\n\n /**\n * Keygen product's UUID\n */\n readonly product: string\n\n /**\n * The channel.\n * @default stable\n */\n readonly channel?: \"stable\" | \"rc\" | \"beta\" | \"alpha\" | \"dev\" | null\n\n /**\n * The target Platform. Is set programmatically explicitly during publishing.\n */\n readonly platform?: string | null\n}\n\n/**\n * Bitbucket options.\n * https://bitbucket.org/\n * Define `BITBUCKET_TOKEN` environment variable.\n *\n * For converting an app password to a usable token, you can utilize this\n```typescript\nconvertAppPassword(owner: string, appPassword: string) {\n const base64encodedData = Buffer.from(`${owner}:${appPassword.trim()}`).toString(\"base64\")\n return `Basic ${base64encodedData}`\n}\n```\n */\nexport interface BitbucketOptions extends PublishConfiguration {\n /**\n * The provider. Must be `bitbucket`.\n */\n readonly provider: \"bitbucket\"\n\n /**\n * Repository owner\n */\n readonly owner: string\n\n /**\n * The [app password](https://bitbucket.org/account/settings/app-passwords) to support auto-update from private bitbucket repositories.\n */\n readonly token?: string | null\n\n /**\n * The user name to support auto-update from private bitbucket repositories.\n */\n readonly username?: string | null\n\n /**\n * Repository slug/name\n */\n readonly slug: string\n\n /**\n * The channel.\n * @default latest\n */\n readonly channel?: string | null\n}\n\n/**\n * [Snap Store](https://snapcraft.io/) options. To publish directly to Snapcraft, see <a href=\"https://snapcraft.io/docs/snapcraft-authentication\">Snapcraft authentication options</a> for local or CI/CD authentication options.\n */\nexport interface SnapStoreOptions extends PublishConfiguration {\n /**\n * The provider. Must be `snapStore`.\n */\n readonly provider: \"snapStore\"\n\n /**\n * snapcraft repo name\n */\n readonly repo?: string\n\n /**\n * The list of channels the snap would be released.\n * @default [\"edge\"]\n */\n readonly channels?: string | Array<string> | null\n}\n\nexport interface BaseS3Options extends PublishConfiguration {\n /**\n * The update channel.\n * @default latest\n */\n channel?: string | null\n\n /**\n * The directory path.\n * @default /\n */\n readonly path?: string | null\n\n /**\n * The ACL. Set to `null` to not [add](https://github.com/electron-userland/electron-builder/issues/1822).\n *\n * @default public-read\n */\n readonly acl?: \"private\" | \"public-read\" | null\n}\n\n/**\n * [Amazon S3](https://aws.amazon.com/s3/) options.\n * AWS credentials are required, please see [getting your credentials](http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/getting-your-credentials.html).\n * To set credentials 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) directly,\n * or use [~/.aws/credentials](http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-shared.html) file,\n * or use [~/.aws/config](https://docs.aws.amazon.com/sdkref/latest/guide/file-format.html) file. For the last method to work you will also need to define `AWS_SDK_LOAD_CONFIG=1` environment variable.\n *\n * Example configuration:\n *\n```json\n{\n \"build\":\n \"publish\": {\n \"provider\": \"s3\",\n \"bucket\": \"bucket-name\"\n }\n }\n}\n```\n */\nexport interface S3Options extends BaseS3Options {\n /**\n * The provider. Must be `s3`.\n */\n readonly provider: \"s3\"\n\n /**\n * The bucket name.\n */\n readonly bucket: string\n\n /**\n * The region. Is determined and set automatically when publishing.\n */\n region?: string | null\n\n /**\n * The ACL. Set to `null` to not [add](https://github.com/electron-userland/electron-builder/issues/1822).\n *\n * Please see [required permissions for the S3 provider](https://github.com/electron-userland/electron-builder/issues/1618#issuecomment-314679128).\n *\n * @default public-read\n */\n readonly acl?: \"private\" | \"public-read\" | null\n\n /**\n * The type of storage to use for the object.\n * @default STANDARD\n */\n readonly storageClass?: \"STANDARD\" | \"REDUCED_REDUNDANCY\" | \"STANDARD_IA\" | null\n\n /**\n * Server-side encryption algorithm to use for the object.\n */\n readonly encryption?: \"AES256\" | \"aws:kms\" | null\n\n /**\n * The endpoint URI to send requests to. The default endpoint is built from the configured region.\n * The endpoint should be a string like `https://{service}.{region}.amazonaws.com`.\n */\n readonly endpoint?: string | null\n\n /**\n * If set to true, this will enable the s3 accelerated endpoint\n * These endpoints have a particular format of:\n * ${bucketname}.s3-accelerate.amazonaws.com\n */\n readonly accelerate?: boolean\n\n /**\n * When true, force a path-style endpoint to be used where the bucket name is part of the path.\n * [Path-style Access](https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html#path-style-access)\n */\n readonly forcePathStyle?: boolean\n}\n\n/**\n * [DigitalOcean Spaces](https://www.digitalocean.com/community/tutorials/an-introduction-to-digitalocean-spaces) options.\n * Access key is required, define `DO_KEY_ID` and `DO_SECRET_KEY` environment variables.\n */\nexport interface SpacesOptions extends BaseS3Options {\n /**\n * The provider. Must be `spaces`.\n */\n readonly provider: \"spaces\"\n\n /**\n * The space name.\n */\n readonly name: string\n\n /**\n * The region (e.g. `nyc3`).\n */\n readonly region: string\n}\n\nexport interface GitlabReleaseInfo {\n name: string\n tag_name: string\n description: string\n created_at: string\n released_at: string\n upcoming_release: boolean\n assets: GitlabReleaseAsset\n}\n\nexport interface GitlabReleaseAsset {\n count: number\n sources: Array<{\n format: string\n url: string\n }>\n links: Array<{\n id: number\n name: string\n url: string\n direct_asset_url: string\n link_type: string\n }>\n}\n\nexport function getS3LikeProviderBaseUrl(configuration: PublishConfiguration) {\n const provider = configuration.provider\n if (provider === \"s3\") {\n return s3Url(configuration as S3Options)\n }\n if (provider === \"spaces\") {\n return spacesUrl(configuration as SpacesOptions)\n }\n throw new Error(`Not supported provider: ${provider}`)\n}\n\nfunction s3Url(options: S3Options) {\n let url: string\n if (options.accelerate == true) {\n url = `https://${options.bucket}.s3-accelerate.amazonaws.com`\n } else if (options.endpoint != null) {\n url = `${options.endpoint}/${options.bucket}`\n } else if (options.bucket.includes(\".\")) {\n if (options.region == null) {\n throw new Error(`Bucket name \"${options.bucket}\" includes a dot, but S3 region is missing`)\n }\n\n // special case, see http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro\n if (options.region === \"us-east-1\") {\n url = `https://s3.amazonaws.com/${options.bucket}`\n } else {\n url = `https://s3-${options.region}.amazonaws.com/${options.bucket}`\n }\n } else if (options.region === \"cn-north-1\") {\n url = `https://${options.bucket}.s3.${options.region}.amazonaws.com.cn`\n } else {\n url = `https://${options.bucket}.s3.amazonaws.com`\n }\n return appendPath(url, options.path)\n}\n\nfunction appendPath(url: string, p: string | Nullish): string {\n if (p != null && p.length > 0) {\n if (!p.startsWith(\"/\")) {\n url += \"/\"\n }\n url += p\n }\n return url\n}\n\nfunction spacesUrl(options: SpacesOptions) {\n if (options.name == null) {\n throw new Error(`name is missing`)\n }\n if (options.region == null) {\n throw new Error(`region is missing`)\n }\n return appendPath(`https://${options.name}.${options.region}.digitaloceanspaces.com`, options.path)\n}\n"]} | ||
| {"version":3,"file":"publishOptions.js","sourceRoot":"","sources":["../src/publishOptions.ts"],"names":[],"mappings":"AA6IA,eAAe;AACf,MAAM,UAAU,SAAS,CAAC,OAAsB,EAAE,WAAW,GAAG,YAAY;IAC1E,OAAO,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,MAAM,OAAO,CAAC,IAAI,IAAI,WAAW,EAAE,CAAA;AAC1E,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,OAAsB;IACpD,OAAO,OAAO,CAAC,aAAa,IAAI,GAAG,CAAA;AACrC,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,KAAoB;IACvD,MAAM,OAAO,GAA8B,EAAE,CAAA;IAE7C,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QAClB,uEAAuE;QACvE,oEAAoE;QACpE,sFAAsF;QACtF,IAAI,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC/B,OAAO,CAAC,aAAa,GAAG,KAAK,CAAA;QAC/B,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,eAAe,CAAC,GAAG,KAAK,CAAA;QAClC,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC;AAqUD,MAAM,UAAU,wBAAwB,CAAC,aAAmC;IAC1E,MAAM,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAA;IACvC,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC,aAA0B,CAAC,CAAA;IAC1C,CAAC;IACD,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC1B,OAAO,SAAS,CAAC,aAA8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AAE,CAAmB;IAClD,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACvB,GAAG,IAAI,GAAG,CAAA;QACZ,CAAC;QACD,GAAG,IAAI,CAAC,CAAA;IACV,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,SAAS,SAAS,CAAC,OAAsB;IACvC,IAAI,OAAO,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;IACpC,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAA;IACtC,CAAC;IACD,OAAO,UAAU,CAAC,WAAW,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,MAAM,yBAAyB,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;AACrG,CAAC","sourcesContent":["import { OutgoingHttpHeaders } from \"http\"\nimport { Nullish } from \"./index.js\"\n\nexport type PublishProvider = \"github\" | \"gitlab\" | \"s3\" | \"spaces\" | \"generic\" | \"custom\" | \"snapStore\" | \"keygen\" | \"bitbucket\"\n\n// typescript-json-schema generates only PublishConfiguration if it is specified in the list, so, it is not added here\nexport type AllPublishOptions =\n | string\n | GithubOptions\n | GitlabOptions\n | S3Options\n | SpacesOptions\n | GenericServerOptions\n | CustomPublishOptions\n | KeygenOptions\n | SnapStoreOptions\n | BitbucketOptions\n\nexport interface PublishConfiguration {\n /**\n * The provider.\n */\n readonly provider: PublishProvider\n\n /**\n * @private\n * win-only\n */\n publisherName?: Array<string> | null\n\n /**\n * @private\n * win-only\n */\n readonly updaterCacheDirName?: string | null\n\n /**\n * Whether to publish auto update info files.\n *\n * Auto update relies only on the first provider in the list (you can specify several publishers).\n * Thus, probably, there`s no need to upload the metadata files for the other configured providers. But by default will be uploaded.\n *\n * @default true\n */\n readonly publishAutoUpdate?: boolean\n\n /**\n * Any custom request headers\n */\n readonly requestHeaders?: OutgoingHttpHeaders\n\n /**\n * Request timeout in milliseconds. (Default is 2 minutes; O is ignored)\n *\n * @default 120000\n */\n readonly timeout?: number | null\n}\n\n// https://github.com/electron-userland/electron-builder/issues/3261\nexport interface CustomPublishOptions extends PublishConfiguration {\n /**\n * The provider. Must be `custom`.\n */\n readonly provider: \"custom\"\n\n /**\n * The Provider to provide UpdateInfo regarding available updates. Required\n * to use custom providers with electron-updater.\n */\n updateProvider?: new (options: CustomPublishOptions, updater: any, runtimeOptions: any) => any\n\n [index: string]: any\n}\n\n/**\n * [GitHub](https://help.github.com/articles/about-releases/) options.\n *\n * 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.\n * Define `GH_TOKEN` environment variable.\n */\nexport interface GithubOptions extends PublishConfiguration {\n /**\n * The provider. Must be `github`.\n */\n readonly provider: \"github\"\n\n /**\n * The repository name. [Detected automatically](#github-repository-and-bintray-package).\n */\n readonly repo?: string | null\n\n /**\n * The owner.\n */\n readonly owner?: string | null\n\n /**\n * If defined, sets the prefix of the tag name that comes before the semver number.\n * e.g. \"v\" in \"v1.2.3\" or \"test\" of \"test1.2.3\".\n * @default \"v\"\n */\n readonly tagNamePrefix?: string\n\n /**\n * The host (including the port if need).\n * @default github.com\n */\n readonly host?: string | null\n\n /**\n * The protocol. GitHub Publisher supports only `https`.\n * @default https\n */\n readonly protocol?: \"https\" | \"http\" | null\n\n /**\n * The access token to support auto-update from private github repositories. Never specify it in the configuration files. Only for [setFeedURL](https://www.electron.build/auto-update#appupdatersetfeedurloptions).\n */\n readonly token?: string | null\n\n /**\n * Whether to use private github auto-update provider if `GH_TOKEN` environment variable is defined. See [Private GitHub Update Repo](https://www.electron.build/auto-update#private-github-update-repo).\n */\n readonly private?: boolean | null\n\n /**\n * The channel.\n * @default latest\n */\n readonly channel?: string | null\n\n /**\n * The type of release. By default `draft` release will be created.\n *\n * Also you can set release type using environment variable. If `EP_DRAFT`is set to `true` — `draft`, if `EP_PRE_RELEASE`is set to `true` — `prerelease`.\n * @default draft\n */\n releaseType?: \"draft\" | \"prerelease\" | \"release\" | null\n}\n\n/** @private */\nexport function githubUrl(options: GithubOptions, defaultHost = \"github.com\") {\n return `${options.protocol || \"https\"}://${options.host || defaultHost}`\n}\n\nexport function githubTagPrefix(options: GithubOptions) {\n return options.tagNamePrefix ?? \"v\"\n}\n\nexport function getGitlabAuthHeaders(token: string | null): { [key: string]: string } {\n const headers: { [key: string]: string } = {}\n\n if (token != null) {\n // If the token starts with \"Bearer\", it is an OAuth application secret\n // Note that the original gitlab token would not start with \"Bearer\"\n // it might start with \"gloas-\", if so user needs to add \"Bearer \" prefix to the token\n if (token.startsWith(\"Bearer\")) {\n headers.authorization = token\n } else {\n headers[\"PRIVATE-TOKEN\"] = token\n }\n }\n\n return headers\n}\n\n/**\n * [GitLab](https://docs.gitlab.com/ee/user/project/releases/) options.\n *\n * GitLab [personal access token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html) is required for private repositories. You can generate one by going to your GitLab profile settings.\n * Define `GITLAB_TOKEN` environment variable.\n */\nexport interface GitlabOptions extends PublishConfiguration {\n /**\n * The provider. Must be `gitlab`.\n */\n readonly provider: \"gitlab\"\n\n /**\n * The GitLab project ID or path (e.g., \"12345678\" or \"namespace/project\").\n */\n readonly projectId?: string | number | null\n\n /**\n * The GitLab host (including the port if need).\n * @default gitlab.com\n */\n readonly host?: string | null\n\n /**\n * The access token to support auto-update from private GitLab repositories. Never specify it in the configuration files.\n */\n readonly token?: string | null\n\n /**\n * Whether to use `v`-prefixed tag name.\n * @default true\n */\n readonly vPrefixedTagName?: boolean\n\n /**\n * The channel.\n * @default latest\n */\n readonly channel?: string | null\n\n /**\n * Upload target method. Can be \"project_upload\" for GitLab project uploads or \"generic_package\" for GitLab generic packages.\n * @default \"project_upload\"\n */\n readonly uploadTarget?: \"project_upload\" | \"generic_package\" | null\n}\n\n/**\n * Generic (any HTTP(S) server) options.\n * In all publish options [File Macros](https://www.electron.build/file-patterns#file-macros) are supported.\n */\nexport interface GenericServerOptions extends PublishConfiguration {\n /**\n * The provider. Must be `generic`.\n */\n readonly provider: \"generic\"\n\n /**\n * The base url. e.g. `https://bucket_name.s3.amazonaws.com`.\n */\n readonly url: string\n\n /**\n * The channel.\n * @default latest\n */\n readonly channel?: string | null\n\n /**\n * Whether to use multiple range requests for differential update. Defaults to `true` if `url` doesn't contain `s3.amazonaws.com`.\n */\n readonly useMultipleRangeRequest?: boolean\n}\n\n/**\n * Keygen options.\n * https://keygen.sh/\n * Define `KEYGEN_TOKEN` environment variable.\n */\nexport interface KeygenOptions extends PublishConfiguration {\n /**\n * The provider. Must be `keygen`.\n */\n readonly provider: \"keygen\"\n\n /**\n * Keygen host for self-hosted instances\n * @default \"api.keygen.sh\"\n */\n readonly host?: string\n\n /**\n * Keygen account's UUID\n */\n readonly account: string\n\n /**\n * Keygen product's UUID\n */\n readonly product: string\n\n /**\n * The channel.\n * @default stable\n */\n readonly channel?: \"stable\" | \"rc\" | \"beta\" | \"alpha\" | \"dev\" | null\n\n /**\n * The target Platform. Is set programmatically explicitly during publishing.\n */\n readonly platform?: string | null\n}\n\n/**\n * Bitbucket options.\n * https://bitbucket.org/\n * Define `BITBUCKET_TOKEN` environment variable.\n *\n * For converting an app password to a usable token, you can utilize this\n```typescript\nconvertAppPassword(owner: string, appPassword: string) {\n const base64encodedData = Buffer.from(`${owner}:${appPassword.trim()}`).toString(\"base64\")\n return `Basic ${base64encodedData}`\n}\n```\n */\nexport interface BitbucketOptions extends PublishConfiguration {\n /**\n * The provider. Must be `bitbucket`.\n */\n readonly provider: \"bitbucket\"\n\n /**\n * Repository owner\n */\n readonly owner: string\n\n /**\n * The [app password](https://bitbucket.org/account/settings/app-passwords) to support auto-update from private bitbucket repositories.\n */\n readonly token?: string | null\n\n /**\n * The user name to support auto-update from private bitbucket repositories.\n */\n readonly username?: string | null\n\n /**\n * Repository slug/name\n */\n readonly slug: string\n\n /**\n * The channel.\n * @default latest\n */\n readonly channel?: string | null\n}\n\n/**\n * [Snap Store](https://snapcraft.io/) options. To publish directly to Snapcraft, see <a href=\"https://snapcraft.io/docs/snapcraft-authentication\">Snapcraft authentication options</a> for local or CI/CD authentication options.\n */\nexport interface SnapStoreOptions extends PublishConfiguration {\n /**\n * The provider. Must be `snapStore`.\n */\n readonly provider: \"snapStore\"\n\n /**\n * snapcraft repo name\n */\n readonly repo?: string\n\n /**\n * The list of channels the snap would be released.\n * @default [\"edge\"]\n */\n readonly channels?: string | Array<string> | null\n}\n\nexport interface BaseS3Options extends PublishConfiguration {\n /**\n * The update channel.\n * @default latest\n */\n channel?: string | null\n\n /**\n * The directory path.\n * @default /\n */\n readonly path?: string | null\n\n /**\n * The ACL. Set to `null` to not [add](https://github.com/electron-userland/electron-builder/issues/1822).\n *\n * @default public-read\n */\n readonly acl?: \"private\" | \"public-read\" | null\n}\n\n/**\n * [Amazon S3](https://aws.amazon.com/s3/) options.\n * AWS credentials are required, please see [getting your credentials](http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/getting-your-credentials.html).\n * To set credentials 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) directly,\n * or use [~/.aws/credentials](http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-shared.html) file,\n * or use [~/.aws/config](https://docs.aws.amazon.com/sdkref/latest/guide/file-format.html) file. For the last method to work you will also need to define `AWS_SDK_LOAD_CONFIG=1` environment variable.\n *\n * Example configuration:\n *\n```json\n{\n \"build\":\n \"publish\": {\n \"provider\": \"s3\",\n \"bucket\": \"bucket-name\"\n }\n }\n}\n```\n */\nexport interface S3Options extends BaseS3Options {\n /**\n * The provider. Must be `s3`.\n */\n readonly provider: \"s3\"\n\n /**\n * The bucket name.\n */\n readonly bucket: string\n\n /**\n * The region. Is determined and set automatically when publishing.\n */\n region?: string | null\n\n /**\n * The ACL. Set to `null` to not [add](https://github.com/electron-userland/electron-builder/issues/1822).\n *\n * Please see [required permissions for the S3 provider](https://github.com/electron-userland/electron-builder/issues/1618#issuecomment-314679128).\n *\n * @default public-read\n */\n readonly acl?: \"private\" | \"public-read\" | null\n\n /**\n * The type of storage to use for the object.\n * @default STANDARD\n */\n readonly storageClass?: \"STANDARD\" | \"REDUCED_REDUNDANCY\" | \"STANDARD_IA\" | null\n\n /**\n * Server-side encryption algorithm to use for the object.\n */\n readonly encryption?: \"AES256\" | \"aws:kms\" | null\n\n /**\n * The endpoint URI to send requests to. The default endpoint is built from the configured region.\n * The endpoint should be a string like `https://{service}.{region}.amazonaws.com`.\n */\n readonly endpoint?: string | null\n\n /**\n * If set to true, this will enable the s3 accelerated endpoint\n * These endpoints have a particular format of:\n * ${bucketname}.s3-accelerate.amazonaws.com\n */\n readonly accelerate?: boolean\n\n /**\n * When true, force a path-style endpoint to be used where the bucket name is part of the path.\n * [Path-style Access](https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html#path-style-access)\n */\n readonly forcePathStyle?: boolean\n}\n\n/**\n * [DigitalOcean Spaces](https://www.digitalocean.com/community/tutorials/an-introduction-to-digitalocean-spaces) options.\n * Access key is required, define `DO_KEY_ID` and `DO_SECRET_KEY` environment variables.\n */\nexport interface SpacesOptions extends BaseS3Options {\n /**\n * The provider. Must be `spaces`.\n */\n readonly provider: \"spaces\"\n\n /**\n * The space name.\n */\n readonly name: string\n\n /**\n * The region (e.g. `nyc3`).\n */\n readonly region: string\n}\n\nexport interface GitlabReleaseInfo {\n name: string\n tag_name: string\n description: string\n created_at: string\n released_at: string\n upcoming_release: boolean\n assets: GitlabReleaseAsset\n}\n\nexport interface GitlabReleaseAsset {\n count: number\n sources: Array<{\n format: string\n url: string\n }>\n links: Array<{\n id: number\n name: string\n url: string\n direct_asset_url: string\n link_type: string\n }>\n}\n\nexport function getS3LikeProviderBaseUrl(configuration: PublishConfiguration) {\n const provider = configuration.provider\n if (provider === \"s3\") {\n return s3Url(configuration as S3Options)\n }\n if (provider === \"spaces\") {\n return spacesUrl(configuration as SpacesOptions)\n }\n throw new Error(`Not supported provider: ${provider}`)\n}\n\nfunction s3Url(options: S3Options) {\n let url: string\n if (options.accelerate == true) {\n url = `https://${options.bucket}.s3-accelerate.amazonaws.com`\n } else if (options.endpoint != null) {\n url = `${options.endpoint}/${options.bucket}`\n } else if (options.bucket.includes(\".\")) {\n if (options.region == null) {\n throw new Error(`Bucket name \"${options.bucket}\" includes a dot, but S3 region is missing`)\n }\n\n // special case, see http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro\n if (options.region === \"us-east-1\") {\n url = `https://s3.amazonaws.com/${options.bucket}`\n } else {\n url = `https://s3-${options.region}.amazonaws.com/${options.bucket}`\n }\n } else if (options.region === \"cn-north-1\") {\n url = `https://${options.bucket}.s3.${options.region}.amazonaws.com.cn`\n } else {\n url = `https://${options.bucket}.s3.amazonaws.com`\n }\n return appendPath(url, options.path)\n}\n\nfunction appendPath(url: string, p: string | Nullish): string {\n if (p != null && p.length > 0) {\n if (!p.startsWith(\"/\")) {\n url += \"/\"\n }\n url += p\n }\n return url\n}\n\nfunction spacesUrl(options: SpacesOptions) {\n if (options.name == null) {\n throw new Error(`name is missing`)\n }\n if (options.region == null) {\n throw new Error(`region is missing`)\n }\n return appendPath(`https://${options.name}.${options.region}.digitaloceanspaces.com`, options.path)\n}\n"]} |
+1
-1
| { | ||
| "name": "builder-util-runtime", | ||
| "version": "10.0.0-alpha.3", | ||
| "version": "10.0.0-alpha.4", | ||
| "type": "module", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
207673
2.21%67
6.35%1999
1.83%3
50%