diff options
Diffstat (limited to 'desktop/node_modules/@electron/osx-sign')
102 files changed, 5806 insertions, 0 deletions
diff --git a/desktop/node_modules/@electron/osx-sign/LICENSE b/desktop/node_modules/@electron/osx-sign/LICENSE new file mode 100644 index 0000000..740ca28 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) Electron contributors +Copyright (c) 2015-2016 Zhuo Lu, Jason Hinkle, et al. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/desktop/node_modules/@electron/osx-sign/README.md b/desktop/node_modules/@electron/osx-sign/README.md new file mode 100644 index 0000000..d13feb6 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/README.md @@ -0,0 +1,322 @@ +# @electron/osx-sign [![npm][npm_img]][npm_url] [![Build Status][circleci_img]][circleci_url] + +Codesign Electron macOS apps + +## About + +[`@electron/osx-sign`][electron-osx-sign] minimizes the extra work needed to eventually prepare your apps for shipping, providing the most basic tools and assets. Note that the bare necessities here are sufficient for enabling app sandbox, yet other configurations for network access etc. require additional work. + +*NB: Since [`@electron/osx-sign`][electron-osx-sign] injects the entry `com.apple.security.application-groups` into the entitlements file as part of the pre-signing process, this would reportedly limit app transfer on iTunes Connect (see [#150](https://github.com/electron/osx-sign/issues/150)). However, opting out entitlements automation `opts['preAutoEntitlements'] === false` may result in worse graphics performance.* + +*The signing procedure implemented in this package is based on what described in [Code Signing Guide](https://github.com/electron/electron/blob/main/docs/tutorial/code-signing.md).* + +## Installation + +```sh +# For use in npm scripts +npm install --save @electron/osx-sign +# yarn +yarn add @electron/osx-sign +``` + +```sh +# For use from CLI +npm install -g @electron/osx-sign +# Yarn +yarn global add @electron/osx-sign +``` + +*Note: `@electron/osx-sign` is a dependency of [`electron-packager`](https://github.com/electron/electron-packager) as of 6.0.0 for signing apps on macOS. However, feel free to install this package globally for more customization beyond specifying identity and entitlements.* + +## Usage + +### Code Signing + +#### From the API + +```javascript +const { signAsync } = require('@electron/osx-sign') +signAsync({ + app: 'path/to/my.app' +}) + .then(function () { + // Application signed + }) + .catch(function (err) { + // Handle the error + }) +``` + +###### opts - Options + +**Required** + +`app` - *String* + +Path to the application package. +Needs file extension `.app`. + +**Optional** + +`binaries` - *Array* + +Path to additional binaries that will be signed along with built-ins of Electron. +Default to `undefined`. + +`optionsForFile` - *Function* + +Function that receives the path to a file and can return the entitlements to use for that file to override the default behavior. The +object this function returns can include any of the following optional keys. + +| Option | Description | Usage Example | +|-------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------| +| `entitlements` | String specifying the path to an `entitlements.plist` file. Will default to built-in entitlements files. Can also be an array of entitlement keys that osx-sign will write to an entitlements file for you. | `'path/to/entitlements'` | +| `hardenedRuntime` | Boolean flag to enable the Hardened Runtime when signing the app. Enabled by default. | `false` | +| `requirements` | String specifying the [requirements](https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html) that you recommend to be used to evaluate the code signature. | `'anchor apple or anchor = "/var/db/yourcorporateanchor.cert"'` | +| `signatureFlags` | List of [code signature flags](https://developer.apple.com/documentation/security/seccodesignatureflags?language=objc). Accepts an array of strings or a comma-separated string. | `['kSecCodeSignatureRestrict']` | +| `timestamp` | String specifying the URL of the timestamp authority server. Defaults to the server provided by Apple. Please note that this default server may not support signatures not furnished by Apple. Disable the timestamp service with `none`. | `'https://different.timeserver'` | + +**Note:** Only available via the JS API + +`identity` - *String* + +Name of certificate to use when signing. +Default to be selected with respect to `provisioning-profile` and `platform` from `keychain` or keychain by system default. + +Signing platform `mas` will look for `3rd Party Mac Developer Application: * (*)`, and platform `darwin` will look for `Developer ID Application: * (*)` by default. + +`identityValidation` - *Boolean* + +Flag to enable/disable validation for the signing identity. If enabled, the `identity` provided will be validated in the `keychain` specified. +Default to `true`. + +`keychain` - *String* + +The keychain name. +Default to system default keychain. + +`ignore` - *RegExp|Function|Array.<(RegExp|Function)>* + +Regex, function or an array of regex's and functions that signal skipping signing a file. +Elements of other types are treated as `RegExp`. +Default to `undefined`. + +`platform` - *String* + +Build platform of Electron. +Allowed values: `darwin`, `mas`. +Default to auto detect by presence of `Squirrel.framework` within the application bundle. + +`preAutoEntitlements` - *Boolean* + +Flag to enable/disable automation of `com.apple.security.application-groups` in entitlements file and update `Info.plist` with `ElectronTeamID`. +Default to `true`. + +`preEmbedProvisioningProfile` - *Boolean* + +Flag to enable/disable embedding of provisioning profile in the current working directory. +Default to `true`. + +`provisioningProfile` - *String* + +Path to provisioning profile. + +`strictVerify` - *Boolean|String|Array.<String>* + +Flag to enable/disable `--strict` flag when verifying the signed application bundle. +If provided as a string, each component should be separated with comma (`,`). +If provided as an array, each item should be a string corresponding to a component. +Default to `true`. + +`type` - *String* + +Specify whether to sign app for development or for distribution. +Allowed values: `development`, `distribution`. +Default to `distribution`. + +`version` - *String* + +Build version of Electron. +Values may be like: `1.1.1`, `1.2.0`. +Default to latest Electron version. + +It is recommended to utilize this option for best support of specific Electron versions. This may trigger pre/post operations for signing: For example, automation of setting `com.apple.security.application-groups` in entitlements file and of updating `Info.plist` with `ElectronTeamID` is enabled for all versions starting from `1.1.1`; set `preAutoEntitlements` option to `false` to disable this feature. + +#### From the Command Line + +```sh +electron-osx-sign app [embedded-binary ...] [options ...] +``` + +##### Examples + +Since `electron-osx-sign` adds the entry `com.apple.developer.team-identifier` to a temporary copy of the specified entitlements file (with the default option `--pre-auto-entitlements`) distribution builds can no longer be run directly. To run the app codesigned for distribution locally after codesigning, you may manually add `ElectronTeamID` in your `Info.plist` and `com.apple.security.application-groups` in the entitlements file, and provide the flag `--no-pre-auto-entitlements` for `electron-osx-sign` to avoid this extra bit. Note that "certain features are only allowed across apps whose team-identifier value match" ([Technical Note TN2415](https://developer.apple.com/library/content/technotes/tn2415/_index.html#//apple_ref/doc/uid/DTS40016427-CH1-ENTITLEMENTSLIST)). + +The examples below assume that `--pre-auto-entitlements` is enabled. + +- To sign a distribution version by default: + ```sh + electron-osx-sign path/to/my.app + ``` + For distribution in the Mac App Store: Have the provisioning profile for distribution placed in the current working directory and the signing identity installed in the default keychain. *The app is not expected to run after codesigning since there is no provisioned device, and it is intended only for submission to iTunes Connect.* + For distribution outside the Mac App Store: Have the signing identity for distribution installed in the default keychain and optionally place the provisioning profile in the current working directory. By default App Sandbox is not enabled. *The app should run on all devices.* + +- To sign development version: + ```sh + electron-osx-sign path/to/my.app --type=development + ``` + For testing Mac App Store builds: Have the provisioning profile for development placed in the current working directory and the signing identity installed in the default keychain. *The app will only run on provisioned devices.* + For testing apps for distribution outside the Mac App Store, have the signing identity for development installed in the default keychain and optionally the provisioning profile placed in the current working directory. *The app will only run on provisioned devices.* However, you may prefer to just go with signing a distribution version because the app is expected to launch properly after codesigned. + +- It is recommended to place the provisioning profile(s) under the working directory for `electron-osx-sign` to pick up automatically; however, to specify provisioning profile to be embedded explicitly: + ```sh + electron-osx-sign path/to/my.app --provisioning-profile=path/to/my.provisionprofile + ``` + +- To specify custom entitlements files you have to use the JS API. + +- It is recommended to make use of `--version` while signing legacy versions of Electron: + ```sh + electron-osx-sign path/to/my.app --version=0.34.0 + ``` + +Run `electron-osx-sign --help` or see [electron-osx-sign-usage.txt](https://github.com/electron/osx-sign/blob/main/bin/electron-osx-sign-usage.txt) for CLI-specific options. + +### electron-osx-flat + +#### From the API + +```javascript +const { flatAsync } = require('@electron/osx-sign') +flatAsync({ + app: 'path/to/my.app' +}) + .then(function () { + // Application flattened + }) + .catch(function (err) { + // Handle the error + }) +``` + +###### opts - Options + +**Required** + +`app` - *String* + +Path to the application bundle. +Needs file extension `.app`. + +**Optional** + +`identity` - *String* + +Name of certificate to use when signing. +Default to be selected with respect to `platform` from `keychain` or keychain by system default. + +Flattening platform `mas` will look for `3rd Party Mac Developer Installer: * (*)`, and platform `darwin` will look for `Developer ID Installer: * (*)` by default. + +`identityValidation` - *Boolean* + +Flag to enable/disable validation for signing identity. If enabled, the `identity` provided will be validated in the `keychain` specified. +Default to `true`. + +`install` - *String* + +Path to install the bundle. +Default to `/Applications`. + +`keychain` - *String* + +The keychain name. +Default to system default keychain. + +`platform` - *String* + +Build platform of Electron. Allowed values: `darwin`, `mas`. +Default to auto detect by presence of `Squirrel.framework` within the application bundle. + +`pkg` - *String* + +Path to the output the flattened package. +Needs file extension `.pkg`. + +`scripts` - *String* +Path to a directory containing pre and/or post install scripts. +#### From the Command Line + +```sh +electron-osx-flat app [options ...] +``` + +Example: + +```sh +electron-osx-flat path/to/my.app +``` + +Run `electron-osx-flat --help` or see [electron-osx-flat-usage.txt](https://github.com/electron/osx-sign/blob/main/bin/electron-osx-flat-usage.txt) for CLI-specific options. + +## Debug + +As of release v0.3.1, external module `debug` is used to display logs and messages; remember to `export DEBUG=electron-osx-sign*` when necessary. + +## Test + +The project's configured to run automated tests on CircleCI. + +If you wish to manually test the module, first comment out `opts.identity` in `test/basic.js` to enable auto discovery. Then run the command `npm test` from the dev directory. + +When this command is run for the first time: `@electron/get` will download macOS Electron releases defined in `test/config.json`, and save to `~/.electron/`, which might take up less than 1GB of disk space. + +A successful testing should look something like: + +``` +$ npm test + +> electron-osx-sign@0.4.17 pretest electron-osx-sign +> rimraf test/work + +> electron-osx-sign@0.4.17 test electron-osx-sign +> standard && tape test + +Calling @electron/get before running tests... +Running tests... +TAP version 13 +# setup +# defaults-test:v7.0.0-beta.3-darwin-x64 +ok 1 app signed +# defaults-test:v7.0.0-beta.3-mas-x64 +ok 2 app signed +# defaults-test:v6.0.3-darwin-x64 +ok 3 app signed +# defaults-test:v6.0.3-mas-x64 +ok 4 app signed +# defaults-test:v5.0.10-darwin-x64 +ok 5 app signed +# defaults-test:v5.0.10-mas-x64 +ok 6 app signed +# defaults-test:v4.2.9-darwin-x64 +ok 7 app signed +# defaults-test:v4.2.9-mas-x64 +ok 8 app signed +# defaults-test:v3.1.2-darwin-x64 +ok 9 app signed +# defaults-test:v3.1.2-mas-x64 +ok 10 app signed +# teardown + +1..10 +# tests 10 +# pass 10 + +# ok +``` + +[Electron]: https://github.com/electron/electron +[electron-osx-sign]: https://github.com/electron/osx-sign +[npm_img]: https://img.shields.io/npm/v/@electron/osx-sign.svg +[npm_url]: https://npmjs.org/package/@electron/osx-sign +[circleci_img]: https://img.shields.io/circleci/build/github/electron/osx-sign +[circleci_url]: https://circleci.com/gh/electron/osx-sign diff --git a/desktop/node_modules/@electron/osx-sign/bin/electron-osx-flat-usage.txt b/desktop/node_modules/@electron/osx-sign/bin/electron-osx-flat-usage.txt new file mode 100644 index 0000000..368ce2c --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/bin/electron-osx-flat-usage.txt @@ -0,0 +1,41 @@ + +NAME + electron-osx-flat -- product building for Electron apps + +SYNOPSIS + electron-osx-flat app [options ...] + +DESCRIPTION + app + Path to the application package. + Needs file extension ``.app''. + + --help + Flag to display all commands. + + --identity=identity + Name of certificate to use when signing. + Default to selected with respect to --platform from --keychain specified or keychain by system default. + + --identityValidation, --no-identityValidation + Flag to enable/disable validation for the signing identity. + + --install=install-path + Path to install the bundle. + Default to ``/Applications''. + + --keychain=keychain + The keychain name. + Default to system default keychain. + + --platform=platform + Build platform of Electron. + Allowed values: ``darwin'', ``mas''. + Default to auto detect from application bundle. + + --pkg + Path to the output the flattened package. + Needs file extension ``.pkg''. + + --scripts + Path to a directory containing pre and/or post install scripts. diff --git a/desktop/node_modules/@electron/osx-sign/bin/electron-osx-flat.js b/desktop/node_modules/@electron/osx-sign/bin/electron-osx-flat.js new file mode 100755 index 0000000..e250489 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/bin/electron-osx-flat.js @@ -0,0 +1,34 @@ +#!/usr/bin/env node + +const fs = require('fs'); +const path = require('path'); +const args = require('minimist')(process.argv.slice(2), { + boolean: [ + 'help' + ] +}); +const usage = fs.readFileSync(path.join(__dirname, 'electron-osx-flat-usage.txt')).toString(); +const flat = require('../').flat; + +args.app = args._.shift(); + +if (!args.app || args.help) { + console.log(usage); + process.exit(0); +} + +// Remove excess arguments +delete args._; +delete args.help; + +flat(args, function done (err) { + if (err) { + console.error('Flat failed:'); + if (err.message) console.error(err.message); + else if (err.stack) console.error(err.stack); + else console.log(err); + process.exit(1); + } + console.log('Application flattened, saved to:', args.pkg); + process.exit(0); +}); diff --git a/desktop/node_modules/@electron/osx-sign/bin/electron-osx-sign-usage.txt b/desktop/node_modules/@electron/osx-sign/bin/electron-osx-sign-usage.txt new file mode 100644 index 0000000..55bd8cc --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/bin/electron-osx-sign-usage.txt @@ -0,0 +1,60 @@ + +NAME + electron-osx-sign -- code signing for Electron apps + +SYNOPSIS + electron-osx-sign app [embedded-binary ...] [options ...] + +DESCRIPTION + app + Path to the application package. + Needs file extension ``.app''. + + embedded-binary ... + Path to additional binaries that will be signed along with built-ins of Electron, spaced. + + --help + Flag to display all commands. + + --identity=identity + Name of certificate to use when signing. + Default to selected with respect to --provisioning-profile and --platform from --keychain specified or keychain by system default. + + --identityValidation, --no-identityValidation + Flag to enable/disable validation for the signing identity. + + --ignore=path + Path to skip signing. The string will be treated as a regular expression when used to match the file paths. + + --keychain=keychain + The keychain name. + Default to system default keychain. + + --platform=platform + Build platform of Electron. + Allowed values: ``darwin'', ``mas''. + Default to auto detect from application bundle. + + --pre-auto-entitlements, --no-pre-auto-entitlements + Flag to enable/disable automation of entitlements file and Info.plist. + + --pre-embed-provisioning-profile, --no-pre-embed-provisioning-profile + Flag to enable/disable embedding of provisioning profile. + + --provisioning-profile=file + Path to provisioning profile. + + --strictVerify, --strictVerify=options, --no-strictVerify + Flag to enable/disable ``--strict'' flag when verifying the signed application bundle. + Each component should be separated in ``options'' with comma (``,''). + Enabled by default. + + --type=type + Specify whether to sign app for development or for distribution. + Allowed values: ``development'', ``distribution''. + Default to ``distribution''. + + --version=version + Build version of Electron. + Values may be: ``1.2.0''. + Default to latest Electron version. diff --git a/desktop/node_modules/@electron/osx-sign/bin/electron-osx-sign.js b/desktop/node_modules/@electron/osx-sign/bin/electron-osx-sign.js new file mode 100755 index 0000000..95234db --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/bin/electron-osx-sign.js @@ -0,0 +1,46 @@ +#!/usr/bin/env node + +const fs = require('fs'); +const path = require('path'); +const args = require('minimist')(process.argv.slice(2), { + string: [ + 'signature-flags' + ], + boolean: [ + 'help', + 'pre-auto-entitlements', + 'pre-embed-provisioning-profile', + 'hardened-runtime', + 'restrict' + ], + default: { + 'pre-auto-entitlements': true, + 'pre-embed-provisioning-profile': true + } +}); +const usage = fs.readFileSync(path.join(__dirname, 'electron-osx-sign-usage.txt')).toString(); +const sign = require('../').sign; + +args.app = args._.shift(); +args.binaries = args._; + +if (!args.app || args.help) { + console.log(usage); + process.exit(0); +} + +// Remove excess arguments +delete args._; +delete args.help; + +sign(args, function done (err) { + if (err) { + console.error('Sign failed:'); + if (err.message) console.error(err.message); + else if (err.stack) console.error(err.stack); + else console.log(err); + process.exit(1); + } + console.log('Application signed:', args.app); + process.exit(0); +}); diff --git a/desktop/node_modules/@electron/osx-sign/dist/cjs/flat.d.ts b/desktop/node_modules/@electron/osx-sign/dist/cjs/flat.d.ts new file mode 100644 index 0000000..4d63f07 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/cjs/flat.d.ts @@ -0,0 +1,11 @@ +import { FlatOptions } from './types'; +/** + * This function is exported and returns a promise flattening the application. + */ +export declare function buildPkg(_opts: FlatOptions): Promise<void>; +/** + * This function is exported with normal callback implementation. + * + * @deprecated Please use the promise based "buildPkg" method + */ +export declare const flat: (opts: FlatOptions, cb?: ((error?: Error) => void) | undefined) => void; diff --git a/desktop/node_modules/@electron/osx-sign/dist/cjs/flat.js b/desktop/node_modules/@electron/osx-sign/dist/cjs/flat.js new file mode 100644 index 0000000..abd7312 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/cjs/flat.js @@ -0,0 +1,153 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.flat = exports.buildPkg = void 0; +const path = __importStar(require("path")); +const util_1 = require("./util"); +const util_identities_1 = require("./util-identities"); +const pkgVersion = require('../../package.json').version; +/** + * This function returns a promise validating all options passed in opts. + * @function + * @param {Object} opts - Options. + * @returns {Promise} Promise. + */ +async function validateFlatOpts(opts) { + await (0, util_1.validateOptsApp)(opts); + let pkg = opts.pkg; + if (pkg) { + if (typeof pkg !== 'string') + throw new Error('`pkg` must be a string.'); + if (path.extname(pkg) !== '.pkg') { + throw new Error('Extension of output package must be `.pkg`.'); + } + } + else { + (0, util_1.debugWarn)('No `pkg` passed in arguments, will fallback to default inferred from the given application.'); + pkg = path.join(path.dirname(opts.app), path.basename(opts.app, '.app') + '.pkg'); + } + let install = opts.install; + if (install) { + if (typeof install !== 'string') { + return Promise.reject(new Error('`install` must be a string.')); + } + } + else { + (0, util_1.debugWarn)('No `install` passed in arguments, will fallback to default `/Applications`.'); + install = '/Applications'; + } + return Object.assign(Object.assign({}, opts), { pkg, + install, platform: await (0, util_1.validateOptsPlatform)(opts) }); +} +/** + * This function returns a promise flattening the application. + * @function + * @param {Object} opts - Options. + * @returns {Promise} Promise. + */ +async function buildApplicationPkg(opts, identity) { + const args = ['--component', opts.app, opts.install, '--sign', identity.name, opts.pkg]; + if (opts.keychain) { + args.unshift('--keychain', opts.keychain); + } + if (opts.scripts) { + args.unshift('--scripts', opts.scripts); + } + (0, util_1.debugLog)('Flattening... ' + opts.app); + await (0, util_1.execFileAsync)('productbuild', args); +} +/** + * This function is exported and returns a promise flattening the application. + */ +async function buildPkg(_opts) { + (0, util_1.debugLog)('@electron/osx-sign@%s', pkgVersion); + const validatedOptions = await validateFlatOpts(_opts); + let identities = []; + let identityInUse = null; + if (validatedOptions.identity) { + (0, util_1.debugLog)('`identity` passed in arguments.'); + if (validatedOptions.identityValidation === false) { + // Do nothing + } + else { + identities = await (0, util_identities_1.findIdentities)(validatedOptions.keychain || null, validatedOptions.identity); + } + } + else { + (0, util_1.debugWarn)('No `identity` passed in arguments...'); + if (validatedOptions.platform === 'mas') { + (0, util_1.debugLog)('Finding `3rd Party Mac Developer Installer` certificate for flattening app distribution in the Mac App Store...'); + identities = await (0, util_identities_1.findIdentities)(validatedOptions.keychain || null, '3rd Party Mac Developer Installer:'); + } + else { + (0, util_1.debugLog)('Finding `Developer ID Application` certificate for distribution outside the Mac App Store...'); + identities = await (0, util_identities_1.findIdentities)(validatedOptions.keychain || null, 'Developer ID Installer:'); + } + } + if (identities.length > 0) { + // Provisioning profile(s) found + if (identities.length > 1) { + (0, util_1.debugWarn)('Multiple identities found, will use the first discovered.'); + } + else { + (0, util_1.debugLog)('Found 1 identity.'); + } + identityInUse = identities[0]; + } + else { + // No identity found + throw new Error('No identity found for signing.'); + } + (0, util_1.debugLog)('Flattening application...', '\n', '> Application:', validatedOptions.app, '\n', '> Package output:', validatedOptions.pkg, '\n', '> Install path:', validatedOptions.install, '\n', '> Identity:', validatedOptions.identity, '\n', '> Scripts:', validatedOptions.scripts); + await buildApplicationPkg(validatedOptions, identityInUse); + (0, util_1.debugLog)('Application flattened.'); +} +exports.buildPkg = buildPkg; +/** + * This function is exported with normal callback implementation. + * + * @deprecated Please use the promise based "buildPkg" method + */ +const flat = (opts, cb) => { + buildPkg(opts) + .then(() => { + (0, util_1.debugLog)('Application flattened, saved to: ' + opts.app); + if (cb) + cb(); + }) + .catch((err) => { + (0, util_1.debugLog)('Flat failed:'); + if (err.message) + (0, util_1.debugLog)(err.message); + else if (err.stack) + (0, util_1.debugLog)(err.stack); + else + (0, util_1.debugLog)(err); + if (cb) + cb(err); + }); +}; +exports.flat = flat; +//# sourceMappingURL=flat.js.map
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/cjs/flat.js.map b/desktop/node_modules/@electron/osx-sign/dist/cjs/flat.js.map new file mode 100644 index 0000000..406801c --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/cjs/flat.js.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CAAC,IAAI,CAAC;SACX,IAAI,CAAC,GAAG,EAAE;QACT,IAAA,eAAQ,EAAC,mCAAmC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;QACzD,IAAI,EAAE;YAAE,EAAE,EAAE,CAAC;IACf,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACb,IAAA,eAAQ,EAAC,cAAc,CAAC,CAAC;QACzB,IAAI,GAAG,CAAC,OAAO;YAAE,IAAA,eAAQ,EAAC,GAAG,CAAC,OAAO,CAAC,CAAC;aAClC,IAAI,GAAG,CAAC,KAAK;YAAE,IAAA,eAAQ,EAAC,GAAG,CAAC,KAAK,CAAC,CAAC;;YACnC,IAAA,eAAQ,EAAC,GAAG,CAAC,CAAC;QACnB,IAAI,EAAE;YAAE,EAAE,CAAC,GAAG,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAbW,QAAA,IAAI,QAaf"}
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/cjs/index.d.ts b/desktop/node_modules/@electron/osx-sign/dist/cjs/index.d.ts new file mode 100644 index 0000000..deb3ca0 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/cjs/index.d.ts @@ -0,0 +1,4 @@ +import { sign, signApp } from './sign'; +import { flat, buildPkg } from './flat'; +export { sign, flat, signApp as signAsync, signApp, buildPkg as flatAsync, buildPkg }; +export * from './types'; diff --git a/desktop/node_modules/@electron/osx-sign/dist/cjs/index.js b/desktop/node_modules/@electron/osx-sign/dist/cjs/index.js new file mode 100644 index 0000000..2b59385 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/cjs/index.js @@ -0,0 +1,36 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.buildPkg = exports.flatAsync = exports.signApp = exports.signAsync = exports.flat = exports.sign = void 0; +const sign_1 = require("./sign"); +Object.defineProperty(exports, "sign", { enumerable: true, get: function () { return sign_1.sign; } }); +Object.defineProperty(exports, "signAsync", { enumerable: true, get: function () { return sign_1.signApp; } }); +Object.defineProperty(exports, "signApp", { enumerable: true, get: function () { return sign_1.signApp; } }); +const flat_1 = require("./flat"); +Object.defineProperty(exports, "flat", { enumerable: true, get: function () { return flat_1.flat; } }); +Object.defineProperty(exports, "flatAsync", { enumerable: true, get: function () { return flat_1.buildPkg; } }); +Object.defineProperty(exports, "buildPkg", { enumerable: true, get: function () { return flat_1.buildPkg; } }); +// TODO: Remove and leave only proper named exports, but for non-breaking change reasons +// we need to keep this weirdness for now +module.exports = sign_1.sign; +module.exports.sign = sign_1.sign; +module.exports.signAsync = sign_1.signApp; +module.exports.signApp = sign_1.signApp; +module.exports.flat = flat_1.flat; +module.exports.flatAsync = flat_1.buildPkg; +module.exports.buildPkg = flat_1.buildPkg; +__exportStar(require("./types"), exports); +//# sourceMappingURL=index.js.map
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/cjs/index.js.map b/desktop/node_modules/@electron/osx-sign/dist/cjs/index.js.map new file mode 100644 index 0000000..4dce983 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/cjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,iCAAuC;AAa9B,qFAbA,WAAI,OAaA;AAAmB,0FAbjB,cAAO,OAamB;AAAE,wFAb5B,cAAO,OAa4B;AAZlD,iCAAwC;AAYzB,qFAZN,WAAI,OAYM;AAA6C,0FAZjD,eAAQ,OAYkD;AAAE,yFAZ5D,eAAQ,OAY4D;AAVnF,wFAAwF;AACxF,yCAAyC;AACzC,MAAM,CAAC,OAAO,GAAG,WAAI,CAAC;AACtB,MAAM,CAAC,OAAO,CAAC,IAAI,GAAG,WAAI,CAAC;AAC3B,MAAM,CAAC,OAAO,CAAC,SAAS,GAAG,cAAO,CAAC;AACnC,MAAM,CAAC,OAAO,CAAC,OAAO,GAAG,cAAO,CAAC;AACjC,MAAM,CAAC,OAAO,CAAC,IAAI,GAAG,WAAI,CAAC;AAC3B,MAAM,CAAC,OAAO,CAAC,SAAS,GAAG,eAAQ,CAAC;AACpC,MAAM,CAAC,OAAO,CAAC,QAAQ,GAAG,eAAQ,CAAC;AAGnC,0CAAwB"}
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/cjs/sign.d.ts b/desktop/node_modules/@electron/osx-sign/dist/cjs/sign.d.ts new file mode 100644 index 0000000..14eda7e --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/cjs/sign.d.ts @@ -0,0 +1,11 @@ +import { SignOptions } from './types'; +/** + * This function returns a promise signing the application. + */ +export declare function signApp(_opts: SignOptions): Promise<void>; +/** + * This function is a legacy callback implementation. + * + * @deprecated Please use the promise based "signApp" method + */ +export declare const sign: (opts: SignOptions, cb?: ((error?: Error) => void) | undefined) => void; diff --git a/desktop/node_modules/@electron/osx-sign/dist/cjs/sign.js b/desktop/node_modules/@electron/osx-sign/dist/cjs/sign.js new file mode 100644 index 0000000..2796997 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/cjs/sign.js @@ -0,0 +1,363 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.sign = exports.signApp = void 0; +const fs = __importStar(require("fs-extra")); +const os = __importStar(require("os")); +const path = __importStar(require("path")); +const plist = __importStar(require("plist")); +const compare_version_1 = __importDefault(require("compare-version")); +const util_1 = require("./util"); +const util_identities_1 = require("./util-identities"); +const util_provisioning_profiles_1 = require("./util-provisioning-profiles"); +const util_entitlements_1 = require("./util-entitlements"); +const pkgVersion = require('../../package.json').version; +const osRelease = os.release(); +/** + * This function returns a promise validating opts.binaries, the additional binaries to be signed along with the discovered enclosed components. + */ +async function validateOptsBinaries(opts) { + if (opts.binaries) { + if (!Array.isArray(opts.binaries)) { + throw new Error('Additional binaries should be an Array.'); + } + // TODO: Presence check for binary files, reject if any does not exist + } +} +function validateOptsIgnore(ignore) { + if (ignore && !(ignore instanceof Array)) { + return [ignore]; + } +} +/** + * This function returns a promise validating all options passed in opts. + */ +async function validateSignOpts(opts) { + await validateOptsBinaries(opts); + await (0, util_1.validateOptsApp)(opts); + if (opts.provisioningProfile && typeof opts.provisioningProfile !== 'string') { + throw new Error('Path to provisioning profile should be a string.'); + } + if (opts.type && opts.type !== 'development' && opts.type !== 'distribution') { + throw new Error('Type must be either `development` or `distribution`.'); + } + const platform = await (0, util_1.validateOptsPlatform)(opts); + const cloned = Object.assign(Object.assign({}, opts), { ignore: validateOptsIgnore(opts.ignore), type: opts.type || 'distribution', platform }); + return cloned; +} +/** + * This function returns a promise verifying the code sign of application bundle. + */ +async function verifySignApplication(opts) { + // Verify with codesign + (0, util_1.debugLog)('Verifying application bundle with codesign...'); + await (0, util_1.execFileAsync)('codesign', ['--verify', '--deep'].concat(opts.strictVerify !== false && (0, compare_version_1.default)(osRelease, '15.0.0') >= 0 // Strict flag since darwin 15.0.0 --> OS X 10.11.0 El Capitan + ? [ + '--strict' + + (opts.strictVerify + ? '=' + opts.strictVerify // Array should be converted to a comma separated string + : '') + ] + : [], ['--verbose=2', opts.app])); +} +function defaultOptionsForFile(filePath, platform) { + const entitlementsFolder = path.resolve(__dirname, '..', '..', 'entitlements'); + let entitlementsFile; + if (platform === 'darwin') { + // Default Entitlements + // c.f. https://source.chromium.org/chromium/chromium/src/+/main:chrome/app/app-entitlements.plist + // Also include JIT for main process V8 + entitlementsFile = path.resolve(entitlementsFolder, 'default.darwin.plist'); + // Plugin helper + // c.f. https://source.chromium.org/chromium/chromium/src/+/main:chrome/app/helper-plugin-entitlements.plist + if (filePath.includes('(Plugin).app')) { + entitlementsFile = path.resolve(entitlementsFolder, 'default.darwin.plugin.plist'); + // GPU Helper + // c.f. https://source.chromium.org/chromium/chromium/src/+/main:chrome/app/helper-gpu-entitlements.plist + } + else if (filePath.includes('(GPU).app')) { + entitlementsFile = path.resolve(entitlementsFolder, 'default.darwin.gpu.plist'); + // Renderer Helper + // c.f. https://source.chromium.org/chromium/chromium/src/+/main:chrome/app/helper-renderer-entitlements.plist + } + else if (filePath.includes('(Renderer).app')) { + entitlementsFile = path.resolve(entitlementsFolder, 'default.darwin.renderer.plist'); + } + } + else { + // Default entitlements + // TODO: Can these be more scoped like the non-mas variant? + entitlementsFile = path.resolve(entitlementsFolder, 'default.mas.plist'); + // If it is not the top level app bundle, we sign with inherit + if (filePath.includes('.app/')) { + entitlementsFile = path.resolve(entitlementsFolder, 'default.mas.child.plist'); + } + } + return { + entitlements: entitlementsFile, + hardenedRuntime: true, + requirements: undefined, + signatureFlags: undefined, + timestamp: undefined + }; +} +async function mergeOptionsForFile(opts, defaults) { + const mergedPerFileOptions = Object.assign({}, defaults); + if (opts) { + if (opts.entitlements !== undefined) { + if (Array.isArray(opts.entitlements)) { + const entitlements = opts.entitlements.reduce((dict, entitlementKey) => (Object.assign(Object.assign({}, dict), { [entitlementKey]: true })), {}); + const dir = await fs.mkdtemp(path.resolve(os.tmpdir(), 'tmp-entitlements-')); + const entitlementsPath = path.join(dir, 'entitlements.plist'); + await fs.writeFile(entitlementsPath, plist.build(entitlements), 'utf8'); + opts.entitlements = entitlementsPath; + } + mergedPerFileOptions.entitlements = opts.entitlements; + } + if (opts.hardenedRuntime !== undefined) { + mergedPerFileOptions.hardenedRuntime = opts.hardenedRuntime; + } + if (opts.requirements !== undefined) + mergedPerFileOptions.requirements = opts.requirements; + if (opts.signatureFlags !== undefined) { + mergedPerFileOptions.signatureFlags = opts.signatureFlags; + } + if (opts.timestamp !== undefined) + mergedPerFileOptions.timestamp = opts.timestamp; + } + return mergedPerFileOptions; +} +/** + * This function returns a promise codesigning only. + */ +async function signApplication(opts, identity) { + function shouldIgnoreFilePath(filePath) { + if (opts.ignore) { + return opts.ignore.some(function (ignore) { + if (typeof ignore === 'function') { + return ignore(filePath); + } + return filePath.match(ignore); + }); + } + return false; + } + const children = await (0, util_1.walkAsync)((0, util_1.getAppContentsPath)(opts)); + if (opts.binaries) + children.push(...opts.binaries); + const args = ['--sign', identity.hash || identity.name, '--force']; + if (opts.keychain) { + args.push('--keychain', opts.keychain); + } + /** + * Sort the child paths by how deep they are in the file tree. Some arcane apple + * logic expects the deeper files to be signed first otherwise strange errors get + * thrown our way + */ + children.sort((a, b) => { + const aDepth = a.split(path.sep).length; + const bDepth = b.split(path.sep).length; + return bDepth - aDepth; + }); + for (const filePath of [...children, opts.app]) { + if (shouldIgnoreFilePath(filePath)) { + (0, util_1.debugLog)('Skipped... ' + filePath); + continue; + } + const perFileOptions = await mergeOptionsForFile(opts.optionsForFile ? opts.optionsForFile(filePath) : null, defaultOptionsForFile(filePath, opts.platform)); + // preAutoEntitlements should only be applied to the top level app bundle. + // Applying it other files will cause the app to crash and be rejected by Apple. + if (!filePath.includes('.app/')) { + if (opts.preAutoEntitlements === false) { + (0, util_1.debugWarn)('Pre-sign operation disabled for entitlements automation.'); + } + else { + (0, util_1.debugLog)('Pre-sign operation enabled for entitlements automation with versions >= `1.1.1`:', '\n', '* Disable by setting `pre-auto-entitlements` to `false`.'); + if (!opts.version || (0, compare_version_1.default)(opts.version, '1.1.1') >= 0) { + // Enable Mac App Store sandboxing without using temporary-exception, introduced in Electron v1.1.1. Relates to electron#5601 + const newEntitlements = await (0, util_entitlements_1.preAutoEntitlements)(opts, perFileOptions, { + identity, + provisioningProfile: opts.provisioningProfile + ? await (0, util_provisioning_profiles_1.getProvisioningProfile)(opts.provisioningProfile, opts.keychain) + : undefined + }); + // preAutoEntitlements may provide us new entitlements, if so we update our options + // and ensure that entitlements-loginhelper has a correct default value + if (newEntitlements) { + perFileOptions.entitlements = newEntitlements; + } + } + } + } + (0, util_1.debugLog)('Signing... ' + filePath); + const perFileArgs = [...args]; + if (perFileOptions.requirements) { + perFileArgs.push('--requirements', perFileOptions.requirements); + } + if (perFileOptions.timestamp) { + perFileArgs.push('--timestamp=' + perFileOptions.timestamp); + } + else { + perFileArgs.push('--timestamp'); + } + let optionsArguments = []; + if (perFileOptions.signatureFlags) { + if (Array.isArray(perFileOptions.signatureFlags)) { + optionsArguments.push(...perFileOptions.signatureFlags); + } + else { + const flags = perFileOptions.signatureFlags.split(',').map(function (flag) { + return flag.trim(); + }); + optionsArguments.push(...flags); + } + } + if (perFileOptions.hardenedRuntime || optionsArguments.includes('runtime')) { + // Hardened runtime since darwin 17.7.0 --> macOS 10.13.6 + if ((0, compare_version_1.default)(osRelease, '17.7.0') >= 0) { + optionsArguments.push('runtime'); + } + else { + // Remove runtime if passed in with --signature-flags + (0, util_1.debugLog)('Not enabling hardened runtime, current macOS version too low, requires 10.13.6 and higher'); + optionsArguments = optionsArguments.filter((arg) => { + return arg !== 'runtime'; + }); + } + } + if (optionsArguments.length) { + perFileArgs.push('--options', [...new Set(optionsArguments)].join(',')); + } + await (0, util_1.execFileAsync)('codesign', perFileArgs.concat('--entitlements', perFileOptions.entitlements, filePath)); + } + // Verify code sign + (0, util_1.debugLog)('Verifying...'); + await verifySignApplication(opts); + (0, util_1.debugLog)('Verified.'); + // Check entitlements if applicable + (0, util_1.debugLog)('Displaying entitlements...'); + const result = await (0, util_1.execFileAsync)('codesign', [ + '--display', + '--entitlements', + ':-', + opts.app + ]); + (0, util_1.debugLog)('Entitlements:', '\n', result); +} +/** + * This function returns a promise signing the application. + */ +async function signApp(_opts) { + (0, util_1.debugLog)('electron-osx-sign@%s', pkgVersion); + const validatedOpts = await validateSignOpts(_opts); + let identities = []; + let identityInUse = null; + // Determine identity for signing + if (validatedOpts.identity) { + (0, util_1.debugLog)('`identity` passed in arguments.'); + if (validatedOpts.identityValidation === false) { + identityInUse = new util_identities_1.Identity(validatedOpts.identity); + } + else { + identities = await (0, util_identities_1.findIdentities)(validatedOpts.keychain || null, validatedOpts.identity); + } + } + else { + (0, util_1.debugWarn)('No `identity` passed in arguments...'); + if (validatedOpts.platform === 'mas') { + if (validatedOpts.type === 'distribution') { + (0, util_1.debugLog)('Finding `3rd Party Mac Developer Application` certificate for signing app distribution in the Mac App Store...'); + identities = await (0, util_identities_1.findIdentities)(validatedOpts.keychain || null, '3rd Party Mac Developer Application:'); + } + else { + (0, util_1.debugLog)('Finding `Mac Developer` certificate for signing app in development for the Mac App Store signing...'); + identities = await (0, util_identities_1.findIdentities)(validatedOpts.keychain || null, 'Mac Developer:'); + } + } + else { + (0, util_1.debugLog)('Finding `Developer ID Application` certificate for distribution outside the Mac App Store...'); + identities = await (0, util_identities_1.findIdentities)(validatedOpts.keychain || null, 'Developer ID Application:'); + } + } + if (!identityInUse) { + if (identities.length > 0) { + // Identity(/ies) found + if (identities.length > 1) { + (0, util_1.debugWarn)('Multiple identities found, will use the first discovered.'); + } + else { + (0, util_1.debugLog)('Found 1 identity.'); + } + identityInUse = identities[0]; + } + else { + // No identity found + throw new Error('No identity found for signing.'); + } + } + // Pre-sign operations + if (validatedOpts.preEmbedProvisioningProfile === false) { + (0, util_1.debugWarn)('Pre-sign operation disabled for provisioning profile embedding:', '\n', '* Enable by setting `pre-embed-provisioning-profile` to `true`.'); + } + else { + (0, util_1.debugLog)('Pre-sign operation enabled for provisioning profile:', '\n', '* Disable by setting `pre-embed-provisioning-profile` to `false`.'); + await (0, util_provisioning_profiles_1.preEmbedProvisioningProfile)(validatedOpts, validatedOpts.provisioningProfile + ? await (0, util_provisioning_profiles_1.getProvisioningProfile)(validatedOpts.provisioningProfile, validatedOpts.keychain) + : null); + } + (0, util_1.debugLog)('Signing application...', '\n', '> Application:', validatedOpts.app, '\n', '> Platform:', validatedOpts.platform, '\n', '> Additional binaries:', validatedOpts.binaries, '\n', '> Identity:', validatedOpts.identity); + await signApplication(validatedOpts, identityInUse); + // Post-sign operations + (0, util_1.debugLog)('Application signed.'); +} +exports.signApp = signApp; +/** + * This function is a legacy callback implementation. + * + * @deprecated Please use the promise based "signApp" method + */ +const sign = (opts, cb) => { + signApp(opts) + .then(() => { + (0, util_1.debugLog)('Application signed: ' + opts.app); + if (cb) + cb(); + }) + .catch((err) => { + if (err.message) + (0, util_1.debugLog)(err.message); + else if (err.stack) + (0, util_1.debugLog)(err.stack); + else + (0, util_1.debugLog)(err); + if (cb) + cb(err); + }); +}; +exports.sign = sign; +//# sourceMappingURL=sign.js.map
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/cjs/sign.js.map b/desktop/node_modules/@electron/osx-sign/dist/cjs/sign.js.map new file mode 100644 index 0000000..329d456 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/c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AAa,CAAC,mBAAmB,EAAE,aAAa,CAAC,QAAQ,CAAC;YACzF,CAAC,CAAC,IAAI,CACT,CAAC;KACH;IAED,IAAA,eAAQ,EACN,wBAAwB,EACxB,IAAI,EACJ,gBAAgB,EAChB,aAAa,CAAC,GAAG,EACjB,IAAI,EACJ,aAAa,EACb,aAAa,CAAC,QAAQ,EACtB,IAAI,EACJ,wBAAwB,EACxB,aAAa,CAAC,QAAQ,EACtB,IAAI,EACJ,aAAa,EACb,aAAa,CAAC,QAAQ,CACvB,CAAC;IACF,MAAM,eAAe,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;IAEpD,uBAAuB;IACvB,IAAA,eAAQ,EAAC,qBAAqB,CAAC,CAAC;AAClC,CAAC;AAjGD,0BAiGC;AAED;;;;GAIG;AACI,MAAM,IAAI,GAAG,CAAC,IAAiB,EAAE,EAA4B,EAAE,EAAE;IACtE,OAAO,CAAC,IAAI,CAAC;SACV,IAAI,CAAC,GAAG,EAAE;QACT,IAAA,eAAQ,EAAC,sBAAsB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,EAAE;YAAE,EAAE,EAAE,CAAC;IACf,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACb,IAAI,GAAG,CAAC,OAAO;YAAE,IAAA,eAAQ,EAAC,GAAG,CAAC,OAAO,CAAC,CAAC;aAClC,IAAI,GAAG,CAAC,KAAK;YAAE,IAAA,eAAQ,EAAC,GAAG,CAAC,KAAK,CAAC,CAAC;;YACnC,IAAA,eAAQ,EAAC,GAAG,CAAC,CAAC;QACnB,IAAI,EAAE;YAAE,EAAE,CAAC,GAAG,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAZW,QAAA,IAAI,QAYf"}
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/cjs/types.d.ts b/desktop/node_modules/@electron/osx-sign/dist/cjs/types.d.ts new file mode 100644 index 0000000..c2ba609 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/cjs/types.d.ts @@ -0,0 +1,73 @@ +export type ElectronMacPlatform = 'darwin' | 'mas'; +type SigningDistributionType = 'development' | 'distribution'; +export type BaseSignOptions = Readonly<{ + app: string; + identity?: string; + platform?: ElectronMacPlatform; + keychain?: string; +}>; +type OnlyValidatedBaseSignOptions = { + platform: ElectronMacPlatform; +}; +/** + * Any missing options will use the default values, providing a partial + * structure will shallow merge with the default values. + */ +export type PerFileSignOptions = { + /** + * The entitlements file to use when signing this file + */ + entitlements?: string | string[]; + /** + * Whether to enable hardened runtime for this file. Enabled by default. + */ + hardenedRuntime?: boolean; + /** + * The designated requirements to embed when signing this file + */ + requirements?: string; + /** + * See --options of the "codesign" command. + * + * https://www.manpagez.com/man/1/codesign + */ + signatureFlags?: string | string[]; + /** + * The timestamp server to use when signing, by default uses the Apple provided + * timestamp server. + */ + timestamp?: string; +}; +type OnlySignOptions = { + binaries?: string[]; + optionsForFile?: (filePath: string) => PerFileSignOptions; + identityValidation?: boolean; + ignore?: string | string[] | ((file: string) => boolean); + preAutoEntitlements?: boolean; + preEmbedProvisioningProfile?: boolean; + provisioningProfile?: string; + strictVerify?: boolean; + type?: SigningDistributionType; + version?: string; +}; +type OnlyValidatedSignOptions = { + ignore?: (string | ((file: string) => boolean))[]; + type: SigningDistributionType; +}; +type OnlyFlatOptions = { + identityValidation?: boolean; + install?: string; + pkg?: string; + scripts?: string; +}; +type OnlyValidatedFlatOptions = { + install: string; + pkg: string; +}; +type ValidatedForm<UnValidated, Validated> = Omit<UnValidated, keyof Validated> & Validated; +export type ValidatedBaseSignOptions = Readonly<ValidatedForm<BaseSignOptions, OnlyValidatedBaseSignOptions>>; +export type SignOptions = Readonly<OnlySignOptions & BaseSignOptions>; +export type ValidatedSignOptions = Readonly<ValidatedForm<OnlySignOptions, OnlyValidatedSignOptions> & ValidatedBaseSignOptions>; +export type FlatOptions = Readonly<OnlyFlatOptions & BaseSignOptions>; +export type ValidatedFlatOptions = Readonly<ValidatedForm<OnlyFlatOptions, OnlyValidatedFlatOptions> & ValidatedBaseSignOptions>; +export {}; diff --git a/desktop/node_modules/@electron/osx-sign/dist/cjs/types.js b/desktop/node_modules/@electron/osx-sign/dist/cjs/types.js new file mode 100644 index 0000000..11e638d --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/cjs/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/cjs/types.js.map b/desktop/node_modules/@electron/osx-sign/dist/cjs/types.js.map new file mode 100644 index 0000000..7b5fff8 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/cjs/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/cjs/util-entitlements.d.ts b/desktop/node_modules/@electron/osx-sign/dist/cjs/util-entitlements.d.ts new file mode 100644 index 0000000..0c4ff73 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/cjs/util-entitlements.d.ts @@ -0,0 +1,17 @@ +import { PerFileSignOptions, ValidatedSignOptions } from './types'; +import { Identity } from './util-identities'; +import { ProvisioningProfile } from './util-provisioning-profiles'; +type ComputedOptions = { + identity: Identity; + provisioningProfile?: ProvisioningProfile; +}; +/** + * This function returns a promise completing the entitlements automation: The + * process includes checking in `Info.plist` for `ElectronTeamID` or setting + * parsed value from identity, and checking in entitlements file for + * `com.apple.security.application-groups` or inserting new into array. A + * temporary entitlements file may be created to replace the input for any + * changes introduced. + */ +export declare function preAutoEntitlements(opts: ValidatedSignOptions, perFileOpts: PerFileSignOptions, computed: ComputedOptions): Promise<void | string>; +export {}; diff --git a/desktop/node_modules/@electron/osx-sign/dist/cjs/util-entitlements.js b/desktop/node_modules/@electron/osx-sign/dist/cjs/util-entitlements.js new file mode 100644 index 0000000..aed4bce --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/cjs/util-entitlements.js @@ -0,0 +1,133 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.preAutoEntitlements = void 0; +const fs = __importStar(require("fs-extra")); +const os = __importStar(require("os")); +const path = __importStar(require("path")); +const plist = __importStar(require("plist")); +const util_1 = require("./util"); +const preAuthMemo = new Map(); +/** + * This function returns a promise completing the entitlements automation: The + * process includes checking in `Info.plist` for `ElectronTeamID` or setting + * parsed value from identity, and checking in entitlements file for + * `com.apple.security.application-groups` or inserting new into array. A + * temporary entitlements file may be created to replace the input for any + * changes introduced. + */ +async function preAutoEntitlements(opts, perFileOpts, computed) { + var _a; + if (!perFileOpts.entitlements) + return; + const memoKey = [opts.app, perFileOpts.entitlements].join('---'); + if (preAuthMemo.has(memoKey)) + return preAuthMemo.get(memoKey); + // If entitlements file not provided, default will be used. Fixes #41 + const appInfoPath = path.join((0, util_1.getAppContentsPath)(opts), 'Info.plist'); + (0, util_1.debugLog)('Automating entitlement app group...', '\n', '> Info.plist:', appInfoPath, '\n'); + let entitlements; + if (typeof perFileOpts.entitlements === 'string') { + const entitlementsContents = await fs.readFile(perFileOpts.entitlements, 'utf8'); + entitlements = plist.parse(entitlementsContents); + } + else { + entitlements = perFileOpts.entitlements.reduce((dict, entitlementKey) => (Object.assign(Object.assign({}, dict), { [entitlementKey]: true })), {}); + } + if (!entitlements['com.apple.security.app-sandbox']) { + // Only automate when app sandbox enabled by user + return; + } + const appInfoContents = await fs.readFile(appInfoPath, 'utf8'); + const appInfo = plist.parse(appInfoContents); + // Use ElectronTeamID in Info.plist if already specified + if (appInfo.ElectronTeamID) { + (0, util_1.debugLog)('`ElectronTeamID` found in `Info.plist`: ' + appInfo.ElectronTeamID); + } + else { + // The team identifier in signing identity should not be trusted + if (computed.provisioningProfile) { + appInfo.ElectronTeamID = + computed.provisioningProfile.message.Entitlements['com.apple.developer.team-identifier']; + (0, util_1.debugLog)('`ElectronTeamID` not found in `Info.plist`, use parsed from provisioning profile: ' + + appInfo.ElectronTeamID); + } + else { + const teamID = (_a = /^.+\((.+?)\)$/g.exec(computed.identity.name)) === null || _a === void 0 ? void 0 : _a[1]; + if (!teamID) { + throw new Error(`Could not automatically determine ElectronTeamID from identity: ${computed.identity.name}`); + } + appInfo.ElectronTeamID = teamID; + (0, util_1.debugLog)('`ElectronTeamID` not found in `Info.plist`, use parsed from signing identity: ' + + appInfo.ElectronTeamID); + } + await fs.writeFile(appInfoPath, plist.build(appInfo), 'utf8'); + (0, util_1.debugLog)('`Info.plist` updated:', '\n', '> Info.plist:', appInfoPath); + } + const appIdentifier = appInfo.ElectronTeamID + '.' + appInfo.CFBundleIdentifier; + // Insert application identifier if not exists + if (entitlements['com.apple.application-identifier']) { + (0, util_1.debugLog)('`com.apple.application-identifier` found in entitlements file: ' + + entitlements['com.apple.application-identifier']); + } + else { + (0, util_1.debugLog)('`com.apple.application-identifier` not found in entitlements file, new inserted: ' + + appIdentifier); + entitlements['com.apple.application-identifier'] = appIdentifier; + } + // Insert developer team identifier if not exists + if (entitlements['com.apple.developer.team-identifier']) { + (0, util_1.debugLog)('`com.apple.developer.team-identifier` found in entitlements file: ' + + entitlements['com.apple.developer.team-identifier']); + } + else { + (0, util_1.debugLog)('`com.apple.developer.team-identifier` not found in entitlements file, new inserted: ' + + appInfo.ElectronTeamID); + entitlements['com.apple.developer.team-identifier'] = appInfo.ElectronTeamID; + } + // Init entitlements app group key to array if not exists + if (!entitlements['com.apple.security.application-groups']) { + entitlements['com.apple.security.application-groups'] = []; + } + // Insert app group if not exists + if (Array.isArray(entitlements['com.apple.security.application-groups']) && + entitlements['com.apple.security.application-groups'].indexOf(appIdentifier) === -1) { + (0, util_1.debugLog)('`com.apple.security.application-groups` not found in entitlements file, new inserted: ' + + appIdentifier); + entitlements['com.apple.security.application-groups'].push(appIdentifier); + } + else { + (0, util_1.debugLog)('`com.apple.security.application-groups` found in entitlements file: ' + appIdentifier); + } + // Create temporary entitlements file + const dir = await fs.mkdtemp(path.resolve(os.tmpdir(), 'tmp-entitlements-')); + const entitlementsPath = path.join(dir, 'entitlements.plist'); + await fs.writeFile(entitlementsPath, plist.build(entitlements), 'utf8'); + (0, util_1.debugLog)('Entitlements file updated:', '\n', '> Entitlements:', entitlementsPath); + preAuthMemo.set(memoKey, entitlementsPath); + return entitlementsPath; +} +exports.preAutoEntitlements = preAutoEntitlements; +//# sourceMappingURL=util-entitlements.js.map
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/cjs/util-entitlements.js.map b/desktop/node_modules/@electron/osx-sign/dist/cjs/util-entitlements.js.map new file mode 100644 index 0000000..5e125c0 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/cjs/util-entitlements.js.map @@ -0,0 +1 @@ +{"version":3,"file":"util-entitlements.js","sourceRoot":"","sources":["../../src/util-entitlements.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAC/B,uCAAyB;AACzB,2CAA6B;AAC7B,6CAA+B;AAE/B,iCA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EAAC,4BAA4B,EAAE,IAAI,EAAE,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;IAElF,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;IAC3C,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAvHD,kDAuHC"}
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/cjs/util-identities.d.ts b/desktop/node_modules/@electron/osx-sign/dist/cjs/util-identities.d.ts new file mode 100644 index 0000000..fe56cdb --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/cjs/util-identities.d.ts @@ -0,0 +1,6 @@ +export declare class Identity { + name: string; + hash?: string | undefined; + constructor(name: string, hash?: string | undefined); +} +export declare function findIdentities(keychain: string | null, identity: string): Promise<Identity[]>; diff --git a/desktop/node_modules/@electron/osx-sign/dist/cjs/util-identities.js b/desktop/node_modules/@electron/osx-sign/dist/cjs/util-identities.js new file mode 100644 index 0000000..bf5c128 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/cjs/util-identities.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.findIdentities = exports.Identity = void 0; +const util_1 = require("./util"); +class Identity { + constructor(name, hash) { + this.name = name; + this.hash = hash; + } +} +exports.Identity = Identity; +async function findIdentities(keychain, identity) { + // Only to look for valid identities, excluding those flagged with + // CSSMERR_TP_CERT_EXPIRED or CSSMERR_TP_NOT_TRUSTED. Fixes #9 + const args = [ + 'find-identity', + '-v' + ]; + if (keychain) { + args.push(keychain); + } + const result = await (0, util_1.execFileAsync)('security', args); + const identities = result.split('\n').map(function (line) { + if (line.indexOf(identity) >= 0) { + const identityFound = line.substring(line.indexOf('"') + 1, line.lastIndexOf('"')); + const identityHashFound = line.substring(line.indexOf(')') + 2, line.indexOf('"') - 1); + (0, util_1.debugLog)('Identity:', '\n', '> Name:', identityFound, '\n', '> Hash:', identityHashFound); + return new Identity(identityFound, identityHashFound); + } + return null; + }); + return (0, util_1.compactFlattenedList)(identities); +} +exports.findIdentities = findIdentities; +//# sourceMappingURL=util-identities.js.map
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/cjs/util-identities.js.map b/desktop/node_modules/@electron/osx-sign/dist/cjs/util-identities.js.map new file mode 100644 index 0000000..257ef88 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/cjs/util-identities.js.map @@ -0,0 +1 @@ +{"version":3,"file":"util-identities.js","sourceRoot":"","sources":["../../src/util-identities.ts"],"names":[],"mappings":";;;AAAA,iCAAuE;AAEvE,MAAa,QAAQ;IACnB,YAAoB,IAAY,EAAS,IAAa;QAAlC,SAAI,GAAJ,IAAI,CAAQ;QAAS,SAAI,GAAJ,IAAI,CAAS;IAAG,CAAC;CAC3D;AAFD,4BAEC;AAEM,KAAK,UAAU,cAAc,CAAE,QAAuB,EAAE,QAAgB;IAC7E,kEAAkE;IAClE,8DAA8D;IAE9D,MAAM,IAAI,GAAG;QACX,eAAe;QACf,IAAI;KACL,CAAC;IACF,IAAI,QAAQ,EAAE;QACZ,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;KACrB;IAED,MAAM,MAAM,GAAG,MAAM,IAAA,oBAAa,EAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACrD,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,UAAU,IAAI;QACtD,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YAC/B,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;YACnF,MAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;YACvF,IAAA,eAAQ,EAAC,WAAW,EAAE,IAAI,EACxB,SAAS,EAAE,aAAa,EAAE,IAAI,EAC9B,SAAS,EAAE,iBAAiB,CAAC,CAAC;YAChC,OAAO,IAAI,QAAQ,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAC;SACvD;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;IAEH,OAAO,IAAA,2BAAoB,EAAC,UAAU,CAAC,CAAC;AAC1C,CAAC;AA3BD,wCA2BC"}
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/cjs/util-provisioning-profiles.d.ts b/desktop/node_modules/@electron/osx-sign/dist/cjs/util-provisioning-profiles.d.ts new file mode 100644 index 0000000..7c9d9c3 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/cjs/util-provisioning-profiles.d.ts @@ -0,0 +1,25 @@ +import { ElectronMacPlatform, ValidatedSignOptions } from './types'; +export declare class ProvisioningProfile { + filePath: string; + message: any; + constructor(filePath: string, message: any); + get name(): string; + get platforms(): ElectronMacPlatform[]; + get type(): "development" | "distribution"; +} +/** + * Returns a promise resolving to a ProvisioningProfile instance based on file. + * @function + * @param {string} filePath - Path to provisioning profile. + * @param {string} keychain - Keychain to use when unlocking provisioning profile. + * @returns {Promise} Promise. + */ +export declare function getProvisioningProfile(filePath: string, keychain?: string | null): Promise<ProvisioningProfile>; +/** + * Returns a promise resolving to a list of suitable provisioning profile within the current working directory. + */ +export declare function findProvisioningProfiles(opts: ValidatedSignOptions): Promise<ProvisioningProfile[]>; +/** + * Returns a promise embedding the provisioning profile in the app Contents folder. + */ +export declare function preEmbedProvisioningProfile(opts: ValidatedSignOptions, profile: ProvisioningProfile | null): Promise<void>; diff --git a/desktop/node_modules/@electron/osx-sign/dist/cjs/util-provisioning-profiles.js b/desktop/node_modules/@electron/osx-sign/dist/cjs/util-provisioning-profiles.js new file mode 100644 index 0000000..2c1b7e5 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/cjs/util-provisioning-profiles.js @@ -0,0 +1,148 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.preEmbedProvisioningProfile = exports.findProvisioningProfiles = exports.getProvisioningProfile = exports.ProvisioningProfile = void 0; +const fs = __importStar(require("fs-extra")); +const path = __importStar(require("path")); +const plist_1 = __importDefault(require("plist")); +const util_1 = require("./util"); +class ProvisioningProfile { + constructor(filePath, message) { + this.filePath = filePath; + this.message = message; + } + get name() { + return this.message.Name; + } + get platforms() { + if ('ProvisionsAllDevices' in this.message) + return ['darwin']; + // Developer ID + else if (this.type === 'distribution') + return ['mas']; + // Mac App Store + else + return ['darwin', 'mas']; // Mac App Development + } + get type() { + if ('ProvisionedDevices' in this.message) + return 'development'; + // Mac App Development + else + return 'distribution'; // Developer ID or Mac App Store + } +} +exports.ProvisioningProfile = ProvisioningProfile; +/** + * Returns a promise resolving to a ProvisioningProfile instance based on file. + * @function + * @param {string} filePath - Path to provisioning profile. + * @param {string} keychain - Keychain to use when unlocking provisioning profile. + * @returns {Promise} Promise. + */ +async function getProvisioningProfile(filePath, keychain = null) { + const securityArgs = [ + 'cms', + '-D', + '-i', + filePath // Use infile as source of data + ]; + if (keychain) { + securityArgs.push('-k', keychain); + } + const result = await (0, util_1.execFileAsync)('security', securityArgs); + const provisioningProfile = new ProvisioningProfile(filePath, plist_1.default.parse(result)); + (0, util_1.debugLog)('Provisioning profile:', '\n', '> Name:', provisioningProfile.name, '\n', '> Platforms:', provisioningProfile.platforms, '\n', '> Type:', provisioningProfile.type, '\n', '> Path:', provisioningProfile.filePath, '\n', '> Message:', provisioningProfile.message); + return provisioningProfile; +} +exports.getProvisioningProfile = getProvisioningProfile; +/** + * Returns a promise resolving to a list of suitable provisioning profile within the current working directory. + */ +async function findProvisioningProfiles(opts) { + const cwd = process.cwd(); + const children = await fs.readdir(cwd); + const foundProfiles = (0, util_1.compactFlattenedList)(await Promise.all(children.map(async (child) => { + const filePath = path.resolve(cwd, child); + const stat = await fs.stat(filePath); + if (stat.isFile() && path.extname(filePath) === '.provisionprofile') { + return filePath; + } + return null; + }))); + return (0, util_1.compactFlattenedList)(await Promise.all(foundProfiles.map(async (filePath) => { + const profile = await getProvisioningProfile(filePath); + if (profile.platforms.indexOf(opts.platform) >= 0 && profile.type === opts.type) { + return profile; + } + (0, util_1.debugWarn)('Provisioning profile above ignored, not for ' + opts.platform + ' ' + opts.type + '.'); + return null; + }))); +} +exports.findProvisioningProfiles = findProvisioningProfiles; +/** + * Returns a promise embedding the provisioning profile in the app Contents folder. + */ +async function preEmbedProvisioningProfile(opts, profile) { + async function embedProvisioningProfile(profile) { + (0, util_1.debugLog)('Looking for existing provisioning profile...'); + const embeddedFilePath = path.join((0, util_1.getAppContentsPath)(opts), 'embedded.provisionprofile'); + if (await fs.pathExists(embeddedFilePath)) { + (0, util_1.debugLog)('Found embedded provisioning profile:', '\n', '* Please manually remove the existing file if not wanted.', '\n', '* Current file at:', embeddedFilePath); + } + else { + (0, util_1.debugLog)('Embedding provisioning profile...'); + await fs.copy(profile.filePath, embeddedFilePath); + } + } + if (profile) { + // User input provisioning profile + return await embedProvisioningProfile(profile); + } + else { + // Discover provisioning profile + (0, util_1.debugLog)('No `provisioning-profile` passed in arguments, will find in current working directory and in user library...'); + const profiles = await findProvisioningProfiles(opts); + if (profiles.length > 0) { + // Provisioning profile(s) found + if (profiles.length > 1) { + (0, util_1.debugLog)('Multiple provisioning profiles found, will use the first discovered.'); + } + else { + (0, util_1.debugLog)('Found 1 provisioning profile.'); + } + await embedProvisioningProfile(profiles[0]); + } + else { + // No provisioning profile found + (0, util_1.debugLog)('No provisioning profile found, will not embed profile in app contents.'); + } + } +} +exports.preEmbedProvisioningProfile = preEmbedProvisioningProfile; +//# sourceMappingURL=util-provisioning-profiles.js.map
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/cjs/util-provisioning-profiles.js.map b/desktop/node_modules/@electron/osx-sign/dist/cjs/util-provisioning-profiles.js.map new file mode 100644 index 0000000..bc555ff --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/cjs/util-provisioning-profiles.js.map @@ -0,0 +1 @@ +{"version":3,"file":"util-provisioning-profiles.js","sourceRoot":"","sources":["../../src/util-provisioning-profiles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAC/B,2CAA6B;AAC7B,kDAA0B;AAG1B,iCAAsG;AAEtG,MAAa,mBAAmB;IAC9B,YAAoB,QAAgB,EAAS,OAAY;QAArC,aAAQ,GAAR,QAAQ,CAAQ;QAAS,YAAO,GAAP,OAAO,CAAK;IAAG,CAAC;IAE7D,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;IAC3B,CAAC;IAED,IAAI,SAAS;QACX,IAAI,sBAAsB,IAAI,IAAI,CAAC,OAAO;YAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC9D,eAAe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AAQ,EAAC,8CAA8C,CAAC,CAAC;QACzD,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,IAAA,yBAAkB,EAAC,IAAI,CAAC,EAAE,2BAA2B,CAAC,CAAC;QAE1F,IAAI,MAAM,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE;YACzC,IAAA,eAAQ,EACN,sCAAsC,EACtC,IAAI,EACJ,2DAA2D,EAC3D,IAAI,EACJ,oBAAoB,EACpB,gBAAgB,CACjB,CAAC;SACH;aAAM;YACL,IAAA,eAAQ,EAAC,mCAAmC,CAAC,CAAC;YAC9C,MAAM,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;SACnD;IACH,CAAC;IAED,IAAI,OAAO,EAAE;QACX,kCAAkC;QAClC,OAAO,MAAM,wBAAwB,CAAC,OAAO,CAAC,CAAC;KAChD;SAAM;QACL,gCAAgC;QAChC,IAAA,eAAQ,EACN,8GAA8G,CAC/G,CAAC;QACF,MAAM,QAAQ,GAAG,MAAM,wBAAwB,CAAC,IAAI,CAAC,CAAC;QACtD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;YACvB,gCAAgC;YAChC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;gBACvB,IAAA,eAAQ,EAAC,sEAAsE,CAAC,CAAC;aAClF;iBAAM;gBACL,IAAA,eAAQ,EAAC,+BAA+B,CAAC,CAAC;aAC3C;YACD,MAAM,wBAAwB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;SAC7C;aAAM;YACL,gCAAgC;YAChC,IAAA,eAAQ,EAAC,wEAAwE,CAAC,CAAC;SACpF;KACF;AACH,CAAC;AA1CD,kEA0CC"}
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/cjs/util.d.ts b/desktop/node_modules/@electron/osx-sign/dist/cjs/util.d.ts new file mode 100644 index 0000000..d420151 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/cjs/util.d.ts @@ -0,0 +1,35 @@ +/// <reference types="node" /> +import * as child from 'child_process'; +import debug from 'debug'; +import { BaseSignOptions, ElectronMacPlatform } from './types'; +export declare const debugLog: debug.Debugger; +export declare const debugWarn: debug.Debugger; +export declare function execFileAsync(file: string, args: string[], options?: child.ExecFileOptions): Promise<string>; +type DeepListItem<T> = null | T | DeepListItem<T>[]; +type DeepList<T> = DeepListItem<T>[]; +export declare function compactFlattenedList<T>(list: DeepList<T>): T[]; +/** + * Returns the path to the "Contents" folder inside the application bundle + */ +export declare function getAppContentsPath(opts: BaseSignOptions): string; +/** + * Returns the path to app "Frameworks" within contents. + */ +export declare function getAppFrameworksPath(opts: BaseSignOptions): string; +export declare function detectElectronPlatform(opts: BaseSignOptions): Promise<ElectronMacPlatform>; +/** + * This function returns a promise validating opts.app, the application to be signed or flattened. + */ +export declare function validateOptsApp(opts: BaseSignOptions): Promise<void>; +/** + * This function returns a promise validating opts.platform, the platform of Electron build. It allows auto-discovery if no opts.platform is specified. + */ +export declare function validateOptsPlatform(opts: BaseSignOptions): Promise<ElectronMacPlatform>; +/** + * This function returns a promise resolving all child paths within the directory specified. + * @function + * @param {string} dirPath - Path to directory. + * @returns {Promise} Promise resolving child paths needing signing in order. + */ +export declare function walkAsync(dirPath: string): Promise<string[]>; +export {}; diff --git a/desktop/node_modules/@electron/osx-sign/dist/cjs/util.js b/desktop/node_modules/@electron/osx-sign/dist/cjs/util.js new file mode 100644 index 0000000..8fdd393 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/cjs/util.js @@ -0,0 +1,182 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.walkAsync = exports.validateOptsPlatform = exports.validateOptsApp = exports.detectElectronPlatform = exports.getAppFrameworksPath = exports.getAppContentsPath = exports.compactFlattenedList = exports.execFileAsync = exports.debugWarn = exports.debugLog = void 0; +const child = __importStar(require("child_process")); +const fs = __importStar(require("fs-extra")); +const isbinaryfile_1 = require("isbinaryfile"); +const path = __importStar(require("path")); +const debug_1 = __importDefault(require("debug")); +exports.debugLog = (0, debug_1.default)('electron-osx-sign'); +exports.debugLog.log = console.log.bind(console); +exports.debugWarn = (0, debug_1.default)('electron-osx-sign:warn'); +exports.debugWarn.log = console.warn.bind(console); +const removePassword = function (input) { + return input.replace(/(-P |pass:|\/p|-pass )([^ ]+)/, function (_, p1) { + return `${p1}***`; + }); +}; +async function execFileAsync(file, args, options = {}) { + if (exports.debugLog.enabled) { + (0, exports.debugLog)('Executing...', file, args && Array.isArray(args) ? removePassword(args.join(' ')) : ''); + } + return new Promise(function (resolve, reject) { + child.execFile(file, args, options, function (err, stdout, stderr) { + if (err) { + (0, exports.debugLog)('Error executing file:', '\n', '> Stdout:', stdout, '\n', '> Stderr:', stderr); + reject(err); + return; + } + resolve(stdout); + }); + }); +} +exports.execFileAsync = execFileAsync; +function compactFlattenedList(list) { + const result = []; + function populateResult(list) { + if (!Array.isArray(list)) { + if (list) + result.push(list); + } + else if (list.length > 0) { + for (const item of list) + if (item) + populateResult(item); + } + } + populateResult(list); + return result; +} +exports.compactFlattenedList = compactFlattenedList; +/** + * Returns the path to the "Contents" folder inside the application bundle + */ +function getAppContentsPath(opts) { + return path.join(opts.app, 'Contents'); +} +exports.getAppContentsPath = getAppContentsPath; +/** + * Returns the path to app "Frameworks" within contents. + */ +function getAppFrameworksPath(opts) { + return path.join(getAppContentsPath(opts), 'Frameworks'); +} +exports.getAppFrameworksPath = getAppFrameworksPath; +async function detectElectronPlatform(opts) { + const appFrameworksPath = getAppFrameworksPath(opts); + if (await fs.pathExists(path.resolve(appFrameworksPath, 'Squirrel.framework'))) { + return 'darwin'; + } + else { + return 'mas'; + } +} +exports.detectElectronPlatform = detectElectronPlatform; +/** + * This function returns a promise resolving the file path if file binary. + */ +async function getFilePathIfBinary(filePath) { + if (await (0, isbinaryfile_1.isBinaryFile)(filePath)) { + return filePath; + } + return null; +} +/** + * This function returns a promise validating opts.app, the application to be signed or flattened. + */ +async function validateOptsApp(opts) { + if (!opts.app) { + throw new Error('Path to application must be specified.'); + } + if (path.extname(opts.app) !== '.app') { + throw new Error('Extension of application must be `.app`.'); + } + if (!(await fs.pathExists(opts.app))) { + throw new Error(`Application at path "${opts.app}" could not be found`); + } +} +exports.validateOptsApp = validateOptsApp; +/** + * This function returns a promise validating opts.platform, the platform of Electron build. It allows auto-discovery if no opts.platform is specified. + */ +async function validateOptsPlatform(opts) { + if (opts.platform) { + if (opts.platform === 'mas' || opts.platform === 'darwin') { + return opts.platform; + } + else { + (0, exports.debugWarn)('`platform` passed in arguments not supported, checking Electron platform...'); + } + } + else { + (0, exports.debugWarn)('No `platform` passed in arguments, checking Electron platform...'); + } + return await detectElectronPlatform(opts); +} +exports.validateOptsPlatform = validateOptsPlatform; +/** + * This function returns a promise resolving all child paths within the directory specified. + * @function + * @param {string} dirPath - Path to directory. + * @returns {Promise} Promise resolving child paths needing signing in order. + */ +async function walkAsync(dirPath) { + (0, exports.debugLog)('Walking... ' + dirPath); + async function _walkAsync(dirPath) { + const children = await fs.readdir(dirPath); + return await Promise.all(children.map(async (child) => { + const filePath = path.resolve(dirPath, child); + const stat = await fs.stat(filePath); + if (stat.isFile()) { + switch (path.extname(filePath)) { + case '.cstemp': // Temporary file generated from past codesign + (0, exports.debugLog)('Removing... ' + filePath); + await fs.remove(filePath); + return null; + default: + return await getFilePathIfBinary(filePath); + } + } + else if (stat.isDirectory() && !stat.isSymbolicLink()) { + const walkResult = await _walkAsync(filePath); + switch (path.extname(filePath)) { + case '.app': // Application + case '.framework': // Framework + walkResult.push(filePath); + } + return walkResult; + } + return null; + })); + } + const allPaths = await _walkAsync(dirPath); + return compactFlattenedList(allPaths); +} +exports.walkAsync = walkAsync; +//# sourceMappingURL=util.js.map
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/cjs/util.js.map b/desktop/node_modules/@electron/osx-sign/dist/cjs/util.js.map new file mode 100644 index 0000000..2e565d7 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/cjs/util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuC;AACvC,6CAA+B;AAC/B,+CAA4C;AAC5C,2CAA6B;AAE7B,kDAA0B;AAGb,QAAA,QAAQ,GAAG,IAAA,eAAK,EAAC,mBAAmB,CAAC,CAAC;AACnD,gBAAQ,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAE5B,QAAA,SAAS,GAAG,IAAA,eAAK,EAAC,wBAAwB,CAAC,CAAC;AACzD,iBAAS,CAAC,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAE3C,MAAM,cAAc,GAAG,UAAU,KAAa;IAC5C,OAAO,KAAK,CAAC,OAAO,CAAC,+BAA+B,EAAE,UAAU,CAAC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pC,MAAM,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;wBAC1B,OAAO,IAAI,CAAC;oBACd;wBACE,OAAO,MAAM,mBAAmB,CAAC,QAAQ,CAAC,CAAC;iBAC9C;aACF;iBAAM,IAAI,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE;gBACvD,MAAM,UAAU,GAAG,MAAM,UAAU,CAAC,QAAQ,CAAC,CAAC;gBAC9C,QAAQ,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;oBAC9B,KAAK,MAAM,CAAC,CAAC,cAAc;oBAC3B,KAAK,YAAY,EAAE,YAAY;wBAC7B,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;iBAC7B;gBACD,OAAO,UAAU,CAAC;aACnB;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC;IAC3C,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC;AACxC,CAAC;AAnCD,8BAmCC"}
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/esm/flat.d.ts b/desktop/node_modules/@electron/osx-sign/dist/esm/flat.d.ts new file mode 100644 index 0000000..4d63f07 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/esm/flat.d.ts @@ -0,0 +1,11 @@ +import { FlatOptions } from './types'; +/** + * This function is exported and returns a promise flattening the application. + */ +export declare function buildPkg(_opts: FlatOptions): Promise<void>; +/** + * This function is exported with normal callback implementation. + * + * @deprecated Please use the promise based "buildPkg" method + */ +export declare const flat: (opts: FlatOptions, cb?: ((error?: Error) => void) | undefined) => void; diff --git a/desktop/node_modules/@electron/osx-sign/dist/esm/flat.js b/desktop/node_modules/@electron/osx-sign/dist/esm/flat.js new file mode 100644 index 0000000..3b72803 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/esm/flat.js @@ -0,0 +1,125 @@ +import * as path from 'path'; +import { debugLog, debugWarn, execFileAsync, validateOptsApp, validateOptsPlatform } from './util'; +import { findIdentities } from './util-identities'; +const pkgVersion = require('../../package.json').version; +/** + * This function returns a promise validating all options passed in opts. + * @function + * @param {Object} opts - Options. + * @returns {Promise} Promise. + */ +async function validateFlatOpts(opts) { + await validateOptsApp(opts); + let pkg = opts.pkg; + if (pkg) { + if (typeof pkg !== 'string') + throw new Error('`pkg` must be a string.'); + if (path.extname(pkg) !== '.pkg') { + throw new Error('Extension of output package must be `.pkg`.'); + } + } + else { + debugWarn('No `pkg` passed in arguments, will fallback to default inferred from the given application.'); + pkg = path.join(path.dirname(opts.app), path.basename(opts.app, '.app') + '.pkg'); + } + let install = opts.install; + if (install) { + if (typeof install !== 'string') { + return Promise.reject(new Error('`install` must be a string.')); + } + } + else { + debugWarn('No `install` passed in arguments, will fallback to default `/Applications`.'); + install = '/Applications'; + } + return Object.assign(Object.assign({}, opts), { pkg, + install, platform: await validateOptsPlatform(opts) }); +} +/** + * This function returns a promise flattening the application. + * @function + * @param {Object} opts - Options. + * @returns {Promise} Promise. + */ +async function buildApplicationPkg(opts, identity) { + const args = ['--component', opts.app, opts.install, '--sign', identity.name, opts.pkg]; + if (opts.keychain) { + args.unshift('--keychain', opts.keychain); + } + if (opts.scripts) { + args.unshift('--scripts', opts.scripts); + } + debugLog('Flattening... ' + opts.app); + await execFileAsync('productbuild', args); +} +/** + * This function is exported and returns a promise flattening the application. + */ +export async function buildPkg(_opts) { + debugLog('@electron/osx-sign@%s', pkgVersion); + const validatedOptions = await validateFlatOpts(_opts); + let identities = []; + let identityInUse = null; + if (validatedOptions.identity) { + debugLog('`identity` passed in arguments.'); + if (validatedOptions.identityValidation === false) { + // Do nothing + } + else { + identities = await findIdentities(validatedOptions.keychain || null, validatedOptions.identity); + } + } + else { + debugWarn('No `identity` passed in arguments...'); + if (validatedOptions.platform === 'mas') { + debugLog('Finding `3rd Party Mac Developer Installer` certificate for flattening app distribution in the Mac App Store...'); + identities = await findIdentities(validatedOptions.keychain || null, '3rd Party Mac Developer Installer:'); + } + else { + debugLog('Finding `Developer ID Application` certificate for distribution outside the Mac App Store...'); + identities = await findIdentities(validatedOptions.keychain || null, 'Developer ID Installer:'); + } + } + if (identities.length > 0) { + // Provisioning profile(s) found + if (identities.length > 1) { + debugWarn('Multiple identities found, will use the first discovered.'); + } + else { + debugLog('Found 1 identity.'); + } + identityInUse = identities[0]; + } + else { + // No identity found + throw new Error('No identity found for signing.'); + } + debugLog('Flattening application...', '\n', '> Application:', validatedOptions.app, '\n', '> Package output:', validatedOptions.pkg, '\n', '> Install path:', validatedOptions.install, '\n', '> Identity:', validatedOptions.identity, '\n', '> Scripts:', validatedOptions.scripts); + await buildApplicationPkg(validatedOptions, identityInUse); + debugLog('Application flattened.'); +} +/** + * This function is exported with normal callback implementation. + * + * @deprecated Please use the promise based "buildPkg" method + */ +export const flat = (opts, cb) => { + buildPkg(opts) + .then(() => { + debugLog('Application flattened, saved to: ' + opts.app); + if (cb) + cb(); + }) + .catch((err) => { + debugLog('Flat failed:'); + if (err.message) + debugLog(err.message); + else if (err.stack) + debugLog(err.stack); + else + debugLog(err); + if (cb) + cb(err); + }); +}; +//# sourceMappingURL=flat.js.map
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/esm/flat.js.map b/desktop/node_modules/@electron/osx-sign/dist/esm/flat.js.map new file mode 100644 index 0000000..2337fb6 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/esm/flat.js.map @@ -0,0 +1 @@ +{"version":3,"file":"flat.js","sourceRoot":"","sources":["../../src/flat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAEnG,OAAO,EAAY,cAAc,EAAE,MAAM,mB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AAI,GAAG,CAAC,OAAO;YAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;aAClC,IAAI,GAAG,CAAC,KAAK;YAAE,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;;YACnC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACnB,IAAI,EAAE;YAAE,EAAE,CAAC,GAAG,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"}
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/esm/index.d.ts b/desktop/node_modules/@electron/osx-sign/dist/esm/index.d.ts new file mode 100644 index 0000000..deb3ca0 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/esm/index.d.ts @@ -0,0 +1,4 @@ +import { sign, signApp } from './sign'; +import { flat, buildPkg } from './flat'; +export { sign, flat, signApp as signAsync, signApp, buildPkg as flatAsync, buildPkg }; +export * from './types'; diff --git a/desktop/node_modules/@electron/osx-sign/dist/esm/index.js b/desktop/node_modules/@electron/osx-sign/dist/esm/index.js new file mode 100644 index 0000000..de8bd18 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/esm/index.js @@ -0,0 +1,14 @@ +import { sign, signApp } from './sign'; +import { flat, buildPkg } from './flat'; +// TODO: Remove and leave only proper named exports, but for non-breaking change reasons +// we need to keep this weirdness for now +module.exports = sign; +module.exports.sign = sign; +module.exports.signAsync = signApp; +module.exports.signApp = signApp; +module.exports.flat = flat; +module.exports.flatAsync = buildPkg; +module.exports.buildPkg = buildPkg; +export { sign, flat, signApp as signAsync, signApp, buildPkg as flatAsync, buildPkg }; +export * from './types'; +//# sourceMappingURL=index.js.map
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/esm/index.js.map b/desktop/node_modules/@electron/osx-sign/dist/esm/index.js.map new file mode 100644 index 0000000..616e01e --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAExC,wFAAwF;AACxF,yCAAyC;AACzC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;AACtB,MAAM,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;AAC3B,MAAM,CAAC,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC;AACnC,MAAM,CAAC,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;AACjC,MAAM,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;AAC3B,MAAM,CAAC,OAAO,CAAC,SAAS,GAAG,QAAQ,CAAC;AACpC,MAAM,CAAC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAEnC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,IAAI,SAAS,EAAE,OAAO,EAAE,QAAQ,IAAI,SAAS,EAAE,QAAQ,EAAE,CAAC;AACtF,cAAc,SAAS,CAAC"}
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/esm/sign.d.ts b/desktop/node_modules/@electron/osx-sign/dist/esm/sign.d.ts new file mode 100644 index 0000000..14eda7e --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/esm/sign.d.ts @@ -0,0 +1,11 @@ +import { SignOptions } from './types'; +/** + * This function returns a promise signing the application. + */ +export declare function signApp(_opts: SignOptions): Promise<void>; +/** + * This function is a legacy callback implementation. + * + * @deprecated Please use the promise based "signApp" method + */ +export declare const sign: (opts: SignOptions, cb?: ((error?: Error) => void) | undefined) => void; diff --git a/desktop/node_modules/@electron/osx-sign/dist/esm/sign.js b/desktop/node_modules/@electron/osx-sign/dist/esm/sign.js new file mode 100644 index 0000000..856aab4 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/esm/sign.js @@ -0,0 +1,332 @@ +import * as fs from 'fs-extra'; +import * as os from 'os'; +import * as path from 'path'; +import * as plist from 'plist'; +import compareVersion from 'compare-version'; +import { debugLog, debugWarn, getAppContentsPath, execFileAsync, validateOptsApp, validateOptsPlatform, walkAsync } from './util'; +import { Identity, findIdentities } from './util-identities'; +import { preEmbedProvisioningProfile, getProvisioningProfile } from './util-provisioning-profiles'; +import { preAutoEntitlements } from './util-entitlements'; +const pkgVersion = require('../../package.json').version; +const osRelease = os.release(); +/** + * This function returns a promise validating opts.binaries, the additional binaries to be signed along with the discovered enclosed components. + */ +async function validateOptsBinaries(opts) { + if (opts.binaries) { + if (!Array.isArray(opts.binaries)) { + throw new Error('Additional binaries should be an Array.'); + } + // TODO: Presence check for binary files, reject if any does not exist + } +} +function validateOptsIgnore(ignore) { + if (ignore && !(ignore instanceof Array)) { + return [ignore]; + } +} +/** + * This function returns a promise validating all options passed in opts. + */ +async function validateSignOpts(opts) { + await validateOptsBinaries(opts); + await validateOptsApp(opts); + if (opts.provisioningProfile && typeof opts.provisioningProfile !== 'string') { + throw new Error('Path to provisioning profile should be a string.'); + } + if (opts.type && opts.type !== 'development' && opts.type !== 'distribution') { + throw new Error('Type must be either `development` or `distribution`.'); + } + const platform = await validateOptsPlatform(opts); + const cloned = Object.assign(Object.assign({}, opts), { ignore: validateOptsIgnore(opts.ignore), type: opts.type || 'distribution', platform }); + return cloned; +} +/** + * This function returns a promise verifying the code sign of application bundle. + */ +async function verifySignApplication(opts) { + // Verify with codesign + debugLog('Verifying application bundle with codesign...'); + await execFileAsync('codesign', ['--verify', '--deep'].concat(opts.strictVerify !== false && compareVersion(osRelease, '15.0.0') >= 0 // Strict flag since darwin 15.0.0 --> OS X 10.11.0 El Capitan + ? [ + '--strict' + + (opts.strictVerify + ? '=' + opts.strictVerify // Array should be converted to a comma separated string + : '') + ] + : [], ['--verbose=2', opts.app])); +} +function defaultOptionsForFile(filePath, platform) { + const entitlementsFolder = path.resolve(__dirname, '..', '..', 'entitlements'); + let entitlementsFile; + if (platform === 'darwin') { + // Default Entitlements + // c.f. https://source.chromium.org/chromium/chromium/src/+/main:chrome/app/app-entitlements.plist + // Also include JIT for main process V8 + entitlementsFile = path.resolve(entitlementsFolder, 'default.darwin.plist'); + // Plugin helper + // c.f. https://source.chromium.org/chromium/chromium/src/+/main:chrome/app/helper-plugin-entitlements.plist + if (filePath.includes('(Plugin).app')) { + entitlementsFile = path.resolve(entitlementsFolder, 'default.darwin.plugin.plist'); + // GPU Helper + // c.f. https://source.chromium.org/chromium/chromium/src/+/main:chrome/app/helper-gpu-entitlements.plist + } + else if (filePath.includes('(GPU).app')) { + entitlementsFile = path.resolve(entitlementsFolder, 'default.darwin.gpu.plist'); + // Renderer Helper + // c.f. https://source.chromium.org/chromium/chromium/src/+/main:chrome/app/helper-renderer-entitlements.plist + } + else if (filePath.includes('(Renderer).app')) { + entitlementsFile = path.resolve(entitlementsFolder, 'default.darwin.renderer.plist'); + } + } + else { + // Default entitlements + // TODO: Can these be more scoped like the non-mas variant? + entitlementsFile = path.resolve(entitlementsFolder, 'default.mas.plist'); + // If it is not the top level app bundle, we sign with inherit + if (filePath.includes('.app/')) { + entitlementsFile = path.resolve(entitlementsFolder, 'default.mas.child.plist'); + } + } + return { + entitlements: entitlementsFile, + hardenedRuntime: true, + requirements: undefined, + signatureFlags: undefined, + timestamp: undefined + }; +} +async function mergeOptionsForFile(opts, defaults) { + const mergedPerFileOptions = Object.assign({}, defaults); + if (opts) { + if (opts.entitlements !== undefined) { + if (Array.isArray(opts.entitlements)) { + const entitlements = opts.entitlements.reduce((dict, entitlementKey) => (Object.assign(Object.assign({}, dict), { [entitlementKey]: true })), {}); + const dir = await fs.mkdtemp(path.resolve(os.tmpdir(), 'tmp-entitlements-')); + const entitlementsPath = path.join(dir, 'entitlements.plist'); + await fs.writeFile(entitlementsPath, plist.build(entitlements), 'utf8'); + opts.entitlements = entitlementsPath; + } + mergedPerFileOptions.entitlements = opts.entitlements; + } + if (opts.hardenedRuntime !== undefined) { + mergedPerFileOptions.hardenedRuntime = opts.hardenedRuntime; + } + if (opts.requirements !== undefined) + mergedPerFileOptions.requirements = opts.requirements; + if (opts.signatureFlags !== undefined) { + mergedPerFileOptions.signatureFlags = opts.signatureFlags; + } + if (opts.timestamp !== undefined) + mergedPerFileOptions.timestamp = opts.timestamp; + } + return mergedPerFileOptions; +} +/** + * This function returns a promise codesigning only. + */ +async function signApplication(opts, identity) { + function shouldIgnoreFilePath(filePath) { + if (opts.ignore) { + return opts.ignore.some(function (ignore) { + if (typeof ignore === 'function') { + return ignore(filePath); + } + return filePath.match(ignore); + }); + } + return false; + } + const children = await walkAsync(getAppContentsPath(opts)); + if (opts.binaries) + children.push(...opts.binaries); + const args = ['--sign', identity.hash || identity.name, '--force']; + if (opts.keychain) { + args.push('--keychain', opts.keychain); + } + /** + * Sort the child paths by how deep they are in the file tree. Some arcane apple + * logic expects the deeper files to be signed first otherwise strange errors get + * thrown our way + */ + children.sort((a, b) => { + const aDepth = a.split(path.sep).length; + const bDepth = b.split(path.sep).length; + return bDepth - aDepth; + }); + for (const filePath of [...children, opts.app]) { + if (shouldIgnoreFilePath(filePath)) { + debugLog('Skipped... ' + filePath); + continue; + } + const perFileOptions = await mergeOptionsForFile(opts.optionsForFile ? opts.optionsForFile(filePath) : null, defaultOptionsForFile(filePath, opts.platform)); + // preAutoEntitlements should only be applied to the top level app bundle. + // Applying it other files will cause the app to crash and be rejected by Apple. + if (!filePath.includes('.app/')) { + if (opts.preAutoEntitlements === false) { + debugWarn('Pre-sign operation disabled for entitlements automation.'); + } + else { + debugLog('Pre-sign operation enabled for entitlements automation with versions >= `1.1.1`:', '\n', '* Disable by setting `pre-auto-entitlements` to `false`.'); + if (!opts.version || compareVersion(opts.version, '1.1.1') >= 0) { + // Enable Mac App Store sandboxing without using temporary-exception, introduced in Electron v1.1.1. Relates to electron#5601 + const newEntitlements = await preAutoEntitlements(opts, perFileOptions, { + identity, + provisioningProfile: opts.provisioningProfile + ? await getProvisioningProfile(opts.provisioningProfile, opts.keychain) + : undefined + }); + // preAutoEntitlements may provide us new entitlements, if so we update our options + // and ensure that entitlements-loginhelper has a correct default value + if (newEntitlements) { + perFileOptions.entitlements = newEntitlements; + } + } + } + } + debugLog('Signing... ' + filePath); + const perFileArgs = [...args]; + if (perFileOptions.requirements) { + perFileArgs.push('--requirements', perFileOptions.requirements); + } + if (perFileOptions.timestamp) { + perFileArgs.push('--timestamp=' + perFileOptions.timestamp); + } + else { + perFileArgs.push('--timestamp'); + } + let optionsArguments = []; + if (perFileOptions.signatureFlags) { + if (Array.isArray(perFileOptions.signatureFlags)) { + optionsArguments.push(...perFileOptions.signatureFlags); + } + else { + const flags = perFileOptions.signatureFlags.split(',').map(function (flag) { + return flag.trim(); + }); + optionsArguments.push(...flags); + } + } + if (perFileOptions.hardenedRuntime || optionsArguments.includes('runtime')) { + // Hardened runtime since darwin 17.7.0 --> macOS 10.13.6 + if (compareVersion(osRelease, '17.7.0') >= 0) { + optionsArguments.push('runtime'); + } + else { + // Remove runtime if passed in with --signature-flags + debugLog('Not enabling hardened runtime, current macOS version too low, requires 10.13.6 and higher'); + optionsArguments = optionsArguments.filter((arg) => { + return arg !== 'runtime'; + }); + } + } + if (optionsArguments.length) { + perFileArgs.push('--options', [...new Set(optionsArguments)].join(',')); + } + await execFileAsync('codesign', perFileArgs.concat('--entitlements', perFileOptions.entitlements, filePath)); + } + // Verify code sign + debugLog('Verifying...'); + await verifySignApplication(opts); + debugLog('Verified.'); + // Check entitlements if applicable + debugLog('Displaying entitlements...'); + const result = await execFileAsync('codesign', [ + '--display', + '--entitlements', + ':-', + opts.app + ]); + debugLog('Entitlements:', '\n', result); +} +/** + * This function returns a promise signing the application. + */ +export async function signApp(_opts) { + debugLog('electron-osx-sign@%s', pkgVersion); + const validatedOpts = await validateSignOpts(_opts); + let identities = []; + let identityInUse = null; + // Determine identity for signing + if (validatedOpts.identity) { + debugLog('`identity` passed in arguments.'); + if (validatedOpts.identityValidation === false) { + identityInUse = new Identity(validatedOpts.identity); + } + else { + identities = await findIdentities(validatedOpts.keychain || null, validatedOpts.identity); + } + } + else { + debugWarn('No `identity` passed in arguments...'); + if (validatedOpts.platform === 'mas') { + if (validatedOpts.type === 'distribution') { + debugLog('Finding `3rd Party Mac Developer Application` certificate for signing app distribution in the Mac App Store...'); + identities = await findIdentities(validatedOpts.keychain || null, '3rd Party Mac Developer Application:'); + } + else { + debugLog('Finding `Mac Developer` certificate for signing app in development for the Mac App Store signing...'); + identities = await findIdentities(validatedOpts.keychain || null, 'Mac Developer:'); + } + } + else { + debugLog('Finding `Developer ID Application` certificate for distribution outside the Mac App Store...'); + identities = await findIdentities(validatedOpts.keychain || null, 'Developer ID Application:'); + } + } + if (!identityInUse) { + if (identities.length > 0) { + // Identity(/ies) found + if (identities.length > 1) { + debugWarn('Multiple identities found, will use the first discovered.'); + } + else { + debugLog('Found 1 identity.'); + } + identityInUse = identities[0]; + } + else { + // No identity found + throw new Error('No identity found for signing.'); + } + } + // Pre-sign operations + if (validatedOpts.preEmbedProvisioningProfile === false) { + debugWarn('Pre-sign operation disabled for provisioning profile embedding:', '\n', '* Enable by setting `pre-embed-provisioning-profile` to `true`.'); + } + else { + debugLog('Pre-sign operation enabled for provisioning profile:', '\n', '* Disable by setting `pre-embed-provisioning-profile` to `false`.'); + await preEmbedProvisioningProfile(validatedOpts, validatedOpts.provisioningProfile + ? await getProvisioningProfile(validatedOpts.provisioningProfile, validatedOpts.keychain) + : null); + } + debugLog('Signing application...', '\n', '> Application:', validatedOpts.app, '\n', '> Platform:', validatedOpts.platform, '\n', '> Additional binaries:', validatedOpts.binaries, '\n', '> Identity:', validatedOpts.identity); + await signApplication(validatedOpts, identityInUse); + // Post-sign operations + debugLog('Application signed.'); +} +/** + * This function is a legacy callback implementation. + * + * @deprecated Please use the promise based "signApp" method + */ +export const sign = (opts, cb) => { + signApp(opts) + .then(() => { + debugLog('Application signed: ' + opts.app); + if (cb) + cb(); + }) + .catch((err) => { + if (err.message) + debugLog(err.message); + else if (err.stack) + debugLog(err.stack); + else + debugLog(err); + if (cb) + cb(err); + }); +}; +//# sourceMappingURL=sign.js.map
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/esm/sign.js.map b/desktop/node_modules/@electron/osx-sign/dist/esm/sign.js.map new file mode 100644 index 0000000..fd6f022 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/esm/sign.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sign.js","sourceRoot":"","sources":["../../src/sign.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,cAAc,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EACL,QAAQ,EACR,SAAS,EACT,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,SAAS,EACV,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACnG,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG1D,MAAM,UAAU,GAAW,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC;AAEjE,MAAM,SAAS,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;AAE/B;;GAEG;AACH,KAAK,UAAU,oBAAoB,CAAE,IAAiB;IACpD,IAAI,IAAI,CAAC,QAAQ,EAAE;QACjB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YACjC,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;SAC5D;QACD,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GAAG,CAAC,KAAK;YAAE,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;;YACnC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACnB,IAAI,EAAE;YAAE,EAAE,CAAC,GAAG,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"}
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/esm/types.d.ts b/desktop/node_modules/@electron/osx-sign/dist/esm/types.d.ts new file mode 100644 index 0000000..c2ba609 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/esm/types.d.ts @@ -0,0 +1,73 @@ +export type ElectronMacPlatform = 'darwin' | 'mas'; +type SigningDistributionType = 'development' | 'distribution'; +export type BaseSignOptions = Readonly<{ + app: string; + identity?: string; + platform?: ElectronMacPlatform; + keychain?: string; +}>; +type OnlyValidatedBaseSignOptions = { + platform: ElectronMacPlatform; +}; +/** + * Any missing options will use the default values, providing a partial + * structure will shallow merge with the default values. + */ +export type PerFileSignOptions = { + /** + * The entitlements file to use when signing this file + */ + entitlements?: string | string[]; + /** + * Whether to enable hardened runtime for this file. Enabled by default. + */ + hardenedRuntime?: boolean; + /** + * The designated requirements to embed when signing this file + */ + requirements?: string; + /** + * See --options of the "codesign" command. + * + * https://www.manpagez.com/man/1/codesign + */ + signatureFlags?: string | string[]; + /** + * The timestamp server to use when signing, by default uses the Apple provided + * timestamp server. + */ + timestamp?: string; +}; +type OnlySignOptions = { + binaries?: string[]; + optionsForFile?: (filePath: string) => PerFileSignOptions; + identityValidation?: boolean; + ignore?: string | string[] | ((file: string) => boolean); + preAutoEntitlements?: boolean; + preEmbedProvisioningProfile?: boolean; + provisioningProfile?: string; + strictVerify?: boolean; + type?: SigningDistributionType; + version?: string; +}; +type OnlyValidatedSignOptions = { + ignore?: (string | ((file: string) => boolean))[]; + type: SigningDistributionType; +}; +type OnlyFlatOptions = { + identityValidation?: boolean; + install?: string; + pkg?: string; + scripts?: string; +}; +type OnlyValidatedFlatOptions = { + install: string; + pkg: string; +}; +type ValidatedForm<UnValidated, Validated> = Omit<UnValidated, keyof Validated> & Validated; +export type ValidatedBaseSignOptions = Readonly<ValidatedForm<BaseSignOptions, OnlyValidatedBaseSignOptions>>; +export type SignOptions = Readonly<OnlySignOptions & BaseSignOptions>; +export type ValidatedSignOptions = Readonly<ValidatedForm<OnlySignOptions, OnlyValidatedSignOptions> & ValidatedBaseSignOptions>; +export type FlatOptions = Readonly<OnlyFlatOptions & BaseSignOptions>; +export type ValidatedFlatOptions = Readonly<ValidatedForm<OnlyFlatOptions, OnlyValidatedFlatOptions> & ValidatedBaseSignOptions>; +export {}; diff --git a/desktop/node_modules/@electron/osx-sign/dist/esm/types.js b/desktop/node_modules/@electron/osx-sign/dist/esm/types.js new file mode 100644 index 0000000..718fd38 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/esm/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/esm/types.js.map b/desktop/node_modules/@electron/osx-sign/dist/esm/types.js.map new file mode 100644 index 0000000..7b5fff8 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/esm/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/esm/util-entitlements.d.ts b/desktop/node_modules/@electron/osx-sign/dist/esm/util-entitlements.d.ts new file mode 100644 index 0000000..0c4ff73 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/esm/util-entitlements.d.ts @@ -0,0 +1,17 @@ +import { PerFileSignOptions, ValidatedSignOptions } from './types'; +import { Identity } from './util-identities'; +import { ProvisioningProfile } from './util-provisioning-profiles'; +type ComputedOptions = { + identity: Identity; + provisioningProfile?: ProvisioningProfile; +}; +/** + * This function returns a promise completing the entitlements automation: The + * process includes checking in `Info.plist` for `ElectronTeamID` or setting + * parsed value from identity, and checking in entitlements file for + * `com.apple.security.application-groups` or inserting new into array. A + * temporary entitlements file may be created to replace the input for any + * changes introduced. + */ +export declare function preAutoEntitlements(opts: ValidatedSignOptions, perFileOpts: PerFileSignOptions, computed: ComputedOptions): Promise<void | string>; +export {}; diff --git a/desktop/node_modules/@electron/osx-sign/dist/esm/util-entitlements.js b/desktop/node_modules/@electron/osx-sign/dist/esm/util-entitlements.js new file mode 100644 index 0000000..8d4455b --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/esm/util-entitlements.js @@ -0,0 +1,106 @@ +import * as fs from 'fs-extra'; +import * as os from 'os'; +import * as path from 'path'; +import * as plist from 'plist'; +import { debugLog, getAppContentsPath } from './util'; +const preAuthMemo = new Map(); +/** + * This function returns a promise completing the entitlements automation: The + * process includes checking in `Info.plist` for `ElectronTeamID` or setting + * parsed value from identity, and checking in entitlements file for + * `com.apple.security.application-groups` or inserting new into array. A + * temporary entitlements file may be created to replace the input for any + * changes introduced. + */ +export async function preAutoEntitlements(opts, perFileOpts, computed) { + var _a; + if (!perFileOpts.entitlements) + return; + const memoKey = [opts.app, perFileOpts.entitlements].join('---'); + if (preAuthMemo.has(memoKey)) + return preAuthMemo.get(memoKey); + // If entitlements file not provided, default will be used. Fixes #41 + const appInfoPath = path.join(getAppContentsPath(opts), 'Info.plist'); + debugLog('Automating entitlement app group...', '\n', '> Info.plist:', appInfoPath, '\n'); + let entitlements; + if (typeof perFileOpts.entitlements === 'string') { + const entitlementsContents = await fs.readFile(perFileOpts.entitlements, 'utf8'); + entitlements = plist.parse(entitlementsContents); + } + else { + entitlements = perFileOpts.entitlements.reduce((dict, entitlementKey) => (Object.assign(Object.assign({}, dict), { [entitlementKey]: true })), {}); + } + if (!entitlements['com.apple.security.app-sandbox']) { + // Only automate when app sandbox enabled by user + return; + } + const appInfoContents = await fs.readFile(appInfoPath, 'utf8'); + const appInfo = plist.parse(appInfoContents); + // Use ElectronTeamID in Info.plist if already specified + if (appInfo.ElectronTeamID) { + debugLog('`ElectronTeamID` found in `Info.plist`: ' + appInfo.ElectronTeamID); + } + else { + // The team identifier in signing identity should not be trusted + if (computed.provisioningProfile) { + appInfo.ElectronTeamID = + computed.provisioningProfile.message.Entitlements['com.apple.developer.team-identifier']; + debugLog('`ElectronTeamID` not found in `Info.plist`, use parsed from provisioning profile: ' + + appInfo.ElectronTeamID); + } + else { + const teamID = (_a = /^.+\((.+?)\)$/g.exec(computed.identity.name)) === null || _a === void 0 ? void 0 : _a[1]; + if (!teamID) { + throw new Error(`Could not automatically determine ElectronTeamID from identity: ${computed.identity.name}`); + } + appInfo.ElectronTeamID = teamID; + debugLog('`ElectronTeamID` not found in `Info.plist`, use parsed from signing identity: ' + + appInfo.ElectronTeamID); + } + await fs.writeFile(appInfoPath, plist.build(appInfo), 'utf8'); + debugLog('`Info.plist` updated:', '\n', '> Info.plist:', appInfoPath); + } + const appIdentifier = appInfo.ElectronTeamID + '.' + appInfo.CFBundleIdentifier; + // Insert application identifier if not exists + if (entitlements['com.apple.application-identifier']) { + debugLog('`com.apple.application-identifier` found in entitlements file: ' + + entitlements['com.apple.application-identifier']); + } + else { + debugLog('`com.apple.application-identifier` not found in entitlements file, new inserted: ' + + appIdentifier); + entitlements['com.apple.application-identifier'] = appIdentifier; + } + // Insert developer team identifier if not exists + if (entitlements['com.apple.developer.team-identifier']) { + debugLog('`com.apple.developer.team-identifier` found in entitlements file: ' + + entitlements['com.apple.developer.team-identifier']); + } + else { + debugLog('`com.apple.developer.team-identifier` not found in entitlements file, new inserted: ' + + appInfo.ElectronTeamID); + entitlements['com.apple.developer.team-identifier'] = appInfo.ElectronTeamID; + } + // Init entitlements app group key to array if not exists + if (!entitlements['com.apple.security.application-groups']) { + entitlements['com.apple.security.application-groups'] = []; + } + // Insert app group if not exists + if (Array.isArray(entitlements['com.apple.security.application-groups']) && + entitlements['com.apple.security.application-groups'].indexOf(appIdentifier) === -1) { + debugLog('`com.apple.security.application-groups` not found in entitlements file, new inserted: ' + + appIdentifier); + entitlements['com.apple.security.application-groups'].push(appIdentifier); + } + else { + debugLog('`com.apple.security.application-groups` found in entitlements file: ' + appIdentifier); + } + // Create temporary entitlements file + const dir = await fs.mkdtemp(path.resolve(os.tmpdir(), 'tmp-entitlements-')); + const entitlementsPath = path.join(dir, 'entitlements.plist'); + await fs.writeFile(entitlementsPath, plist.build(entitlements), 'utf8'); + debugLog('Entitlements file updated:', '\n', '> Entitlements:', entitlementsPath); + preAuthMemo.set(memoKey, entitlementsPath); + return entitlementsPath; +} +//# sourceMappingURL=util-entitlements.js.map
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/esm/util-entitlements.js.map b/desktop/node_modules/@electron/osx-sign/dist/esm/util-entitlements.js.map new file mode 100644 index 0000000..0b50559 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/esm/util-entitlements.js.map @@ -0,0 +1 @@ +{"version":3,"file":"util-entitlements.js","sourceRoot":"","sources":["../../src/util-entitlements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAStD,MAAM,WAAW,GAAG,IAAI,GAAG,EAAkB,CAAC;AAE9C;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,IAA0B,EAC1B,WAA+B,EAC/B,QAAyB;;IAEzB,IAAI,CAAC,WAAW,CAAC,YAAY;QAAE,OAAO;IAEtC,MAAM,OAAO,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjE,IAAI,WAAW,CAAC,GAAG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ACzD,IAAI,CAAC,YAAY,CAAC,uCAAuC,CAAC,EAAE;QAC1D,YAAY,CAAC,uCAAuC,CAAC,GAAG,EAAE,CAAC;KAC5D;IACD,iCAAiC;IACjC,IACE,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,uCAAuC,CAAC,CAAC;QACpE,YAAY,CAAC,uCAAuC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,EACnF;QACA,QAAQ,CACN,wFAAwF;YACtF,aAAa,CAChB,CAAC;QACF,YAAY,CAAC,uCAAuC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;KAC3E;SAAM;QACL,QAAQ,CACN,sEAAsE,GAAG,aAAa,CACvF,CAAC;KACH;IACD,qCAAqC;IACrC,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAC7E,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAC;IAC9D,MAAM,EAAE,CAAC,SAAS,CAAC,gBAAgB,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,CAAC;IACxE,QAAQ,CAAC,4BAA4B,EAAE,IAAI,EAAE,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;IAElF,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;IAC3C,OAAO,gBAAgB,CAAC;AAC1B,CAAC"}
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/esm/util-identities.d.ts b/desktop/node_modules/@electron/osx-sign/dist/esm/util-identities.d.ts new file mode 100644 index 0000000..fe56cdb --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/esm/util-identities.d.ts @@ -0,0 +1,6 @@ +export declare class Identity { + name: string; + hash?: string | undefined; + constructor(name: string, hash?: string | undefined); +} +export declare function findIdentities(keychain: string | null, identity: string): Promise<Identity[]>; diff --git a/desktop/node_modules/@electron/osx-sign/dist/esm/util-identities.js b/desktop/node_modules/@electron/osx-sign/dist/esm/util-identities.js new file mode 100644 index 0000000..4fb273d --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/esm/util-identities.js @@ -0,0 +1,30 @@ +import { debugLog, compactFlattenedList, execFileAsync } from './util'; +export class Identity { + constructor(name, hash) { + this.name = name; + this.hash = hash; + } +} +export async function findIdentities(keychain, identity) { + // Only to look for valid identities, excluding those flagged with + // CSSMERR_TP_CERT_EXPIRED or CSSMERR_TP_NOT_TRUSTED. Fixes #9 + const args = [ + 'find-identity', + '-v' + ]; + if (keychain) { + args.push(keychain); + } + const result = await execFileAsync('security', args); + const identities = result.split('\n').map(function (line) { + if (line.indexOf(identity) >= 0) { + const identityFound = line.substring(line.indexOf('"') + 1, line.lastIndexOf('"')); + const identityHashFound = line.substring(line.indexOf(')') + 2, line.indexOf('"') - 1); + debugLog('Identity:', '\n', '> Name:', identityFound, '\n', '> Hash:', identityHashFound); + return new Identity(identityFound, identityHashFound); + } + return null; + }); + return compactFlattenedList(identities); +} +//# sourceMappingURL=util-identities.js.map
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/esm/util-identities.js.map b/desktop/node_modules/@electron/osx-sign/dist/esm/util-identities.js.map new file mode 100644 index 0000000..18e3c43 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/esm/util-identities.js.map @@ -0,0 +1 @@ +{"version":3,"file":"util-identities.js","sourceRoot":"","sources":["../../src/util-identities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvE,MAAM,OAAO,QAAQ;IACnB,YAAoB,IAAY,EAAS,IAAa;QAAlC,SAAI,GAAJ,IAAI,CAAQ;QAAS,SAAI,GAAJ,IAAI,CAAS;IAAG,CAAC;CAC3D;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAE,QAAuB,EAAE,QAAgB;IAC7E,kEAAkE;IAClE,8DAA8D;IAE9D,MAAM,IAAI,GAAG;QACX,eAAe;QACf,IAAI;KACL,CAAC;IACF,IAAI,QAAQ,EAAE;QACZ,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;KACrB;IAED,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACrD,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,UAAU,IAAI;QACtD,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YAC/B,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;YACnF,MAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;YACvF,QAAQ,CAAC,WAAW,EAAE,IAAI,EACxB,SAAS,EAAE,aAAa,EAAE,IAAI,EAC9B,SAAS,EAAE,iBAAiB,CAAC,CAAC;YAChC,OAAO,IAAI,QAAQ,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAC;SACvD;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;IAEH,OAAO,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAC1C,CAAC"}
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/esm/util-provisioning-profiles.d.ts b/desktop/node_modules/@electron/osx-sign/dist/esm/util-provisioning-profiles.d.ts new file mode 100644 index 0000000..7c9d9c3 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/esm/util-provisioning-profiles.d.ts @@ -0,0 +1,25 @@ +import { ElectronMacPlatform, ValidatedSignOptions } from './types'; +export declare class ProvisioningProfile { + filePath: string; + message: any; + constructor(filePath: string, message: any); + get name(): string; + get platforms(): ElectronMacPlatform[]; + get type(): "development" | "distribution"; +} +/** + * Returns a promise resolving to a ProvisioningProfile instance based on file. + * @function + * @param {string} filePath - Path to provisioning profile. + * @param {string} keychain - Keychain to use when unlocking provisioning profile. + * @returns {Promise} Promise. + */ +export declare function getProvisioningProfile(filePath: string, keychain?: string | null): Promise<ProvisioningProfile>; +/** + * Returns a promise resolving to a list of suitable provisioning profile within the current working directory. + */ +export declare function findProvisioningProfiles(opts: ValidatedSignOptions): Promise<ProvisioningProfile[]>; +/** + * Returns a promise embedding the provisioning profile in the app Contents folder. + */ +export declare function preEmbedProvisioningProfile(opts: ValidatedSignOptions, profile: ProvisioningProfile | null): Promise<void>; diff --git a/desktop/node_modules/@electron/osx-sign/dist/esm/util-provisioning-profiles.js b/desktop/node_modules/@electron/osx-sign/dist/esm/util-provisioning-profiles.js new file mode 100644 index 0000000..62d0fea --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/esm/util-provisioning-profiles.js @@ -0,0 +1,115 @@ +import * as fs from 'fs-extra'; +import * as path from 'path'; +import plist from 'plist'; +import { debugLog, debugWarn, getAppContentsPath, compactFlattenedList, execFileAsync } from './util'; +export class ProvisioningProfile { + constructor(filePath, message) { + this.filePath = filePath; + this.message = message; + } + get name() { + return this.message.Name; + } + get platforms() { + if ('ProvisionsAllDevices' in this.message) + return ['darwin']; + // Developer ID + else if (this.type === 'distribution') + return ['mas']; + // Mac App Store + else + return ['darwin', 'mas']; // Mac App Development + } + get type() { + if ('ProvisionedDevices' in this.message) + return 'development'; + // Mac App Development + else + return 'distribution'; // Developer ID or Mac App Store + } +} +/** + * Returns a promise resolving to a ProvisioningProfile instance based on file. + * @function + * @param {string} filePath - Path to provisioning profile. + * @param {string} keychain - Keychain to use when unlocking provisioning profile. + * @returns {Promise} Promise. + */ +export async function getProvisioningProfile(filePath, keychain = null) { + const securityArgs = [ + 'cms', + '-D', + '-i', + filePath // Use infile as source of data + ]; + if (keychain) { + securityArgs.push('-k', keychain); + } + const result = await execFileAsync('security', securityArgs); + const provisioningProfile = new ProvisioningProfile(filePath, plist.parse(result)); + debugLog('Provisioning profile:', '\n', '> Name:', provisioningProfile.name, '\n', '> Platforms:', provisioningProfile.platforms, '\n', '> Type:', provisioningProfile.type, '\n', '> Path:', provisioningProfile.filePath, '\n', '> Message:', provisioningProfile.message); + return provisioningProfile; +} +/** + * Returns a promise resolving to a list of suitable provisioning profile within the current working directory. + */ +export async function findProvisioningProfiles(opts) { + const cwd = process.cwd(); + const children = await fs.readdir(cwd); + const foundProfiles = compactFlattenedList(await Promise.all(children.map(async (child) => { + const filePath = path.resolve(cwd, child); + const stat = await fs.stat(filePath); + if (stat.isFile() && path.extname(filePath) === '.provisionprofile') { + return filePath; + } + return null; + }))); + return compactFlattenedList(await Promise.all(foundProfiles.map(async (filePath) => { + const profile = await getProvisioningProfile(filePath); + if (profile.platforms.indexOf(opts.platform) >= 0 && profile.type === opts.type) { + return profile; + } + debugWarn('Provisioning profile above ignored, not for ' + opts.platform + ' ' + opts.type + '.'); + return null; + }))); +} +/** + * Returns a promise embedding the provisioning profile in the app Contents folder. + */ +export async function preEmbedProvisioningProfile(opts, profile) { + async function embedProvisioningProfile(profile) { + debugLog('Looking for existing provisioning profile...'); + const embeddedFilePath = path.join(getAppContentsPath(opts), 'embedded.provisionprofile'); + if (await fs.pathExists(embeddedFilePath)) { + debugLog('Found embedded provisioning profile:', '\n', '* Please manually remove the existing file if not wanted.', '\n', '* Current file at:', embeddedFilePath); + } + else { + debugLog('Embedding provisioning profile...'); + await fs.copy(profile.filePath, embeddedFilePath); + } + } + if (profile) { + // User input provisioning profile + return await embedProvisioningProfile(profile); + } + else { + // Discover provisioning profile + debugLog('No `provisioning-profile` passed in arguments, will find in current working directory and in user library...'); + const profiles = await findProvisioningProfiles(opts); + if (profiles.length > 0) { + // Provisioning profile(s) found + if (profiles.length > 1) { + debugLog('Multiple provisioning profiles found, will use the first discovered.'); + } + else { + debugLog('Found 1 provisioning profile.'); + } + await embedProvisioningProfile(profiles[0]); + } + else { + // No provisioning profile found + debugLog('No provisioning profile found, will not embed profile in app contents.'); + } + } +} +//# sourceMappingURL=util-provisioning-profiles.js.map
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/esm/util-provisioning-profiles.js.map b/desktop/node_modules/@electron/osx-sign/dist/esm/util-provisioning-profiles.js.map new file mode 100644 index 0000000..6beb366 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/esm/util-provisioning-profiles.js.map @@ -0,0 +1 @@ +{"version":3,"file":"util-provisioning-profiles.js","sourceRoot":"","sources":["../../src/util-provisioning-profiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEtG,MAAM,OAAO,mBAAmB;IAC9B,YAAoB,QAAgB,EAAS,OAAY;QAArC,aAAQ,GAAR,QAAQ,CAAQ;QAAS,YAAO,GAAP,OAAO,CAAK;IAAG,CAAC;IAE7D,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;IAC3B,CAAC;IAED,IAAI,SAAS;QACX,IAAI,sBAAsB,IAAI,IAAI,CAAC,OAAO;YAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC9D,eAAe;aACV,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc;YAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QACtD,gBAAgB;;YACX,OAAO,C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,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE;YACzC,QAAQ,CACN,sCAAsC,EACtC,IAAI,EACJ,2DAA2D,EAC3D,IAAI,EACJ,oBAAoB,EACpB,gBAAgB,CACjB,CAAC;SACH;aAAM;YACL,QAAQ,CAAC,mCAAmC,CAAC,CAAC;YAC9C,MAAM,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;SACnD;IACH,CAAC;IAED,IAAI,OAAO,EAAE;QACX,kCAAkC;QAClC,OAAO,MAAM,wBAAwB,CAAC,OAAO,CAAC,CAAC;KAChD;SAAM;QACL,gCAAgC;QAChC,QAAQ,CACN,8GAA8G,CAC/G,CAAC;QACF,MAAM,QAAQ,GAAG,MAAM,wBAAwB,CAAC,IAAI,CAAC,CAAC;QACtD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;YACvB,gCAAgC;YAChC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;gBACvB,QAAQ,CAAC,sEAAsE,CAAC,CAAC;aAClF;iBAAM;gBACL,QAAQ,CAAC,+BAA+B,CAAC,CAAC;aAC3C;YACD,MAAM,wBAAwB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;SAC7C;aAAM;YACL,gCAAgC;YAChC,QAAQ,CAAC,wEAAwE,CAAC,CAAC;SACpF;KACF;AACH,CAAC"}
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/esm/util.d.ts b/desktop/node_modules/@electron/osx-sign/dist/esm/util.d.ts new file mode 100644 index 0000000..d420151 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/esm/util.d.ts @@ -0,0 +1,35 @@ +/// <reference types="node" /> +import * as child from 'child_process'; +import debug from 'debug'; +import { BaseSignOptions, ElectronMacPlatform } from './types'; +export declare const debugLog: debug.Debugger; +export declare const debugWarn: debug.Debugger; +export declare function execFileAsync(file: string, args: string[], options?: child.ExecFileOptions): Promise<string>; +type DeepListItem<T> = null | T | DeepListItem<T>[]; +type DeepList<T> = DeepListItem<T>[]; +export declare function compactFlattenedList<T>(list: DeepList<T>): T[]; +/** + * Returns the path to the "Contents" folder inside the application bundle + */ +export declare function getAppContentsPath(opts: BaseSignOptions): string; +/** + * Returns the path to app "Frameworks" within contents. + */ +export declare function getAppFrameworksPath(opts: BaseSignOptions): string; +export declare function detectElectronPlatform(opts: BaseSignOptions): Promise<ElectronMacPlatform>; +/** + * This function returns a promise validating opts.app, the application to be signed or flattened. + */ +export declare function validateOptsApp(opts: BaseSignOptions): Promise<void>; +/** + * This function returns a promise validating opts.platform, the platform of Electron build. It allows auto-discovery if no opts.platform is specified. + */ +export declare function validateOptsPlatform(opts: BaseSignOptions): Promise<ElectronMacPlatform>; +/** + * This function returns a promise resolving all child paths within the directory specified. + * @function + * @param {string} dirPath - Path to directory. + * @returns {Promise} Promise resolving child paths needing signing in order. + */ +export declare function walkAsync(dirPath: string): Promise<string[]>; +export {}; diff --git a/desktop/node_modules/@electron/osx-sign/dist/esm/util.js b/desktop/node_modules/@electron/osx-sign/dist/esm/util.js new file mode 100644 index 0000000..76eef43 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/esm/util.js @@ -0,0 +1,145 @@ +import * as child from 'child_process'; +import * as fs from 'fs-extra'; +import { isBinaryFile } from 'isbinaryfile'; +import * as path from 'path'; +import debug from 'debug'; +export const debugLog = debug('electron-osx-sign'); +debugLog.log = console.log.bind(console); +export const debugWarn = debug('electron-osx-sign:warn'); +debugWarn.log = console.warn.bind(console); +const removePassword = function (input) { + return input.replace(/(-P |pass:|\/p|-pass )([^ ]+)/, function (_, p1) { + return `${p1}***`; + }); +}; +export async function execFileAsync(file, args, options = {}) { + if (debugLog.enabled) { + debugLog('Executing...', file, args && Array.isArray(args) ? removePassword(args.join(' ')) : ''); + } + return new Promise(function (resolve, reject) { + child.execFile(file, args, options, function (err, stdout, stderr) { + if (err) { + debugLog('Error executing file:', '\n', '> Stdout:', stdout, '\n', '> Stderr:', stderr); + reject(err); + return; + } + resolve(stdout); + }); + }); +} +export function compactFlattenedList(list) { + const result = []; + function populateResult(list) { + if (!Array.isArray(list)) { + if (list) + result.push(list); + } + else if (list.length > 0) { + for (const item of list) + if (item) + populateResult(item); + } + } + populateResult(list); + return result; +} +/** + * Returns the path to the "Contents" folder inside the application bundle + */ +export function getAppContentsPath(opts) { + return path.join(opts.app, 'Contents'); +} +/** + * Returns the path to app "Frameworks" within contents. + */ +export function getAppFrameworksPath(opts) { + return path.join(getAppContentsPath(opts), 'Frameworks'); +} +export async function detectElectronPlatform(opts) { + const appFrameworksPath = getAppFrameworksPath(opts); + if (await fs.pathExists(path.resolve(appFrameworksPath, 'Squirrel.framework'))) { + return 'darwin'; + } + else { + return 'mas'; + } +} +/** + * This function returns a promise resolving the file path if file binary. + */ +async function getFilePathIfBinary(filePath) { + if (await isBinaryFile(filePath)) { + return filePath; + } + return null; +} +/** + * This function returns a promise validating opts.app, the application to be signed or flattened. + */ +export async function validateOptsApp(opts) { + if (!opts.app) { + throw new Error('Path to application must be specified.'); + } + if (path.extname(opts.app) !== '.app') { + throw new Error('Extension of application must be `.app`.'); + } + if (!(await fs.pathExists(opts.app))) { + throw new Error(`Application at path "${opts.app}" could not be found`); + } +} +/** + * This function returns a promise validating opts.platform, the platform of Electron build. It allows auto-discovery if no opts.platform is specified. + */ +export async function validateOptsPlatform(opts) { + if (opts.platform) { + if (opts.platform === 'mas' || opts.platform === 'darwin') { + return opts.platform; + } + else { + debugWarn('`platform` passed in arguments not supported, checking Electron platform...'); + } + } + else { + debugWarn('No `platform` passed in arguments, checking Electron platform...'); + } + return await detectElectronPlatform(opts); +} +/** + * This function returns a promise resolving all child paths within the directory specified. + * @function + * @param {string} dirPath - Path to directory. + * @returns {Promise} Promise resolving child paths needing signing in order. + */ +export async function walkAsync(dirPath) { + debugLog('Walking... ' + dirPath); + async function _walkAsync(dirPath) { + const children = await fs.readdir(dirPath); + return await Promise.all(children.map(async (child) => { + const filePath = path.resolve(dirPath, child); + const stat = await fs.stat(filePath); + if (stat.isFile()) { + switch (path.extname(filePath)) { + case '.cstemp': // Temporary file generated from past codesign + debugLog('Removing... ' + filePath); + await fs.remove(filePath); + return null; + default: + return await getFilePathIfBinary(filePath); + } + } + else if (stat.isDirectory() && !stat.isSymbolicLink()) { + const walkResult = await _walkAsync(filePath); + switch (path.extname(filePath)) { + case '.app': // Application + case '.framework': // Framework + walkResult.push(filePath); + } + return walkResult; + } + return null; + })); + } + const allPaths = await _walkAsync(dirPath); + return compactFlattenedList(allPaths); +} +//# sourceMappingURL=util.js.map
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/dist/esm/util.js.map b/desktop/node_modules/@electron/osx-sign/dist/esm/util.js.map new file mode 100644 index 0000000..ecc2617 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/dist/esm/util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,eAAe,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,CAAC,mBAAmB,CAAC,CAAC;AACnD,QAAQ,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAEzC,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAAC,wBAAwB,CAAC,CAAC;AACzD,SAAS,CAAC,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAE3C,MAAM,cAAc,GAAG,UAAU,KAAa;IAC5C,OAAO,KAAK,CAAC,OAAO,CAAC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CAAC;wBAC1B,OAAO,IAAI,CAAC;oBACd;wBACE,OAAO,MAAM,mBAAmB,CAAC,QAAQ,CAAC,CAAC;iBAC9C;aACF;iBAAM,IAAI,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE;gBACvD,MAAM,UAAU,GAAG,MAAM,UAAU,CAAC,QAAQ,CAAC,CAAC;gBAC9C,QAAQ,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;oBAC9B,KAAK,MAAM,CAAC,CAAC,cAAc;oBAC3B,KAAK,YAAY,EAAE,YAAY;wBAC7B,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;iBAC7B;gBACD,OAAO,UAAU,CAAC;aACnB;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC;IAC3C,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC;AACxC,CAAC"}
\ No newline at end of file diff --git a/desktop/node_modules/@electron/osx-sign/entitlements/default.darwin.gpu.plist b/desktop/node_modules/@electron/osx-sign/entitlements/default.darwin.gpu.plist new file mode 100644 index 0000000..446fe17 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/entitlements/default.darwin.gpu.plist @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> + <dict> + <key>com.apple.security.cs.allow-jit</key> + <true/> + </dict> +</plist> diff --git a/desktop/node_modules/@electron/osx-sign/entitlements/default.darwin.plist b/desktop/node_modules/@electron/osx-sign/entitlements/default.darwin.plist new file mode 100644 index 0000000..c762cfb --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/entitlements/default.darwin.plist @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> + <dict> + <key>com.apple.security.cs.allow-jit</key> + <true/> + <key>com.apple.security.device.audio-input</key> + <true/> + <key>com.apple.security.device.bluetooth</key> + <true/> + <key>com.apple.security.device.camera</key> + <true/> + <key>com.apple.security.device.print</key> + <true/> + <key>com.apple.security.device.usb</key> + <true/> + <key>com.apple.security.personal-information.location</key> + <true/> + </dict> +</plist> diff --git a/desktop/node_modules/@electron/osx-sign/entitlements/default.darwin.plugin.plist b/desktop/node_modules/@electron/osx-sign/entitlements/default.darwin.plugin.plist new file mode 100644 index 0000000..67ebe4e --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/entitlements/default.darwin.plugin.plist @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> + <dict> + <key>com.apple.security.cs.allow-unsigned-executable-memory</key> + <true/> + <key>com.apple.security.cs.disable-library-validation</key> + <true/> + </dict> +</plist> diff --git a/desktop/node_modules/@electron/osx-sign/entitlements/default.darwin.renderer.plist b/desktop/node_modules/@electron/osx-sign/entitlements/default.darwin.renderer.plist new file mode 100644 index 0000000..446fe17 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/entitlements/default.darwin.renderer.plist @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> + <dict> + <key>com.apple.security.cs.allow-jit</key> + <true/> + </dict> +</plist> diff --git a/desktop/node_modules/@electron/osx-sign/entitlements/default.mas.child.plist b/desktop/node_modules/@electron/osx-sign/entitlements/default.mas.child.plist new file mode 100755 index 0000000..d8dc69e --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/entitlements/default.mas.child.plist @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> + <dict> + <key>com.apple.security.app-sandbox</key> + <true/> + <key>com.apple.security.inherit</key> + <true/> + </dict> +</plist> diff --git a/desktop/node_modules/@electron/osx-sign/entitlements/default.mas.plist b/desktop/node_modules/@electron/osx-sign/entitlements/default.mas.plist new file mode 100755 index 0000000..025064d --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/entitlements/default.mas.plist @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> + <dict> + <key>com.apple.security.app-sandbox</key> + <true/> + <key>com.apple.security.files.user-selected.read-write</key> + <true/> + <key>com.apple.security.files.bookmarks.app-scope</key> + <true/> + <key>com.apple.security.network.client</key> + <true/> + <key>com.apple.security.print</key> + <true/> + <key>com.apple.security.device.camera</key> + <true/> + <key>com.apple.security.device.microphone</key> + <true/> + <key>com.apple.security.device.usb</key> + <true/> + </dict> +</plist> diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/LICENSE b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/LICENSE new file mode 100644 index 0000000..93546df --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/LICENSE @@ -0,0 +1,15 @@ +(The MIT License) + +Copyright (c) 2011-2017 JP Richardson + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files +(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, + merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/README.md b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/README.md new file mode 100644 index 0000000..6ed8b6a --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/README.md @@ -0,0 +1,262 @@ +Node.js: fs-extra +================= + +`fs-extra` adds file system methods that aren't included in the native `fs` module and adds promise support to the `fs` methods. It also uses [`graceful-fs`](https://github.com/isaacs/node-graceful-fs) to prevent `EMFILE` errors. It should be a drop in replacement for `fs`. + +[![npm Package](https://img.shields.io/npm/v/fs-extra.svg)](https://www.npmjs.org/package/fs-extra) +[![License](https://img.shields.io/npm/l/fs-extra.svg)](https://github.com/jprichardson/node-fs-extra/blob/master/LICENSE) +[![build status](https://img.shields.io/github/workflow/status/jprichardson/node-fs-extra/Node.js%20CI/master)](https://github.com/jprichardson/node-fs-extra/actions/workflows/ci.yml?query=branch%3Amaster) +[![downloads per month](http://img.shields.io/npm/dm/fs-extra.svg)](https://www.npmjs.org/package/fs-extra) +[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) + +Why? +---- + +I got tired of including `mkdirp`, `rimraf`, and `ncp` in most of my projects. + + + + +Installation +------------ + + npm install fs-extra + + + +Usage +----- + +`fs-extra` is a drop in replacement for native `fs`. All methods in `fs` are attached to `fs-extra`. All `fs` methods return promises if the callback isn't passed. + +You don't ever need to include the original `fs` module again: + +```js +const fs = require('fs') // this is no longer necessary +``` + +you can now do this: + +```js +const fs = require('fs-extra') +``` + +or if you prefer to make it clear that you're using `fs-extra` and not `fs`, you may want +to name your `fs` variable `fse` like so: + +```js +const fse = require('fs-extra') +``` + +you can also keep both, but it's redundant: + +```js +const fs = require('fs') +const fse = require('fs-extra') +``` + +Sync vs Async vs Async/Await +------------- +Most methods are async by default. All async methods will return a promise if the callback isn't passed. + +Sync methods on the other hand will throw if an error occurs. + +Also Async/Await will throw an error if one occurs. + +Example: + +```js +const fs = require('fs-extra') + +// Async with promises: +fs.copy('/tmp/myfile', '/tmp/mynewfile') + .then(() => console.log('success!')) + .catch(err => console.error(err)) + +// Async with callbacks: +fs.copy('/tmp/myfile', '/tmp/mynewfile', err => { + if (err) return console.error(err) + console.log('success!') +}) + +// Sync: +try { + fs.copySync('/tmp/myfile', '/tmp/mynewfile') + console.log('success!') +} catch (err) { + console.error(err) +} + +// Async/Await: +async function copyFiles () { + try { + await fs.copy('/tmp/myfile', '/tmp/mynewfile') + console.log('success!') + } catch (err) { + console.error(err) + } +} + +copyFiles() +``` + + +Methods +------- + +### Async + +- [copy](docs/copy.md) +- [emptyDir](docs/emptyDir.md) +- [ensureFile](docs/ensureFile.md) +- [ensureDir](docs/ensureDir.md) +- [ensureLink](docs/ensureLink.md) +- [ensureSymlink](docs/ensureSymlink.md) +- [mkdirp](docs/ensureDir.md) +- [mkdirs](docs/ensureDir.md) +- [move](docs/move.md) +- [outputFile](docs/outputFile.md) +- [outputJson](docs/outputJson.md) +- [pathExists](docs/pathExists.md) +- [readJson](docs/readJson.md) +- [remove](docs/remove.md) +- [writeJson](docs/writeJson.md) + +### Sync + +- [copySync](docs/copy-sync.md) +- [emptyDirSync](docs/emptyDir-sync.md) +- [ensureFileSync](docs/ensureFile-sync.md) +- [ensureDirSync](docs/ensureDir-sync.md) +- [ensureLinkSync](docs/ensureLink-sync.md) +- [ensureSymlinkSync](docs/ensureSymlink-sync.md) +- [mkdirpSync](docs/ensureDir-sync.md) +- [mkdirsSync](docs/ensureDir-sync.md) +- [moveSync](docs/move-sync.md) +- [outputFileSync](docs/outputFile-sync.md) +- [outputJsonSync](docs/outputJson-sync.md) +- [pathExistsSync](docs/pathExists-sync.md) +- [readJsonSync](docs/readJson-sync.md) +- [removeSync](docs/remove-sync.md) +- [writeJsonSync](docs/writeJson-sync.md) + + +**NOTE:** You can still use the native Node.js methods. They are promisified and copied over to `fs-extra`. See [notes on `fs.read()`, `fs.write()`, & `fs.writev()`](docs/fs-read-write-writev.md) + +### What happened to `walk()` and `walkSync()`? + +They were removed from `fs-extra` in v2.0.0. If you need the functionality, `walk` and `walkSync` are available as separate packages, [`klaw`](https://github.com/jprichardson/node-klaw) and [`klaw-sync`](https://github.com/manidlou/node-klaw-sync). + + +Third Party +----------- + +### CLI + +[fse-cli](https://www.npmjs.com/package/@atao60/fse-cli) allows you to run `fs-extra` from a console or from [npm](https://www.npmjs.com) scripts. + +### TypeScript + +If you like TypeScript, you can use `fs-extra` with it: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/fs-extra + + +### File / Directory Watching + +If you want to watch for changes to files or directories, then you should use [chokidar](https://github.com/paulmillr/chokidar). + +### Obtain Filesystem (Devices, Partitions) Information + +[fs-filesystem](https://github.com/arthurintelligence/node-fs-filesystem) allows you to read the state of the filesystem of the host on which it is run. It returns information about both the devices and the partitions (volumes) of the system. + +### Misc. + +- [fs-extra-debug](https://github.com/jdxcode/fs-extra-debug) - Send your fs-extra calls to [debug](https://npmjs.org/package/debug). +- [mfs](https://github.com/cadorn/mfs) - Monitor your fs-extra calls. + + + +Hacking on fs-extra +------------------- + +Wanna hack on `fs-extra`? Great! Your help is needed! [fs-extra is one of the most depended upon Node.js packages](http://nodei.co/npm/fs-extra.png?downloads=true&downloadRank=true&stars=true). This project +uses [JavaScript Standard Style](https://github.com/feross/standard) - if the name or style choices bother you, +you're gonna have to get over it :) If `standard` is good enough for `npm`, it's good enough for `fs-extra`. + +[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) + +What's needed? +- First, take a look at existing issues. Those are probably going to be where the priority lies. +- More tests for edge cases. Specifically on different platforms. There can never be enough tests. +- Improve test coverage. + +Note: If you make any big changes, **you should definitely file an issue for discussion first.** + +### Running the Test Suite + +fs-extra contains hundreds of tests. + +- `npm run lint`: runs the linter ([standard](http://standardjs.com/)) +- `npm run unit`: runs the unit tests +- `npm test`: runs both the linter and the tests + + +### Windows + +If you run the tests on the Windows and receive a lot of symbolic link `EPERM` permission errors, it's +because on Windows you need elevated privilege to create symbolic links. You can add this to your Windows's +account by following the instructions here: http://superuser.com/questions/104845/permission-to-make-symbolic-links-in-windows-7 +However, I didn't have much luck doing this. + +Since I develop on Mac OS X, I use VMWare Fusion for Windows testing. I create a shared folder that I map to a drive on Windows. +I open the `Node.js command prompt` and run as `Administrator`. I then map the network drive running the following command: + + net use z: "\\vmware-host\Shared Folders" + +I can then navigate to my `fs-extra` directory and run the tests. + + +Naming +------ + +I put a lot of thought into the naming of these functions. Inspired by @coolaj86's request. So he deserves much of the credit for raising the issue. See discussion(s) here: + +* https://github.com/jprichardson/node-fs-extra/issues/2 +* https://github.com/flatiron/utile/issues/11 +* https://github.com/ryanmcgrath/wrench-js/issues/29 +* https://github.com/substack/node-mkdirp/issues/17 + +First, I believe that in as many cases as possible, the [Node.js naming schemes](http://nodejs.org/api/fs.html) should be chosen. However, there are problems with the Node.js own naming schemes. + +For example, `fs.readFile()` and `fs.readdir()`: the **F** is capitalized in *File* and the **d** is not capitalized in *dir*. Perhaps a bit pedantic, but they should still be consistent. Also, Node.js has chosen a lot of POSIX naming schemes, which I believe is great. See: `fs.mkdir()`, `fs.rmdir()`, `fs.chown()`, etc. + +We have a dilemma though. How do you consistently name methods that perform the following POSIX commands: `cp`, `cp -r`, `mkdir -p`, and `rm -rf`? + +My perspective: when in doubt, err on the side of simplicity. A directory is just a hierarchical grouping of directories and files. Consider that for a moment. So when you want to copy it or remove it, in most cases you'll want to copy or remove all of its contents. When you want to create a directory, if the directory that it's suppose to be contained in does not exist, then in most cases you'll want to create that too. + +So, if you want to remove a file or a directory regardless of whether it has contents, just call `fs.remove(path)`. If you want to copy a file or a directory whether it has contents, just call `fs.copy(source, destination)`. If you want to create a directory regardless of whether its parent directories exist, just call `fs.mkdirs(path)` or `fs.mkdirp(path)`. + + +Credit +------ + +`fs-extra` wouldn't be possible without using the modules from the following authors: + +- [Isaac Shlueter](https://github.com/isaacs) +- [Charlie McConnel](https://github.com/avianflu) +- [James Halliday](https://github.com/substack) +- [Andrew Kelley](https://github.com/andrewrk) + + + + +License +------- + +Licensed under MIT + +Copyright (c) 2011-2017 [JP Richardson](https://github.com/jprichardson) + +[1]: http://nodejs.org/docs/latest/api/fs.html + + +[jsonfile]: https://github.com/jprichardson/node-jsonfile diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/copy/copy-sync.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/copy/copy-sync.js new file mode 100644 index 0000000..551abe0 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/copy/copy-sync.js @@ -0,0 +1,169 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const mkdirsSync = require('../mkdirs').mkdirsSync +const utimesMillisSync = require('../util/utimes').utimesMillisSync +const stat = require('../util/stat') + +function copySync (src, dest, opts) { + if (typeof opts === 'function') { + opts = { filter: opts } + } + + opts = opts || {} + opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now + opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber + + // Warn about using preserveTimestamps on 32-bit node + if (opts.preserveTimestamps && process.arch === 'ia32') { + process.emitWarning( + 'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' + + '\tsee https://github.com/jprichardson/node-fs-extra/issues/269', + 'Warning', 'fs-extra-WARN0002' + ) + } + + const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy', opts) + stat.checkParentPathsSync(src, srcStat, dest, 'copy') + return handleFilterAndCopy(destStat, src, dest, opts) +} + +function handleFilterAndCopy (destStat, src, dest, opts) { + if (opts.filter && !opts.filter(src, dest)) return + const destParent = path.dirname(dest) + if (!fs.existsSync(destParent)) mkdirsSync(destParent) + return getStats(destStat, src, dest, opts) +} + +function startCopy (destStat, src, dest, opts) { + if (opts.filter && !opts.filter(src, dest)) return + return getStats(destStat, src, dest, opts) +} + +function getStats (destStat, src, dest, opts) { + const statSync = opts.dereference ? fs.statSync : fs.lstatSync + const srcStat = statSync(src) + + if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts) + else if (srcStat.isFile() || + srcStat.isCharacterDevice() || + srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts) + else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts) + else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`) + else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`) + throw new Error(`Unknown file: ${src}`) +} + +function onFile (srcStat, destStat, src, dest, opts) { + if (!destStat) return copyFile(srcStat, src, dest, opts) + return mayCopyFile(srcStat, src, dest, opts) +} + +function mayCopyFile (srcStat, src, dest, opts) { + if (opts.overwrite) { + fs.unlinkSync(dest) + return copyFile(srcStat, src, dest, opts) + } else if (opts.errorOnExist) { + throw new Error(`'${dest}' already exists`) + } +} + +function copyFile (srcStat, src, dest, opts) { + fs.copyFileSync(src, dest) + if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest) + return setDestMode(dest, srcStat.mode) +} + +function handleTimestamps (srcMode, src, dest) { + // Make sure the file is writable before setting the timestamp + // otherwise open fails with EPERM when invoked with 'r+' + // (through utimes call) + if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode) + return setDestTimestamps(src, dest) +} + +function fileIsNotWritable (srcMode) { + return (srcMode & 0o200) === 0 +} + +function makeFileWritable (dest, srcMode) { + return setDestMode(dest, srcMode | 0o200) +} + +function setDestMode (dest, srcMode) { + return fs.chmodSync(dest, srcMode) +} + +function setDestTimestamps (src, dest) { + // The initial srcStat.atime cannot be trusted + // because it is modified by the read(2) system call + // (See https://nodejs.org/api/fs.html#fs_stat_time_values) + const updatedSrcStat = fs.statSync(src) + return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime) +} + +function onDir (srcStat, destStat, src, dest, opts) { + if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts) + return copyDir(src, dest, opts) +} + +function mkDirAndCopy (srcMode, src, dest, opts) { + fs.mkdirSync(dest) + copyDir(src, dest, opts) + return setDestMode(dest, srcMode) +} + +function copyDir (src, dest, opts) { + fs.readdirSync(src).forEach(item => copyDirItem(item, src, dest, opts)) +} + +function copyDirItem (item, src, dest, opts) { + const srcItem = path.join(src, item) + const destItem = path.join(dest, item) + const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy', opts) + return startCopy(destStat, srcItem, destItem, opts) +} + +function onLink (destStat, src, dest, opts) { + let resolvedSrc = fs.readlinkSync(src) + if (opts.dereference) { + resolvedSrc = path.resolve(process.cwd(), resolvedSrc) + } + + if (!destStat) { + return fs.symlinkSync(resolvedSrc, dest) + } else { + let resolvedDest + try { + resolvedDest = fs.readlinkSync(dest) + } catch (err) { + // dest exists and is a regular file or directory, + // Windows may throw UNKNOWN error. If dest already exists, + // fs throws error anyway, so no need to guard against it here. + if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest) + throw err + } + if (opts.dereference) { + resolvedDest = path.resolve(process.cwd(), resolvedDest) + } + if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { + throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`) + } + + // prevent copy if src is a subdir of dest since unlinking + // dest in this case would result in removing src contents + // and therefore a broken symlink would be created. + if (fs.statSync(dest).isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) { + throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`) + } + return copyLink(resolvedSrc, dest) + } +} + +function copyLink (resolvedSrc, dest) { + fs.unlinkSync(dest) + return fs.symlinkSync(resolvedSrc, dest) +} + +module.exports = copySync diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/copy/copy.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/copy/copy.js new file mode 100644 index 0000000..09d53df --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/copy/copy.js @@ -0,0 +1,235 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const mkdirs = require('../mkdirs').mkdirs +const pathExists = require('../path-exists').pathExists +const utimesMillis = require('../util/utimes').utimesMillis +const stat = require('../util/stat') + +function copy (src, dest, opts, cb) { + if (typeof opts === 'function' && !cb) { + cb = opts + opts = {} + } else if (typeof opts === 'function') { + opts = { filter: opts } + } + + cb = cb || function () {} + opts = opts || {} + + opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now + opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber + + // Warn about using preserveTimestamps on 32-bit node + if (opts.preserveTimestamps && process.arch === 'ia32') { + process.emitWarning( + 'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' + + '\tsee https://github.com/jprichardson/node-fs-extra/issues/269', + 'Warning', 'fs-extra-WARN0001' + ) + } + + stat.checkPaths(src, dest, 'copy', opts, (err, stats) => { + if (err) return cb(err) + const { srcStat, destStat } = stats + stat.checkParentPaths(src, srcStat, dest, 'copy', err => { + if (err) return cb(err) + if (opts.filter) return handleFilter(checkParentDir, destStat, src, dest, opts, cb) + return checkParentDir(destStat, src, dest, opts, cb) + }) + }) +} + +function checkParentDir (destStat, src, dest, opts, cb) { + const destParent = path.dirname(dest) + pathExists(destParent, (err, dirExists) => { + if (err) return cb(err) + if (dirExists) return getStats(destStat, src, dest, opts, cb) + mkdirs(destParent, err => { + if (err) return cb(err) + return getStats(destStat, src, dest, opts, cb) + }) + }) +} + +function handleFilter (onInclude, destStat, src, dest, opts, cb) { + Promise.resolve(opts.filter(src, dest)).then(include => { + if (include) return onInclude(destStat, src, dest, opts, cb) + return cb() + }, error => cb(error)) +} + +function startCopy (destStat, src, dest, opts, cb) { + if (opts.filter) return handleFilter(getStats, destStat, src, dest, opts, cb) + return getStats(destStat, src, dest, opts, cb) +} + +function getStats (destStat, src, dest, opts, cb) { + const stat = opts.dereference ? fs.stat : fs.lstat + stat(src, (err, srcStat) => { + if (err) return cb(err) + + if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts, cb) + else if (srcStat.isFile() || + srcStat.isCharacterDevice() || + srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts, cb) + else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts, cb) + else if (srcStat.isSocket()) return cb(new Error(`Cannot copy a socket file: ${src}`)) + else if (srcStat.isFIFO()) return cb(new Error(`Cannot copy a FIFO pipe: ${src}`)) + return cb(new Error(`Unknown file: ${src}`)) + }) +} + +function onFile (srcStat, destStat, src, dest, opts, cb) { + if (!destStat) return copyFile(srcStat, src, dest, opts, cb) + return mayCopyFile(srcStat, src, dest, opts, cb) +} + +function mayCopyFile (srcStat, src, dest, opts, cb) { + if (opts.overwrite) { + fs.unlink(dest, err => { + if (err) return cb(err) + return copyFile(srcStat, src, dest, opts, cb) + }) + } else if (opts.errorOnExist) { + return cb(new Error(`'${dest}' already exists`)) + } else return cb() +} + +function copyFile (srcStat, src, dest, opts, cb) { + fs.copyFile(src, dest, err => { + if (err) return cb(err) + if (opts.preserveTimestamps) return handleTimestampsAndMode(srcStat.mode, src, dest, cb) + return setDestMode(dest, srcStat.mode, cb) + }) +} + +function handleTimestampsAndMode (srcMode, src, dest, cb) { + // Make sure the file is writable before setting the timestamp + // otherwise open fails with EPERM when invoked with 'r+' + // (through utimes call) + if (fileIsNotWritable(srcMode)) { + return makeFileWritable(dest, srcMode, err => { + if (err) return cb(err) + return setDestTimestampsAndMode(srcMode, src, dest, cb) + }) + } + return setDestTimestampsAndMode(srcMode, src, dest, cb) +} + +function fileIsNotWritable (srcMode) { + return (srcMode & 0o200) === 0 +} + +function makeFileWritable (dest, srcMode, cb) { + return setDestMode(dest, srcMode | 0o200, cb) +} + +function setDestTimestampsAndMode (srcMode, src, dest, cb) { + setDestTimestamps(src, dest, err => { + if (err) return cb(err) + return setDestMode(dest, srcMode, cb) + }) +} + +function setDestMode (dest, srcMode, cb) { + return fs.chmod(dest, srcMode, cb) +} + +function setDestTimestamps (src, dest, cb) { + // The initial srcStat.atime cannot be trusted + // because it is modified by the read(2) system call + // (See https://nodejs.org/api/fs.html#fs_stat_time_values) + fs.stat(src, (err, updatedSrcStat) => { + if (err) return cb(err) + return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb) + }) +} + +function onDir (srcStat, destStat, src, dest, opts, cb) { + if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts, cb) + return copyDir(src, dest, opts, cb) +} + +function mkDirAndCopy (srcMode, src, dest, opts, cb) { + fs.mkdir(dest, err => { + if (err) return cb(err) + copyDir(src, dest, opts, err => { + if (err) return cb(err) + return setDestMode(dest, srcMode, cb) + }) + }) +} + +function copyDir (src, dest, opts, cb) { + fs.readdir(src, (err, items) => { + if (err) return cb(err) + return copyDirItems(items, src, dest, opts, cb) + }) +} + +function copyDirItems (items, src, dest, opts, cb) { + const item = items.pop() + if (!item) return cb() + return copyDirItem(items, item, src, dest, opts, cb) +} + +function copyDirItem (items, item, src, dest, opts, cb) { + const srcItem = path.join(src, item) + const destItem = path.join(dest, item) + stat.checkPaths(srcItem, destItem, 'copy', opts, (err, stats) => { + if (err) return cb(err) + const { destStat } = stats + startCopy(destStat, srcItem, destItem, opts, err => { + if (err) return cb(err) + return copyDirItems(items, src, dest, opts, cb) + }) + }) +} + +function onLink (destStat, src, dest, opts, cb) { + fs.readlink(src, (err, resolvedSrc) => { + if (err) return cb(err) + if (opts.dereference) { + resolvedSrc = path.resolve(process.cwd(), resolvedSrc) + } + + if (!destStat) { + return fs.symlink(resolvedSrc, dest, cb) + } else { + fs.readlink(dest, (err, resolvedDest) => { + if (err) { + // dest exists and is a regular file or directory, + // Windows may throw UNKNOWN error. If dest already exists, + // fs throws error anyway, so no need to guard against it here. + if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest, cb) + return cb(err) + } + if (opts.dereference) { + resolvedDest = path.resolve(process.cwd(), resolvedDest) + } + if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { + return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)) + } + + // do not copy if src is a subdir of dest since unlinking + // dest in this case would result in removing src contents + // and therefore a broken symlink would be created. + if (destStat.isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) { + return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)) + } + return copyLink(resolvedSrc, dest, cb) + }) + } + }) +} + +function copyLink (resolvedSrc, dest, cb) { + fs.unlink(dest, err => { + if (err) return cb(err) + return fs.symlink(resolvedSrc, dest, cb) + }) +} + +module.exports = copy diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/copy/index.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/copy/index.js new file mode 100644 index 0000000..45c07a2 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/copy/index.js @@ -0,0 +1,7 @@ +'use strict' + +const u = require('universalify').fromCallback +module.exports = { + copy: u(require('./copy')), + copySync: require('./copy-sync') +} diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/empty/index.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/empty/index.js new file mode 100644 index 0000000..b4a2e82 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/empty/index.js @@ -0,0 +1,39 @@ +'use strict' + +const u = require('universalify').fromPromise +const fs = require('../fs') +const path = require('path') +const mkdir = require('../mkdirs') +const remove = require('../remove') + +const emptyDir = u(async function emptyDir (dir) { + let items + try { + items = await fs.readdir(dir) + } catch { + return mkdir.mkdirs(dir) + } + + return Promise.all(items.map(item => remove.remove(path.join(dir, item)))) +}) + +function emptyDirSync (dir) { + let items + try { + items = fs.readdirSync(dir) + } catch { + return mkdir.mkdirsSync(dir) + } + + items.forEach(item => { + item = path.join(dir, item) + remove.removeSync(item) + }) +} + +module.exports = { + emptyDirSync, + emptydirSync: emptyDirSync, + emptyDir, + emptydir: emptyDir +} diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/ensure/file.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/ensure/file.js new file mode 100644 index 0000000..15cc473 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/ensure/file.js @@ -0,0 +1,69 @@ +'use strict' + +const u = require('universalify').fromCallback +const path = require('path') +const fs = require('graceful-fs') +const mkdir = require('../mkdirs') + +function createFile (file, callback) { + function makeFile () { + fs.writeFile(file, '', err => { + if (err) return callback(err) + callback() + }) + } + + fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err + if (!err && stats.isFile()) return callback() + const dir = path.dirname(file) + fs.stat(dir, (err, stats) => { + if (err) { + // if the directory doesn't exist, make it + if (err.code === 'ENOENT') { + return mkdir.mkdirs(dir, err => { + if (err) return callback(err) + makeFile() + }) + } + return callback(err) + } + + if (stats.isDirectory()) makeFile() + else { + // parent is not a directory + // This is just to cause an internal ENOTDIR error to be thrown + fs.readdir(dir, err => { + if (err) return callback(err) + }) + } + }) + }) +} + +function createFileSync (file) { + let stats + try { + stats = fs.statSync(file) + } catch {} + if (stats && stats.isFile()) return + + const dir = path.dirname(file) + try { + if (!fs.statSync(dir).isDirectory()) { + // parent is not a directory + // This is just to cause an internal ENOTDIR error to be thrown + fs.readdirSync(dir) + } + } catch (err) { + // If the stat call above failed because the directory doesn't exist, create it + if (err && err.code === 'ENOENT') mkdir.mkdirsSync(dir) + else throw err + } + + fs.writeFileSync(file, '') +} + +module.exports = { + createFile: u(createFile), + createFileSync +} diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/ensure/index.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/ensure/index.js new file mode 100644 index 0000000..ecbcdd0 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/ensure/index.js @@ -0,0 +1,23 @@ +'use strict' + +const { createFile, createFileSync } = require('./file') +const { createLink, createLinkSync } = require('./link') +const { createSymlink, createSymlinkSync } = require('./symlink') + +module.exports = { + // file + createFile, + createFileSync, + ensureFile: createFile, + ensureFileSync: createFileSync, + // link + createLink, + createLinkSync, + ensureLink: createLink, + ensureLinkSync: createLinkSync, + // symlink + createSymlink, + createSymlinkSync, + ensureSymlink: createSymlink, + ensureSymlinkSync: createSymlinkSync +} diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/ensure/link.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/ensure/link.js new file mode 100644 index 0000000..f6d6748 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/ensure/link.js @@ -0,0 +1,64 @@ +'use strict' + +const u = require('universalify').fromCallback +const path = require('path') +const fs = require('graceful-fs') +const mkdir = require('../mkdirs') +const pathExists = require('../path-exists').pathExists +const { areIdentical } = require('../util/stat') + +function createLink (srcpath, dstpath, callback) { + function makeLink (srcpath, dstpath) { + fs.link(srcpath, dstpath, err => { + if (err) return callback(err) + callback(null) + }) + } + + fs.lstat(dstpath, (_, dstStat) => { + fs.lstat(srcpath, (err, srcStat) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureLink') + return callback(err) + } + if (dstStat && areIdentical(srcStat, dstStat)) return callback(null) + + const dir = path.dirname(dstpath) + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return makeLink(srcpath, dstpath) + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + makeLink(srcpath, dstpath) + }) + }) + }) + }) +} + +function createLinkSync (srcpath, dstpath) { + let dstStat + try { + dstStat = fs.lstatSync(dstpath) + } catch {} + + try { + const srcStat = fs.lstatSync(srcpath) + if (dstStat && areIdentical(srcStat, dstStat)) return + } catch (err) { + err.message = err.message.replace('lstat', 'ensureLink') + throw err + } + + const dir = path.dirname(dstpath) + const dirExists = fs.existsSync(dir) + if (dirExists) return fs.linkSync(srcpath, dstpath) + mkdir.mkdirsSync(dir) + + return fs.linkSync(srcpath, dstpath) +} + +module.exports = { + createLink: u(createLink), + createLinkSync +} diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/ensure/symlink-paths.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/ensure/symlink-paths.js new file mode 100644 index 0000000..33cd760 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/ensure/symlink-paths.js @@ -0,0 +1,99 @@ +'use strict' + +const path = require('path') +const fs = require('graceful-fs') +const pathExists = require('../path-exists').pathExists + +/** + * Function that returns two types of paths, one relative to symlink, and one + * relative to the current working directory. Checks if path is absolute or + * relative. If the path is relative, this function checks if the path is + * relative to symlink or relative to current working directory. This is an + * initiative to find a smarter `srcpath` to supply when building symlinks. + * This allows you to determine which path to use out of one of three possible + * types of source paths. The first is an absolute path. This is detected by + * `path.isAbsolute()`. When an absolute path is provided, it is checked to + * see if it exists. If it does it's used, if not an error is returned + * (callback)/ thrown (sync). The other two options for `srcpath` are a + * relative url. By default Node's `fs.symlink` works by creating a symlink + * using `dstpath` and expects the `srcpath` to be relative to the newly + * created symlink. If you provide a `srcpath` that does not exist on the file + * system it results in a broken symlink. To minimize this, the function + * checks to see if the 'relative to symlink' source file exists, and if it + * does it will use it. If it does not, it checks if there's a file that + * exists that is relative to the current working directory, if does its used. + * This preserves the expectations of the original fs.symlink spec and adds + * the ability to pass in `relative to current working direcotry` paths. + */ + +function symlinkPaths (srcpath, dstpath, callback) { + if (path.isAbsolute(srcpath)) { + return fs.lstat(srcpath, (err) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureSymlink') + return callback(err) + } + return callback(null, { + toCwd: srcpath, + toDst: srcpath + }) + }) + } else { + const dstdir = path.dirname(dstpath) + const relativeToDst = path.join(dstdir, srcpath) + return pathExists(relativeToDst, (err, exists) => { + if (err) return callback(err) + if (exists) { + return callback(null, { + toCwd: relativeToDst, + toDst: srcpath + }) + } else { + return fs.lstat(srcpath, (err) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureSymlink') + return callback(err) + } + return callback(null, { + toCwd: srcpath, + toDst: path.relative(dstdir, srcpath) + }) + }) + } + }) + } +} + +function symlinkPathsSync (srcpath, dstpath) { + let exists + if (path.isAbsolute(srcpath)) { + exists = fs.existsSync(srcpath) + if (!exists) throw new Error('absolute srcpath does not exist') + return { + toCwd: srcpath, + toDst: srcpath + } + } else { + const dstdir = path.dirname(dstpath) + const relativeToDst = path.join(dstdir, srcpath) + exists = fs.existsSync(relativeToDst) + if (exists) { + return { + toCwd: relativeToDst, + toDst: srcpath + } + } else { + exists = fs.existsSync(srcpath) + if (!exists) throw new Error('relative srcpath does not exist') + return { + toCwd: srcpath, + toDst: path.relative(dstdir, srcpath) + } + } + } +} + +module.exports = { + symlinkPaths, + symlinkPathsSync +} diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/ensure/symlink-type.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/ensure/symlink-type.js new file mode 100644 index 0000000..42dc0ce --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/ensure/symlink-type.js @@ -0,0 +1,31 @@ +'use strict' + +const fs = require('graceful-fs') + +function symlinkType (srcpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + if (type) return callback(null, type) + fs.lstat(srcpath, (err, stats) => { + if (err) return callback(null, 'file') + type = (stats && stats.isDirectory()) ? 'dir' : 'file' + callback(null, type) + }) +} + +function symlinkTypeSync (srcpath, type) { + let stats + + if (type) return type + try { + stats = fs.lstatSync(srcpath) + } catch { + return 'file' + } + return (stats && stats.isDirectory()) ? 'dir' : 'file' +} + +module.exports = { + symlinkType, + symlinkTypeSync +} diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/ensure/symlink.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/ensure/symlink.js new file mode 100644 index 0000000..2b93052 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/ensure/symlink.js @@ -0,0 +1,82 @@ +'use strict' + +const u = require('universalify').fromCallback +const path = require('path') +const fs = require('../fs') +const _mkdirs = require('../mkdirs') +const mkdirs = _mkdirs.mkdirs +const mkdirsSync = _mkdirs.mkdirsSync + +const _symlinkPaths = require('./symlink-paths') +const symlinkPaths = _symlinkPaths.symlinkPaths +const symlinkPathsSync = _symlinkPaths.symlinkPathsSync + +const _symlinkType = require('./symlink-type') +const symlinkType = _symlinkType.symlinkType +const symlinkTypeSync = _symlinkType.symlinkTypeSync + +const pathExists = require('../path-exists').pathExists + +const { areIdentical } = require('../util/stat') + +function createSymlink (srcpath, dstpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + + fs.lstat(dstpath, (err, stats) => { + if (!err && stats.isSymbolicLink()) { + Promise.all([ + fs.stat(srcpath), + fs.stat(dstpath) + ]).then(([srcStat, dstStat]) => { + if (areIdentical(srcStat, dstStat)) return callback(null) + _createSymlink(srcpath, dstpath, type, callback) + }) + } else _createSymlink(srcpath, dstpath, type, callback) + }) +} + +function _createSymlink (srcpath, dstpath, type, callback) { + symlinkPaths(srcpath, dstpath, (err, relative) => { + if (err) return callback(err) + srcpath = relative.toDst + symlinkType(relative.toCwd, type, (err, type) => { + if (err) return callback(err) + const dir = path.dirname(dstpath) + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return fs.symlink(srcpath, dstpath, type, callback) + mkdirs(dir, err => { + if (err) return callback(err) + fs.symlink(srcpath, dstpath, type, callback) + }) + }) + }) + }) +} + +function createSymlinkSync (srcpath, dstpath, type) { + let stats + try { + stats = fs.lstatSync(dstpath) + } catch {} + if (stats && stats.isSymbolicLink()) { + const srcStat = fs.statSync(srcpath) + const dstStat = fs.statSync(dstpath) + if (areIdentical(srcStat, dstStat)) return + } + + const relative = symlinkPathsSync(srcpath, dstpath) + srcpath = relative.toDst + type = symlinkTypeSync(relative.toCwd, type) + const dir = path.dirname(dstpath) + const exists = fs.existsSync(dir) + if (exists) return fs.symlinkSync(srcpath, dstpath, type) + mkdirsSync(dir) + return fs.symlinkSync(srcpath, dstpath, type) +} + +module.exports = { + createSymlink: u(createSymlink), + createSymlinkSync +} diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/fs/index.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/fs/index.js new file mode 100644 index 0000000..7b025e2 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/fs/index.js @@ -0,0 +1,128 @@ +'use strict' +// This is adapted from https://github.com/normalize/mz +// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors +const u = require('universalify').fromCallback +const fs = require('graceful-fs') + +const api = [ + 'access', + 'appendFile', + 'chmod', + 'chown', + 'close', + 'copyFile', + 'fchmod', + 'fchown', + 'fdatasync', + 'fstat', + 'fsync', + 'ftruncate', + 'futimes', + 'lchmod', + 'lchown', + 'link', + 'lstat', + 'mkdir', + 'mkdtemp', + 'open', + 'opendir', + 'readdir', + 'readFile', + 'readlink', + 'realpath', + 'rename', + 'rm', + 'rmdir', + 'stat', + 'symlink', + 'truncate', + 'unlink', + 'utimes', + 'writeFile' +].filter(key => { + // Some commands are not available on some systems. Ex: + // fs.opendir was added in Node.js v12.12.0 + // fs.rm was added in Node.js v14.14.0 + // fs.lchown is not available on at least some Linux + return typeof fs[key] === 'function' +}) + +// Export cloned fs: +Object.assign(exports, fs) + +// Universalify async methods: +api.forEach(method => { + exports[method] = u(fs[method]) +}) + +// We differ from mz/fs in that we still ship the old, broken, fs.exists() +// since we are a drop-in replacement for the native module +exports.exists = function (filename, callback) { + if (typeof callback === 'function') { + return fs.exists(filename, callback) + } + return new Promise(resolve => { + return fs.exists(filename, resolve) + }) +} + +// fs.read(), fs.write(), & fs.writev() need special treatment due to multiple callback args + +exports.read = function (fd, buffer, offset, length, position, callback) { + if (typeof callback === 'function') { + return fs.read(fd, buffer, offset, length, position, callback) + } + return new Promise((resolve, reject) => { + fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => { + if (err) return reject(err) + resolve({ bytesRead, buffer }) + }) + }) +} + +// Function signature can be +// fs.write(fd, buffer[, offset[, length[, position]]], callback) +// OR +// fs.write(fd, string[, position[, encoding]], callback) +// We need to handle both cases, so we use ...args +exports.write = function (fd, buffer, ...args) { + if (typeof args[args.length - 1] === 'function') { + return fs.write(fd, buffer, ...args) + } + + return new Promise((resolve, reject) => { + fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => { + if (err) return reject(err) + resolve({ bytesWritten, buffer }) + }) + }) +} + +// fs.writev only available in Node v12.9.0+ +if (typeof fs.writev === 'function') { + // Function signature is + // s.writev(fd, buffers[, position], callback) + // We need to handle the optional arg, so we use ...args + exports.writev = function (fd, buffers, ...args) { + if (typeof args[args.length - 1] === 'function') { + return fs.writev(fd, buffers, ...args) + } + + return new Promise((resolve, reject) => { + fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => { + if (err) return reject(err) + resolve({ bytesWritten, buffers }) + }) + }) + } +} + +// fs.realpath.native sometimes not available if fs is monkey-patched +if (typeof fs.realpath.native === 'function') { + exports.realpath.native = u(fs.realpath.native) +} else { + process.emitWarning( + 'fs.realpath.native is not a function. Is fs being monkey-patched?', + 'Warning', 'fs-extra-WARN0003' + ) +} diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/index.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/index.js new file mode 100644 index 0000000..da6711a --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/index.js @@ -0,0 +1,16 @@ +'use strict' + +module.exports = { + // Export promiseified graceful-fs: + ...require('./fs'), + // Export extra methods: + ...require('./copy'), + ...require('./empty'), + ...require('./ensure'), + ...require('./json'), + ...require('./mkdirs'), + ...require('./move'), + ...require('./output-file'), + ...require('./path-exists'), + ...require('./remove') +} diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/json/index.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/json/index.js new file mode 100644 index 0000000..900126a --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/json/index.js @@ -0,0 +1,16 @@ +'use strict' + +const u = require('universalify').fromPromise +const jsonFile = require('./jsonfile') + +jsonFile.outputJson = u(require('./output-json')) +jsonFile.outputJsonSync = require('./output-json-sync') +// aliases +jsonFile.outputJSON = jsonFile.outputJson +jsonFile.outputJSONSync = jsonFile.outputJsonSync +jsonFile.writeJSON = jsonFile.writeJson +jsonFile.writeJSONSync = jsonFile.writeJsonSync +jsonFile.readJSON = jsonFile.readJson +jsonFile.readJSONSync = jsonFile.readJsonSync + +module.exports = jsonFile diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/json/jsonfile.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/json/jsonfile.js new file mode 100644 index 0000000..f11d34d --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/json/jsonfile.js @@ -0,0 +1,11 @@ +'use strict' + +const jsonFile = require('jsonfile') + +module.exports = { + // jsonfile exports + readJson: jsonFile.readFile, + readJsonSync: jsonFile.readFileSync, + writeJson: jsonFile.writeFile, + writeJsonSync: jsonFile.writeFileSync +} diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/json/output-json-sync.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/json/output-json-sync.js new file mode 100644 index 0000000..d4e564f --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/json/output-json-sync.js @@ -0,0 +1,12 @@ +'use strict' + +const { stringify } = require('jsonfile/utils') +const { outputFileSync } = require('../output-file') + +function outputJsonSync (file, data, options) { + const str = stringify(data, options) + + outputFileSync(file, str, options) +} + +module.exports = outputJsonSync diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/json/output-json.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/json/output-json.js new file mode 100644 index 0000000..0afdeb6 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/json/output-json.js @@ -0,0 +1,12 @@ +'use strict' + +const { stringify } = require('jsonfile/utils') +const { outputFile } = require('../output-file') + +async function outputJson (file, data, options = {}) { + const str = stringify(data, options) + + await outputFile(file, str, options) +} + +module.exports = outputJson diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/mkdirs/index.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/mkdirs/index.js new file mode 100644 index 0000000..9edecee --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/mkdirs/index.js @@ -0,0 +1,14 @@ +'use strict' +const u = require('universalify').fromPromise +const { makeDir: _makeDir, makeDirSync } = require('./make-dir') +const makeDir = u(_makeDir) + +module.exports = { + mkdirs: makeDir, + mkdirsSync: makeDirSync, + // alias + mkdirp: makeDir, + mkdirpSync: makeDirSync, + ensureDir: makeDir, + ensureDirSync: makeDirSync +} diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/mkdirs/make-dir.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/mkdirs/make-dir.js new file mode 100644 index 0000000..45ece64 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/mkdirs/make-dir.js @@ -0,0 +1,27 @@ +'use strict' +const fs = require('../fs') +const { checkPath } = require('./utils') + +const getMode = options => { + const defaults = { mode: 0o777 } + if (typeof options === 'number') return options + return ({ ...defaults, ...options }).mode +} + +module.exports.makeDir = async (dir, options) => { + checkPath(dir) + + return fs.mkdir(dir, { + mode: getMode(options), + recursive: true + }) +} + +module.exports.makeDirSync = (dir, options) => { + checkPath(dir) + + return fs.mkdirSync(dir, { + mode: getMode(options), + recursive: true + }) +} diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/mkdirs/utils.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/mkdirs/utils.js new file mode 100644 index 0000000..a4059ad --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/mkdirs/utils.js @@ -0,0 +1,21 @@ +// Adapted from https://github.com/sindresorhus/make-dir +// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +'use strict' +const path = require('path') + +// https://github.com/nodejs/node/issues/8987 +// https://github.com/libuv/libuv/pull/1088 +module.exports.checkPath = function checkPath (pth) { + if (process.platform === 'win32') { + const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')) + + if (pathHasInvalidWinCharacters) { + const error = new Error(`Path contains invalid characters: ${pth}`) + error.code = 'EINVAL' + throw error + } + } +} diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/move/index.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/move/index.js new file mode 100644 index 0000000..fcee73c --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/move/index.js @@ -0,0 +1,7 @@ +'use strict' + +const u = require('universalify').fromCallback +module.exports = { + move: u(require('./move')), + moveSync: require('./move-sync') +} diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/move/move-sync.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/move/move-sync.js new file mode 100644 index 0000000..8453366 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/move/move-sync.js @@ -0,0 +1,54 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const copySync = require('../copy').copySync +const removeSync = require('../remove').removeSync +const mkdirpSync = require('../mkdirs').mkdirpSync +const stat = require('../util/stat') + +function moveSync (src, dest, opts) { + opts = opts || {} + const overwrite = opts.overwrite || opts.clobber || false + + const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, 'move', opts) + stat.checkParentPathsSync(src, srcStat, dest, 'move') + if (!isParentRoot(dest)) mkdirpSync(path.dirname(dest)) + return doRename(src, dest, overwrite, isChangingCase) +} + +function isParentRoot (dest) { + const parent = path.dirname(dest) + const parsedPath = path.parse(parent) + return parsedPath.root === parent +} + +function doRename (src, dest, overwrite, isChangingCase) { + if (isChangingCase) return rename(src, dest, overwrite) + if (overwrite) { + removeSync(dest) + return rename(src, dest, overwrite) + } + if (fs.existsSync(dest)) throw new Error('dest already exists.') + return rename(src, dest, overwrite) +} + +function rename (src, dest, overwrite) { + try { + fs.renameSync(src, dest) + } catch (err) { + if (err.code !== 'EXDEV') throw err + return moveAcrossDevice(src, dest, overwrite) + } +} + +function moveAcrossDevice (src, dest, overwrite) { + const opts = { + overwrite, + errorOnExist: true + } + copySync(src, dest, opts) + return removeSync(src) +} + +module.exports = moveSync diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/move/move.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/move/move.js new file mode 100644 index 0000000..7dc6ecd --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/move/move.js @@ -0,0 +1,75 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const copy = require('../copy').copy +const remove = require('../remove').remove +const mkdirp = require('../mkdirs').mkdirp +const pathExists = require('../path-exists').pathExists +const stat = require('../util/stat') + +function move (src, dest, opts, cb) { + if (typeof opts === 'function') { + cb = opts + opts = {} + } + + opts = opts || {} + + const overwrite = opts.overwrite || opts.clobber || false + + stat.checkPaths(src, dest, 'move', opts, (err, stats) => { + if (err) return cb(err) + const { srcStat, isChangingCase = false } = stats + stat.checkParentPaths(src, srcStat, dest, 'move', err => { + if (err) return cb(err) + if (isParentRoot(dest)) return doRename(src, dest, overwrite, isChangingCase, cb) + mkdirp(path.dirname(dest), err => { + if (err) return cb(err) + return doRename(src, dest, overwrite, isChangingCase, cb) + }) + }) + }) +} + +function isParentRoot (dest) { + const parent = path.dirname(dest) + const parsedPath = path.parse(parent) + return parsedPath.root === parent +} + +function doRename (src, dest, overwrite, isChangingCase, cb) { + if (isChangingCase) return rename(src, dest, overwrite, cb) + if (overwrite) { + return remove(dest, err => { + if (err) return cb(err) + return rename(src, dest, overwrite, cb) + }) + } + pathExists(dest, (err, destExists) => { + if (err) return cb(err) + if (destExists) return cb(new Error('dest already exists.')) + return rename(src, dest, overwrite, cb) + }) +} + +function rename (src, dest, overwrite, cb) { + fs.rename(src, dest, err => { + if (!err) return cb() + if (err.code !== 'EXDEV') return cb(err) + return moveAcrossDevice(src, dest, overwrite, cb) + }) +} + +function moveAcrossDevice (src, dest, overwrite, cb) { + const opts = { + overwrite, + errorOnExist: true + } + copy(src, dest, opts, err => { + if (err) return cb(err) + return remove(src, cb) + }) +} + +module.exports = move diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/output-file/index.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/output-file/index.js new file mode 100644 index 0000000..92297ca --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/output-file/index.js @@ -0,0 +1,40 @@ +'use strict' + +const u = require('universalify').fromCallback +const fs = require('graceful-fs') +const path = require('path') +const mkdir = require('../mkdirs') +const pathExists = require('../path-exists').pathExists + +function outputFile (file, data, encoding, callback) { + if (typeof encoding === 'function') { + callback = encoding + encoding = 'utf8' + } + + const dir = path.dirname(file) + pathExists(dir, (err, itDoes) => { + if (err) return callback(err) + if (itDoes) return fs.writeFile(file, data, encoding, callback) + + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + + fs.writeFile(file, data, encoding, callback) + }) + }) +} + +function outputFileSync (file, ...args) { + const dir = path.dirname(file) + if (fs.existsSync(dir)) { + return fs.writeFileSync(file, ...args) + } + mkdir.mkdirsSync(dir) + fs.writeFileSync(file, ...args) +} + +module.exports = { + outputFile: u(outputFile), + outputFileSync +} diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/path-exists/index.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/path-exists/index.js new file mode 100644 index 0000000..ddd9bc7 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/path-exists/index.js @@ -0,0 +1,12 @@ +'use strict' +const u = require('universalify').fromPromise +const fs = require('../fs') + +function pathExists (path) { + return fs.access(path).then(() => true).catch(() => false) +} + +module.exports = { + pathExists: u(pathExists), + pathExistsSync: fs.existsSync +} diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/remove/index.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/remove/index.js new file mode 100644 index 0000000..4428e59 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/remove/index.js @@ -0,0 +1,22 @@ +'use strict' + +const fs = require('graceful-fs') +const u = require('universalify').fromCallback +const rimraf = require('./rimraf') + +function remove (path, callback) { + // Node 14.14.0+ + if (fs.rm) return fs.rm(path, { recursive: true, force: true }, callback) + rimraf(path, callback) +} + +function removeSync (path) { + // Node 14.14.0+ + if (fs.rmSync) return fs.rmSync(path, { recursive: true, force: true }) + rimraf.sync(path) +} + +module.exports = { + remove: u(remove), + removeSync +} diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/remove/rimraf.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/remove/rimraf.js new file mode 100644 index 0000000..2c77102 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/remove/rimraf.js @@ -0,0 +1,302 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const assert = require('assert') + +const isWindows = (process.platform === 'win32') + +function defaults (options) { + const methods = [ + 'unlink', + 'chmod', + 'stat', + 'lstat', + 'rmdir', + 'readdir' + ] + methods.forEach(m => { + options[m] = options[m] || fs[m] + m = m + 'Sync' + options[m] = options[m] || fs[m] + }) + + options.maxBusyTries = options.maxBusyTries || 3 +} + +function rimraf (p, options, cb) { + let busyTries = 0 + + if (typeof options === 'function') { + cb = options + options = {} + } + + assert(p, 'rimraf: missing path') + assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string') + assert.strictEqual(typeof cb, 'function', 'rimraf: callback function required') + assert(options, 'rimraf: invalid options argument provided') + assert.strictEqual(typeof options, 'object', 'rimraf: options should be object') + + defaults(options) + + rimraf_(p, options, function CB (er) { + if (er) { + if ((er.code === 'EBUSY' || er.code === 'ENOTEMPTY' || er.code === 'EPERM') && + busyTries < options.maxBusyTries) { + busyTries++ + const time = busyTries * 100 + // try again, with the same exact callback as this one. + return setTimeout(() => rimraf_(p, options, CB), time) + } + + // already gone + if (er.code === 'ENOENT') er = null + } + + cb(er) + }) +} + +// Two possible strategies. +// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR +// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR +// +// Both result in an extra syscall when you guess wrong. However, there +// are likely far more normal files in the world than directories. This +// is based on the assumption that a the average number of files per +// directory is >= 1. +// +// If anyone ever complains about this, then I guess the strategy could +// be made configurable somehow. But until then, YAGNI. +function rimraf_ (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + // sunos lets the root user unlink directories, which is... weird. + // so we have to lstat here and make sure it's not a dir. + options.lstat(p, (er, st) => { + if (er && er.code === 'ENOENT') { + return cb(null) + } + + // Windows can EPERM on stat. Life is suffering. + if (er && er.code === 'EPERM' && isWindows) { + return fixWinEPERM(p, options, er, cb) + } + + if (st && st.isDirectory()) { + return rmdir(p, options, er, cb) + } + + options.unlink(p, er => { + if (er) { + if (er.code === 'ENOENT') { + return cb(null) + } + if (er.code === 'EPERM') { + return (isWindows) + ? fixWinEPERM(p, options, er, cb) + : rmdir(p, options, er, cb) + } + if (er.code === 'EISDIR') { + return rmdir(p, options, er, cb) + } + } + return cb(er) + }) + }) +} + +function fixWinEPERM (p, options, er, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.chmod(p, 0o666, er2 => { + if (er2) { + cb(er2.code === 'ENOENT' ? null : er) + } else { + options.stat(p, (er3, stats) => { + if (er3) { + cb(er3.code === 'ENOENT' ? null : er) + } else if (stats.isDirectory()) { + rmdir(p, options, er, cb) + } else { + options.unlink(p, cb) + } + }) + } + }) +} + +function fixWinEPERMSync (p, options, er) { + let stats + + assert(p) + assert(options) + + try { + options.chmodSync(p, 0o666) + } catch (er2) { + if (er2.code === 'ENOENT') { + return + } else { + throw er + } + } + + try { + stats = options.statSync(p) + } catch (er3) { + if (er3.code === 'ENOENT') { + return + } else { + throw er + } + } + + if (stats.isDirectory()) { + rmdirSync(p, options, er) + } else { + options.unlinkSync(p) + } +} + +function rmdir (p, options, originalEr, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) + // if we guessed wrong, and it's not a directory, then + // raise the original error. + options.rmdir(p, er => { + if (er && (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM')) { + rmkids(p, options, cb) + } else if (er && er.code === 'ENOTDIR') { + cb(originalEr) + } else { + cb(er) + } + }) +} + +function rmkids (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.readdir(p, (er, files) => { + if (er) return cb(er) + + let n = files.length + let errState + + if (n === 0) return options.rmdir(p, cb) + + files.forEach(f => { + rimraf(path.join(p, f), options, er => { + if (errState) { + return + } + if (er) return cb(errState = er) + if (--n === 0) { + options.rmdir(p, cb) + } + }) + }) + }) +} + +// this looks simpler, and is strictly *faster*, but will +// tie up the JavaScript thread and fail on excessively +// deep directory trees. +function rimrafSync (p, options) { + let st + + options = options || {} + defaults(options) + + assert(p, 'rimraf: missing path') + assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string') + assert(options, 'rimraf: missing options') + assert.strictEqual(typeof options, 'object', 'rimraf: options should be object') + + try { + st = options.lstatSync(p) + } catch (er) { + if (er.code === 'ENOENT') { + return + } + + // Windows can EPERM on stat. Life is suffering. + if (er.code === 'EPERM' && isWindows) { + fixWinEPERMSync(p, options, er) + } + } + + try { + // sunos lets the root user unlink directories, which is... weird. + if (st && st.isDirectory()) { + rmdirSync(p, options, null) + } else { + options.unlinkSync(p) + } + } catch (er) { + if (er.code === 'ENOENT') { + return + } else if (er.code === 'EPERM') { + return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) + } else if (er.code !== 'EISDIR') { + throw er + } + rmdirSync(p, options, er) + } +} + +function rmdirSync (p, options, originalEr) { + assert(p) + assert(options) + + try { + options.rmdirSync(p) + } catch (er) { + if (er.code === 'ENOTDIR') { + throw originalEr + } else if (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM') { + rmkidsSync(p, options) + } else if (er.code !== 'ENOENT') { + throw er + } + } +} + +function rmkidsSync (p, options) { + assert(p) + assert(options) + options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) + + if (isWindows) { + // We only end up here once we got ENOTEMPTY at least once, and + // at this point, we are guaranteed to have removed all the kids. + // So, we know that it won't be ENOENT or ENOTDIR or anything else. + // try really hard to delete stuff on windows, because it has a + // PROFOUNDLY annoying habit of not closing handles promptly when + // files are deleted, resulting in spurious ENOTEMPTY errors. + const startTime = Date.now() + do { + try { + const ret = options.rmdirSync(p, options) + return ret + } catch {} + } while (Date.now() - startTime < 500) // give up after 500ms + } else { + const ret = options.rmdirSync(p, options) + return ret + } +} + +module.exports = rimraf +rimraf.sync = rimrafSync diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/util/stat.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/util/stat.js new file mode 100644 index 0000000..0ed5aec --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/util/stat.js @@ -0,0 +1,154 @@ +'use strict' + +const fs = require('../fs') +const path = require('path') +const util = require('util') + +function getStats (src, dest, opts) { + const statFunc = opts.dereference + ? (file) => fs.stat(file, { bigint: true }) + : (file) => fs.lstat(file, { bigint: true }) + return Promise.all([ + statFunc(src), + statFunc(dest).catch(err => { + if (err.code === 'ENOENT') return null + throw err + }) + ]).then(([srcStat, destStat]) => ({ srcStat, destStat })) +} + +function getStatsSync (src, dest, opts) { + let destStat + const statFunc = opts.dereference + ? (file) => fs.statSync(file, { bigint: true }) + : (file) => fs.lstatSync(file, { bigint: true }) + const srcStat = statFunc(src) + try { + destStat = statFunc(dest) + } catch (err) { + if (err.code === 'ENOENT') return { srcStat, destStat: null } + throw err + } + return { srcStat, destStat } +} + +function checkPaths (src, dest, funcName, opts, cb) { + util.callbackify(getStats)(src, dest, opts, (err, stats) => { + if (err) return cb(err) + const { srcStat, destStat } = stats + + if (destStat) { + if (areIdentical(srcStat, destStat)) { + const srcBaseName = path.basename(src) + const destBaseName = path.basename(dest) + if (funcName === 'move' && + srcBaseName !== destBaseName && + srcBaseName.toLowerCase() === destBaseName.toLowerCase()) { + return cb(null, { srcStat, destStat, isChangingCase: true }) + } + return cb(new Error('Source and destination must not be the same.')) + } + if (srcStat.isDirectory() && !destStat.isDirectory()) { + return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)) + } + if (!srcStat.isDirectory() && destStat.isDirectory()) { + return cb(new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`)) + } + } + + if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { + return cb(new Error(errMsg(src, dest, funcName))) + } + return cb(null, { srcStat, destStat }) + }) +} + +function checkPathsSync (src, dest, funcName, opts) { + const { srcStat, destStat } = getStatsSync(src, dest, opts) + + if (destStat) { + if (areIdentical(srcStat, destStat)) { + const srcBaseName = path.basename(src) + const destBaseName = path.basename(dest) + if (funcName === 'move' && + srcBaseName !== destBaseName && + srcBaseName.toLowerCase() === destBaseName.toLowerCase()) { + return { srcStat, destStat, isChangingCase: true } + } + throw new Error('Source and destination must not be the same.') + } + if (srcStat.isDirectory() && !destStat.isDirectory()) { + throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`) + } + if (!srcStat.isDirectory() && destStat.isDirectory()) { + throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`) + } + } + + if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { + throw new Error(errMsg(src, dest, funcName)) + } + return { srcStat, destStat } +} + +// recursively check if dest parent is a subdirectory of src. +// It works for all file types including symlinks since it +// checks the src and dest inodes. It starts from the deepest +// parent and stops once it reaches the src parent or the root path. +function checkParentPaths (src, srcStat, dest, funcName, cb) { + const srcParent = path.resolve(path.dirname(src)) + const destParent = path.resolve(path.dirname(dest)) + if (destParent === srcParent || destParent === path.parse(destParent).root) return cb() + fs.stat(destParent, { bigint: true }, (err, destStat) => { + if (err) { + if (err.code === 'ENOENT') return cb() + return cb(err) + } + if (areIdentical(srcStat, destStat)) { + return cb(new Error(errMsg(src, dest, funcName))) + } + return checkParentPaths(src, srcStat, destParent, funcName, cb) + }) +} + +function checkParentPathsSync (src, srcStat, dest, funcName) { + const srcParent = path.resolve(path.dirname(src)) + const destParent = path.resolve(path.dirname(dest)) + if (destParent === srcParent || destParent === path.parse(destParent).root) return + let destStat + try { + destStat = fs.statSync(destParent, { bigint: true }) + } catch (err) { + if (err.code === 'ENOENT') return + throw err + } + if (areIdentical(srcStat, destStat)) { + throw new Error(errMsg(src, dest, funcName)) + } + return checkParentPathsSync(src, srcStat, destParent, funcName) +} + +function areIdentical (srcStat, destStat) { + return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev +} + +// return true if dest is a subdir of src, otherwise false. +// It only checks the path strings. +function isSrcSubdir (src, dest) { + const srcArr = path.resolve(src).split(path.sep).filter(i => i) + const destArr = path.resolve(dest).split(path.sep).filter(i => i) + return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true) +} + +function errMsg (src, dest, funcName) { + return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.` +} + +module.exports = { + checkPaths, + checkPathsSync, + checkParentPaths, + checkParentPathsSync, + isSrcSubdir, + areIdentical +} diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/util/utimes.js b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/util/utimes.js new file mode 100644 index 0000000..75395de --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/lib/util/utimes.js @@ -0,0 +1,26 @@ +'use strict' + +const fs = require('graceful-fs') + +function utimesMillis (path, atime, mtime, callback) { + // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback) + fs.open(path, 'r+', (err, fd) => { + if (err) return callback(err) + fs.futimes(fd, atime, mtime, futimesErr => { + fs.close(fd, closeErr => { + if (callback) callback(futimesErr || closeErr) + }) + }) + }) +} + +function utimesMillisSync (path, atime, mtime) { + const fd = fs.openSync(path, 'r+') + fs.futimesSync(fd, atime, mtime) + return fs.closeSync(fd) +} + +module.exports = { + utimesMillis, + utimesMillisSync +} diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/package.json b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/package.json new file mode 100644 index 0000000..059000e --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/fs-extra/package.json @@ -0,0 +1,67 @@ +{ + "name": "fs-extra", + "version": "10.1.0", + "description": "fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as recursive mkdir, copy, and remove.", + "engines": { + "node": ">=12" + }, + "homepage": "https://github.com/jprichardson/node-fs-extra", + "repository": { + "type": "git", + "url": "https://github.com/jprichardson/node-fs-extra" + }, + "keywords": [ + "fs", + "file", + "file system", + "copy", + "directory", + "extra", + "mkdirp", + "mkdir", + "mkdirs", + "recursive", + "json", + "read", + "write", + "extra", + "delete", + "remove", + "touch", + "create", + "text", + "output", + "move", + "promise" + ], + "author": "JP Richardson <jprichardson@gmail.com>", + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "devDependencies": { + "at-least-node": "^1.0.0", + "klaw": "^2.1.1", + "klaw-sync": "^3.0.2", + "minimist": "^1.1.1", + "mocha": "^5.0.5", + "nyc": "^15.0.0", + "proxyquire": "^2.0.1", + "read-dir-files": "^0.1.1", + "standard": "^16.0.3" + }, + "main": "./lib/index.js", + "files": [ + "lib/", + "!lib/**/__tests__/" + ], + "scripts": { + "lint": "standard", + "test-find": "find ./lib/**/__tests__ -name *.test.js | xargs mocha", + "test": "npm run lint && npm run unit", + "unit": "nyc node test.js" + }, + "sideEffects": false +} diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/jsonfile/CHANGELOG.md b/desktop/node_modules/@electron/osx-sign/node_modules/jsonfile/CHANGELOG.md new file mode 100644 index 0000000..d772e43 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/jsonfile/CHANGELOG.md @@ -0,0 +1,171 @@ +6.1.0 / 2020-10-31 +------------------ + +- Add `finalEOL` option to disable writing final EOL ([#115](https://github.com/jprichardson/node-jsonfile/issues/115), [#137](https://github.com/jprichardson/node-jsonfile/pull/137)) +- Update dependency ([#138](https://github.com/jprichardson/node-jsonfile/pull/138)) + +6.0.1 / 2020-03-07 +------------------ + +- Update dependency ([#130](https://github.com/jprichardson/node-jsonfile/pull/130)) +- Fix code style ([#129](https://github.com/jprichardson/node-jsonfile/pull/129)) + +6.0.0 / 2020-02-24 +------------------ + +- **BREAKING:** Drop support for Node 6 & 8 ([#128](https://github.com/jprichardson/node-jsonfile/pull/128)) +- **BREAKING:** Do not allow passing `null` as options to `readFile()` or `writeFile()` ([#128](https://github.com/jprichardson/node-jsonfile/pull/128)) +- Refactor internals ([#128](https://github.com/jprichardson/node-jsonfile/pull/128)) + +5.0.0 / 2018-09-08 +------------------ + +- **BREAKING:** Drop Node 4 support +- **BREAKING:** If no callback is passed to an asynchronous method, a promise is now returned ([#109](https://github.com/jprichardson/node-jsonfile/pull/109)) +- Cleanup docs + +4.0.0 / 2017-07-12 +------------------ + +- **BREAKING:** Remove global `spaces` option. +- **BREAKING:** Drop support for Node 0.10, 0.12, and io.js. +- Remove undocumented `passParsingErrors` option. +- Added `EOL` override option to `writeFile` when using `spaces`. [#89] + +3.0.1 / 2017-07-05 +------------------ + +- Fixed bug in `writeFile` when there was a serialization error & no callback was passed. In previous versions, an empty file would be written; now no file is written. + +3.0.0 / 2017-04-25 +------------------ + +- Changed behavior of `throws` option for `readFileSync`; now does not throw filesystem errors when `throws` is `false` + +2.4.0 / 2016-09-15 +------------------ +### Changed +- added optional support for `graceful-fs` [#62] + +2.3.1 / 2016-05-13 +------------------ +- fix to support BOM. [#45][#45] + +2.3.0 / 2016-04-16 +------------------ +- add `throws` to `readFile()`. See [#39][#39] +- add support for any arbitrary `fs` module. Useful with [mock-fs](https://www.npmjs.com/package/mock-fs) + +2.2.3 / 2015-10-14 +------------------ +- include file name in parse error. See: https://github.com/jprichardson/node-jsonfile/pull/34 + +2.2.2 / 2015-09-16 +------------------ +- split out tests into separate files +- fixed `throws` when set to `true` in `readFileSync()`. See: https://github.com/jprichardson/node-jsonfile/pull/33 + +2.2.1 / 2015-06-25 +------------------ +- fixed regression when passing in string as encoding for options in `writeFile()` and `writeFileSync()`. See: https://github.com/jprichardson/node-jsonfile/issues/28 + +2.2.0 / 2015-06-25 +------------------ +- added `options.spaces` to `writeFile()` and `writeFileSync()` + +2.1.2 / 2015-06-22 +------------------ +- fixed if passed `readFileSync(file, 'utf8')`. See: https://github.com/jprichardson/node-jsonfile/issues/25 + +2.1.1 / 2015-06-19 +------------------ +- fixed regressions if `null` is passed for options. See: https://github.com/jprichardson/node-jsonfile/issues/24 + +2.1.0 / 2015-06-19 +------------------ +- cleanup: JavaScript Standard Style, rename files, dropped terst for assert +- methods now support JSON revivers/replacers + +2.0.1 / 2015-05-24 +------------------ +- update license attribute https://github.com/jprichardson/node-jsonfile/pull/21 + +2.0.0 / 2014-07-28 +------------------ +* added `\n` to end of file on write. [#14](https://github.com/jprichardson/node-jsonfile/pull/14) +* added `options.throws` to `readFileSync()` +* dropped support for Node v0.8 + +1.2.0 / 2014-06-29 +------------------ +* removed semicolons +* bugfix: passed `options` to `fs.readFile` and `fs.readFileSync`. This technically changes behavior, but +changes it according to docs. [#12][#12] + +1.1.1 / 2013-11-11 +------------------ +* fixed catching of callback bug (ffissore / #5) + +1.1.0 / 2013-10-11 +------------------ +* added `options` param to methods, (seanodell / #4) + +1.0.1 / 2013-09-05 +------------------ +* removed `homepage` field from package.json to remove NPM warning + +1.0.0 / 2013-06-28 +------------------ +* added `.npmignore`, #1 +* changed spacing default from `4` to `2` to follow Node conventions + +0.0.1 / 2012-09-10 +------------------ +* Initial release. + +[#89]: https://github.com/jprichardson/node-jsonfile/pull/89 +[#45]: https://github.com/jprichardson/node-jsonfile/issues/45 "Reading of UTF8-encoded (w/ BOM) files fails" +[#44]: https://github.com/jprichardson/node-jsonfile/issues/44 "Extra characters in written file" +[#43]: https://github.com/jprichardson/node-jsonfile/issues/43 "Prettyfy json when written to file" +[#42]: https://github.com/jprichardson/node-jsonfile/pull/42 "Moved fs.readFileSync within the try/catch" +[#41]: https://github.com/jprichardson/node-jsonfile/issues/41 "Linux: Hidden file not working" +[#40]: https://github.com/jprichardson/node-jsonfile/issues/40 "autocreate folder doesn't work from Path-value" +[#39]: https://github.com/jprichardson/node-jsonfile/pull/39 "Add `throws` option for readFile (async)" +[#38]: https://github.com/jprichardson/node-jsonfile/pull/38 "Update README.md writeFile[Sync] signature" +[#37]: https://github.com/jprichardson/node-jsonfile/pull/37 "support append file" +[#36]: https://github.com/jprichardson/node-jsonfile/pull/36 "Add typescript definition file." +[#35]: https://github.com/jprichardson/node-jsonfile/pull/35 "Add typescript definition file." +[#34]: https://github.com/jprichardson/node-jsonfile/pull/34 "readFile JSON parse error includes filename" +[#33]: https://github.com/jprichardson/node-jsonfile/pull/33 "fix throw->throws typo in readFileSync()" +[#32]: https://github.com/jprichardson/node-jsonfile/issues/32 "readFile & readFileSync can possible have strip-comments as an option?" +[#31]: https://github.com/jprichardson/node-jsonfile/pull/31 "[Modify] Support string include is unicode escape string" +[#30]: https://github.com/jprichardson/node-jsonfile/issues/30 "How to use Jsonfile package in Meteor.js App?" +[#29]: https://github.com/jprichardson/node-jsonfile/issues/29 "writefile callback if no error?" +[#28]: https://github.com/jprichardson/node-jsonfile/issues/28 "writeFile options argument broken " +[#27]: https://github.com/jprichardson/node-jsonfile/pull/27 "Use svg instead of png to get better image quality" +[#26]: https://github.com/jprichardson/node-jsonfile/issues/26 "Breaking change to fs-extra" +[#25]: https://github.com/jprichardson/node-jsonfile/issues/25 "support string encoding param for read methods" +[#24]: https://github.com/jprichardson/node-jsonfile/issues/24 "readFile: Passing in null options with a callback throws an error" +[#23]: https://github.com/jprichardson/node-jsonfile/pull/23 "Add appendFile and appendFileSync" +[#22]: https://github.com/jprichardson/node-jsonfile/issues/22 "Default value for spaces in readme.md is outdated" +[#21]: https://github.com/jprichardson/node-jsonfile/pull/21 "Update license attribute" +[#20]: https://github.com/jprichardson/node-jsonfile/issues/20 "Add simple caching functionallity" +[#19]: https://github.com/jprichardson/node-jsonfile/pull/19 "Add appendFileSync method" +[#18]: https://github.com/jprichardson/node-jsonfile/issues/18 "Add updateFile and updateFileSync methods" +[#17]: https://github.com/jprichardson/node-jsonfile/issues/17 "seem read & write sync has sequentially problem" +[#16]: https://github.com/jprichardson/node-jsonfile/pull/16 "export spaces defaulted to null" +[#15]: https://github.com/jprichardson/node-jsonfile/issues/15 "`jsonfile.spaces` should default to `null`" +[#14]: https://github.com/jprichardson/node-jsonfile/pull/14 "Add EOL at EOF" +[#13]: https://github.com/jprichardson/node-jsonfile/issues/13 "Add a final newline" +[#12]: https://github.com/jprichardson/node-jsonfile/issues/12 "readFile doesn't accept options" +[#11]: https://github.com/jprichardson/node-jsonfile/pull/11 "Added try,catch to readFileSync" +[#10]: https://github.com/jprichardson/node-jsonfile/issues/10 "No output or error from writeFile" +[#9]: https://github.com/jprichardson/node-jsonfile/pull/9 "Change 'js' to 'jf' in example." +[#8]: https://github.com/jprichardson/node-jsonfile/pull/8 "Updated forgotten module.exports to me." +[#7]: https://github.com/jprichardson/node-jsonfile/pull/7 "Add file name in error message" +[#6]: https://github.com/jprichardson/node-jsonfile/pull/6 "Use graceful-fs when possible" +[#5]: https://github.com/jprichardson/node-jsonfile/pull/5 "Jsonfile doesn't behave nicely when used inside a test suite." +[#4]: https://github.com/jprichardson/node-jsonfile/pull/4 "Added options parameter to writeFile and writeFileSync" +[#3]: https://github.com/jprichardson/node-jsonfile/issues/3 "test2" +[#2]: https://github.com/jprichardson/node-jsonfile/issues/2 "homepage field must be a string url. Deleted." +[#1]: https://github.com/jprichardson/node-jsonfile/pull/1 "adding an `.npmignore` file" diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/jsonfile/LICENSE b/desktop/node_modules/@electron/osx-sign/node_modules/jsonfile/LICENSE new file mode 100644 index 0000000..cb7e807 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/jsonfile/LICENSE @@ -0,0 +1,15 @@ +(The MIT License) + +Copyright (c) 2012-2015, JP Richardson <jprichardson@gmail.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files +(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, + merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/jsonfile/README.md b/desktop/node_modules/@electron/osx-sign/node_modules/jsonfile/README.md new file mode 100644 index 0000000..910cde0 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/jsonfile/README.md @@ -0,0 +1,230 @@ +Node.js - jsonfile +================ + +Easily read/write JSON files in Node.js. _Note: this module cannot be used in the browser._ + +[![npm Package](https://img.shields.io/npm/v/jsonfile.svg?style=flat-square)](https://www.npmjs.org/package/jsonfile) +[![build status](https://secure.travis-ci.org/jprichardson/node-jsonfile.svg)](http://travis-ci.org/jprichardson/node-jsonfile) +[![windows Build status](https://img.shields.io/appveyor/ci/jprichardson/node-jsonfile/master.svg?label=windows%20build)](https://ci.appveyor.com/project/jprichardson/node-jsonfile/branch/master) + +<a href="https://github.com/feross/standard"><img src="https://cdn.rawgit.com/feross/standard/master/sticker.svg" alt="Standard JavaScript" width="100"></a> + +Why? +---- + +Writing `JSON.stringify()` and then `fs.writeFile()` and `JSON.parse()` with `fs.readFile()` enclosed in `try/catch` blocks became annoying. + + + +Installation +------------ + + npm install --save jsonfile + + + +API +--- + +* [`readFile(filename, [options], callback)`](#readfilefilename-options-callback) +* [`readFileSync(filename, [options])`](#readfilesyncfilename-options) +* [`writeFile(filename, obj, [options], callback)`](#writefilefilename-obj-options-callback) +* [`writeFileSync(filename, obj, [options])`](#writefilesyncfilename-obj-options) + +---- + +### readFile(filename, [options], callback) + +`options` (`object`, default `undefined`): Pass in any [`fs.readFile`](https://nodejs.org/api/fs.html#fs_fs_readfile_path_options_callback) options or set `reviver` for a [JSON reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse). + - `throws` (`boolean`, default: `true`). If `JSON.parse` throws an error, pass this error to the callback. + If `false`, returns `null` for the object. + + +```js +const jsonfile = require('jsonfile') +const file = '/tmp/data.json' +jsonfile.readFile(file, function (err, obj) { + if (err) console.error(err) + console.dir(obj) +}) +``` + +You can also use this method with promises. The `readFile` method will return a promise if you do not pass a callback function. + +```js +const jsonfile = require('jsonfile') +const file = '/tmp/data.json' +jsonfile.readFile(file) + .then(obj => console.dir(obj)) + .catch(error => console.error(error)) +``` + +---- + +### readFileSync(filename, [options]) + +`options` (`object`, default `undefined`): Pass in any [`fs.readFileSync`](https://nodejs.org/api/fs.html#fs_fs_readfilesync_path_options) options or set `reviver` for a [JSON reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse). +- `throws` (`boolean`, default: `true`). If an error is encountered reading or parsing the file, throw the error. If `false`, returns `null` for the object. + +```js +const jsonfile = require('jsonfile') +const file = '/tmp/data.json' + +console.dir(jsonfile.readFileSync(file)) +``` + +---- + +### writeFile(filename, obj, [options], callback) + +`options`: Pass in any [`fs.writeFile`](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback) options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Can also pass in `spaces`, or override `EOL` string or set `finalEOL` flag as `false` to not save the file with `EOL` at the end. + + +```js +const jsonfile = require('jsonfile') + +const file = '/tmp/data.json' +const obj = { name: 'JP' } + +jsonfile.writeFile(file, obj, function (err) { + if (err) console.error(err) +}) +``` +Or use with promises as follows: + +```js +const jsonfile = require('jsonfile') + +const file = '/tmp/data.json' +const obj = { name: 'JP' } + +jsonfile.writeFile(file, obj) + .then(res => { + console.log('Write complete') + }) + .catch(error => console.error(error)) +``` + + +**formatting with spaces:** + +```js +const jsonfile = require('jsonfile') + +const file = '/tmp/data.json' +const obj = { name: 'JP' } + +jsonfile.writeFile(file, obj, { spaces: 2 }, function (err) { + if (err) console.error(err) +}) +``` + +**overriding EOL:** + +```js +const jsonfile = require('jsonfile') + +const file = '/tmp/data.json' +const obj = { name: 'JP' } + +jsonfile.writeFile(file, obj, { spaces: 2, EOL: '\r\n' }, function (err) { + if (err) console.error(err) +}) +``` + + +**disabling the EOL at the end of file:** + +```js +const jsonfile = require('jsonfile') + +const file = '/tmp/data.json' +const obj = { name: 'JP' } + +jsonfile.writeFile(file, obj, { spaces: 2, finalEOL: false }, function (err) { + if (err) console.log(err) +}) +``` + +**appending to an existing JSON file:** + +You can use `fs.writeFile` option `{ flag: 'a' }` to achieve this. + +```js +const jsonfile = require('jsonfile') + +const file = '/tmp/mayAlreadyExistedData.json' +const obj = { name: 'JP' } + +jsonfile.writeFile(file, obj, { flag: 'a' }, function (err) { + if (err) console.error(err) +}) +``` + +---- + +### writeFileSync(filename, obj, [options]) + +`options`: Pass in any [`fs.writeFileSync`](https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options) options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Can also pass in `spaces`, or override `EOL` string or set `finalEOL` flag as `false` to not save the file with `EOL` at the end. + +```js +const jsonfile = require('jsonfile') + +const file = '/tmp/data.json' +const obj = { name: 'JP' } + +jsonfile.writeFileSync(file, obj) +``` + +**formatting with spaces:** + +```js +const jsonfile = require('jsonfile') + +const file = '/tmp/data.json' +const obj = { name: 'JP' } + +jsonfile.writeFileSync(file, obj, { spaces: 2 }) +``` + +**overriding EOL:** + +```js +const jsonfile = require('jsonfile') + +const file = '/tmp/data.json' +const obj = { name: 'JP' } + +jsonfile.writeFileSync(file, obj, { spaces: 2, EOL: '\r\n' }) +``` + +**disabling the EOL at the end of file:** + +```js +const jsonfile = require('jsonfile') + +const file = '/tmp/data.json' +const obj = { name: 'JP' } + +jsonfile.writeFileSync(file, obj, { spaces: 2, finalEOL: false }) +``` + +**appending to an existing JSON file:** + +You can use `fs.writeFileSync` option `{ flag: 'a' }` to achieve this. + +```js +const jsonfile = require('jsonfile') + +const file = '/tmp/mayAlreadyExistedData.json' +const obj = { name: 'JP' } + +jsonfile.writeFileSync(file, obj, { flag: 'a' }) +``` + +License +------- + +(MIT License) + +Copyright 2012-2016, JP Richardson <jprichardson@gmail.com> diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/jsonfile/index.js b/desktop/node_modules/@electron/osx-sign/node_modules/jsonfile/index.js new file mode 100644 index 0000000..0582868 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/jsonfile/index.js @@ -0,0 +1,88 @@ +let _fs +try { + _fs = require('graceful-fs') +} catch (_) { + _fs = require('fs') +} +const universalify = require('universalify') +const { stringify, stripBom } = require('./utils') + +async function _readFile (file, options = {}) { + if (typeof options === 'string') { + options = { encoding: options } + } + + const fs = options.fs || _fs + + const shouldThrow = 'throws' in options ? options.throws : true + + let data = await universalify.fromCallback(fs.readFile)(file, options) + + data = stripBom(data) + + let obj + try { + obj = JSON.parse(data, options ? options.reviver : null) + } catch (err) { + if (shouldThrow) { + err.message = `${file}: ${err.message}` + throw err + } else { + return null + } + } + + return obj +} + +const readFile = universalify.fromPromise(_readFile) + +function readFileSync (file, options = {}) { + if (typeof options === 'string') { + options = { encoding: options } + } + + const fs = options.fs || _fs + + const shouldThrow = 'throws' in options ? options.throws : true + + try { + let content = fs.readFileSync(file, options) + content = stripBom(content) + return JSON.parse(content, options.reviver) + } catch (err) { + if (shouldThrow) { + err.message = `${file}: ${err.message}` + throw err + } else { + return null + } + } +} + +async function _writeFile (file, obj, options = {}) { + const fs = options.fs || _fs + + const str = stringify(obj, options) + + await universalify.fromCallback(fs.writeFile)(file, str, options) +} + +const writeFile = universalify.fromPromise(_writeFile) + +function writeFileSync (file, obj, options = {}) { + const fs = options.fs || _fs + + const str = stringify(obj, options) + // not sure if fs.writeFileSync returns anything, but just in case + return fs.writeFileSync(file, str, options) +} + +const jsonfile = { + readFile, + readFileSync, + writeFile, + writeFileSync +} + +module.exports = jsonfile diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/jsonfile/package.json b/desktop/node_modules/@electron/osx-sign/node_modules/jsonfile/package.json new file mode 100644 index 0000000..4d01eb1 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/jsonfile/package.json @@ -0,0 +1,40 @@ +{ + "name": "jsonfile", + "version": "6.1.0", + "description": "Easily read/write JSON files.", + "repository": { + "type": "git", + "url": "git@github.com:jprichardson/node-jsonfile.git" + }, + "keywords": [ + "read", + "write", + "file", + "json", + "fs", + "fs-extra" + ], + "author": "JP Richardson <jprichardson@gmail.com>", + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + }, + "devDependencies": { + "mocha": "^8.2.0", + "rimraf": "^2.4.0", + "standard": "^16.0.1" + }, + "main": "index.js", + "files": [ + "index.js", + "utils.js" + ], + "scripts": { + "lint": "standard", + "test": "npm run lint && npm run unit", + "unit": "mocha" + } +} diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/jsonfile/utils.js b/desktop/node_modules/@electron/osx-sign/node_modules/jsonfile/utils.js new file mode 100644 index 0000000..b5ff48e --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/jsonfile/utils.js @@ -0,0 +1,14 @@ +function stringify (obj, { EOL = '\n', finalEOL = true, replacer = null, spaces } = {}) { + const EOF = finalEOL ? EOL : '' + const str = JSON.stringify(obj, replacer, spaces) + + return str.replace(/\n/g, EOL) + EOF +} + +function stripBom (content) { + // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified + if (Buffer.isBuffer(content)) content = content.toString('utf8') + return content.replace(/^\uFEFF/, '') +} + +module.exports = { stringify, stripBom } diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/universalify/LICENSE b/desktop/node_modules/@electron/osx-sign/node_modules/universalify/LICENSE new file mode 100644 index 0000000..514e84e --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/universalify/LICENSE @@ -0,0 +1,20 @@ +(The MIT License) + +Copyright (c) 2017, Ryan Zimmerman <opensrc@ryanzim.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the 'Software'), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/universalify/README.md b/desktop/node_modules/@electron/osx-sign/node_modules/universalify/README.md new file mode 100644 index 0000000..aa12474 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/universalify/README.md @@ -0,0 +1,76 @@ +# universalify + +[![Travis branch](https://img.shields.io/travis/RyanZim/universalify/master.svg)](https://travis-ci.org/RyanZim/universalify) +![Coveralls github branch](https://img.shields.io/coveralls/github/RyanZim/universalify/master.svg) +![npm](https://img.shields.io/npm/dm/universalify.svg) +![npm](https://img.shields.io/npm/l/universalify.svg) + +Make a callback- or promise-based function support both promises and callbacks. + +Uses the native promise implementation. + +## Installation + +```bash +npm install universalify +``` + +## API + +### `universalify.fromCallback(fn)` + +Takes a callback-based function to universalify, and returns the universalified function. + +Function must take a callback as the last parameter that will be called with the signature `(error, result)`. `universalify` does not support calling the callback with three or more arguments, and does not ensure that the callback is only called once. + +```js +function callbackFn (n, cb) { + setTimeout(() => cb(null, n), 15) +} + +const fn = universalify.fromCallback(callbackFn) + +// Works with Promises: +fn('Hello World!') +.then(result => console.log(result)) // -> Hello World! +.catch(error => console.error(error)) + +// Works with Callbacks: +fn('Hi!', (error, result) => { + if (error) return console.error(error) + console.log(result) + // -> Hi! +}) +``` + +### `universalify.fromPromise(fn)` + +Takes a promise-based function to universalify, and returns the universalified function. + +Function must return a valid JS promise. `universalify` does not ensure that a valid promise is returned. + +```js +function promiseFn (n) { + return new Promise(resolve => { + setTimeout(() => resolve(n), 15) + }) +} + +const fn = universalify.fromPromise(promiseFn) + +// Works with Promises: +fn('Hello World!') +.then(result => console.log(result)) // -> Hello World! +.catch(error => console.error(error)) + +// Works with Callbacks: +fn('Hi!', (error, result) => { + if (error) return console.error(error) + console.log(result) + // -> Hi! +}) +``` + +## License + +MIT diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/universalify/index.js b/desktop/node_modules/@electron/osx-sign/node_modules/universalify/index.js new file mode 100644 index 0000000..ba6c662 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/universalify/index.js @@ -0,0 +1,24 @@ +'use strict' + +exports.fromCallback = function (fn) { + return Object.defineProperty(function (...args) { + if (typeof args[args.length - 1] === 'function') fn.apply(this, args) + else { + return new Promise((resolve, reject) => { + fn.call( + this, + ...args, + (err, res) => (err != null) ? reject(err) : resolve(res) + ) + }) + } + }, 'name', { value: fn.name }) +} + +exports.fromPromise = function (fn) { + return Object.defineProperty(function (...args) { + const cb = args[args.length - 1] + if (typeof cb !== 'function') return fn.apply(this, args) + else fn.apply(this, args.slice(0, -1)).then(r => cb(null, r), cb) + }, 'name', { value: fn.name }) +} diff --git a/desktop/node_modules/@electron/osx-sign/node_modules/universalify/package.json b/desktop/node_modules/@electron/osx-sign/node_modules/universalify/package.json new file mode 100644 index 0000000..006d4cc --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/node_modules/universalify/package.json @@ -0,0 +1,34 @@ +{ + "name": "universalify", + "version": "2.0.0", + "description": "Make a callback- or promise-based function support both promises and callbacks.", + "keywords": [ + "callback", + "native", + "promise" + ], + "homepage": "https://github.com/RyanZim/universalify#readme", + "bugs": "https://github.com/RyanZim/universalify/issues", + "license": "MIT", + "author": "Ryan Zimmerman <opensrc@ryanzim.com>", + "files": [ + "index.js" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/RyanZim/universalify.git" + }, + "scripts": { + "test": "standard && nyc tape test/*.js | colortape" + }, + "devDependencies": { + "colortape": "^0.1.2", + "coveralls": "^3.0.1", + "nyc": "^15.0.0", + "standard": "^14.3.1", + "tape": "^5.0.1" + }, + "engines": { + "node": ">= 10.0.0" + } +} diff --git a/desktop/node_modules/@electron/osx-sign/package.json b/desktop/node_modules/@electron/osx-sign/package.json new file mode 100644 index 0000000..c7e4d44 --- /dev/null +++ b/desktop/node_modules/@electron/osx-sign/package.json @@ -0,0 +1,76 @@ +{ + "name": "@electron/osx-sign", + "version": "1.0.5", + "description": "Codesign Electron macOS apps", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "files": [ + "dist", + "entitlements", + "README.md", + "LICENSE", + "bin" + ], + "bin": { + "electron-osx-flat": "bin/electron-osx-flat.js", + "electron-osx-sign": "bin/electron-osx-sign.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/electron/osx-sign.git" + }, + "author": "electron", + "license": "BSD-2-Clause", + "bugs": { + "url": "https://github.com/electron/osx-sign/issues" + }, + "homepage": "https://github.com/electron/osx-sign", + "dependencies": { + "compare-version": "^0.1.2", + "debug": "^4.3.4", + "fs-extra": "^10.0.0", + "isbinaryfile": "^4.0.8", + "minimist": "^1.2.6", + "plist": "^3.0.5" + }, + "devDependencies": { + "@continuous-auth/semantic-release-npm": "^3.0.0", + "@electron/get": "^2.0.2", + "@types/compare-version": "^0.1.31", + "@types/debug": "^4.1.7", + "@types/fs-extra": "^9.0.13", + "@types/node": "^16.11.6", + "@types/plist": "^3.0.2", + "@typescript-eslint/eslint-plugin": "^5.45.0", + "@typescript-eslint/parser": "^5.45.0", + "eslint": "^8.29.0", + "eslint-config-eslint": "^7.0.0", + "eslint-config-standard": "^17.0.0", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^6.1.1", + "extract-zip": "^2.0.1", + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2", + "run-series": "^1.1.9", + "run-waterfall": "^1.1.7", + "standard": "^17.0.0", + "tape": "^4.7.1", + "typescript": "^4.9.3" + }, + "scripts": { + "build": "tsc && tsc -p tsconfig.esm.json", + "lint": "eslint --ext .ts,.js src bin test", + "pretest": "rimraf test/work", + "test": "yarn lint && tape test", + "prepublishOnly": "yarn build" + }, + "standard": { + "ignore": [ + "test/work" + ] + }, + "engines": { + "node": ">=12.0.0" + } +} |