app-builder-lib 25.1.1 → 25.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +3 -0
  2. package/out/configuration.d.ts +1 -1
  3. package/out/configuration.js.map +1 -1
  4. package/out/core.d.ts +1 -1
  5. package/out/core.js.map +1 -1
  6. package/out/errorMessages.d.ts +1 -1
  7. package/out/errorMessages.js +1 -1
  8. package/out/errorMessages.js.map +1 -1
  9. package/out/index.d.ts +1 -1
  10. package/out/index.js.map +1 -1
  11. package/out/options/AppXOptions.d.ts +1 -1
  12. package/out/options/AppXOptions.js.map +1 -1
  13. package/out/options/FileAssociation.d.ts +1 -1
  14. package/out/options/FileAssociation.js.map +1 -1
  15. package/out/options/PlatformSpecificBuildOptions.d.ts +71 -14
  16. package/out/options/PlatformSpecificBuildOptions.js.map +1 -1
  17. package/out/options/SnapOptions.d.ts +1 -1
  18. package/out/options/SnapOptions.js.map +1 -1
  19. package/out/options/linuxOptions.d.ts +5 -5
  20. package/out/options/linuxOptions.js.map +1 -1
  21. package/out/options/macOptions.d.ts +4 -4
  22. package/out/options/macOptions.js.map +1 -1
  23. package/out/options/pkgOptions.d.ts +1 -1
  24. package/out/options/pkgOptions.js.map +1 -1
  25. package/out/options/winOptions.d.ts +5 -5
  26. package/out/options/winOptions.js.map +1 -1
  27. package/out/packager.d.ts +1 -1
  28. package/out/publish/BitbucketPublisher.js +1 -1
  29. package/out/publish/BitbucketPublisher.js.map +1 -1
  30. package/out/publish/KeygenPublisher.js +1 -1
  31. package/out/publish/KeygenPublisher.js.map +1 -1
  32. package/out/publish/PublishManager.js +1 -1
  33. package/out/publish/PublishManager.js.map +1 -1
  34. package/out/publish/s3/spacesPublisher.js +4 -4
  35. package/out/publish/s3/spacesPublisher.js.map +1 -1
  36. package/out/targets/FpmTarget.js +1 -1
  37. package/out/targets/FpmTarget.js.map +1 -1
  38. package/out/targets/LinuxTargetHelper.js +1 -1
  39. package/out/targets/LinuxTargetHelper.js.map +1 -1
  40. package/out/targets/MsiWrappedTarget.js.map +1 -1
  41. package/out/targets/nsis/NsisTarget.js +5 -4
  42. package/out/targets/nsis/NsisTarget.js.map +1 -1
  43. package/out/targets/nsis/nsisOptions.d.ts +9 -9
  44. package/out/targets/nsis/nsisOptions.js.map +1 -1
  45. package/out/util/appFileCopier.js +10 -11
  46. package/out/util/appFileCopier.js.map +1 -1
  47. package/out/util/config/config.js +2 -2
  48. package/out/util/config/config.js.map +1 -1
  49. package/out/version.d.ts +1 -1
  50. package/out/version.js +1 -1
  51. package/out/version.js.map +1 -1
  52. package/package.json +10 -10
  53. package/scheme.json +109 -94
  54. package/templates/nsis/README.md +2 -2
@@ -15,8 +15,8 @@ export interface MacConfiguration extends PlatformSpecificBuildOptions {
15
15
  */
16
16
  readonly target?: Array<MacOsTargetName | TargetConfiguration> | MacOsTargetName | TargetConfiguration | null;
17
17
  /**
18
- * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](/code-signing) instead of specifying this option.
19
- * MAS installer identity is specified in the [mas](/configuration/mas).
18
+ * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](./code-signing.md) instead of specifying this option.
19
+ * MAS installer identity is specified in the [mas](./mas.md).
20
20
  */
21
21
  readonly identity?: string | null;
22
22
  /**
@@ -26,7 +26,7 @@ export interface MacConfiguration extends PlatformSpecificBuildOptions {
26
26
  readonly icon?: string | null;
27
27
  /**
28
28
  * The path to entitlements file for signing the app. `build/entitlements.mac.plist` will be used if exists (it is a recommended way to set).
29
- * MAS entitlements is specified in the [mas](/configuration/mas).
29
+ * MAS entitlements is specified in the [mas](./mas.md).
30
30
  * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.
31
31
  * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.
32
32
  * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.
@@ -215,7 +215,7 @@ export interface DmgOptions extends TargetSpecificOptions {
215
215
  */
216
216
  backgroundColor?: string | null;
217
217
  /**
218
- * The path to DMG icon (volume icon), which will be shown when mounted, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.
218
+ * The path to DMG icon (volume icon), which will be shown when mounted, relative to the [build resources](./configuration.md#MetadataDirectories-buildResources) or to the project directory.
219
219
  * Defaults to the application icon (`build/icon.icns`).
220
220
  */
221
221
  icon?: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"macOptions.js","sourceRoot":"","sources":["../../src/options/macOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { PlatformSpecificBuildOptions, TargetConfiguration, TargetSpecificOptions } from \"../index\"\nimport { CustomMacSign } from \"../macPackager\"\n\nexport type MacOsTargetName = \"default\" | \"dmg\" | \"mas\" | \"mas-dev\" | \"pkg\" | \"7z\" | \"zip\" | \"tar.xz\" | \"tar.lz\" | \"tar.gz\" | \"tar.bz2\" | \"dir\"\n\nexport interface MacConfiguration extends PlatformSpecificBuildOptions {\n /**\n * The application category type, as shown in the Finder via *View -> Arrange by Application Category* when viewing the Applications directory.\n *\n * For example, `\"category\": \"public.app-category.developer-tools\"` will set the application category to *Developer Tools*.\n *\n * Valid values are listed in [Apple's documentation](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW8).\n */\n readonly category?: string | null\n\n /**\n * The target package type: list of `default`, `dmg`, `mas`, `mas-dev`, `pkg`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`. Defaults to `default` (`dmg` and `zip` for Squirrel.Mac). Note: Squirrel.Mac auto update mechanism requires both `dmg` and `zip` to be enabled, even when only `dmg` is used. Disabling `zip` will break auto update in `dmg` packages.\n */\n readonly target?: Array<MacOsTargetName | TargetConfiguration> | MacOsTargetName | TargetConfiguration | null\n\n /**\n * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](/code-signing) instead of specifying this option.\n * MAS installer identity is specified in the [mas](/configuration/mas).\n */\n readonly identity?: string | null\n\n /**\n * The path to application icon.\n * @default build/icon.icns\n */\n readonly icon?: string | null\n\n /**\n * The path to entitlements file for signing the app. `build/entitlements.mac.plist` will be used if exists (it is a recommended way to set).\n * MAS entitlements is specified in the [mas](/configuration/mas).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\n * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mac.inherit.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n *\n * This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Path to login helper entitlement file.\n * When using App Sandbox, the the `com.apple.security.inherit` key that is normally in the inherited entitlements cannot be inherited since the login helper is a standalone executable.\n * Defaults to the value provided for `entitlements`. This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsLoginHelper?: string | null\n\n /**\n * The path to the provisioning profile to use when signing, absolute or relative to the app root.\n */\n readonly provisioningProfile?: string | null\n\n /**\n * The `CFBundleVersion`. Do not use it unless [you need to](https://github.com/electron-userland/electron-builder/issues/565#issuecomment-230678643).\n */\n readonly bundleVersion?: string | null\n\n /**\n * The `CFBundleShortVersionString`. Do not use it unless you need to.\n */\n readonly bundleShortVersion?: string | null\n\n /**\n * Whether a dark mode is supported. If your app does have a dark mode, you can make your app follow the system-wide dark mode setting.\n * @default false\n */\n readonly darkModeSupport?: boolean\n\n /**\n * The bundle identifier to use in the application helper's plist.\n * @default ${appBundleIdentifier}.helper\n */\n readonly helperBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Renderer helper's plist.\n * @default ${appBundleIdentifier}.helper.Renderer\n */\n readonly helperRendererBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Plugin helper's plist.\n * @default ${appBundleIdentifier}.helper.Plugin\n */\n readonly helperPluginBundleId?: string | null\n\n /**\n * The bundle identifier to use in the GPU helper's plist.\n * @default ${appBundleIdentifier}.helper.GPU\n */\n readonly helperGPUBundleId?: string | null\n\n /**\n * The bundle identifier to use in the EH helper's plist.\n * @default ${appBundleIdentifier}.helper.EH\n */\n readonly helperEHBundleId?: string | null\n\n /**\n * The bundle identifier to use in the NP helper's plist.\n * @default ${appBundleIdentifier}.helper.NP\n */\n readonly helperNPBundleId?: string | null\n\n /**\n * Whether to sign app for development or for distribution.\n * @default distribution\n */\n readonly type?: \"distribution\" | \"development\" | null\n\n /**\n * The extra entries for `Info.plist`.\n */\n readonly extendInfo?: any\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\n\n /**\n * The minimum version of macOS required for the app to run. Corresponds to `LSMinimumSystemVersion`.\n */\n readonly minimumSystemVersion?: string | null\n\n /**\n * Path of [requirements file](https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html) used in signing. Not applicable for MAS.\n */\n readonly requirements?: string | null\n\n /** @private */\n readonly cscInstallerLink?: string | null\n /** @private */\n readonly cscInstallerKeyPassword?: string | null\n\n /**\n * Extra files to put in archive. Not applicable for `tar.*`.\n */\n readonly extraDistFiles?: Array<string> | string | null\n\n /**\n * Whether your app has to be signed with hardened runtime.\n * @default true\n */\n readonly hardenedRuntime?: boolean\n\n /**\n * Whether to let `@electron/osx-sign` validate the signing or not.\n * @default false\n */\n readonly gatekeeperAssess?: boolean\n\n /**\n * Whether to let `@electron/osx-sign` verify the contents or not.\n * @default true\n */\n readonly strictVerify?: boolean\n\n /**\n * Whether to enable entitlements automation from `@electron/osx-sign`.\n * @default true\n */\n readonly preAutoEntitlements?: boolean\n\n /**\n * Regex or an array of regex's that signal skipping signing a file.\n */\n readonly signIgnore?: Array<string> | string | null\n\n /**\n * The custom function (or path to file or module id) to sign an app bundle.\n */\n readonly sign?: CustomMacSign | string | null\n\n /**\n * Specify the URL of the timestamp authority server\n */\n readonly timestamp?: string | null\n\n /**\n * Whether to merge ASAR files for different architectures or not.\n *\n * This option has no effect unless building for \"universal\" arch.\n * @default true\n */\n readonly mergeASARs?: boolean\n\n /**\n * Minimatch pattern of paths that are allowed to be present in one of the\n * ASAR files, but not in the other.\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly singleArchFiles?: string | null\n\n /**\n * Minimatch pattern of paths that are allowed to be x64 binaries in both\n * ASAR files\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly x64ArchFiles?: string | null\n\n /**\n * Array of strings specifying additional arguments to pass to the `codesign` command used to sign a specific file.\n *\n * Some subresources that you may include in your Electron app may need to be signed with --deep, this is not typically safe to apply to the entire Electron app and therefore should be applied to just your file.\n * Usage Example: `['--deep']`\n */\n readonly additionalArguments?: Array<string> | null\n\n /**\n * Options to use for @electron/notarize (ref: https://github.com/electron/notarize).\n * Use `false` to explicitly disable\n *\n * Note: In order to activate the notarization step You MUST specify one of the following via environment variables:\n * 1. `APPLE_API_KEY`, `APPLE_API_KEY_ID` and `APPLE_API_ISSUER`.\n * 2. `APPLE_ID`, `APPLE_APP_SPECIFIC_PASSWORD`, and `APPLE_TEAM_ID`\n * 3. `APPLE_KEYCHAIN` and `APPLE_KEYCHAIN_PROFILE`\n *\n * For security reasons it is recommended to use the first option (see https://github.com/electron-userland/electron-builder/issues/7859)\n */\n readonly notarize?: NotarizeNotaryOptions | boolean | null\n}\n\nexport interface NotarizeNotaryOptions {\n /**\n * The team ID you want to notarize under for when using `notarytool`\n * @deprecated Set the `APPLE_TEAM_ID` environment variable instead\n */\n readonly teamId?: string\n}\n\nexport interface DmgOptions extends TargetSpecificOptions {\n /**\n * The path to background image (default: `build/background.tiff` or `build/background.png` if exists). The resolution of this file determines the resolution of the installer window.\n * If background is not specified, use `window.size`. Default locations expected background size to be 540x380.\n * @see [DMG with Retina background support](http://stackoverflow.com/a/11204769/1910191).\n */\n background?: string | null\n\n /**\n * The background color (accepts css colors). Defaults to `#ffffff` (white) if no background image.\n */\n backgroundColor?: string | null\n\n /**\n * The path to DMG icon (volume icon), which will be shown when mounted, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.\n * Defaults to the application icon (`build/icon.icns`).\n */\n icon?: string | null\n\n /**\n * The size of all the icons inside the DMG.\n * @default 80\n */\n readonly iconSize?: number | null\n\n /**\n * The size of all the icon texts inside the DMG.\n * @default 12\n */\n readonly iconTextSize?: number | null\n\n /**\n * The title of the produced DMG, which will be shown when mounted (volume name).\n *\n * Macro `${productName}`, `${version}` and `${name}` are supported.\n * @default ${productName} ${version}\n */\n readonly title?: string | null\n\n /**\n * The content — to customize icon locations. The x and y coordinates refer to the position of the **center** of the icon (at 1x scale), and do not take the label into account.\n */\n contents?: Array<DmgContent>\n\n /**\n * The disk image format. `ULFO` (lzfse-compressed image (OS X 10.11+ only)).\n * @default UDZO\n */\n format?: \"UDRW\" | \"UDRO\" | \"UDCO\" | \"UDZO\" | \"UDBZ\" | \"ULFO\"\n\n /**\n * The DMG window position and size. With y co-ordinates running from bottom to top.\n *\n * The Finder makes sure that the window will be on the user’s display, so if you want your window at the top left of the display you could use `\"x\": 0, \"y\": 100000` as the x, y co-ordinates.\n * It is not to be possible to position the window relative to the [top left](https://github.com/electron-userland/electron-builder/issues/3990#issuecomment-512960957) or relative to the center of the user’s screen.\n */\n window?: DmgWindow\n\n /**\n * Whether to create internet-enabled disk image (when it is downloaded using a browser it will automatically decompress the image, put the application on the desktop, unmount and remove the disk image file).\n * @default false\n */\n readonly internetEnabled?: boolean\n\n /**\n * Whether to sign the DMG or not. Signing is not required and will lead to unwanted errors in combination with notarization requirements.\n * @default false\n */\n readonly sign?: boolean\n\n /**\n * @private\n * @default true\n */\n writeUpdateInfo?: boolean\n}\n\nexport interface DmgWindow {\n /**\n * The X position relative to left of the screen.\n * @default 400\n */\n x?: number\n\n /**\n * The Y position relative to bottom of the screen.\n * @default 100\n */\n y?: number\n\n /**\n * The width. Defaults to background image width or 540.\n */\n width?: number\n\n /**\n * The height. Defaults to background image height or 380.\n */\n height?: number\n}\n\nexport interface DmgContent {\n /**\n * The device-independent pixel offset from the left of the window to the **center** of the icon.\n */\n x: number\n /**\n * The device-independent pixel offset from the top of the window to the **center** of the icon.\n */\n y: number\n type?: \"link\" | \"file\" | \"dir\"\n\n /**\n * The name of the file within the DMG. Defaults to basename of `path`.\n */\n name?: string\n\n /**\n * The path of the file within the DMG.\n */\n path?: string\n}\n\nexport interface MasConfiguration extends MacConfiguration {\n /**\n * The path to entitlements file for signing the app. `build/entitlements.mas.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\n * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mas.inherit.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\n}\n"]}
1
+ {"version":3,"file":"macOptions.js","sourceRoot":"","sources":["../../src/options/macOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { PlatformSpecificBuildOptions, TargetConfiguration, TargetSpecificOptions } from \"../index\"\nimport { CustomMacSign } from \"../macPackager\"\n\nexport type MacOsTargetName = \"default\" | \"dmg\" | \"mas\" | \"mas-dev\" | \"pkg\" | \"7z\" | \"zip\" | \"tar.xz\" | \"tar.lz\" | \"tar.gz\" | \"tar.bz2\" | \"dir\"\n\nexport interface MacConfiguration extends PlatformSpecificBuildOptions {\n /**\n * The application category type, as shown in the Finder via *View -> Arrange by Application Category* when viewing the Applications directory.\n *\n * For example, `\"category\": \"public.app-category.developer-tools\"` will set the application category to *Developer Tools*.\n *\n * Valid values are listed in [Apple's documentation](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW8).\n */\n readonly category?: string | null\n\n /**\n * The target package type: list of `default`, `dmg`, `mas`, `mas-dev`, `pkg`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`. Defaults to `default` (`dmg` and `zip` for Squirrel.Mac). Note: Squirrel.Mac auto update mechanism requires both `dmg` and `zip` to be enabled, even when only `dmg` is used. Disabling `zip` will break auto update in `dmg` packages.\n */\n readonly target?: Array<MacOsTargetName | TargetConfiguration> | MacOsTargetName | TargetConfiguration | null\n\n /**\n * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](./code-signing.md) instead of specifying this option.\n * MAS installer identity is specified in the [mas](./mas.md).\n */\n readonly identity?: string | null\n\n /**\n * The path to application icon.\n * @default build/icon.icns\n */\n readonly icon?: string | null\n\n /**\n * The path to entitlements file for signing the app. `build/entitlements.mac.plist` will be used if exists (it is a recommended way to set).\n * MAS entitlements is specified in the [mas](./mas.md).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\n * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mac.inherit.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n *\n * This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Path to login helper entitlement file.\n * When using App Sandbox, the the `com.apple.security.inherit` key that is normally in the inherited entitlements cannot be inherited since the login helper is a standalone executable.\n * Defaults to the value provided for `entitlements`. This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsLoginHelper?: string | null\n\n /**\n * The path to the provisioning profile to use when signing, absolute or relative to the app root.\n */\n readonly provisioningProfile?: string | null\n\n /**\n * The `CFBundleVersion`. Do not use it unless [you need to](https://github.com/electron-userland/electron-builder/issues/565#issuecomment-230678643).\n */\n readonly bundleVersion?: string | null\n\n /**\n * The `CFBundleShortVersionString`. Do not use it unless you need to.\n */\n readonly bundleShortVersion?: string | null\n\n /**\n * Whether a dark mode is supported. If your app does have a dark mode, you can make your app follow the system-wide dark mode setting.\n * @default false\n */\n readonly darkModeSupport?: boolean\n\n /**\n * The bundle identifier to use in the application helper's plist.\n * @default ${appBundleIdentifier}.helper\n */\n readonly helperBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Renderer helper's plist.\n * @default ${appBundleIdentifier}.helper.Renderer\n */\n readonly helperRendererBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Plugin helper's plist.\n * @default ${appBundleIdentifier}.helper.Plugin\n */\n readonly helperPluginBundleId?: string | null\n\n /**\n * The bundle identifier to use in the GPU helper's plist.\n * @default ${appBundleIdentifier}.helper.GPU\n */\n readonly helperGPUBundleId?: string | null\n\n /**\n * The bundle identifier to use in the EH helper's plist.\n * @default ${appBundleIdentifier}.helper.EH\n */\n readonly helperEHBundleId?: string | null\n\n /**\n * The bundle identifier to use in the NP helper's plist.\n * @default ${appBundleIdentifier}.helper.NP\n */\n readonly helperNPBundleId?: string | null\n\n /**\n * Whether to sign app for development or for distribution.\n * @default distribution\n */\n readonly type?: \"distribution\" | \"development\" | null\n\n /**\n * The extra entries for `Info.plist`.\n */\n readonly extendInfo?: any\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\n\n /**\n * The minimum version of macOS required for the app to run. Corresponds to `LSMinimumSystemVersion`.\n */\n readonly minimumSystemVersion?: string | null\n\n /**\n * Path of [requirements file](https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html) used in signing. Not applicable for MAS.\n */\n readonly requirements?: string | null\n\n /** @private */\n readonly cscInstallerLink?: string | null\n /** @private */\n readonly cscInstallerKeyPassword?: string | null\n\n /**\n * Extra files to put in archive. Not applicable for `tar.*`.\n */\n readonly extraDistFiles?: Array<string> | string | null\n\n /**\n * Whether your app has to be signed with hardened runtime.\n * @default true\n */\n readonly hardenedRuntime?: boolean\n\n /**\n * Whether to let `@electron/osx-sign` validate the signing or not.\n * @default false\n */\n readonly gatekeeperAssess?: boolean\n\n /**\n * Whether to let `@electron/osx-sign` verify the contents or not.\n * @default true\n */\n readonly strictVerify?: boolean\n\n /**\n * Whether to enable entitlements automation from `@electron/osx-sign`.\n * @default true\n */\n readonly preAutoEntitlements?: boolean\n\n /**\n * Regex or an array of regex's that signal skipping signing a file.\n */\n readonly signIgnore?: Array<string> | string | null\n\n /**\n * The custom function (or path to file or module id) to sign an app bundle.\n */\n readonly sign?: CustomMacSign | string | null\n\n /**\n * Specify the URL of the timestamp authority server\n */\n readonly timestamp?: string | null\n\n /**\n * Whether to merge ASAR files for different architectures or not.\n *\n * This option has no effect unless building for \"universal\" arch.\n * @default true\n */\n readonly mergeASARs?: boolean\n\n /**\n * Minimatch pattern of paths that are allowed to be present in one of the\n * ASAR files, but not in the other.\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly singleArchFiles?: string | null\n\n /**\n * Minimatch pattern of paths that are allowed to be x64 binaries in both\n * ASAR files\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly x64ArchFiles?: string | null\n\n /**\n * Array of strings specifying additional arguments to pass to the `codesign` command used to sign a specific file.\n *\n * Some subresources that you may include in your Electron app may need to be signed with --deep, this is not typically safe to apply to the entire Electron app and therefore should be applied to just your file.\n * Usage Example: `['--deep']`\n */\n readonly additionalArguments?: Array<string> | null\n\n /**\n * Options to use for @electron/notarize (ref: https://github.com/electron/notarize).\n * Use `false` to explicitly disable\n *\n * Note: In order to activate the notarization step You MUST specify one of the following via environment variables:\n * 1. `APPLE_API_KEY`, `APPLE_API_KEY_ID` and `APPLE_API_ISSUER`.\n * 2. `APPLE_ID`, `APPLE_APP_SPECIFIC_PASSWORD`, and `APPLE_TEAM_ID`\n * 3. `APPLE_KEYCHAIN` and `APPLE_KEYCHAIN_PROFILE`\n *\n * For security reasons it is recommended to use the first option (see https://github.com/electron-userland/electron-builder/issues/7859)\n */\n readonly notarize?: NotarizeNotaryOptions | boolean | null\n}\n\nexport interface NotarizeNotaryOptions {\n /**\n * The team ID you want to notarize under for when using `notarytool`\n * @deprecated Set the `APPLE_TEAM_ID` environment variable instead\n */\n readonly teamId?: string\n}\n\nexport interface DmgOptions extends TargetSpecificOptions {\n /**\n * The path to background image (default: `build/background.tiff` or `build/background.png` if exists). The resolution of this file determines the resolution of the installer window.\n * If background is not specified, use `window.size`. Default locations expected background size to be 540x380.\n * @see [DMG with Retina background support](http://stackoverflow.com/a/11204769/1910191).\n */\n background?: string | null\n\n /**\n * The background color (accepts css colors). Defaults to `#ffffff` (white) if no background image.\n */\n backgroundColor?: string | null\n\n /**\n * The path to DMG icon (volume icon), which will be shown when mounted, relative to the [build resources](./configuration.md#MetadataDirectories-buildResources) or to the project directory.\n * Defaults to the application icon (`build/icon.icns`).\n */\n icon?: string | null\n\n /**\n * The size of all the icons inside the DMG.\n * @default 80\n */\n readonly iconSize?: number | null\n\n /**\n * The size of all the icon texts inside the DMG.\n * @default 12\n */\n readonly iconTextSize?: number | null\n\n /**\n * The title of the produced DMG, which will be shown when mounted (volume name).\n *\n * Macro `${productName}`, `${version}` and `${name}` are supported.\n * @default ${productName} ${version}\n */\n readonly title?: string | null\n\n /**\n * The content — to customize icon locations. The x and y coordinates refer to the position of the **center** of the icon (at 1x scale), and do not take the label into account.\n */\n contents?: Array<DmgContent>\n\n /**\n * The disk image format. `ULFO` (lzfse-compressed image (OS X 10.11+ only)).\n * @default UDZO\n */\n format?: \"UDRW\" | \"UDRO\" | \"UDCO\" | \"UDZO\" | \"UDBZ\" | \"ULFO\"\n\n /**\n * The DMG window position and size. With y co-ordinates running from bottom to top.\n *\n * The Finder makes sure that the window will be on the user’s display, so if you want your window at the top left of the display you could use `\"x\": 0, \"y\": 100000` as the x, y co-ordinates.\n * It is not to be possible to position the window relative to the [top left](https://github.com/electron-userland/electron-builder/issues/3990#issuecomment-512960957) or relative to the center of the user’s screen.\n */\n window?: DmgWindow\n\n /**\n * Whether to create internet-enabled disk image (when it is downloaded using a browser it will automatically decompress the image, put the application on the desktop, unmount and remove the disk image file).\n * @default false\n */\n readonly internetEnabled?: boolean\n\n /**\n * Whether to sign the DMG or not. Signing is not required and will lead to unwanted errors in combination with notarization requirements.\n * @default false\n */\n readonly sign?: boolean\n\n /**\n * @private\n * @default true\n */\n writeUpdateInfo?: boolean\n}\n\nexport interface DmgWindow {\n /**\n * The X position relative to left of the screen.\n * @default 400\n */\n x?: number\n\n /**\n * The Y position relative to bottom of the screen.\n * @default 100\n */\n y?: number\n\n /**\n * The width. Defaults to background image width or 540.\n */\n width?: number\n\n /**\n * The height. Defaults to background image height or 380.\n */\n height?: number\n}\n\nexport interface DmgContent {\n /**\n * The device-independent pixel offset from the left of the window to the **center** of the icon.\n */\n x: number\n /**\n * The device-independent pixel offset from the top of the window to the **center** of the icon.\n */\n y: number\n type?: \"link\" | \"file\" | \"dir\"\n\n /**\n * The name of the file within the DMG. Defaults to basename of `path`.\n */\n name?: string\n\n /**\n * The path of the file within the DMG.\n */\n path?: string\n}\n\nexport interface MasConfiguration extends MacConfiguration {\n /**\n * The path to entitlements file for signing the app. `build/entitlements.mas.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\n * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mas.inherit.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\n}\n"]}
@@ -48,7 +48,7 @@ export interface PkgOptions extends TargetSpecificOptions {
48
48
  */
49
49
  readonly allowRootDirectory?: boolean | null;
50
50
  /**
51
- * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](/code-signing) instead of specifying this option.
51
+ * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](./code-signing.md) instead of specifying this option.
52
52
  */
53
53
  readonly identity?: string | null;
54
54
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"pkgOptions.js","sourceRoot":"","sources":["../../src/options/pkgOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { TargetSpecificOptions } from \"../core\"\n\n// noinspection SpellCheckingInspection\nexport type BackgroundAlignment = \"center\" | \"left\" | \"right\" | \"top\" | \"bottom\" | \"topleft\" | \"topright\" | \"bottomleft\" | \"bottomright\"\n// noinspection SpellCheckingInspection\nexport type BackgroundScaling = \"tofit\" | \"none\" | \"proportional\"\n\n/**\n * macOS product archive options.\n */\nexport interface PkgOptions extends TargetSpecificOptions {\n /**\n * The scripts directory, relative to `build` (build resources directory).\n * The scripts can be in any language so long as the files are marked executable and have the appropriate shebang indicating the path to the interpreter.\n * Scripts are required to be executable (`chmod +x file`).\n * @default build/pkg-scripts\n * @see [Scripting in installer packages](http://macinstallers.blogspot.de/2012/07/scripting-in-installer-packages.html).\n */\n readonly scripts?: string | null\n\n /**\n * should be not documented, only to experiment\n * @private\n */\n readonly productbuild?: Array<string> | null\n\n /**\n * The install location. [Do not use it](https://stackoverflow.com/questions/12863944/how-do-you-specify-a-default-install-location-to-home-with-pkgbuild) to create per-user package.\n * Mostly never you will need to change this option. `/Applications` would install it as expected into `/Applications` if the local system domain is chosen, or into `$HOME/Applications` if the home installation is chosen.\n * @default /Applications\n */\n readonly installLocation?: string | null\n\n /**\n * Whether can be installed at the root of any volume, including non-system volumes. Otherwise, it cannot be installed at the root of a volume.\n *\n * Corresponds to [enable_anywhere](https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW70).\n * @default true\n */\n readonly allowAnywhere?: boolean | null\n\n /**\n * Whether can be installed into the current user’s home directory.\n * A home directory installation is done as the current user (not as root), and it cannot write outside of the home directory.\n * If the product cannot be installed in the user’s home directory and be not completely functional from user’s home directory.\n *\n * Corresponds to [enable_currentUserHome](https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW70).\n * @default true\n */\n readonly allowCurrentUserHome?: boolean | null\n\n /**\n * Whether can be installed into the root directory. Should usually be `true` unless the product can be installed only to the user’s home directory.\n *\n * Corresponds to [enable_localSystem](https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW70).\n * @default true\n */\n readonly allowRootDirectory?: boolean | null\n\n /**\n * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](/code-signing) instead of specifying this option.\n */\n readonly identity?: string | null\n\n /**\n * The path to EULA license file. Defaults to `license.txt` or `eula.txt` (or uppercase variants). In addition to `txt`, `rtf` and `html` supported (don't forget to use `target=\"_blank\"` for links).\n */\n readonly license?: string | null\n\n /**\n * Options for the background image for the installer.\n */\n readonly background?: PkgBackgroundOptions | null\n\n /**\n * The path to the welcome file. This may be used to customize the text on the Introduction page of the installer.\n */\n readonly welcome?: string | null\n\n /**\n * Identifies applications that must be closed before the package is installed.\n *\n * Corresponds to [must-close](https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW77).\n */\n readonly mustClose?: Array<string> | null\n\n /**\n * The path to the conclusion file. This may be used to customize the text on the final \"Summary\" page of the installer.\n */\n readonly conclusion?: string | null\n\n /**\n * Install bundle over previous version if moved by user?\n * @default true\n */\n readonly isRelocatable?: boolean | null\n\n /**\n * Don't install bundle if newer version on disk?\n * @default true\n */\n readonly isVersionChecked?: boolean | null\n\n /**\n * Require identical bundle identifiers at install path?\n * @default true\n */\n readonly hasStrictIdentifier?: boolean | null\n\n /**\n * Specifies how an existing version of the bundle on disk should be handled when the version in\n * the package is installed.\n *\n * If you specify upgrade, the bundle in the package atomi-cally replaces any version on disk;\n * this has the effect of deleting old paths that no longer exist in the new version of\n * the bundle.\n *\n * If you specify update, the bundle in the package overwrites the version on disk, and any files\n * not contained in the package will be left intact; this is appropriate when you are delivering\n * an update-only package.\n *\n * Another effect of update is that the package bundle will not be installed at all if there is\n * not already a version on disk; this allows a package to deliver an update for an app that\n * the user might have deleted.\n *\n * @default upgrade\n */\n readonly overwriteAction?: \"upgrade\" | \"update\" | null\n}\n\n/**\n * Options for the background image in a PKG installer\n */\nexport interface PkgBackgroundOptions {\n /**\n * Path to the image to use as an installer background.\n */\n file?: string\n\n /**\n * Alignment of the background image.\n * Options are: center, left, right, top, bottom, topleft, topright, bottomleft, bottomright\n * @default center\n */\n alignment?: BackgroundAlignment | null\n\n /**\n * Scaling of the background image.\n * Options are: tofit, none, proportional\n * @default tofit\n */\n scaling?: BackgroundScaling | null\n}\n"]}
1
+ {"version":3,"file":"pkgOptions.js","sourceRoot":"","sources":["../../src/options/pkgOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { TargetSpecificOptions } from \"../core\"\n\n// noinspection SpellCheckingInspection\nexport type BackgroundAlignment = \"center\" | \"left\" | \"right\" | \"top\" | \"bottom\" | \"topleft\" | \"topright\" | \"bottomleft\" | \"bottomright\"\n// noinspection SpellCheckingInspection\nexport type BackgroundScaling = \"tofit\" | \"none\" | \"proportional\"\n\n/**\n * macOS product archive options.\n */\nexport interface PkgOptions extends TargetSpecificOptions {\n /**\n * The scripts directory, relative to `build` (build resources directory).\n * The scripts can be in any language so long as the files are marked executable and have the appropriate shebang indicating the path to the interpreter.\n * Scripts are required to be executable (`chmod +x file`).\n * @default build/pkg-scripts\n * @see [Scripting in installer packages](http://macinstallers.blogspot.de/2012/07/scripting-in-installer-packages.html).\n */\n readonly scripts?: string | null\n\n /**\n * should be not documented, only to experiment\n * @private\n */\n readonly productbuild?: Array<string> | null\n\n /**\n * The install location. [Do not use it](https://stackoverflow.com/questions/12863944/how-do-you-specify-a-default-install-location-to-home-with-pkgbuild) to create per-user package.\n * Mostly never you will need to change this option. `/Applications` would install it as expected into `/Applications` if the local system domain is chosen, or into `$HOME/Applications` if the home installation is chosen.\n * @default /Applications\n */\n readonly installLocation?: string | null\n\n /**\n * Whether can be installed at the root of any volume, including non-system volumes. Otherwise, it cannot be installed at the root of a volume.\n *\n * Corresponds to [enable_anywhere](https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW70).\n * @default true\n */\n readonly allowAnywhere?: boolean | null\n\n /**\n * Whether can be installed into the current user’s home directory.\n * A home directory installation is done as the current user (not as root), and it cannot write outside of the home directory.\n * If the product cannot be installed in the user’s home directory and be not completely functional from user’s home directory.\n *\n * Corresponds to [enable_currentUserHome](https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW70).\n * @default true\n */\n readonly allowCurrentUserHome?: boolean | null\n\n /**\n * Whether can be installed into the root directory. Should usually be `true` unless the product can be installed only to the user’s home directory.\n *\n * Corresponds to [enable_localSystem](https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW70).\n * @default true\n */\n readonly allowRootDirectory?: boolean | null\n\n /**\n * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](./code-signing.md) instead of specifying this option.\n */\n readonly identity?: string | null\n\n /**\n * The path to EULA license file. Defaults to `license.txt` or `eula.txt` (or uppercase variants). In addition to `txt`, `rtf` and `html` supported (don't forget to use `target=\"_blank\"` for links).\n */\n readonly license?: string | null\n\n /**\n * Options for the background image for the installer.\n */\n readonly background?: PkgBackgroundOptions | null\n\n /**\n * The path to the welcome file. This may be used to customize the text on the Introduction page of the installer.\n */\n readonly welcome?: string | null\n\n /**\n * Identifies applications that must be closed before the package is installed.\n *\n * Corresponds to [must-close](https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW77).\n */\n readonly mustClose?: Array<string> | null\n\n /**\n * The path to the conclusion file. This may be used to customize the text on the final \"Summary\" page of the installer.\n */\n readonly conclusion?: string | null\n\n /**\n * Install bundle over previous version if moved by user?\n * @default true\n */\n readonly isRelocatable?: boolean | null\n\n /**\n * Don't install bundle if newer version on disk?\n * @default true\n */\n readonly isVersionChecked?: boolean | null\n\n /**\n * Require identical bundle identifiers at install path?\n * @default true\n */\n readonly hasStrictIdentifier?: boolean | null\n\n /**\n * Specifies how an existing version of the bundle on disk should be handled when the version in\n * the package is installed.\n *\n * If you specify upgrade, the bundle in the package atomi-cally replaces any version on disk;\n * this has the effect of deleting old paths that no longer exist in the new version of\n * the bundle.\n *\n * If you specify update, the bundle in the package overwrites the version on disk, and any files\n * not contained in the package will be left intact; this is appropriate when you are delivering\n * an update-only package.\n *\n * Another effect of update is that the package bundle will not be installed at all if there is\n * not already a version on disk; this allows a package to deliver an update for an app that\n * the user might have deleted.\n *\n * @default upgrade\n */\n readonly overwriteAction?: \"upgrade\" | \"update\" | null\n}\n\n/**\n * Options for the background image in a PKG installer\n */\nexport interface PkgBackgroundOptions {\n /**\n * Path to the image to use as an installer background.\n */\n file?: string\n\n /**\n * Alignment of the background image.\n * Options are: center, left, right, top, bottom, topleft, topright, bottomleft, bottomright\n * @default center\n */\n alignment?: BackgroundAlignment | null\n\n /**\n * Scaling of the background image.\n * Options are: tofit, none, proportional\n * @default tofit\n */\n scaling?: BackgroundScaling | null\n}\n"]}
@@ -2,7 +2,7 @@ import { PlatformSpecificBuildOptions, TargetConfigType } from "../index";
2
2
  import { CustomWindowsSign } from "../codeSign/windowsSignToolManager";
3
3
  export interface WindowsConfiguration extends PlatformSpecificBuildOptions {
4
4
  /**
5
- * The target package type: list of `nsis`, `nsis-web` (Web installer), `portable` ([portable](/configuration/nsis#portable) app without installation), `appx`, `msi`, `msi-wrapped`, `squirrel`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`.
5
+ * The target package type: list of `nsis`, `nsis-web` (Web installer), `portable` ([portable]./nsis.md#portable) app without installation), `appx`, `msi`, `msi-wrapped`, `squirrel`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`.
6
6
  * AppX package can be built only on Windows 10.
7
7
  *
8
8
  * To use Squirrel.Windows please install `electron-builder-squirrel-windows` dependency.
@@ -31,13 +31,13 @@ export interface WindowsConfiguration extends PlatformSpecificBuildOptions {
31
31
  readonly sign?: CustomWindowsSign | string | null;
32
32
  /**
33
33
  * The path to the *.pfx certificate you want to sign with. Please use it only if you cannot use env variable `CSC_LINK` (`WIN_CSC_LINK`) for some reason.
34
- * Please see [Code Signing](/code-signing).
34
+ * Please see [Code Signing](./code-signing.md).
35
35
  * @deprecated Please use {@link signtoolOptions.certificateFile}
36
36
  */
37
37
  readonly certificateFile?: string | null;
38
38
  /**
39
39
  * The password to the certificate provided in `certificateFile`. Please use it only if you cannot use env variable `CSC_KEY_PASSWORD` (`WIN_CSC_KEY_PASSWORD`) for some reason.
40
- * Please see [Code Signing](/code-signing).
40
+ * Please see [Code Signing](./code-signing.md).
41
41
  * @deprecated Please use {@link signtoolOptions.certificatePassword}
42
42
  */
43
43
  readonly certificatePassword?: string | null;
@@ -127,12 +127,12 @@ export interface WindowsSigntoolConfiguration {
127
127
  readonly signingHashAlgorithms?: Array<"sha1" | "sha256"> | null;
128
128
  /**
129
129
  * The path to the *.pfx certificate you want to sign with. Please use it only if you cannot use env variable `CSC_LINK` (`WIN_CSC_LINK`) for some reason.
130
- * Please see [Code Signing](/code-signing).
130
+ * Please see [Code Signing](./code-signing.md).
131
131
  */
132
132
  readonly certificateFile?: string | null;
133
133
  /**
134
134
  * The password to the certificate provided in `certificateFile`. Please use it only if you cannot use env variable `CSC_KEY_PASSWORD` (`WIN_CSC_KEY_PASSWORD`) for some reason.
135
- * Please see [Code Signing](/code-signing).
135
+ * Please see [Code Signing](./code-signing.md).
136
136
  */
137
137
  readonly certificatePassword?: string | null;
138
138
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"winOptions.js","sourceRoot":"","sources":["../../src/options/winOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { PlatformSpecificBuildOptions, TargetConfigType } from \"../index\"\nimport { CustomWindowsSign } from \"../codeSign/windowsSignToolManager\"\n\nexport interface WindowsConfiguration extends PlatformSpecificBuildOptions {\n /**\n * The target package type: list of `nsis`, `nsis-web` (Web installer), `portable` ([portable](/configuration/nsis#portable) app without installation), `appx`, `msi`, `msi-wrapped`, `squirrel`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`.\n * AppX package can be built only on Windows 10.\n *\n * To use Squirrel.Windows please install `electron-builder-squirrel-windows` dependency.\n *\n * @default nsis\n */\n readonly target?: TargetConfigType\n\n /**\n * The path to application icon.\n * @default build/icon.ico\n */\n readonly icon?: string | null\n\n /**\n * The trademarks and registered trademarks.\n */\n readonly legalTrademarks?: string | null\n\n /**\n * Array of signing algorithms used. For AppX `sha256` is always used.\n * @deprecated Please use {@link signtoolOptions.signingHashAlgorithms}\n */\n readonly signingHashAlgorithms?: Array<\"sha1\" | \"sha256\"> | null\n /**\n * The custom function (or path to file or module id) to sign Windows executables\n * @deprecated Please use {@link signtoolOptions.sign}\n */\n readonly sign?: CustomWindowsSign | string | null\n /**\n * The path to the *.pfx certificate you want to sign with. Please use it only if you cannot use env variable `CSC_LINK` (`WIN_CSC_LINK`) for some reason.\n * Please see [Code Signing](/code-signing).\n * @deprecated Please use {@link signtoolOptions.certificateFile}\n */\n readonly certificateFile?: string | null\n /**\n * The password to the certificate provided in `certificateFile`. Please use it only if you cannot use env variable `CSC_KEY_PASSWORD` (`WIN_CSC_KEY_PASSWORD`) for some reason.\n * Please see [Code Signing](/code-signing).\n * @deprecated Please use {@link signtoolOptions.certificatePassword}\n */\n readonly certificatePassword?: string | null\n /**\n * The name of the subject of the signing certificate, which is often labeled with the field name `issued to`. Required only for EV Code Signing and works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).\n * @deprecated Please use {@link signtoolOptions.certificateSubjectName}\n */\n readonly certificateSubjectName?: string | null\n /**\n * The SHA1 hash of the signing certificate. The SHA1 hash is commonly specified when multiple certificates satisfy the criteria specified by the remaining switches. Works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).\n * @deprecated Please use win.signtoolOptions.certificateSha1\n */\n readonly certificateSha1?: string | null\n /**\n * The path to an additional certificate file you want to add to the signature block.\n * @deprecated Please use {@link signtoolOptions.additionalCertificateFile}\n */\n readonly additionalCertificateFile?: string | null\n /**\n * The URL of the RFC 3161 time stamp server.\n * @default http://timestamp.digicert.com\n * @deprecated Please use {@link signtoolOptions.rfc3161TimeStampServer}\n */\n readonly rfc3161TimeStampServer?: string | null\n /**\n * The URL of the time stamp server.\n * @default http://timestamp.digicert.com\n * @deprecated Please use {@link signtoolOptions.timeStampServer}\n */\n readonly timeStampServer?: string | null\n\n /**\n * [The publisher name](https://github.com/electron-userland/electron-builder/issues/1187#issuecomment-278972073), exactly as in your code signed certificate. Several names can be provided.\n * Defaults to common name from your code signing certificate.\n * @deprecated Please use {@link signtoolOptions.publisherName}\n */\n readonly publisherName?: string | Array<string> | null\n\n /**\n * Options for usage with signtool.exe\n */\n readonly signtoolOptions?: WindowsSigntoolConfiguration | null\n\n /**\n * Options for usage of Azure Trusted Signing (beta)\n */\n readonly azureSignOptions?: WindowsAzureSigningConfiguration | null\n\n /**\n * Whether to verify the signature of an available update before installation.\n * The [publisher name](#publisherName) will be used for the signature verification.\n *\n * @default true\n */\n readonly verifyUpdateCodeSignature?: boolean\n\n /**\n * The [security level](https://msdn.microsoft.com/en-us/library/6ad1fshk.aspx#Anchor_9) at which the application requests to be executed.\n * Cannot be specified per target, allowed only in the `win`.\n * @default asInvoker\n */\n readonly requestedExecutionLevel?: RequestedExecutionLevel | null\n\n /**\n * Whether to sign and add metadata to executable. Advanced option.\n * @default true\n */\n readonly signAndEditExecutable?: boolean\n\n /**\n * Whether to sign DLL files. Advanced option.\n * @see https://github.com/electron-userland/electron-builder/issues/3101#issuecomment-404212384\n * @default false\n * @deprecated Use {@link signExts} instead for more explicit control\n */\n readonly signDlls?: boolean\n\n /**\n * Explicit file extensions to also sign. Advanced option.\n * @see https://github.com/electron-userland/electron-builder/issues/7329\n * @default null\n */\n readonly signExts?: string[] | null\n}\n\nexport type RequestedExecutionLevel = \"asInvoker\" | \"highestAvailable\" | \"requireAdministrator\"\n\nexport interface WindowsSigntoolConfiguration {\n /**\n * The custom function (or path to file or module id) to sign Windows executables\n */\n readonly sign?: CustomWindowsSign | string | null\n\n /**\n * Array of signing algorithms used. For AppX `sha256` is always used.\n * @default ['sha1', 'sha256']\n */\n readonly signingHashAlgorithms?: Array<\"sha1\" | \"sha256\"> | null\n\n /**\n * The path to the *.pfx certificate you want to sign with. Please use it only if you cannot use env variable `CSC_LINK` (`WIN_CSC_LINK`) for some reason.\n * Please see [Code Signing](/code-signing).\n */\n readonly certificateFile?: string | null\n\n /**\n * The password to the certificate provided in `certificateFile`. Please use it only if you cannot use env variable `CSC_KEY_PASSWORD` (`WIN_CSC_KEY_PASSWORD`) for some reason.\n * Please see [Code Signing](/code-signing).\n */\n readonly certificatePassword?: string | null\n\n /**\n * The name of the subject of the signing certificate, which is often labeled with the field name `issued to`. Required only for EV Code Signing and works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).\n */\n readonly certificateSubjectName?: string | null\n\n /**\n * The SHA1 hash of the signing certificate. The SHA1 hash is commonly specified when multiple certificates satisfy the criteria specified by the remaining switches. Works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).\n */\n readonly certificateSha1?: string | null\n\n /**\n * The path to an additional certificate file you want to add to the signature block.\n */\n readonly additionalCertificateFile?: string | null\n\n /**\n * The URL of the RFC 3161 time stamp server.\n * @default http://timestamp.digicert.com\n */\n readonly rfc3161TimeStampServer?: string | null\n\n /**\n * The URL of the time stamp server.\n * @default http://timestamp.digicert.com\n */\n readonly timeStampServer?: string | null\n\n /**\n * [The publisher name](https://github.com/electron-userland/electron-builder/issues/1187#issuecomment-278972073), exactly as in your code signed certificate. Several names can be provided.\n * Defaults to common name from your code signing certificate.\n */\n readonly publisherName?: string | Array<string> | null\n}\n\n// https://learn.microsoft.com/en-us/azure/trusted-signing/how-to-signing-integrations\nexport interface WindowsAzureSigningConfiguration {\n /**\n * The Trusted Signing Account endpoint. The URI value must have a URI that aligns to the\n * region your Trusted Signing Account and Certificate Profile you are specifying were created\n * in during the setup of these resources.\n *\n * Translates to field: Endpoint\n *\n * Requires one of environment variable configurations for authenticating to Microsoft Entra ID per [Microsoft's documentation](https://learn.microsoft.com/en-us/dotnet/api/azure.identity.environmentcredential?view=azure-dotnet#definition)\n */\n readonly endpoint: string\n /**\n * The Certificate Profile name. Translates to field: CertificateProfileName\n */\n readonly certificateProfileName: string\n /**\n * Allow other CLI parameters (verbatim case-sensitive) to `Invoke-TrustedSigning`\n */\n [k: string]: string\n}\n"]}
1
+ {"version":3,"file":"winOptions.js","sourceRoot":"","sources":["../../src/options/winOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { PlatformSpecificBuildOptions, TargetConfigType } from \"../index\"\nimport { CustomWindowsSign } from \"../codeSign/windowsSignToolManager\"\n\nexport interface WindowsConfiguration extends PlatformSpecificBuildOptions {\n /**\n * The target package type: list of `nsis`, `nsis-web` (Web installer), `portable` ([portable]./nsis.md#portable) app without installation), `appx`, `msi`, `msi-wrapped`, `squirrel`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`.\n * AppX package can be built only on Windows 10.\n *\n * To use Squirrel.Windows please install `electron-builder-squirrel-windows` dependency.\n *\n * @default nsis\n */\n readonly target?: TargetConfigType\n\n /**\n * The path to application icon.\n * @default build/icon.ico\n */\n readonly icon?: string | null\n\n /**\n * The trademarks and registered trademarks.\n */\n readonly legalTrademarks?: string | null\n\n /**\n * Array of signing algorithms used. For AppX `sha256` is always used.\n * @deprecated Please use {@link signtoolOptions.signingHashAlgorithms}\n */\n readonly signingHashAlgorithms?: Array<\"sha1\" | \"sha256\"> | null\n /**\n * The custom function (or path to file or module id) to sign Windows executables\n * @deprecated Please use {@link signtoolOptions.sign}\n */\n readonly sign?: CustomWindowsSign | string | null\n /**\n * The path to the *.pfx certificate you want to sign with. Please use it only if you cannot use env variable `CSC_LINK` (`WIN_CSC_LINK`) for some reason.\n * Please see [Code Signing](./code-signing.md).\n * @deprecated Please use {@link signtoolOptions.certificateFile}\n */\n readonly certificateFile?: string | null\n /**\n * The password to the certificate provided in `certificateFile`. Please use it only if you cannot use env variable `CSC_KEY_PASSWORD` (`WIN_CSC_KEY_PASSWORD`) for some reason.\n * Please see [Code Signing](./code-signing.md).\n * @deprecated Please use {@link signtoolOptions.certificatePassword}\n */\n readonly certificatePassword?: string | null\n /**\n * The name of the subject of the signing certificate, which is often labeled with the field name `issued to`. Required only for EV Code Signing and works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).\n * @deprecated Please use {@link signtoolOptions.certificateSubjectName}\n */\n readonly certificateSubjectName?: string | null\n /**\n * The SHA1 hash of the signing certificate. The SHA1 hash is commonly specified when multiple certificates satisfy the criteria specified by the remaining switches. Works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).\n * @deprecated Please use win.signtoolOptions.certificateSha1\n */\n readonly certificateSha1?: string | null\n /**\n * The path to an additional certificate file you want to add to the signature block.\n * @deprecated Please use {@link signtoolOptions.additionalCertificateFile}\n */\n readonly additionalCertificateFile?: string | null\n /**\n * The URL of the RFC 3161 time stamp server.\n * @default http://timestamp.digicert.com\n * @deprecated Please use {@link signtoolOptions.rfc3161TimeStampServer}\n */\n readonly rfc3161TimeStampServer?: string | null\n /**\n * The URL of the time stamp server.\n * @default http://timestamp.digicert.com\n * @deprecated Please use {@link signtoolOptions.timeStampServer}\n */\n readonly timeStampServer?: string | null\n\n /**\n * [The publisher name](https://github.com/electron-userland/electron-builder/issues/1187#issuecomment-278972073), exactly as in your code signed certificate. Several names can be provided.\n * Defaults to common name from your code signing certificate.\n * @deprecated Please use {@link signtoolOptions.publisherName}\n */\n readonly publisherName?: string | Array<string> | null\n\n /**\n * Options for usage with signtool.exe\n */\n readonly signtoolOptions?: WindowsSigntoolConfiguration | null\n\n /**\n * Options for usage of Azure Trusted Signing (beta)\n */\n readonly azureSignOptions?: WindowsAzureSigningConfiguration | null\n\n /**\n * Whether to verify the signature of an available update before installation.\n * The [publisher name](#publisherName) will be used for the signature verification.\n *\n * @default true\n */\n readonly verifyUpdateCodeSignature?: boolean\n\n /**\n * The [security level](https://msdn.microsoft.com/en-us/library/6ad1fshk.aspx#Anchor_9) at which the application requests to be executed.\n * Cannot be specified per target, allowed only in the `win`.\n * @default asInvoker\n */\n readonly requestedExecutionLevel?: RequestedExecutionLevel | null\n\n /**\n * Whether to sign and add metadata to executable. Advanced option.\n * @default true\n */\n readonly signAndEditExecutable?: boolean\n\n /**\n * Whether to sign DLL files. Advanced option.\n * @see https://github.com/electron-userland/electron-builder/issues/3101#issuecomment-404212384\n * @default false\n * @deprecated Use {@link signExts} instead for more explicit control\n */\n readonly signDlls?: boolean\n\n /**\n * Explicit file extensions to also sign. Advanced option.\n * @see https://github.com/electron-userland/electron-builder/issues/7329\n * @default null\n */\n readonly signExts?: string[] | null\n}\n\nexport type RequestedExecutionLevel = \"asInvoker\" | \"highestAvailable\" | \"requireAdministrator\"\n\nexport interface WindowsSigntoolConfiguration {\n /**\n * The custom function (or path to file or module id) to sign Windows executables\n */\n readonly sign?: CustomWindowsSign | string | null\n\n /**\n * Array of signing algorithms used. For AppX `sha256` is always used.\n * @default ['sha1', 'sha256']\n */\n readonly signingHashAlgorithms?: Array<\"sha1\" | \"sha256\"> | null\n\n /**\n * The path to the *.pfx certificate you want to sign with. Please use it only if you cannot use env variable `CSC_LINK` (`WIN_CSC_LINK`) for some reason.\n * Please see [Code Signing](./code-signing.md).\n */\n readonly certificateFile?: string | null\n\n /**\n * The password to the certificate provided in `certificateFile`. Please use it only if you cannot use env variable `CSC_KEY_PASSWORD` (`WIN_CSC_KEY_PASSWORD`) for some reason.\n * Please see [Code Signing](./code-signing.md).\n */\n readonly certificatePassword?: string | null\n\n /**\n * The name of the subject of the signing certificate, which is often labeled with the field name `issued to`. Required only for EV Code Signing and works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).\n */\n readonly certificateSubjectName?: string | null\n\n /**\n * The SHA1 hash of the signing certificate. The SHA1 hash is commonly specified when multiple certificates satisfy the criteria specified by the remaining switches. Works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).\n */\n readonly certificateSha1?: string | null\n\n /**\n * The path to an additional certificate file you want to add to the signature block.\n */\n readonly additionalCertificateFile?: string | null\n\n /**\n * The URL of the RFC 3161 time stamp server.\n * @default http://timestamp.digicert.com\n */\n readonly rfc3161TimeStampServer?: string | null\n\n /**\n * The URL of the time stamp server.\n * @default http://timestamp.digicert.com\n */\n readonly timeStampServer?: string | null\n\n /**\n * [The publisher name](https://github.com/electron-userland/electron-builder/issues/1187#issuecomment-278972073), exactly as in your code signed certificate. Several names can be provided.\n * Defaults to common name from your code signing certificate.\n */\n readonly publisherName?: string | Array<string> | null\n}\n\n// https://learn.microsoft.com/en-us/azure/trusted-signing/how-to-signing-integrations\nexport interface WindowsAzureSigningConfiguration {\n /**\n * The Trusted Signing Account endpoint. The URI value must have a URI that aligns to the\n * region your Trusted Signing Account and Certificate Profile you are specifying were created\n * in during the setup of these resources.\n *\n * Translates to field: Endpoint\n *\n * Requires one of environment variable configurations for authenticating to Microsoft Entra ID per [Microsoft's documentation](https://learn.microsoft.com/en-us/dotnet/api/azure.identity.environmentcredential?view=azure-dotnet#definition)\n */\n readonly endpoint: string\n /**\n * The Certificate Profile name. Translates to field: CertificateProfileName\n */\n readonly certificateProfileName: string\n /**\n * Allow other CLI parameters (verbatim case-sensitive) to `Invoke-TrustedSigning`\n */\n [k: string]: string\n}\n"]}
package/out/packager.d.ts CHANGED
@@ -26,7 +26,7 @@ export declare class Packager {
26
26
  private _configuration;
27
27
  get config(): Configuration;
28
28
  isTwoPackageJsonProjectLayoutUsed: boolean;
29
- readonly eventEmitter: EventEmitter;
29
+ readonly eventEmitter: EventEmitter<[never]>;
30
30
  _appInfo: AppInfo | null;
31
31
  get appInfo(): AppInfo;
32
32
  readonly tempDirManager: TmpDir;
@@ -15,7 +15,7 @@ class BitbucketPublisher extends electron_publish_1.HttpPublisher {
15
15
  const token = info.token || process.env.BITBUCKET_TOKEN || null;
16
16
  const username = info.username || process.env.BITBUCKET_USERNAME || null;
17
17
  if ((0, builder_util_1.isEmptyOrSpaces)(token)) {
18
- throw new builder_util_1.InvalidConfigurationError(`Bitbucket token is not set using env "BITBUCKET_TOKEN" (see https://www.electron.build/configuration/publish#BitbucketOptions)`);
18
+ throw new builder_util_1.InvalidConfigurationError(`Bitbucket token is not set using env "BITBUCKET_TOKEN" (see https://www.electron.build/publish#BitbucketOptions)`);
19
19
  }
20
20
  if ((0, builder_util_1.isEmptyOrSpaces)(username)) {
21
21
  builder_util_1.log.warn('No Bitbucket username provided via "BITBUCKET_USERNAME". Defaulting to use repo owner.');
@@ -1 +1 @@
1
- {"version":3,"file":"BitbucketPublisher.js","sourceRoot":"","sources":["../../src/publish/BitbucketPublisher.ts"],"names":[],"mappings":";;;AAAA,+CAAoF;AACpF,+CAA2C;AAE3C,uDAAgE;AAEhE,+DAA4E;AAC5E,sCAAqC;AACrC,uCAAmC;AAEnC,MAAa,kBAAmB,SAAQ,gCAAa;IAQnD,YAAY,OAAuB,EAAE,IAAsB;QACzD,KAAK,CAAC,OAAO,CAAC,CAAA;QARP,iBAAY,GAAG,WAAW,CAAA;QAC1B,aAAQ,GAAG,mBAAmB,CAAA;QASrC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,IAAI,CAAA;QAC/D,MAAM,QAAQ,GAAG,IAAI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AAuB,EAAC,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;YACxI,OAAO,QAAQ,CAAA;QACjB,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,QAAgB;QAClC,MAAM,GAAG,GAAmB;YAC1B,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,IAAI,EAAE,GAAG,IAAI,CAAC,QAAQ,IAAI,QAAQ,EAAE;YACpC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,SAAS;SACxC,CAAA;QACD,MAAM,2BAAY,CAAC,OAAO,CAAC,IAAA,8CAAuB,EAAC,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAA;IAC/G,CAAC;IAED,QAAQ;QACN,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI,CAAA;QAC1C,OAAO,qBAAqB,KAAK,WAAW,IAAI,cAAc,OAAO,GAAG,CAAA;IAC1E,CAAC;IAED,MAAM,CAAC,kBAAkB,CAAC,QAAgB,EAAE,KAAa;QACvD,MAAM,iBAAiB,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;QACvF,OAAO,SAAS,iBAAiB,EAAE,CAAA;IACrC,CAAC;CACF;AAnED,gDAmEC","sourcesContent":["import { Arch, InvalidConfigurationError, isEmptyOrSpaces, log } from \"builder-util\"\nimport { httpExecutor } from \"builder-util\"\nimport { ClientRequest, RequestOptions } from \"http\"\nimport { HttpPublisher, PublishContext } from \"electron-publish\"\nimport { BitbucketOptions } from \"builder-util-runtime/out/publishOptions\"\nimport { configureRequestOptions, HttpExecutor } from \"builder-util-runtime\"\nimport * as FormData from \"form-data\"\nimport { readFile } from \"fs-extra\"\n\nexport class BitbucketPublisher extends HttpPublisher {\n readonly providerName = \"bitbucket\"\n readonly hostname = \"api.bitbucket.org\"\n\n private readonly info: BitbucketOptions\n private readonly auth: string\n private readonly basePath: string\n\n constructor(context: PublishContext, info: BitbucketOptions) {\n super(context)\n\n const token = info.token || process.env.BITBUCKET_TOKEN || null\n const username = info.username || process.env.BITBUCKET_USERNAME || null\n\n if (isEmptyOrSpaces(token)) {\n throw new InvalidConfigurationError(`Bitbucket token is not set using env \"BITBUCKET_TOKEN\" (see https://www.electron.build/configuration/publish#BitbucketOptions)`)\n }\n\n if (isEmptyOrSpaces(username)) {\n log.warn('No Bitbucket username provided via \"BITBUCKET_USERNAME\". Defaulting to use repo owner.')\n }\n\n this.info = info\n this.auth = BitbucketPublisher.convertAppPassword(username ?? this.info.owner, token)\n this.basePath = `/2.0/repositories/${this.info.owner}/${this.info.slug}/downloads`\n }\n\n protected doUpload(\n fileName: string,\n _arch: Arch,\n _dataLength: number,\n _requestProcessor: (request: ClientRequest, reject: (error: Error) => void) => void,\n file: string\n ): Promise<any> {\n return HttpExecutor.retryOnServerError(async () => {\n const fileContent = await readFile(file)\n const form = new FormData()\n form.append(\"files\", fileContent, fileName)\n const upload: RequestOptions = {\n hostname: this.hostname,\n path: this.basePath,\n headers: form.getHeaders(),\n timeout: this.info.timeout || undefined,\n }\n await httpExecutor.doApiRequest(configureRequestOptions(upload, this.auth, \"POST\"), this.context.cancellationToken, it => form.pipe(it))\n return fileName\n })\n }\n\n async deleteRelease(filename: string): Promise<void> {\n const req: RequestOptions = {\n hostname: this.hostname,\n path: `${this.basePath}/${filename}`,\n timeout: this.info.timeout || undefined,\n }\n await httpExecutor.request(configureRequestOptions(req, this.auth, \"DELETE\"), this.context.cancellationToken)\n }\n\n toString() {\n const { owner, slug, channel } = this.info\n return `Bitbucket (owner: ${owner}, slug: ${slug}, channel: ${channel})`\n }\n\n static convertAppPassword(username: string, token: string) {\n const base64encodedData = Buffer.from(`${username}:${token.trim()}`).toString(\"base64\")\n return `Basic ${base64encodedData}`\n }\n}\n"]}
1
+ {"version":3,"file":"BitbucketPublisher.js","sourceRoot":"","sources":["../../src/publish/BitbucketPublisher.ts"],"names":[],"mappings":";;;AAAA,+CAAoF;AACpF,+CAA2C;AAE3C,uDAAgE;AAEhE,+DAA4E;AAC5E,sCAAqC;AACrC,uCAAmC;AAEnC,MAAa,kBAAmB,SAAQ,gCAAa;IAQnD,YAAY,OAAuB,EAAE,IAAsB;QACzD,KAAK,CAAC,OAAO,CAAC,CAAA;QARP,iBAAY,GAAG,WAAW,CAAA;QAC1B,aAAQ,GAAG,mBAAmB,CAAA;QASrC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,IAAI,CAAA;QAC/D,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,IAAI,CAAA;QAExE,IAAI,IAAA,8BAAe,EAAC,KAAK,CAAC,EAAE,CAAC;YAC3B,MAAM,IAAI,wCAAyB,CAAC,kHAAkH,CAAC,CAAA;QACzJ,CAAC;QAED,IAAI,IAAA,8BAAe,EAAC,QAAQ,CAAC,EAAE,CAAC;YAC9B,kBAAG,CAAC,IAAI,CAAC,wFAAwF,CAAC,CAAA;QACpG,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC,kBAAkB,CAAC,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;QACrF,IAAI,CAAC,QAAQ,GAAG,qBAAqB,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI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AAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAA;IAC/G,CAAC;IAED,QAAQ;QACN,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI,CAAA;QAC1C,OAAO,qBAAqB,KAAK,WAAW,IAAI,cAAc,OAAO,GAAG,CAAA;IAC1E,CAAC;IAED,MAAM,CAAC,kBAAkB,CAAC,QAAgB,EAAE,KAAa;QACvD,MAAM,iBAAiB,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;QACvF,OAAO,SAAS,iBAAiB,EAAE,CAAA;IACrC,CAAC;CACF;AAnED,gDAmEC","sourcesContent":["import { Arch, InvalidConfigurationError, isEmptyOrSpaces, log } from \"builder-util\"\nimport { httpExecutor } from \"builder-util\"\nimport { ClientRequest, RequestOptions } from \"http\"\nimport { HttpPublisher, PublishContext } from \"electron-publish\"\nimport { BitbucketOptions } from \"builder-util-runtime/out/publishOptions\"\nimport { configureRequestOptions, HttpExecutor } from \"builder-util-runtime\"\nimport * as FormData from \"form-data\"\nimport { readFile } from \"fs-extra\"\n\nexport class BitbucketPublisher extends HttpPublisher {\n readonly providerName = \"bitbucket\"\n readonly hostname = \"api.bitbucket.org\"\n\n private readonly info: BitbucketOptions\n private readonly auth: string\n private readonly basePath: string\n\n constructor(context: PublishContext, info: BitbucketOptions) {\n super(context)\n\n const token = info.token || process.env.BITBUCKET_TOKEN || null\n const username = info.username || process.env.BITBUCKET_USERNAME || null\n\n if (isEmptyOrSpaces(token)) {\n throw new InvalidConfigurationError(`Bitbucket token is not set using env \"BITBUCKET_TOKEN\" (see https://www.electron.build/publish#BitbucketOptions)`)\n }\n\n if (isEmptyOrSpaces(username)) {\n log.warn('No Bitbucket username provided via \"BITBUCKET_USERNAME\". Defaulting to use repo owner.')\n }\n\n this.info = info\n this.auth = BitbucketPublisher.convertAppPassword(username ?? this.info.owner, token)\n this.basePath = `/2.0/repositories/${this.info.owner}/${this.info.slug}/downloads`\n }\n\n protected doUpload(\n fileName: string,\n _arch: Arch,\n _dataLength: number,\n _requestProcessor: (request: ClientRequest, reject: (error: Error) => void) => void,\n file: string\n ): Promise<any> {\n return HttpExecutor.retryOnServerError(async () => {\n const fileContent = await readFile(file)\n const form = new FormData()\n form.append(\"files\", fileContent, fileName)\n const upload: RequestOptions = {\n hostname: this.hostname,\n path: this.basePath,\n headers: form.getHeaders(),\n timeout: this.info.timeout || undefined,\n }\n await httpExecutor.doApiRequest(configureRequestOptions(upload, this.auth, \"POST\"), this.context.cancellationToken, it => form.pipe(it))\n return fileName\n })\n }\n\n async deleteRelease(filename: string): Promise<void> {\n const req: RequestOptions = {\n hostname: this.hostname,\n path: `${this.basePath}/${filename}`,\n timeout: this.info.timeout || undefined,\n }\n await httpExecutor.request(configureRequestOptions(req, this.auth, \"DELETE\"), this.context.cancellationToken)\n }\n\n toString() {\n const { owner, slug, channel } = this.info\n return `Bitbucket (owner: ${owner}, slug: ${slug}, channel: ${channel})`\n }\n\n static convertAppPassword(username: string, token: string) {\n const base64encodedData = Buffer.from(`${username}:${token.trim()}`).toString(\"base64\")\n return `Basic ${base64encodedData}`\n }\n}\n"]}
@@ -13,7 +13,7 @@ class KeygenPublisher extends electron_publish_1.HttpPublisher {
13
13
  this.hostname = "api.keygen.sh";
14
14
  const token = process.env.KEYGEN_TOKEN;
15
15
  if ((0, builder_util_1.isEmptyOrSpaces)(token)) {
16
- throw new builder_util_1.InvalidConfigurationError(`Keygen token is not set using env "KEYGEN_TOKEN" (see https://www.electron.build/configuration/publish#KeygenOptions)`);
16
+ throw new builder_util_1.InvalidConfigurationError(`Keygen token is not set using env "KEYGEN_TOKEN" (see https://www.electron.build/publish#KeygenOptions)`);
17
17
  }
18
18
  this.info = info;
19
19
  this.auth = `Bearer ${token.trim()}`;
@@ -1 +1 @@
1
- {"version":3,"file":"Keyg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Executor } from \"builder-util\"\nimport { ClientRequest, RequestOptions } from \"http\"\nimport { HttpPublisher, PublishContext } from \"electron-publish\"\nimport { KeygenOptions } from \"builder-util-runtime/out/publishOptions\"\nimport { configureRequestOptions, HttpExecutor, parseJson } from \"builder-util-runtime\"\nimport { getCompleteExtname } from \"../util/filename\"\n\ntype RecursivePartial<T> = {\n [P in keyof T]?: RecursivePartial<T[P]>\n}\n\nexport interface KeygenError {\n title: string\n detail: string\n code: string\n}\n\nexport interface KeygenRelease {\n id: string\n type: \"releases\"\n attributes: {\n name: string | null\n description: string | null\n channel: \"stable\" | \"rc\" | \"beta\" | \"alpha\" | \"dev\"\n status: \"DRAFT\" | \"PUBLISHED\" | \"YANKED\"\n tag: string\n version: string\n semver: {\n major: number\n minor: number\n patch: number\n prerelease: string | null\n build: string | null\n }\n metadata: { [s: string]: any }\n created: string\n updated: string\n yanked: string | null\n }\n relationships: {\n account: {\n data: { type: \"accounts\"; id: string }\n }\n product: {\n data: { type: \"products\"; id: string }\n }\n }\n}\n\nexport interface KeygenArtifact {\n id: string\n type: \"artifacts\"\n attributes: {\n filename: string\n filetype: string | null\n filesize: number | null\n platform: string | null\n arch: string | null\n signature: string | null\n checksum: string | null\n status: \"WAITING\" | \"UPLOADED\" | \"FAILED\" | \"YANKED\"\n metadata: { [s: string]: any }\n created: string\n updated: string\n }\n relationships: {\n account: {\n data: { type: \"accounts\"; id: string }\n }\n release: {\n data: { type: \"releases\"; id: string }\n }\n }\n links: {\n redirect: string\n }\n}\n\nexport class KeygenPublisher extends HttpPublisher {\n readonly providerName = \"keygen\"\n readonly hostname = \"api.keygen.sh\"\n\n private readonly info: KeygenOptions\n private readonly auth: string\n private readonly version: string\n private readonly basePath: string\n\n constructor(context: PublishContext, info: KeygenOptions, version: string) {\n super(context)\n\n const token = process.env.KEYGEN_TOKEN\n if (isEmptyOrSpaces(token)) {\n throw new InvalidConfigurationError(`Keygen token is not set using env \"KEYGEN_TOKEN\" (see https://www.electron.build/configuration/publish#KeygenOptions)`)\n }\n\n this.info = info\n this.auth = `Bearer ${token.trim()}`\n this.version = version\n this.basePath = `/v1/accounts/${this.info.account}`\n }\n\n protected doUpload(\n fileName: string,\n _arch: Arch,\n dataLength: number,\n requestProcessor: (request: ClientRequest, reject: (error: Error) => void) => void,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _file: string\n ): Promise<string> {\n return HttpExecutor.retryOnServerError(async () => {\n const { data, errors } = await this.getOrCreateRelease()\n if (errors) {\n throw new Error(`Keygen - Creating release returned errors: ${JSON.stringify(errors)}`)\n }\n\n await this.uploadArtifact(data!.id, fileName, dataLength, requestProcessor)\n\n return data!.id\n })\n }\n\n private async uploadArtifact(\n releaseId: any,\n fileName: string,\n dataLength: number,\n requestProcessor: (request: ClientRequest, reject: (error: Error) => void) => void\n ): Promise<void> {\n const { data, errors } = await this.createArtifact(releaseId, fileName, dataLength)\n if (errors) {\n throw new Error(`Keygen - Creating artifact returned errors: ${JSON.stringify(errors)}`)\n }\n\n // Follow the redirect and upload directly to S3-equivalent storage provider\n const url = new URL(data!.links.redirect)\n const upload: RequestOptions = {\n hostname: url.hostname,\n path: url.pathname + url.search,\n headers: {\n \"Content-Length\": dataLength,\n },\n timeout: this.info.timeout || undefined,\n }\n\n await httpExecutor.doApiRequest(configureRequestOptions(upload, null, \"PUT\"), this.context.cancellationToken, requestProcessor)\n }\n\n private async createArtifact(releaseId: any, fileName: string, dataLength: number): Promise<{ data?: KeygenArtifact; errors?: KeygenError[] }> {\n const upload: RequestOptions = {\n hostname: this.hostname,\n path: `${this.basePath}/artifacts`,\n headers: {\n \"Content-Type\": \"application/vnd.api+json\",\n Accept: \"application/vnd.api+json\",\n \"Keygen-Version\": \"1.1\",\n Prefer: \"no-redirect\",\n },\n timeout: this.info.timeout || undefined,\n }\n\n const data: RecursivePartial<KeygenArtifact> = {\n type: \"artifacts\",\n attributes: {\n filename: fileName,\n filetype: getCompleteExtname(fileName),\n filesize: dataLength,\n platform: this.info.platform,\n },\n relationships: {\n release: {\n data: {\n type: \"releases\",\n id: releaseId,\n },\n },\n },\n }\n\n log.debug({ data: JSON.stringify(data) }, \"Keygen create artifact\")\n\n return parseJson(httpExecutor.request(configureRequestOptions(upload, this.auth, \"POST\"), this.context.cancellationToken, { data }))\n }\n\n private async getOrCreateRelease(): Promise<{ data?: KeygenRelease; errors?: KeygenError[] }> {\n try {\n // First, we'll attempt to fetch the release.\n return await this.getRelease()\n } catch (e: any) {\n if (e.statusCode !== 404) {\n throw e\n }\n\n try {\n // Next, if the release doesn't exist, we'll attempt to create it.\n return await this.createRelease()\n } catch (e: any) {\n if (e.statusCode !== 409 && e.statusCode !== 422) {\n throw e\n }\n\n // Lastly, when a conflict occurs (in the case of parallel uploads),\n // we'll try to fetch it one last time.\n return this.getRelease()\n }\n }\n }\n\n private async getRelease(): Promise<{ data?: KeygenRelease; errors?: KeygenError[] }> {\n const req: RequestOptions = {\n hostname: this.hostname,\n path: `${this.basePath}/releases/${this.version}?product=${this.info.product}`,\n headers: {\n Accept: \"application/vnd.api+json\",\n \"Keygen-Version\": \"1.1\",\n },\n timeout: this.info.timeout || undefined,\n }\n\n return parseJson(httpExecutor.request(configureRequestOptions(req, this.auth, \"GET\"), this.context.cancellationToken, null))\n }\n\n private async createRelease(): Promise<{ data?: KeygenRelease; errors?: KeygenError[] }> {\n const req: RequestOptions = {\n hostname: this.hostname,\n path: `${this.basePath}/releases`,\n headers: {\n \"Content-Type\": \"application/vnd.api+json\",\n Accept: \"application/vnd.api+json\",\n \"Keygen-Version\": \"1.1\",\n },\n timeout: this.info.timeout || undefined,\n }\n\n const data: RecursivePartial<KeygenRelease> = {\n type: \"releases\",\n attributes: {\n version: this.version,\n channel: this.info.channel || \"stable\",\n status: \"PUBLISHED\",\n },\n relationships: {\n product: {\n data: {\n type: \"products\",\n id: this.info.product,\n },\n },\n },\n }\n\n log.debug({ data: JSON.stringify(data) }, \"Keygen create release\")\n\n return parseJson(httpExecutor.request(configureRequestOptions(req, this.auth, \"POST\"), this.context.cancellationToken, { data }))\n }\n\n async deleteRelease(releaseId: string): Promise<void> {\n const req: RequestOptions = {\n hostname: this.hostname,\n path: `${this.basePath}/releases/${releaseId}`,\n headers: {\n Accept: \"application/vnd.api+json\",\n \"Keygen-Version\": \"1.1\",\n },\n timeout: this.info.timeout || undefined,\n }\n await httpExecutor.request(configureRequestOptions(req, this.auth, \"DELETE\"), this.context.cancellationToken)\n }\n\n toString() {\n const { account, product, platform } = this.info\n return `Keygen (account: ${account}, product: ${product}, platform: ${platform}, version: ${this.version})`\n }\n}\n"]}
1
+ {"version":3,"file":"KeygenPublisher.js","sourceRoot":"","sources":["../../src/publish/KeygenPublisher.ts"],"names":[],"mappings":";;;AAAA,+CAAoF;AACpF,+CAA2C;AAE3C,uDAAgE;AAEhE,+DAAuF;AACvF,+CAAqD;AAyErD,MAAa,eAAgB,SAAQ,gCAAa;IAShD,YAAY,OAAuB,EAAE,IAAmB,EAAE,OAAe;QACvE,KAAK,CAAC,OAAO,CAAC,CAAA;QATP,iBAAY,GAAG,QAAQ,CAAA;QACvB,aAAQ,GAAG,eAAe,CAAA;QAUjC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAA;QACtC,IAAI,IAAA,8BAAe,EAAC,KAAK,CAAC,EAAE,CAAC;YAC3B,MAAM,IAAI,wCAAyB,CAAC,yGAAyG,CAAC,CAAA;QAChJ,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,IAAI,GAAG,UAAU,KAAK,CAAC,IAAI,EAAE,EAAE,CAAA;QACpC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,QAAQ,GAAG,gBAAgB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAA;IACrD,CAAC;IAES,QAAQ,CAChB,QAAgB,EAChB,KAAW,EACX,UAAkB,EAClB,gBAAkF;IAClF,6DAA6D;IAC7D,KAAa;QAEb,OA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I,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAA;IAC/G,CAAC;IAED,QAAQ;QACN,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,IAAI,CAAA;QAChD,OAAO,oBAAoB,OAAO,cAAc,OAAO,eAAe,QAAQ,cAAc,IAAI,CAAC,OAAO,GAAG,CAAA;IAC7G,CAAC;CACF;AAjMD,0CAiMC","sourcesContent":["import { Arch, InvalidConfigurationError, log, isEmptyOrSpaces } from \"builder-util\"\nimport { httpExecutor } from \"builder-util\"\nimport { ClientRequest, RequestOptions } from \"http\"\nimport { HttpPublisher, PublishContext } from \"electron-publish\"\nimport { KeygenOptions } from \"builder-util-runtime/out/publishOptions\"\nimport { configureRequestOptions, HttpExecutor, parseJson } from \"builder-util-runtime\"\nimport { getCompleteExtname } from \"../util/filename\"\n\ntype RecursivePartial<T> = {\n [P in keyof T]?: RecursivePartial<T[P]>\n}\n\nexport interface KeygenError {\n title: string\n detail: string\n code: string\n}\n\nexport interface KeygenRelease {\n id: string\n type: \"releases\"\n attributes: {\n name: string | null\n description: string | null\n channel: \"stable\" | \"rc\" | \"beta\" | \"alpha\" | \"dev\"\n status: \"DRAFT\" | \"PUBLISHED\" | \"YANKED\"\n tag: string\n version: string\n semver: {\n major: number\n minor: number\n patch: number\n prerelease: string | null\n build: string | null\n }\n metadata: { [s: string]: any }\n created: string\n updated: string\n yanked: string | null\n }\n relationships: {\n account: {\n data: { type: \"accounts\"; id: string }\n }\n product: {\n data: { type: \"products\"; id: string }\n }\n }\n}\n\nexport interface KeygenArtifact {\n id: string\n type: \"artifacts\"\n attributes: {\n filename: string\n filetype: string | null\n filesize: number | null\n platform: string | null\n arch: string | null\n signature: string | null\n checksum: string | null\n status: \"WAITING\" | \"UPLOADED\" | \"FAILED\" | \"YANKED\"\n metadata: { [s: string]: any }\n created: string\n updated: string\n }\n relationships: {\n account: {\n data: { type: \"accounts\"; id: string }\n }\n release: {\n data: { type: \"releases\"; id: string }\n }\n }\n links: {\n redirect: string\n }\n}\n\nexport class KeygenPublisher extends HttpPublisher {\n readonly providerName = \"keygen\"\n readonly hostname = \"api.keygen.sh\"\n\n private readonly info: KeygenOptions\n private readonly auth: string\n private readonly version: string\n private readonly basePath: string\n\n constructor(context: PublishContext, info: KeygenOptions, version: string) {\n super(context)\n\n const token = process.env.KEYGEN_TOKEN\n if (isEmptyOrSpaces(token)) {\n throw new InvalidConfigurationError(`Keygen token is not set using env \"KEYGEN_TOKEN\" (see https://www.electron.build/publish#KeygenOptions)`)\n }\n\n this.info = info\n this.auth = `Bearer ${token.trim()}`\n this.version = version\n this.basePath = `/v1/accounts/${this.info.account}`\n }\n\n protected doUpload(\n fileName: string,\n _arch: Arch,\n dataLength: number,\n requestProcessor: (request: ClientRequest, reject: (error: Error) => void) => void,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _file: string\n ): Promise<string> {\n return HttpExecutor.retryOnServerError(async () => {\n const { data, errors } = await this.getOrCreateRelease()\n if (errors) {\n throw new Error(`Keygen - Creating release returned errors: ${JSON.stringify(errors)}`)\n }\n\n await this.uploadArtifact(data!.id, fileName, dataLength, requestProcessor)\n\n return data!.id\n })\n }\n\n private async uploadArtifact(\n releaseId: any,\n fileName: string,\n dataLength: number,\n requestProcessor: (request: ClientRequest, reject: (error: Error) => void) => void\n ): Promise<void> {\n const { data, errors } = await this.createArtifact(releaseId, fileName, dataLength)\n if (errors) {\n throw new Error(`Keygen - Creating artifact returned errors: ${JSON.stringify(errors)}`)\n }\n\n // Follow the redirect and upload directly to S3-equivalent storage provider\n const url = new URL(data!.links.redirect)\n const upload: RequestOptions = {\n hostname: url.hostname,\n path: url.pathname + url.search,\n headers: {\n \"Content-Length\": dataLength,\n },\n timeout: this.info.timeout || undefined,\n }\n\n await httpExecutor.doApiRequest(configureRequestOptions(upload, null, \"PUT\"), this.context.cancellationToken, requestProcessor)\n }\n\n private async createArtifact(releaseId: any, fileName: string, dataLength: number): Promise<{ data?: KeygenArtifact; errors?: KeygenError[] }> {\n const upload: RequestOptions = {\n hostname: this.hostname,\n path: `${this.basePath}/artifacts`,\n headers: {\n \"Content-Type\": \"application/vnd.api+json\",\n Accept: \"application/vnd.api+json\",\n \"Keygen-Version\": \"1.1\",\n Prefer: \"no-redirect\",\n },\n timeout: this.info.timeout || undefined,\n }\n\n const data: RecursivePartial<KeygenArtifact> = {\n type: \"artifacts\",\n attributes: {\n filename: fileName,\n filetype: getCompleteExtname(fileName),\n filesize: dataLength,\n platform: this.info.platform,\n },\n relationships: {\n release: {\n data: {\n type: \"releases\",\n id: releaseId,\n },\n },\n },\n }\n\n log.debug({ data: JSON.stringify(data) }, \"Keygen create artifact\")\n\n return parseJson(httpExecutor.request(configureRequestOptions(upload, this.auth, \"POST\"), this.context.cancellationToken, { data }))\n }\n\n private async getOrCreateRelease(): Promise<{ data?: KeygenRelease; errors?: KeygenError[] }> {\n try {\n // First, we'll attempt to fetch the release.\n return await this.getRelease()\n } catch (e: any) {\n if (e.statusCode !== 404) {\n throw e\n }\n\n try {\n // Next, if the release doesn't exist, we'll attempt to create it.\n return await this.createRelease()\n } catch (e: any) {\n if (e.statusCode !== 409 && e.statusCode !== 422) {\n throw e\n }\n\n // Lastly, when a conflict occurs (in the case of parallel uploads),\n // we'll try to fetch it one last time.\n return this.getRelease()\n }\n }\n }\n\n private async getRelease(): Promise<{ data?: KeygenRelease; errors?: KeygenError[] }> {\n const req: RequestOptions = {\n hostname: this.hostname,\n path: `${this.basePath}/releases/${this.version}?product=${this.info.product}`,\n headers: {\n Accept: \"application/vnd.api+json\",\n \"Keygen-Version\": \"1.1\",\n },\n timeout: this.info.timeout || undefined,\n }\n\n return parseJson(httpExecutor.request(configureRequestOptions(req, this.auth, \"GET\"), this.context.cancellationToken, null))\n }\n\n private async createRelease(): Promise<{ data?: KeygenRelease; errors?: KeygenError[] }> {\n const req: RequestOptions = {\n hostname: this.hostname,\n path: `${this.basePath}/releases`,\n headers: {\n \"Content-Type\": \"application/vnd.api+json\",\n Accept: \"application/vnd.api+json\",\n \"Keygen-Version\": \"1.1\",\n },\n timeout: this.info.timeout || undefined,\n }\n\n const data: RecursivePartial<KeygenRelease> = {\n type: \"releases\",\n attributes: {\n version: this.version,\n channel: this.info.channel || \"stable\",\n status: \"PUBLISHED\",\n },\n relationships: {\n product: {\n data: {\n type: \"products\",\n id: this.info.product,\n },\n },\n },\n }\n\n log.debug({ data: JSON.stringify(data) }, \"Keygen create release\")\n\n return parseJson(httpExecutor.request(configureRequestOptions(req, this.auth, \"POST\"), this.context.cancellationToken, { data }))\n }\n\n async deleteRelease(releaseId: string): Promise<void> {\n const req: RequestOptions = {\n hostname: this.hostname,\n path: `${this.basePath}/releases/${releaseId}`,\n headers: {\n Accept: \"application/vnd.api+json\",\n \"Keygen-Version\": \"1.1\",\n },\n timeout: this.info.timeout || undefined,\n }\n await httpExecutor.request(configureRequestOptions(req, this.auth, \"DELETE\"), this.context.cancellationToken)\n }\n\n toString() {\n const { account, product, platform } = this.info\n return `Keygen (account: ${account}, product: ${product}, platform: ${platform}, version: ${this.version})`\n }\n}\n"]}
@@ -429,7 +429,7 @@ async function getResolvedPublishConfig(platformPackager, packager, options, arc
429
429
  if (info != null) {
430
430
  return info;
431
431
  }
432
- const message = `Cannot detect repository by .git/config. Please specify "repository" in the package.json (https://docs.npmjs.com/files/package.json#repository).\nPlease see https://electron.build/configuration/publish`;
432
+ const message = `Cannot detect repository by .git/config. Please specify "repository" in the package.json (https://docs.npmjs.com/files/package.json#repository).\nPlease see https://electron.build/publish`;
433
433
  if (errorIfCannot) {
434
434
  throw new Error(message);
435
435
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PublishManager.js","sourceRoot":"","sources":["../../src/publish/PublishManager.ts"],"names":[],"mappings":";;;AAsPA,4EAmBC;AAED,wEAwBC;AAED,0CAwBC;AA0CD,gDAuBC;AAED,8CAgCC;AAhaD,+CAA0C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,CAAC;YACN,kBAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YACjB,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;IAED,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC;QACvB,kBAAG,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,8CAA8C,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,iBAAiB,CAAC,CAAA;QAClH,MAAM,IAAI,GAAG,MAAM,OAAO,EAAE,CAAA;QAC5B,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;YACjB,OAAO,IAAI,CAAA;QACb,CAAC;QAED,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,KAAK,GAAG,IAAI,CAAC,IAAI,CAAA;QACnB,CAAC;QACD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QACxB,CAAC;IACH,CAAC;IAED,IAAI,QAAQ,EAAE,CAAC;QACb,IAAK,OAAyB,CAAC,KAAK,IAAI,IAAI,IAAI,CAAE,OAAyB,CAAC,OAAO,EAAE,CAAC;YACpF,kBAAG,CAAC,IAAI,CAAC,yJAAyJ,CAAC,CAAA;QACrK,CAAC;QACD,2DAA2D;QAC3D,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,EAAmB,CAAA;IAC9D,CAAC;SAAM,CAAC;QACN,2DAA2D;QAC3D,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,EAAsB,CAAA;IACjE,CAAC;AACH,CAAC","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { Arch, asArray, AsyncTaskManager, InvalidConfigurationError, isEmptyOrSpaces, isPullRequest, log, safeStringifyJson, serializeToYaml } from \"builder-util\"\nimport {\n CancellationToken,\n GenericServerOptions,\n getS3LikeProviderBaseUrl,\n GithubOptions,\n githubUrl,\n KeygenOptions,\n SnapStoreOptions,\n PublishConfiguration,\n PublishProvider,\n BitbucketOptions,\n} from \"builder-util-runtime\"\nimport _debug from \"debug\"\nimport { getCiTag, PublishContext, Publisher, PublishOptions, UploadTask } from \"electron-publish\"\nimport { GitHubPublisher } from \"electron-publish/out/gitHubPublisher\"\nimport { MultiProgress } from \"electron-publish/out/multiProgress\"\nimport S3Publisher from \"./s3/s3Publisher\"\nimport SpacesPublisher from \"./s3/spacesPublisher\"\nimport { writeFile } from \"fs/promises\"\nimport * as isCi from \"is-ci\"\nimport * as path from \"path\"\nimport { WriteStream as TtyWriteStream } from \"tty\"\nimport * as url from \"url\"\nimport { AppInfo, ArtifactCreated, Configuration, Platform, PlatformSpecificBuildOptions, Target } from \"../index\"\nimport { Packager } from \"../packager\"\nimport { PlatformPackager } from \"../platformPackager\"\nimport { expandMacro } from \"../util/macroExpander\"\nimport { WinPackager } from \"../winPackager\"\nimport { SnapStorePublisher } from \"./SnapStorePublisher\"\nimport { createUpdateInfoTasks, UpdateInfoFileTask, writeUpdateInfoFiles } from \"./updateInfoBuilder\"\nimport { KeygenPublisher } from \"./KeygenPublisher\"\nimport { BitbucketPublisher } from \"./BitbucketPublisher\"\n\nconst publishForPrWarning =\n \"There are serious security concerns with PUBLISH_FOR_PULL_REQUEST=true (see the CircleCI documentation (https://circleci.com/docs/1.0/fork-pr-builds/) for details)\" +\n \"\\nIf you have SSH keys, sensitive env vars or AWS credentials stored in your project settings and untrusted forks can make pull requests against your repo, then this option isn't for you.\"\n\nconst debug = _debug(\"electron-builder:publish\")\n\nfunction checkOptions(publishPolicy: any) {\n if (publishPolicy != null && publishPolicy !== \"onTag\" && publishPolicy !== \"onTagOrDraft\" && publishPolicy !== \"always\" && publishPolicy !== \"never\") {\n if (typeof publishPolicy === \"string\") {\n throw new InvalidConfigurationError(\n `Expected one of \"onTag\", \"onTagOrDraft\", \"always\", \"never\", but got ${JSON.stringify(\n publishPolicy\n )}.\\nPlease note that publish configuration should be specified under \"config\"`\n )\n }\n }\n}\n\nexport class PublishManager implements PublishContext {\n private readonly nameToPublisher = new Map<string, Publisher | null>()\n\n private readonly taskManager: AsyncTaskManager\n\n readonly isPublish: boolean = false\n\n readonly progress = (process.stdout as TtyWriteStream).isTTY ? new MultiProgress() : null\n\n private readonly updateFileWriteTask: Array<UpdateInfoFileTask> = []\n\n constructor(\n private readonly packager: Packager,\n private readonly publishOptions: PublishOptions,\n readonly cancellationToken: CancellationToken = packager.cancellationToken\n ) {\n checkOptions(publishOptions.publish)\n\n this.taskManager = new AsyncTaskManager(cancellationToken)\n\n const forcePublishForPr = process.env.PUBLISH_FOR_PULL_REQUEST === \"true\"\n if (!isPullRequest() || forcePublishForPr) {\n if (publishOptions.publish === undefined) {\n if (process.env.npm_lifecycle_event === \"release\") {\n publishOptions.publish = \"always\"\n } else {\n const tag = getCiTag()\n if (tag != null) {\n log.info({ reason: \"tag is defined\", tag }, \"artifacts will be published\")\n publishOptions.publish = \"onTag\"\n } else if (isCi) {\n log.info({ reason: \"CI detected\" }, \"artifacts will be published if draft release exists\")\n publishOptions.publish = \"onTagOrDraft\"\n }\n }\n }\n\n const publishPolicy = publishOptions.publish\n this.isPublish = publishPolicy != null && publishOptions.publish !== \"never\" && (publishPolicy !== \"onTag\" || getCiTag() != null)\n if (this.isPublish && forcePublishForPr) {\n log.warn(publishForPrWarning)\n }\n } else if (publishOptions.publish !== \"never\") {\n log.info(\n {\n reason: \"current build is a part of pull request\",\n solution: `set env PUBLISH_FOR_PULL_REQUEST to true to force code signing\\n${publishForPrWarning}`,\n },\n \"publishing will be skipped\"\n )\n }\n\n packager.addAfterPackHandler(async event => {\n const packager = event.packager\n if (event.electronPlatformName === \"darwin\") {\n if (!event.targets.some(it => it.name === \"dmg\" || it.name === \"zip\")) {\n return\n }\n } else if (packager.platform === Platform.WINDOWS) {\n if (!event.targets.some(it => isSuitableWindowsTarget(it))) {\n return\n }\n }\n\n const publishConfig = await getAppUpdatePublishConfiguration(packager, event.arch, this.isPublish)\n if (publishConfig != null) {\n await writeFile(path.join(packager.getResourcesDir(event.appOutDir), \"app-update.yml\"), serializeToYaml(publishConfig))\n }\n })\n\n packager.artifactCreated(event => {\n const publishConfiguration = event.publishConfig\n if (publishConfiguration == null) {\n this.taskManager.addTask(this.artifactCreatedWithoutExplicitPublishConfig(event))\n } else if (this.isPublish) {\n if (debug.enabled) {\n debug(`artifactCreated (isPublish: ${this.isPublish}): ${safeStringifyJson(event, new Set([\"packager\"]))},\\n publishConfig: ${safeStringifyJson(publishConfiguration)}`)\n }\n this.scheduleUpload(publishConfiguration, event, this.getAppInfo(event.packager))\n }\n })\n }\n\n private getAppInfo(platformPackager: PlatformPackager<any> | null) {\n return platformPackager == null ? this.packager.appInfo : platformPackager.appInfo\n }\n\n async getGlobalPublishConfigurations(): Promise<Array<PublishConfiguration> | null> {\n const publishers = this.packager.config.publish\n return await resolvePublishConfigurations(publishers, null, this.packager, null, true)\n }\n\n scheduleUpload(publishConfig: PublishConfiguration, event: UploadTask, appInfo: AppInfo): void {\n if (publishConfig.provider === \"generic\") {\n return\n }\n\n const publisher = this.getOrCreatePublisher(publishConfig, appInfo)\n if (publisher == null) {\n log.debug(\n {\n file: log.filePath(event.file),\n reason: \"publisher is null\",\n publishConfig: safeStringifyJson(publishConfig),\n },\n \"not published\"\n )\n return\n }\n\n const providerName = publisher.providerName\n if (this.publishOptions.publish === \"onTagOrDraft\" && getCiTag() == null && providerName !== \"bitbucket\" && providerName !== \"github\") {\n log.info({ file: log.filePath(event.file), reason: \"current build is not for a git tag\", publishPolicy: \"onTagOrDraft\" }, `not published to ${providerName}`)\n return\n }\n\n if (publishConfig.timeout) {\n event.timeout = publishConfig.timeout\n }\n\n this.taskManager.addTask(publisher.upload(event))\n }\n\n private async artifactCreatedWithoutExplicitPublishConfig(event: ArtifactCreated) {\n const platformPackager = event.packager\n const target = event.target\n const publishConfigs = await getPublishConfigs(platformPackager, target == null ? null : target.options, event.arch, this.isPublish)\n\n if (debug.enabled) {\n debug(`artifactCreated (isPublish: ${this.isPublish}): ${safeStringifyJson(event, new Set([\"packager\"]))},\\n publishConfigs: ${safeStringifyJson(publishConfigs)}`)\n }\n\n const eventFile = event.file\n if (publishConfigs == null) {\n if (this.isPublish) {\n log.debug({ file: eventFile, reason: \"no publish configs\" }, \"not published\")\n }\n return\n }\n\n if (this.isPublish) {\n for (const publishConfig of publishConfigs) {\n if (this.cancellationToken.cancelled) {\n log.debug({ file: event.file, reason: \"cancelled\" }, \"not published\")\n break\n }\n\n this.scheduleUpload(publishConfig, event, this.getAppInfo(platformPackager))\n }\n }\n\n if (\n event.isWriteUpdateInfo &&\n target != null &&\n eventFile != null &&\n !this.cancellationToken.cancelled &&\n (platformPackager.platform !== Platform.WINDOWS || isSuitableWindowsTarget(target))\n ) {\n this.taskManager.addTask(createUpdateInfoTasks(event, publishConfigs).then(it => this.updateFileWriteTask.push(...it)))\n }\n }\n\n private getOrCreatePublisher(publishConfig: PublishConfiguration, appInfo: AppInfo): Publisher | null {\n // to not include token into cache key\n const providerCacheKey = safeStringifyJson(publishConfig)\n let publisher = this.nameToPublisher.get(providerCacheKey)\n if (publisher == null) {\n publisher = createPublisher(this, appInfo.version, publishConfig, this.publishOptions, this.packager)\n this.nameToPublisher.set(providerCacheKey, publisher)\n log.info({ publisher: publisher!.toString() }, \"publishing\")\n }\n return publisher\n }\n\n // noinspection JSUnusedGlobalSymbols\n cancelTasks() {\n this.taskManager.cancelTasks()\n this.nameToPublisher.clear()\n }\n\n async awaitTasks(): Promise<void> {\n await this.taskManager.awaitTasks()\n\n const updateInfoFileTasks = this.updateFileWriteTask\n if (this.cancellationToken.cancelled || updateInfoFileTasks.length === 0) {\n return\n }\n\n await writeUpdateInfoFiles(updateInfoFileTasks, this.packager)\n await this.taskManager.awaitTasks()\n }\n}\n\nexport async function getAppUpdatePublishConfiguration(packager: PlatformPackager<any>, arch: Arch, errorIfCannot: boolean) {\n const publishConfigs = await getPublishConfigsForUpdateInfo(packager, await getPublishConfigs(packager, null, arch, errorIfCannot), arch)\n if (publishConfigs == null || publishConfigs.length === 0) {\n return null\n }\n\n const publishConfig = {\n ...publishConfigs[0],\n updaterCacheDirName: packager.appInfo.updaterCacheDirName,\n }\n\n if (packager.platform === Platform.WINDOWS && publishConfig.publisherName == null) {\n const winPackager = packager as WinPackager\n const publisherName = winPackager.isForceCodeSigningVerification ? await (await winPackager.signtoolManager.value).computedPublisherName.value : undefined\n if (publisherName != null) {\n publishConfig.publisherName = publisherName\n }\n }\n return publishConfig\n}\n\nexport async function getPublishConfigsForUpdateInfo(\n packager: PlatformPackager<any>,\n publishConfigs: Array<PublishConfiguration> | null,\n arch: Arch | null\n): Promise<Array<PublishConfiguration> | null> {\n if (publishConfigs === null) {\n return null\n }\n\n if (publishConfigs.length === 0) {\n log.debug(null, \"getPublishConfigsForUpdateInfo: no publishConfigs, detect using repository info\")\n // https://github.com/electron-userland/electron-builder/issues/925#issuecomment-261732378\n // default publish config is github, file should be generated regardless of publish state (user can test installer locally or manage the release process manually)\n const repositoryInfo = await packager.info.repositoryInfo\n debug(`getPublishConfigsForUpdateInfo: ${safeStringifyJson(repositoryInfo)}`)\n if (repositoryInfo != null && repositoryInfo.type === \"github\") {\n const resolvedPublishConfig = await getResolvedPublishConfig(packager, packager.info, { provider: repositoryInfo.type }, arch, false)\n if (resolvedPublishConfig != null) {\n debug(`getPublishConfigsForUpdateInfo: resolve to publish config ${safeStringifyJson(resolvedPublishConfig)}`)\n return [resolvedPublishConfig]\n }\n }\n }\n return publishConfigs\n}\n\nexport function createPublisher(context: PublishContext, version: string, publishConfig: PublishConfiguration, options: PublishOptions, packager: Packager): Publisher | null {\n if (debug.enabled) {\n debug(`Create publisher: ${safeStringifyJson(publishConfig)}`)\n }\n\n const provider = publishConfig.provider\n switch (provider) {\n case \"github\":\n return new GitHubPublisher(context, publishConfig as GithubOptions, version, options)\n\n case \"keygen\":\n return new KeygenPublisher(context, publishConfig as KeygenOptions, version)\n\n case \"snapStore\":\n return new SnapStorePublisher(context, publishConfig as SnapStoreOptions)\n\n case \"generic\":\n return null\n\n default: {\n const clazz = requireProviderClass(provider, packager)\n return clazz == null ? null : new clazz(context, publishConfig)\n }\n }\n}\n\nfunction requireProviderClass(provider: string, packager: Packager): any | null {\n switch (provider) {\n case \"github\":\n return GitHubPublisher\n\n case \"generic\":\n return null\n\n case \"keygen\":\n return KeygenPublisher\n\n case \"s3\":\n return S3Publisher\n\n case \"snapStore\":\n return SnapStorePublisher\n\n case \"spaces\":\n return SpacesPublisher\n\n case \"bitbucket\":\n return BitbucketPublisher\n\n default: {\n const name = `electron-publisher-${provider}`\n let module: any = null\n try {\n module = require(path.join(packager.buildResourcesDir, name + \".js\"))\n } catch (ignored) {\n log.debug({ path: path.join(packager.buildResourcesDir, name + \".js\") }, \"Unable to find publish provider in build resources\")\n }\n\n if (module == null) {\n module = require(name)\n }\n return module.default || module\n }\n }\n}\n\nexport function computeDownloadUrl(publishConfiguration: PublishConfiguration, fileName: string | null, packager: PlatformPackager<any>) {\n if (publishConfiguration.provider === \"generic\") {\n const baseUrlString = (publishConfiguration as GenericServerOptions).url\n if (fileName == null) {\n return baseUrlString\n }\n\n const baseUrl = url.parse(baseUrlString)\n return url.format({ ...(baseUrl as url.UrlObject), pathname: path.posix.resolve(baseUrl.pathname || \"/\", encodeURI(fileName)) })\n }\n\n let baseUrl\n if (publishConfiguration.provider === \"github\") {\n const gh = publishConfiguration as GithubOptions\n baseUrl = `${githubUrl(gh)}/${gh.owner}/${gh.repo}/releases/download/${gh.vPrefixedTagName === false ? \"\" : \"v\"}${packager.appInfo.version}`\n } else {\n baseUrl = getS3LikeProviderBaseUrl(publishConfiguration)\n }\n\n if (fileName == null) {\n return baseUrl\n }\n return `${baseUrl}/${encodeURI(fileName)}`\n}\n\nexport async function getPublishConfigs(\n platformPackager: PlatformPackager<any>,\n targetSpecificOptions: PlatformSpecificBuildOptions | null | undefined,\n arch: Arch | null,\n errorIfCannot: boolean\n): Promise<Array<PublishConfiguration> | null> {\n let publishers\n\n // check build.nsis (target)\n if (targetSpecificOptions != null) {\n publishers = targetSpecificOptions.publish\n // if explicitly set to null - do not publish\n if (publishers === null) {\n return null\n }\n }\n\n // check build.win (platform)\n if (publishers == null) {\n publishers = platformPackager.platformSpecificBuildOptions.publish\n if (publishers === null) {\n return null\n }\n }\n\n if (publishers == null) {\n publishers = platformPackager.config.publish\n if (publishers === null) {\n return null\n }\n }\n return await resolvePublishConfigurations(publishers, platformPackager, platformPackager.info, arch, errorIfCannot)\n}\n\nasync function resolvePublishConfigurations(\n publishers: any,\n platformPackager: PlatformPackager<any> | null,\n packager: Packager,\n arch: Arch | null,\n errorIfCannot: boolean\n): Promise<Array<PublishConfiguration> | null> {\n if (publishers == null) {\n let serviceName: PublishProvider | null = null\n if (!isEmptyOrSpaces(process.env.GH_TOKEN) || !isEmptyOrSpaces(process.env.GITHUB_TOKEN)) {\n serviceName = \"github\"\n } else if (!isEmptyOrSpaces(process.env.KEYGEN_TOKEN)) {\n serviceName = \"keygen\"\n } else if (!isEmptyOrSpaces(process.env.BITBUCKET_TOKEN)) {\n serviceName = \"bitbucket\"\n } else if (!isEmptyOrSpaces(process.env.BT_TOKEN)) {\n throw new Error(\n \"Bintray has been sunset and is no longer supported by electron-builder. Ref: https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/\"\n )\n }\n\n if (serviceName != null) {\n log.debug(null, `detect ${serviceName} as publish provider`)\n return [(await getResolvedPublishConfig(platformPackager, packager, { provider: serviceName }, arch, errorIfCannot))!]\n }\n }\n\n if (publishers == null) {\n return []\n }\n\n debug(`Explicit publish provider: ${safeStringifyJson(publishers)}`)\n return await (BluebirdPromise.map(asArray(publishers), it =>\n getResolvedPublishConfig(platformPackager, packager, typeof it === \"string\" ? { provider: it } : it, arch, errorIfCannot)\n ) as Promise<Array<PublishConfiguration>>)\n}\n\nfunction isSuitableWindowsTarget(target: Target) {\n if (target.name === \"appx\" && target.options != null && (target.options as any).electronUpdaterAware) {\n return true\n }\n return target.name === \"nsis\" || target.name.startsWith(\"nsis-\")\n}\n\nfunction expandPublishConfig(options: any, platformPackager: PlatformPackager<any> | null, packager: Packager, arch: Arch | null): void {\n for (const name of Object.keys(options)) {\n const value = options[name]\n if (typeof value === \"string\") {\n const archValue = arch == null ? null : Arch[arch]\n const expanded = platformPackager == null ? expandMacro(value, archValue, packager.appInfo) : platformPackager.expandMacro(value, archValue)\n if (expanded !== value) {\n options[name] = expanded\n }\n }\n }\n}\n\nfunction isDetectUpdateChannel(platformSpecificConfiguration: PlatformSpecificBuildOptions | null, configuration: Configuration) {\n const value = platformSpecificConfiguration == null ? null : platformSpecificConfiguration.detectUpdateChannel\n return value == null ? configuration.detectUpdateChannel !== false : value\n}\n\nasync function getResolvedPublishConfig(\n platformPackager: PlatformPackager<any> | null,\n packager: Packager,\n options: PublishConfiguration,\n arch: Arch | null,\n errorIfCannot: boolean\n): Promise<PublishConfiguration | GithubOptions | BitbucketOptions | null> {\n options = { ...options }\n expandPublishConfig(options, platformPackager, packager, arch)\n\n let channelFromAppVersion: string | null = null\n if (\n (options as GenericServerOptions).channel == null &&\n isDetectUpdateChannel(platformPackager == null ? null : platformPackager.platformSpecificBuildOptions, packager.config)\n ) {\n channelFromAppVersion = packager.appInfo.channel\n }\n\n const provider = options.provider\n if (provider === \"generic\") {\n const o = options as GenericServerOptions\n if (o.url == null) {\n throw new InvalidConfigurationError(`Please specify \"url\" for \"generic\" update server`)\n }\n\n if (channelFromAppVersion != null) {\n ;(o as any).channel = channelFromAppVersion\n }\n return options\n }\n\n const providerClass = requireProviderClass(options.provider, packager)\n if (providerClass != null && providerClass.checkAndResolveOptions != null) {\n await providerClass.checkAndResolveOptions(options, channelFromAppVersion, errorIfCannot)\n return options\n }\n\n if (provider === \"keygen\") {\n return {\n ...options,\n platform: platformPackager?.platform.name,\n } as KeygenOptions\n }\n\n const isGithub = provider === \"github\"\n if (!isGithub && provider !== \"bitbucket\") {\n return options\n }\n\n let owner = isGithub ? (options as GithubOptions).owner : (options as BitbucketOptions).owner\n let project = isGithub ? (options as GithubOptions).repo : (options as BitbucketOptions).slug\n\n if (isGithub && owner == null && project != null) {\n const index = project.indexOf(\"/\")\n if (index > 0) {\n const repo = project\n project = repo.substring(0, index)\n owner = repo.substring(index + 1)\n }\n }\n\n async function getInfo() {\n const info = await packager.repositoryInfo\n if (info != null) {\n return info\n }\n\n const message = `Cannot detect repository by .git/config. Please specify \"repository\" in the package.json (https://docs.npmjs.com/files/package.json#repository).\\nPlease see https://electron.build/configuration/publish`\n if (errorIfCannot) {\n throw new Error(message)\n } else {\n log.warn(message)\n return null\n }\n }\n\n if (!owner || !project) {\n log.debug({ reason: \"owner or project is not specified explicitly\", provider, owner, project }, \"calling getInfo\")\n const info = await getInfo()\n if (info == null) {\n return null\n }\n\n if (!owner) {\n owner = info.user\n }\n if (!project) {\n project = info.project\n }\n }\n\n if (isGithub) {\n if ((options as GithubOptions).token != null && !(options as GithubOptions).private) {\n log.warn('\"token\" specified in the github publish options. It should be used only for [setFeedURL](module:electron-updater/out/AppUpdater.AppUpdater+setFeedURL).')\n }\n //tslint:disable-next-line:no-object-literal-type-assertion\n return { owner, repo: project, ...options } as GithubOptions\n } else {\n //tslint:disable-next-line:no-object-literal-type-assertion\n return { owner, slug: project, ...options } as BitbucketOptions\n }\n}\n"]}
1
+ {"version":3,"file":"PublishManager.js","sourceRoot":"","sources":["../../src/publish/PublishManager.ts"],"names":[],"mappings":";;;AAsPA,4EAmBC;AAED,wEAwBC;AAED,0CAwBC;AA0CD,gDAuBC;AAED,8CAgCC;AAhaD,+CAA0C;AAC1C,+CAAkK;AAClK,+DAW6B;AAC7B,iCAA0B;AAC1B,uDAAkG;AAClG,0EAAsE;AACtE,sEAAkE;AAClE,kDAA0C;AAC1C,0DAAkD;AAClD,0CAAuC;AACvC,8BAA6B;AAC7B,6BAA4B;AAE5B,2BAA0B;AAC1B,oCAAkH;AAGlH,yDAAmD;AAEnD,6DAAyD;AACzD,2DAAqG;AACr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O,EAAE,EAAE,iBAAiB,CAAC,CAAA;QAClH,MAAM,IAAI,GAAG,MAAM,OAAO,EAAE,CAAA;QAC5B,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;YACjB,OAAO,IAAI,CAAA;QACb,CAAC;QAED,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,KAAK,GAAG,IAAI,CAAC,IAAI,CAAA;QACnB,CAAC;QACD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QACxB,CAAC;IACH,CAAC;IAED,IAAI,QAAQ,EAAE,CAAC;QACb,IAAK,OAAyB,CAAC,KAAK,IAAI,IAAI,IAAI,CAAE,OAAyB,CAAC,OAAO,EAAE,CAAC;YACpF,kBAAG,CAAC,IAAI,CAAC,yJAAyJ,CAAC,CAAA;QACrK,CAAC;QACD,2DAA2D;QAC3D,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,EAAmB,CAAA;IAC9D,CAAC;SAAM,CAAC;QACN,2DAA2D;QAC3D,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,EAAsB,CAAA;IACjE,CAAC;AACH,CAAC","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { Arch, asArray, AsyncTaskManager, InvalidConfigurationError, isEmptyOrSpaces, isPullRequest, log, safeStringifyJson, serializeToYaml } from \"builder-util\"\nimport {\n CancellationToken,\n GenericServerOptions,\n getS3LikeProviderBaseUrl,\n GithubOptions,\n githubUrl,\n KeygenOptions,\n SnapStoreOptions,\n PublishConfiguration,\n PublishProvider,\n BitbucketOptions,\n} from \"builder-util-runtime\"\nimport _debug from \"debug\"\nimport { getCiTag, PublishContext, Publisher, PublishOptions, UploadTask } from \"electron-publish\"\nimport { GitHubPublisher } from \"electron-publish/out/gitHubPublisher\"\nimport { MultiProgress } from \"electron-publish/out/multiProgress\"\nimport S3Publisher from \"./s3/s3Publisher\"\nimport SpacesPublisher from \"./s3/spacesPublisher\"\nimport { writeFile } from \"fs/promises\"\nimport * as isCi from \"is-ci\"\nimport * as path from \"path\"\nimport { WriteStream as TtyWriteStream } from \"tty\"\nimport * as url from \"url\"\nimport { AppInfo, ArtifactCreated, Configuration, Platform, PlatformSpecificBuildOptions, Target } from \"../index\"\nimport { Packager } from \"../packager\"\nimport { PlatformPackager } from \"../platformPackager\"\nimport { expandMacro } from \"../util/macroExpander\"\nimport { WinPackager } from \"../winPackager\"\nimport { SnapStorePublisher } from \"./SnapStorePublisher\"\nimport { createUpdateInfoTasks, UpdateInfoFileTask, writeUpdateInfoFiles } from \"./updateInfoBuilder\"\nimport { KeygenPublisher } from \"./KeygenPublisher\"\nimport { BitbucketPublisher } from \"./BitbucketPublisher\"\n\nconst publishForPrWarning =\n \"There are serious security concerns with PUBLISH_FOR_PULL_REQUEST=true (see the CircleCI documentation (https://circleci.com/docs/1.0/fork-pr-builds/) for details)\" +\n \"\\nIf you have SSH keys, sensitive env vars or AWS credentials stored in your project settings and untrusted forks can make pull requests against your repo, then this option isn't for you.\"\n\nconst debug = _debug(\"electron-builder:publish\")\n\nfunction checkOptions(publishPolicy: any) {\n if (publishPolicy != null && publishPolicy !== \"onTag\" && publishPolicy !== \"onTagOrDraft\" && publishPolicy !== \"always\" && publishPolicy !== \"never\") {\n if (typeof publishPolicy === \"string\") {\n throw new InvalidConfigurationError(\n `Expected one of \"onTag\", \"onTagOrDraft\", \"always\", \"never\", but got ${JSON.stringify(\n publishPolicy\n )}.\\nPlease note that publish configuration should be specified under \"config\"`\n )\n }\n }\n}\n\nexport class PublishManager implements PublishContext {\n private readonly nameToPublisher = new Map<string, Publisher | null>()\n\n private readonly taskManager: AsyncTaskManager\n\n readonly isPublish: boolean = false\n\n readonly progress = (process.stdout as TtyWriteStream).isTTY ? new MultiProgress() : null\n\n private readonly updateFileWriteTask: Array<UpdateInfoFileTask> = []\n\n constructor(\n private readonly packager: Packager,\n private readonly publishOptions: PublishOptions,\n readonly cancellationToken: CancellationToken = packager.cancellationToken\n ) {\n checkOptions(publishOptions.publish)\n\n this.taskManager = new AsyncTaskManager(cancellationToken)\n\n const forcePublishForPr = process.env.PUBLISH_FOR_PULL_REQUEST === \"true\"\n if (!isPullRequest() || forcePublishForPr) {\n if (publishOptions.publish === undefined) {\n if (process.env.npm_lifecycle_event === \"release\") {\n publishOptions.publish = \"always\"\n } else {\n const tag = getCiTag()\n if (tag != null) {\n log.info({ reason: \"tag is defined\", tag }, \"artifacts will be published\")\n publishOptions.publish = \"onTag\"\n } else if (isCi) {\n log.info({ reason: \"CI detected\" }, \"artifacts will be published if draft release exists\")\n publishOptions.publish = \"onTagOrDraft\"\n }\n }\n }\n\n const publishPolicy = publishOptions.publish\n this.isPublish = publishPolicy != null && publishOptions.publish !== \"never\" && (publishPolicy !== \"onTag\" || getCiTag() != null)\n if (this.isPublish && forcePublishForPr) {\n log.warn(publishForPrWarning)\n }\n } else if (publishOptions.publish !== \"never\") {\n log.info(\n {\n reason: \"current build is a part of pull request\",\n solution: `set env PUBLISH_FOR_PULL_REQUEST to true to force code signing\\n${publishForPrWarning}`,\n },\n \"publishing will be skipped\"\n )\n }\n\n packager.addAfterPackHandler(async event => {\n const packager = event.packager\n if (event.electronPlatformName === \"darwin\") {\n if (!event.targets.some(it => it.name === \"dmg\" || it.name === \"zip\")) {\n return\n }\n } else if (packager.platform === Platform.WINDOWS) {\n if (!event.targets.some(it => isSuitableWindowsTarget(it))) {\n return\n }\n }\n\n const publishConfig = await getAppUpdatePublishConfiguration(packager, event.arch, this.isPublish)\n if (publishConfig != null) {\n await writeFile(path.join(packager.getResourcesDir(event.appOutDir), \"app-update.yml\"), serializeToYaml(publishConfig))\n }\n })\n\n packager.artifactCreated(event => {\n const publishConfiguration = event.publishConfig\n if (publishConfiguration == null) {\n this.taskManager.addTask(this.artifactCreatedWithoutExplicitPublishConfig(event))\n } else if (this.isPublish) {\n if (debug.enabled) {\n debug(`artifactCreated (isPublish: ${this.isPublish}): ${safeStringifyJson(event, new Set([\"packager\"]))},\\n publishConfig: ${safeStringifyJson(publishConfiguration)}`)\n }\n this.scheduleUpload(publishConfiguration, event, this.getAppInfo(event.packager))\n }\n })\n }\n\n private getAppInfo(platformPackager: PlatformPackager<any> | null) {\n return platformPackager == null ? this.packager.appInfo : platformPackager.appInfo\n }\n\n async getGlobalPublishConfigurations(): Promise<Array<PublishConfiguration> | null> {\n const publishers = this.packager.config.publish\n return await resolvePublishConfigurations(publishers, null, this.packager, null, true)\n }\n\n scheduleUpload(publishConfig: PublishConfiguration, event: UploadTask, appInfo: AppInfo): void {\n if (publishConfig.provider === \"generic\") {\n return\n }\n\n const publisher = this.getOrCreatePublisher(publishConfig, appInfo)\n if (publisher == null) {\n log.debug(\n {\n file: log.filePath(event.file),\n reason: \"publisher is null\",\n publishConfig: safeStringifyJson(publishConfig),\n },\n \"not published\"\n )\n return\n }\n\n const providerName = publisher.providerName\n if (this.publishOptions.publish === \"onTagOrDraft\" && getCiTag() == null && providerName !== \"bitbucket\" && providerName !== \"github\") {\n log.info({ file: log.filePath(event.file), reason: \"current build is not for a git tag\", publishPolicy: \"onTagOrDraft\" }, `not published to ${providerName}`)\n return\n }\n\n if (publishConfig.timeout) {\n event.timeout = publishConfig.timeout\n }\n\n this.taskManager.addTask(publisher.upload(event))\n }\n\n private async artifactCreatedWithoutExplicitPublishConfig(event: ArtifactCreated) {\n const platformPackager = event.packager\n const target = event.target\n const publishConfigs = await getPublishConfigs(platformPackager, target == null ? null : target.options, event.arch, this.isPublish)\n\n if (debug.enabled) {\n debug(`artifactCreated (isPublish: ${this.isPublish}): ${safeStringifyJson(event, new Set([\"packager\"]))},\\n publishConfigs: ${safeStringifyJson(publishConfigs)}`)\n }\n\n const eventFile = event.file\n if (publishConfigs == null) {\n if (this.isPublish) {\n log.debug({ file: eventFile, reason: \"no publish configs\" }, \"not published\")\n }\n return\n }\n\n if (this.isPublish) {\n for (const publishConfig of publishConfigs) {\n if (this.cancellationToken.cancelled) {\n log.debug({ file: event.file, reason: \"cancelled\" }, \"not published\")\n break\n }\n\n this.scheduleUpload(publishConfig, event, this.getAppInfo(platformPackager))\n }\n }\n\n if (\n event.isWriteUpdateInfo &&\n target != null &&\n eventFile != null &&\n !this.cancellationToken.cancelled &&\n (platformPackager.platform !== Platform.WINDOWS || isSuitableWindowsTarget(target))\n ) {\n this.taskManager.addTask(createUpdateInfoTasks(event, publishConfigs).then(it => this.updateFileWriteTask.push(...it)))\n }\n }\n\n private getOrCreatePublisher(publishConfig: PublishConfiguration, appInfo: AppInfo): Publisher | null {\n // to not include token into cache key\n const providerCacheKey = safeStringifyJson(publishConfig)\n let publisher = this.nameToPublisher.get(providerCacheKey)\n if (publisher == null) {\n publisher = createPublisher(this, appInfo.version, publishConfig, this.publishOptions, this.packager)\n this.nameToPublisher.set(providerCacheKey, publisher)\n log.info({ publisher: publisher!.toString() }, \"publishing\")\n }\n return publisher\n }\n\n // noinspection JSUnusedGlobalSymbols\n cancelTasks() {\n this.taskManager.cancelTasks()\n this.nameToPublisher.clear()\n }\n\n async awaitTasks(): Promise<void> {\n await this.taskManager.awaitTasks()\n\n const updateInfoFileTasks = this.updateFileWriteTask\n if (this.cancellationToken.cancelled || updateInfoFileTasks.length === 0) {\n return\n }\n\n await writeUpdateInfoFiles(updateInfoFileTasks, this.packager)\n await this.taskManager.awaitTasks()\n }\n}\n\nexport async function getAppUpdatePublishConfiguration(packager: PlatformPackager<any>, arch: Arch, errorIfCannot: boolean) {\n const publishConfigs = await getPublishConfigsForUpdateInfo(packager, await getPublishConfigs(packager, null, arch, errorIfCannot), arch)\n if (publishConfigs == null || publishConfigs.length === 0) {\n return null\n }\n\n const publishConfig = {\n ...publishConfigs[0],\n updaterCacheDirName: packager.appInfo.updaterCacheDirName,\n }\n\n if (packager.platform === Platform.WINDOWS && publishConfig.publisherName == null) {\n const winPackager = packager as WinPackager\n const publisherName = winPackager.isForceCodeSigningVerification ? await (await winPackager.signtoolManager.value).computedPublisherName.value : undefined\n if (publisherName != null) {\n publishConfig.publisherName = publisherName\n }\n }\n return publishConfig\n}\n\nexport async function getPublishConfigsForUpdateInfo(\n packager: PlatformPackager<any>,\n publishConfigs: Array<PublishConfiguration> | null,\n arch: Arch | null\n): Promise<Array<PublishConfiguration> | null> {\n if (publishConfigs === null) {\n return null\n }\n\n if (publishConfigs.length === 0) {\n log.debug(null, \"getPublishConfigsForUpdateInfo: no publishConfigs, detect using repository info\")\n // https://github.com/electron-userland/electron-builder/issues/925#issuecomment-261732378\n // default publish config is github, file should be generated regardless of publish state (user can test installer locally or manage the release process manually)\n const repositoryInfo = await packager.info.repositoryInfo\n debug(`getPublishConfigsForUpdateInfo: ${safeStringifyJson(repositoryInfo)}`)\n if (repositoryInfo != null && repositoryInfo.type === \"github\") {\n const resolvedPublishConfig = await getResolvedPublishConfig(packager, packager.info, { provider: repositoryInfo.type }, arch, false)\n if (resolvedPublishConfig != null) {\n debug(`getPublishConfigsForUpdateInfo: resolve to publish config ${safeStringifyJson(resolvedPublishConfig)}`)\n return [resolvedPublishConfig]\n }\n }\n }\n return publishConfigs\n}\n\nexport function createPublisher(context: PublishContext, version: string, publishConfig: PublishConfiguration, options: PublishOptions, packager: Packager): Publisher | null {\n if (debug.enabled) {\n debug(`Create publisher: ${safeStringifyJson(publishConfig)}`)\n }\n\n const provider = publishConfig.provider\n switch (provider) {\n case \"github\":\n return new GitHubPublisher(context, publishConfig as GithubOptions, version, options)\n\n case \"keygen\":\n return new KeygenPublisher(context, publishConfig as KeygenOptions, version)\n\n case \"snapStore\":\n return new SnapStorePublisher(context, publishConfig as SnapStoreOptions)\n\n case \"generic\":\n return null\n\n default: {\n const clazz = requireProviderClass(provider, packager)\n return clazz == null ? null : new clazz(context, publishConfig)\n }\n }\n}\n\nfunction requireProviderClass(provider: string, packager: Packager): any | null {\n switch (provider) {\n case \"github\":\n return GitHubPublisher\n\n case \"generic\":\n return null\n\n case \"keygen\":\n return KeygenPublisher\n\n case \"s3\":\n return S3Publisher\n\n case \"snapStore\":\n return SnapStorePublisher\n\n case \"spaces\":\n return SpacesPublisher\n\n case \"bitbucket\":\n return BitbucketPublisher\n\n default: {\n const name = `electron-publisher-${provider}`\n let module: any = null\n try {\n module = require(path.join(packager.buildResourcesDir, name + \".js\"))\n } catch (ignored) {\n log.debug({ path: path.join(packager.buildResourcesDir, name + \".js\") }, \"Unable to find publish provider in build resources\")\n }\n\n if (module == null) {\n module = require(name)\n }\n return module.default || module\n }\n }\n}\n\nexport function computeDownloadUrl(publishConfiguration: PublishConfiguration, fileName: string | null, packager: PlatformPackager<any>) {\n if (publishConfiguration.provider === \"generic\") {\n const baseUrlString = (publishConfiguration as GenericServerOptions).url\n if (fileName == null) {\n return baseUrlString\n }\n\n const baseUrl = url.parse(baseUrlString)\n return url.format({ ...(baseUrl as url.UrlObject), pathname: path.posix.resolve(baseUrl.pathname || \"/\", encodeURI(fileName)) })\n }\n\n let baseUrl\n if (publishConfiguration.provider === \"github\") {\n const gh = publishConfiguration as GithubOptions\n baseUrl = `${githubUrl(gh)}/${gh.owner}/${gh.repo}/releases/download/${gh.vPrefixedTagName === false ? \"\" : \"v\"}${packager.appInfo.version}`\n } else {\n baseUrl = getS3LikeProviderBaseUrl(publishConfiguration)\n }\n\n if (fileName == null) {\n return baseUrl\n }\n return `${baseUrl}/${encodeURI(fileName)}`\n}\n\nexport async function getPublishConfigs(\n platformPackager: PlatformPackager<any>,\n targetSpecificOptions: PlatformSpecificBuildOptions | null | undefined,\n arch: Arch | null,\n errorIfCannot: boolean\n): Promise<Array<PublishConfiguration> | null> {\n let publishers\n\n // check build.nsis (target)\n if (targetSpecificOptions != null) {\n publishers = targetSpecificOptions.publish\n // if explicitly set to null - do not publish\n if (publishers === null) {\n return null\n }\n }\n\n // check build.win (platform)\n if (publishers == null) {\n publishers = platformPackager.platformSpecificBuildOptions.publish\n if (publishers === null) {\n return null\n }\n }\n\n if (publishers == null) {\n publishers = platformPackager.config.publish\n if (publishers === null) {\n return null\n }\n }\n return await resolvePublishConfigurations(publishers, platformPackager, platformPackager.info, arch, errorIfCannot)\n}\n\nasync function resolvePublishConfigurations(\n publishers: any,\n platformPackager: PlatformPackager<any> | null,\n packager: Packager,\n arch: Arch | null,\n errorIfCannot: boolean\n): Promise<Array<PublishConfiguration> | null> {\n if (publishers == null) {\n let serviceName: PublishProvider | null = null\n if (!isEmptyOrSpaces(process.env.GH_TOKEN) || !isEmptyOrSpaces(process.env.GITHUB_TOKEN)) {\n serviceName = \"github\"\n } else if (!isEmptyOrSpaces(process.env.KEYGEN_TOKEN)) {\n serviceName = \"keygen\"\n } else if (!isEmptyOrSpaces(process.env.BITBUCKET_TOKEN)) {\n serviceName = \"bitbucket\"\n } else if (!isEmptyOrSpaces(process.env.BT_TOKEN)) {\n throw new Error(\n \"Bintray has been sunset and is no longer supported by electron-builder. Ref: https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/\"\n )\n }\n\n if (serviceName != null) {\n log.debug(null, `detect ${serviceName} as publish provider`)\n return [(await getResolvedPublishConfig(platformPackager, packager, { provider: serviceName }, arch, errorIfCannot))!]\n }\n }\n\n if (publishers == null) {\n return []\n }\n\n debug(`Explicit publish provider: ${safeStringifyJson(publishers)}`)\n return await (BluebirdPromise.map(asArray(publishers), it =>\n getResolvedPublishConfig(platformPackager, packager, typeof it === \"string\" ? { provider: it } : it, arch, errorIfCannot)\n ) as Promise<Array<PublishConfiguration>>)\n}\n\nfunction isSuitableWindowsTarget(target: Target) {\n if (target.name === \"appx\" && target.options != null && (target.options as any).electronUpdaterAware) {\n return true\n }\n return target.name === \"nsis\" || target.name.startsWith(\"nsis-\")\n}\n\nfunction expandPublishConfig(options: any, platformPackager: PlatformPackager<any> | null, packager: Packager, arch: Arch | null): void {\n for (const name of Object.keys(options)) {\n const value = options[name]\n if (typeof value === \"string\") {\n const archValue = arch == null ? null : Arch[arch]\n const expanded = platformPackager == null ? expandMacro(value, archValue, packager.appInfo) : platformPackager.expandMacro(value, archValue)\n if (expanded !== value) {\n options[name] = expanded\n }\n }\n }\n}\n\nfunction isDetectUpdateChannel(platformSpecificConfiguration: PlatformSpecificBuildOptions | null, configuration: Configuration) {\n const value = platformSpecificConfiguration == null ? null : platformSpecificConfiguration.detectUpdateChannel\n return value == null ? configuration.detectUpdateChannel !== false : value\n}\n\nasync function getResolvedPublishConfig(\n platformPackager: PlatformPackager<any> | null,\n packager: Packager,\n options: PublishConfiguration,\n arch: Arch | null,\n errorIfCannot: boolean\n): Promise<PublishConfiguration | GithubOptions | BitbucketOptions | null> {\n options = { ...options }\n expandPublishConfig(options, platformPackager, packager, arch)\n\n let channelFromAppVersion: string | null = null\n if (\n (options as GenericServerOptions).channel == null &&\n isDetectUpdateChannel(platformPackager == null ? null : platformPackager.platformSpecificBuildOptions, packager.config)\n ) {\n channelFromAppVersion = packager.appInfo.channel\n }\n\n const provider = options.provider\n if (provider === \"generic\") {\n const o = options as GenericServerOptions\n if (o.url == null) {\n throw new InvalidConfigurationError(`Please specify \"url\" for \"generic\" update server`)\n }\n\n if (channelFromAppVersion != null) {\n ;(o as any).channel = channelFromAppVersion\n }\n return options\n }\n\n const providerClass = requireProviderClass(options.provider, packager)\n if (providerClass != null && providerClass.checkAndResolveOptions != null) {\n await providerClass.checkAndResolveOptions(options, channelFromAppVersion, errorIfCannot)\n return options\n }\n\n if (provider === \"keygen\") {\n return {\n ...options,\n platform: platformPackager?.platform.name,\n } as KeygenOptions\n }\n\n const isGithub = provider === \"github\"\n if (!isGithub && provider !== \"bitbucket\") {\n return options\n }\n\n let owner = isGithub ? (options as GithubOptions).owner : (options as BitbucketOptions).owner\n let project = isGithub ? (options as GithubOptions).repo : (options as BitbucketOptions).slug\n\n if (isGithub && owner == null && project != null) {\n const index = project.indexOf(\"/\")\n if (index > 0) {\n const repo = project\n project = repo.substring(0, index)\n owner = repo.substring(index + 1)\n }\n }\n\n async function getInfo() {\n const info = await packager.repositoryInfo\n if (info != null) {\n return info\n }\n\n const message = `Cannot detect repository by .git/config. Please specify \"repository\" in the package.json (https://docs.npmjs.com/files/package.json#repository).\\nPlease see https://electron.build/publish`\n if (errorIfCannot) {\n throw new Error(message)\n } else {\n log.warn(message)\n return null\n }\n }\n\n if (!owner || !project) {\n log.debug({ reason: \"owner or project is not specified explicitly\", provider, owner, project }, \"calling getInfo\")\n const info = await getInfo()\n if (info == null) {\n return null\n }\n\n if (!owner) {\n owner = info.user\n }\n if (!project) {\n project = info.project\n }\n }\n\n if (isGithub) {\n if ((options as GithubOptions).token != null && !(options as GithubOptions).private) {\n log.warn('\"token\" specified in the github publish options. It should be used only for [setFeedURL](module:electron-updater/out/AppUpdater.AppUpdater+setFeedURL).')\n }\n //tslint:disable-next-line:no-object-literal-type-assertion\n return { owner, repo: project, ...options } as GithubOptions\n } else {\n //tslint:disable-next-line:no-object-literal-type-assertion\n return { owner, slug: project, ...options } as BitbucketOptions\n }\n}\n"]}