@electron/notarize
Advanced tools
@@ -1,2 +0,2 @@ | ||
| import { NotaryToolNotarizeAppOptions } from './types'; | ||
| import { NotaryToolNotarizeAppOptions } from './types.js'; | ||
| export declare function checkSignatures(opts: NotaryToolNotarizeAppOptions): Promise<void>; |
+30
-71
@@ -1,80 +0,39 @@ | ||
| "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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
| function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
| return new (P || (P = Promise))(function (resolve, reject) { | ||
| function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
| function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
| function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
| step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
| }); | ||
| }; | ||
| var __importDefault = (this && this.__importDefault) || function (mod) { | ||
| return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
| }; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.checkSignatures = void 0; | ||
| const path = __importStar(require("path")); | ||
| const spawn_1 = require("./spawn"); | ||
| const debug_1 = __importDefault(require("debug")); | ||
| const d = (0, debug_1.default)('electron-notarize'); | ||
| const codesignDisplay = (opts) => __awaiter(void 0, void 0, void 0, function* () { | ||
| const result = yield (0, spawn_1.spawn)('codesign', ['-dv', '-vvvv', '--deep', path.basename(opts.appPath)], { | ||
| import * as path from 'path'; | ||
| import { spawn } from './spawn.js'; | ||
| import debug from 'debug'; | ||
| const d = debug('electron-notarize'); | ||
| const codesignDisplay = async (opts) => { | ||
| const result = await spawn('codesign', ['-dv', '-vvvv', '--deep', path.basename(opts.appPath)], { | ||
| cwd: path.dirname(opts.appPath), | ||
| }); | ||
| return result; | ||
| }); | ||
| const codesign = (opts) => __awaiter(void 0, void 0, void 0, function* () { | ||
| }; | ||
| const codesign = async (opts) => { | ||
| d('attempting to check codesign of app:', opts.appPath); | ||
| const result = yield (0, spawn_1.spawn)('codesign', ['-vvv', '--deep', '--strict', path.basename(opts.appPath)], { | ||
| const result = await spawn('codesign', ['-vvv', '--deep', '--strict', path.basename(opts.appPath)], { | ||
| cwd: path.dirname(opts.appPath), | ||
| }); | ||
| return result; | ||
| }); | ||
| function checkSignatures(opts) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| const fileExt = path.extname(opts.appPath); | ||
| if (fileExt === '.dmg' || fileExt === '.pkg') { | ||
| d('skipping codesign check for dmg or pkg file'); | ||
| return; | ||
| } | ||
| const [codesignResult, codesignInfo] = yield Promise.all([codesign(opts), codesignDisplay(opts)]); | ||
| let error = ''; | ||
| if (codesignInfo.code !== 0) { | ||
| d('codesignInfo failed'); | ||
| error = `Failed to display codesign info on your application with code: ${codesignInfo.code}\n\n${codesignInfo.output}\n`; | ||
| } | ||
| if (codesignResult.code !== 0) { | ||
| d('codesign check failed'); | ||
| error += `Failed to codesign your application with code: ${codesignResult.code}\n\n${codesignResult.output}\n\n${codesignInfo.output}`; | ||
| } | ||
| if (error) { | ||
| throw new Error(error); | ||
| } | ||
| d('codesign assess succeeded'); | ||
| }); | ||
| }; | ||
| export async function checkSignatures(opts) { | ||
| const fileExt = path.extname(opts.appPath); | ||
| if (fileExt === '.dmg' || fileExt === '.pkg') { | ||
| d('skipping codesign check for dmg or pkg file'); | ||
| return; | ||
| } | ||
| const [codesignResult, codesignInfo] = await Promise.all([codesign(opts), codesignDisplay(opts)]); | ||
| let error = ''; | ||
| if (codesignInfo.code !== 0) { | ||
| d('codesignInfo failed'); | ||
| error = `Failed to display codesign info on your application with code: ${codesignInfo.code}\n\n${codesignInfo.output}\n`; | ||
| } | ||
| if (codesignResult.code !== 0) { | ||
| d('codesign check failed'); | ||
| error += `Failed to codesign your application with code: ${codesignResult.code}\n\n${codesignResult.output}\n\n${codesignInfo.output}`; | ||
| } | ||
| if (error) { | ||
| throw new Error(error); | ||
| } | ||
| d('codesign assess succeeded'); | ||
| } | ||
| exports.checkSignatures = checkSignatures; | ||
| //# sourceMappingURL=check-signature.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"check-signature.js","sourceRoot":"","sources":["../src/check-signature.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAE7B,mCAAgC;AAEhC,kDAA0B;AAC1B,MAAM,CAAC,GAAG,IAAA,eAAK,EAAC,mBAAmB,CAAC,CAAC;AAErC,MAAM,eAAe,GAAG,CAAO,IAAkC,EAAE,EAAE;IACnE,MAAM,MAAM,GAAG,MAAM,IAAA,aAAK,EAAC,UAAU,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE;QAC9F,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC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C;IACtE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3C,IAAI,OAAO,KAAK,MAAM,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QAC7C,CAAC,CAAC,6CAA6C,CAAC,CAAC;QACjD,OAAO;IACT,CAAC;IACD,MAAM,CAAC,cAAc,EAAE,YAAY,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClG,IAAI,KAAK,GAAG,EAAE,CAAC;IAEf,IAAI,YAAY,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QAC5B,CAAC,CAAC,qBAAqB,CAAC,CAAC;QACzB,KAAK,GAAG,kEAAkE,YAAY,CAAC,IAAI,OAAO,YAAY,CAAC,MAAM,IAAI,CAAC;IAC5H,CAAC;IACD,IAAI,cAAc,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QAC9B,CAAC,CAAC,uBAAuB,CAAC,CAAC;QAC3B,KAAK,IAAI,kDAAkD,cAAc,CAAC,IAAI,OAAO,cAAc,CAAC,MAAM,OAAO,YAAY,CAAC,MAAM,EAAE,CAAC;IACzI,CAAC;IAED,IAAI,KAAK,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IACD,CAAC,CAAC,2BAA2B,CAAC,CAAC;AACjC,CAAC"} |
+27
-70
@@ -1,64 +0,25 @@ | ||
| "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]; } }; | ||
| import debug from 'debug'; | ||
| import * as fs from 'graceful-fs'; | ||
| import * as os from 'node:os'; | ||
| import * as path from 'node:path'; | ||
| import * as util from 'node:util'; | ||
| const d = debug('electron-notarize:helpers'); | ||
| export async function withTempDir(fn) { | ||
| const dir = await util.promisify(fs.mkdtemp)(path.resolve(os.tmpdir(), 'electron-notarize-')); | ||
| d('doing work inside temp dir:', dir); | ||
| let result; | ||
| try { | ||
| result = await fn(dir); | ||
| } | ||
| 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); | ||
| catch (err) { | ||
| d('work failed'); | ||
| await util.promisify(fs.rm)(dir, { recursive: true, force: true }); | ||
| throw err; | ||
| } | ||
| d('work succeeded'); | ||
| await util.promisify(fs.rm)(dir, { recursive: true, force: true }); | ||
| return result; | ||
| }; | ||
| var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
| function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
| return new (P || (P = Promise))(function (resolve, reject) { | ||
| function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
| function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
| function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
| step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
| }); | ||
| }; | ||
| var __importDefault = (this && this.__importDefault) || function (mod) { | ||
| return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
| }; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.delay = exports.parseNotarizationInfo = exports.isSecret = exports.makeSecret = exports.withTempDir = void 0; | ||
| const debug_1 = __importDefault(require("debug")); | ||
| const fs = __importStar(require("fs-extra")); | ||
| const os = __importStar(require("os")); | ||
| const path = __importStar(require("path")); | ||
| const d = (0, debug_1.default)('electron-notarize:helpers'); | ||
| function withTempDir(fn) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| const dir = yield fs.mkdtemp(path.resolve(os.tmpdir(), 'electron-notarize-')); | ||
| d('doing work inside temp dir:', dir); | ||
| let result; | ||
| try { | ||
| result = yield fn(dir); | ||
| } | ||
| catch (err) { | ||
| d('work failed'); | ||
| yield fs.remove(dir); | ||
| throw err; | ||
| } | ||
| d('work succeeded'); | ||
| yield fs.remove(dir); | ||
| return result; | ||
| }); | ||
| } | ||
| exports.withTempDir = withTempDir; | ||
| class Secret { | ||
| value; | ||
| constructor(value) { | ||
@@ -74,11 +35,9 @@ this.value = value; | ||
| } | ||
| function makeSecret(s) { | ||
| export function makeSecret(s) { | ||
| return new Secret(s); | ||
| } | ||
| exports.makeSecret = makeSecret; | ||
| function isSecret(s) { | ||
| export function isSecret(s) { | ||
| return s instanceof Secret; | ||
| } | ||
| exports.isSecret = isSecret; | ||
| function parseNotarizationInfo(info) { | ||
| export function parseNotarizationInfo(info) { | ||
| const out = {}; | ||
@@ -92,6 +51,6 @@ const matchToProperty = (key, r, modifier) => { | ||
| matchToProperty('uuid', /\n *RequestUUID: (.+?)\n/); | ||
| matchToProperty('date', /\n *Date: (.+?)\n/, d => new Date(d)); | ||
| matchToProperty('date', /\n *Date: (.+?)\n/, (d) => new Date(d)); | ||
| matchToProperty('status', /\n *Status: (.+?)\n/); | ||
| matchToProperty('logFileUrl', /\n *LogFileURL: (.+?)\n/); | ||
| matchToProperty('statusCode', /\n *Status Code: (.+?)\n/, n => parseInt(n, 10)); | ||
| matchToProperty('statusCode', /\n *Status Code: (.+?)\n/, (n) => parseInt(n, 10)); | ||
| matchToProperty('statusMessage', /\n *Status Message: (.+?)\n/); | ||
@@ -103,7 +62,5 @@ if (out.logFileUrl === '(null)') { | ||
| } | ||
| exports.parseNotarizationInfo = parseNotarizationInfo; | ||
| function delay(ms) { | ||
| return new Promise(resolve => setTimeout(resolve, ms)); | ||
| export function delay(ms) { | ||
| return new Promise((resolve) => setTimeout(resolve, ms)); | ||
| } | ||
| exports.delay = delay; | ||
| //# sourceMappingURL=helpers.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,6CAA+B;AAC/B,uCAAyB;AACzB,2CAA6B;AAE7B,MAAM,CAAC,GAAG,IAAA,eAAK,EAAC,2BAA2B,CAAC,CAAC;AAE7C,SAAsB,WAAW,CAAI,EAA+B;;QAClE,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,oBAAoB,CAAC,CAAC,CAAC;QAC9E,CAAC,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;QACtC,IAAI,MAAS,CAAC;QACd,IAAI;YACF,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC;SACxB;QAAC,OAAO,GAAG,EAAE;YACZ,CAAC,CAAC,aAAa,CAAC,CAAC;YACjB,MAAM,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACrB,MAAM,GAAG,CAAC;SACX;QACD,CAAC,CAAC,gBAAgB,CAAC,CAAC;QACpB,MAAM,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACrB,OAAO,MAAM,CAAC;IAChB,CAAC;CAAA;AAdD,kCAcC;AAED,MAAM,MAAM;IACV,YAAoB,KAAa;QAAb,UAAK,GAAL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Y,EAAE,yBAAyB,CAAC,CAAC;IACzD,eAAe,CAAC,YAAY,EAAE,0BAA0B,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAQ,CAAC,CAAC;IACzF,eAAe,CAAC,eAAe,EAAE,6BAA6B,CAAC,CAAC;IAEhE,IAAI,GAAG,CAAC,UAAU,KAAK,QAAQ,EAAE,CAAC;QAChC,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC;IACxB,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,EAAU;IAC9B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC"} |
+3
-7
@@ -1,4 +0,4 @@ | ||
| import { NotarizeOptions, NotarizeOptionsLegacy, NotarizeOptionsNotaryTool } from './types'; | ||
| import { NotarizeOptions } from './types.js'; | ||
| export { NotarizeOptions }; | ||
| export { validateNotaryToolAuthorizationArgs as validateAuthorizationArgs } from './validate-args'; | ||
| export { validateNotaryToolAuthorizationArgs as validateAuthorizationArgs } from './validate-args.js'; | ||
| /** | ||
@@ -15,7 +15,3 @@ * Sends your app to Apple for notarization with `notarytool` and staples a successful | ||
| */ | ||
| declare function notarize(args: NotarizeOptionsNotaryTool): Promise<void>; | ||
| /** | ||
| * @deprecated | ||
| */ | ||
| declare function notarize(args: NotarizeOptionsLegacy): Promise<void>; | ||
| declare function notarize(args: NotarizeOptions): Promise<void>; | ||
| export { notarize }; |
+19
-49
@@ -1,53 +0,23 @@ | ||
| "use strict"; | ||
| var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
| function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
| return new (P || (P = Promise))(function (resolve, reject) { | ||
| function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
| function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
| function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
| step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
| import debug from 'debug'; | ||
| import retry from 'promise-retry'; | ||
| import { checkSignatures } from './check-signature.js'; | ||
| import { isNotaryToolAvailable, notarizeAndWaitForNotaryTool } from './notarytool.js'; | ||
| import { stapleApp } from './staple.js'; | ||
| const d = debug('electron-notarize'); | ||
| export { validateNotaryToolAuthorizationArgs as validateAuthorizationArgs } from './validate-args.js'; | ||
| async function notarize({ appPath, ...otherOptions }) { | ||
| await checkSignatures({ appPath }); | ||
| d('notarizing using notarytool'); | ||
| if (!(await isNotaryToolAvailable())) { | ||
| throw new Error('notarytool is not available, you must be on at least Xcode 13 or provide notarytoolPath'); | ||
| } | ||
| await notarizeAndWaitForNotaryTool({ | ||
| appPath, | ||
| ...otherOptions, | ||
| }); | ||
| }; | ||
| var __rest = (this && this.__rest) || function (s, e) { | ||
| var t = {}; | ||
| for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
| t[p] = s[p]; | ||
| if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
| for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
| if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
| t[p[i]] = s[p[i]]; | ||
| } | ||
| return t; | ||
| }; | ||
| var __importDefault = (this && this.__importDefault) || function (mod) { | ||
| return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
| }; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.notarize = exports.validateAuthorizationArgs = void 0; | ||
| const debug_1 = __importDefault(require("debug")); | ||
| const promise_retry_1 = __importDefault(require("promise-retry")); | ||
| const check_signature_1 = require("./check-signature"); | ||
| const notarytool_1 = require("./notarytool"); | ||
| const staple_1 = require("./staple"); | ||
| const d = (0, debug_1.default)('electron-notarize'); | ||
| var validate_args_1 = require("./validate-args"); | ||
| Object.defineProperty(exports, "validateAuthorizationArgs", { enumerable: true, get: function () { return validate_args_1.validateNotaryToolAuthorizationArgs; } }); | ||
| function notarize(_a) { | ||
| var { appPath } = _a, otherOptions = __rest(_a, ["appPath"]); | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| if (otherOptions.tool === 'legacy') { | ||
| throw new Error('Notarization with the legacy altool system was decommisioned as of November 2023'); | ||
| } | ||
| yield (0, check_signature_1.checkSignatures)({ appPath }); | ||
| d('notarizing using notarytool'); | ||
| if (!(yield (0, notarytool_1.isNotaryToolAvailable)())) { | ||
| throw new Error('notarytool is not available, you must be on at least Xcode 13 or provide notarytoolPath'); | ||
| } | ||
| yield (0, notarytool_1.notarizeAndWaitForNotaryTool)(Object.assign({ appPath }, otherOptions)); | ||
| yield (0, promise_retry_1.default)(() => (0, staple_1.stapleApp)({ appPath }), { | ||
| retries: 3, | ||
| }); | ||
| await retry(() => stapleApp({ appPath }), { | ||
| retries: 3, | ||
| }); | ||
| } | ||
| exports.notarize = notarize; | ||
| export { notarize }; | ||
| //# sourceMappingURL=index.js.map |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,kEAAkC;AAElC,uDAAoD;AACpD,6CAAmF;AACnF,qCAAqC;AAQrC,MAAM,CAAC,GAAG,IAAA,eAAK,EAAC,mBAAmB,CAAC,CAAC;AAIrC,iDAAmG;AAA1F,0HAAA,mCAAmC,OAA6B;AAmBzE,SAAe,QAAQ,CAAC,EAA6C;QAA7C,EAAE,OAAO,OAAoC,EAA/B,YAAY,cAA1B,WAA4B,CAAF;;QAChD,IAAI,YAAY,CAAC,IAAI,KAAK,QAAQ,EAAE;YAClC,MAAM,IAAI,KAAK,CACb,kFAAkF,CACnF,CAAC;SACH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CAAC,CAAC;IAEtB,MAAM,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE;QACxC,OAAO,EAAE,CAAC;KACX,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"} |
@@ -1,3 +0,3 @@ | ||
| import { NotaryToolStartOptions } from './types'; | ||
| import { NotarizeOptions } from './types.js'; | ||
| export declare function isNotaryToolAvailable(notarytoolPath?: string): Promise<boolean>; | ||
| export declare function notarizeAndWaitForNotaryTool(opts: NotaryToolStartOptions): Promise<void>; | ||
| export declare function notarizeAndWaitForNotaryTool(opts: NotarizeOptions): Promise<void>; |
+81
-127
@@ -1,70 +0,32 @@ | ||
| "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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
| function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
| return new (P || (P = Promise))(function (resolve, reject) { | ||
| function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
| function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
| function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
| step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
| }); | ||
| }; | ||
| var __importDefault = (this && this.__importDefault) || function (mod) { | ||
| return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
| }; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.notarizeAndWaitForNotaryTool = exports.isNotaryToolAvailable = void 0; | ||
| const debug_1 = __importDefault(require("debug")); | ||
| const path = __importStar(require("path")); | ||
| const spawn_1 = require("./spawn"); | ||
| const helpers_1 = require("./helpers"); | ||
| const validate_args_1 = require("./validate-args"); | ||
| const d = (0, debug_1.default)('electron-notarize:notarytool'); | ||
| import debug from 'debug'; | ||
| import path from 'node:path'; | ||
| import { spawn } from './spawn.js'; | ||
| import { makeSecret, withTempDir } from './helpers.js'; | ||
| import { validateNotaryToolAuthorizationArgs, isNotaryToolPasswordCredentials, isNotaryToolApiKeyCredentials, } from './validate-args.js'; | ||
| const d = debug('electron-notarize:notarytool'); | ||
| function runNotaryTool(args, notarytoolPath) { | ||
| const useXcrun = notarytoolPath === undefined; | ||
| const cmd = useXcrun ? 'xcrun' : notarytoolPath; | ||
| return (0, spawn_1.spawn)(cmd, useXcrun ? ['notarytool', ...args] : args); | ||
| return spawn(cmd, useXcrun ? ['notarytool', ...args] : args); | ||
| } | ||
| function authorizationArgs(rawOpts) { | ||
| const opts = (0, validate_args_1.validateNotaryToolAuthorizationArgs)(rawOpts); | ||
| if ((0, validate_args_1.isNotaryToolPasswordCredentials)(opts)) { | ||
| const opts = validateNotaryToolAuthorizationArgs(rawOpts); | ||
| if (isNotaryToolPasswordCredentials(opts)) { | ||
| return [ | ||
| '--apple-id', | ||
| (0, helpers_1.makeSecret)(opts.appleId), | ||
| makeSecret(opts.appleId), | ||
| '--password', | ||
| (0, helpers_1.makeSecret)(opts.appleIdPassword), | ||
| makeSecret(opts.appleIdPassword), | ||
| '--team-id', | ||
| (0, helpers_1.makeSecret)(opts.teamId), | ||
| makeSecret(opts.teamId), | ||
| ]; | ||
| } | ||
| else if ((0, validate_args_1.isNotaryToolApiKeyCredentials)(opts)) { | ||
| else if (isNotaryToolApiKeyCredentials(opts)) { | ||
| return [ | ||
| '--key', | ||
| (0, helpers_1.makeSecret)(opts.appleApiKey), | ||
| makeSecret(opts.appleApiKey), | ||
| '--key-id', | ||
| (0, helpers_1.makeSecret)(opts.appleApiKeyId), | ||
| makeSecret(opts.appleApiKeyId), | ||
| '--issuer', | ||
| (0, helpers_1.makeSecret)(opts.appleApiIssuer), | ||
| makeSecret(opts.appleApiIssuer), | ||
| ]; | ||
@@ -80,82 +42,74 @@ } | ||
| } | ||
| function getNotarizationLogs(opts, id) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| async function getNotarizationLogs(opts, id) { | ||
| try { | ||
| const logResult = await runNotaryTool(['log', id, ...authorizationArgs(opts)], opts.notarytoolPath); | ||
| d('notarization log', logResult.output); | ||
| return logResult.output; | ||
| } | ||
| catch (e) { | ||
| d('failed to pull notarization logs', e); | ||
| } | ||
| } | ||
| export async function isNotaryToolAvailable(notarytoolPath) { | ||
| if (notarytoolPath !== undefined) { | ||
| const result = await spawn(notarytoolPath, ['--version']); | ||
| return result.code === 0; | ||
| } | ||
| else { | ||
| const result = await spawn('xcrun', ['--find', 'notarytool']); | ||
| return result.code === 0; | ||
| } | ||
| } | ||
| export async function notarizeAndWaitForNotaryTool(opts) { | ||
| d('starting notarize process for app:', opts.appPath); | ||
| return await withTempDir(async (dir) => { | ||
| const fileExt = path.extname(opts.appPath); | ||
| let filePath; | ||
| if (fileExt === '.dmg' || fileExt === '.pkg') { | ||
| filePath = path.resolve(dir, opts.appPath); | ||
| d('attempting to upload file to Apple: ', filePath); | ||
| } | ||
| else { | ||
| filePath = path.resolve(dir, `${path.parse(opts.appPath).name}.zip`); | ||
| d('zipping application to:', filePath); | ||
| const zipResult = await spawn('ditto', ['-c', '-k', '--sequesterRsrc', '--keepParent', path.basename(opts.appPath), filePath], { | ||
| cwd: path.dirname(opts.appPath), | ||
| }); | ||
| if (zipResult.code !== 0) { | ||
| throw new Error(`Failed to zip application, exited with code: ${zipResult.code}\n\n${zipResult.output}`); | ||
| } | ||
| d('zip succeeded, attempting to upload to Apple'); | ||
| } | ||
| const notarizeArgs = [ | ||
| 'submit', | ||
| filePath, | ||
| ...authorizationArgs(opts), | ||
| '--wait', | ||
| '--output-format', | ||
| 'json', | ||
| ]; | ||
| const result = await runNotaryTool(notarizeArgs, opts.notarytoolPath); | ||
| const rawOut = result.output.trim(); | ||
| let parsed; | ||
| try { | ||
| const logResult = yield runNotaryTool(['log', id, ...authorizationArgs(opts)], opts.notarytoolPath); | ||
| d('notarization log', logResult.output); | ||
| return logResult.output; | ||
| parsed = JSON.parse(rawOut); | ||
| } | ||
| catch (e) { | ||
| d('failed to pull notarization logs', e); | ||
| catch (err) { | ||
| throw new Error(`Failed to notarize via notarytool. Failed with unexpected result: \n\n${rawOut}`); | ||
| } | ||
| }); | ||
| } | ||
| function isNotaryToolAvailable(notarytoolPath) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| if (notarytoolPath !== undefined) { | ||
| const result = yield (0, spawn_1.spawn)(notarytoolPath, ['--version']); | ||
| return result.code === 0; | ||
| let logOutput; | ||
| if (typeof parsed.id === 'string') { | ||
| logOutput = await getNotarizationLogs(opts, parsed.id); | ||
| } | ||
| else { | ||
| const result = yield (0, spawn_1.spawn)('xcrun', ['--find', 'notarytool']); | ||
| return result.code === 0; | ||
| if (result.code === 0 && parsed.status === 'Accepted') { | ||
| d(`notarization success (id: ${parsed.id})`); | ||
| return; | ||
| } | ||
| let message = `Failed to notarize via notarytool\n\n${result.output}`; | ||
| if (logOutput) { | ||
| message += `\n\nDiagnostics from notarytool log: ${logOutput}`; | ||
| } | ||
| throw new Error(message); | ||
| }); | ||
| } | ||
| exports.isNotaryToolAvailable = isNotaryToolAvailable; | ||
| function notarizeAndWaitForNotaryTool(opts) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| d('starting notarize process for app:', opts.appPath); | ||
| return yield (0, helpers_1.withTempDir)((dir) => __awaiter(this, void 0, void 0, function* () { | ||
| const fileExt = path.extname(opts.appPath); | ||
| let filePath; | ||
| if (fileExt === '.dmg' || fileExt === '.pkg') { | ||
| filePath = path.resolve(dir, opts.appPath); | ||
| d('attempting to upload file to Apple: ', filePath); | ||
| } | ||
| else { | ||
| filePath = path.resolve(dir, `${path.parse(opts.appPath).name}.zip`); | ||
| d('zipping application to:', filePath); | ||
| const zipResult = yield (0, spawn_1.spawn)('ditto', ['-c', '-k', '--sequesterRsrc', '--keepParent', path.basename(opts.appPath), filePath], { | ||
| cwd: path.dirname(opts.appPath), | ||
| }); | ||
| if (zipResult.code !== 0) { | ||
| throw new Error(`Failed to zip application, exited with code: ${zipResult.code}\n\n${zipResult.output}`); | ||
| } | ||
| d('zip succeeded, attempting to upload to Apple'); | ||
| } | ||
| const notarizeArgs = [ | ||
| 'submit', | ||
| filePath, | ||
| ...authorizationArgs(opts), | ||
| '--wait', | ||
| '--output-format', | ||
| 'json', | ||
| ]; | ||
| const result = yield runNotaryTool(notarizeArgs, opts.notarytoolPath); | ||
| const rawOut = result.output.trim(); | ||
| let parsed; | ||
| try { | ||
| parsed = JSON.parse(rawOut); | ||
| } | ||
| catch (err) { | ||
| throw new Error(`Failed to notarize via notarytool. Failed with unexpected result: \n\n${rawOut}`); | ||
| } | ||
| let logOutput; | ||
| if (typeof parsed.id === 'string') { | ||
| logOutput = yield getNotarizationLogs(opts, parsed.id); | ||
| } | ||
| if (result.code === 0 && parsed.status === 'Accepted') { | ||
| d(`notarization success (id: ${parsed.id})`); | ||
| return; | ||
| } | ||
| let message = `Failed to notarize via notarytool\n\n${result.output}`; | ||
| if (logOutput) { | ||
| message += `\n\nDiagnostics from notarytool log: ${logOutput}`; | ||
| } | ||
| throw new Error(message); | ||
| })); | ||
| }); | ||
| } | ||
| exports.notarizeAndWaitForNotaryTool = notarizeAndWaitForNotaryTool; | ||
| //# sourceMappingURL=notarytool.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"notarytool.js","sourceRoot":"","sources":["../src/notarytool.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,2CAA6B;AAE7B,mCAAgC;AAChC,uCAAoD;AACpD,mDAIyB;AAGzB,MAAM,CAAC,GAAG,IAAA,eAAK,EAAC,8BAA8B,CAAC,CAAC;AAEhD,SAAS,aAAa,CAAC,IAAc,EAAE,cAAuB;IAC5D,MAAM,QAAQ,GAAG,cAAc,KAAK,SAAS,CAAC;IAC9C,MAAM,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC;IAChD,OAAO,IAAA,aAAK,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAC/D,CAAC;AAED,SAAS,iBAAiB,CAAC,OAA8B;IACvD,MAAM,IAAI,GAAG,IAAA,mDAAmC,EAAC,OAAO,CAAC,CAAC;IAC1D,IAAI,IAAA,+CAA+B,EAAC,IAAI,CAAC,EAAE;QACzC,OAAO;YACL,YAAY;YACZ,IAAA,oBAAU,EAAC,IAAI,CAAC,OAAO,CAAC;YACxB,YAAY;YACZ,IAAA,oBAAU,EAAC,IAAI,CAAC,eAAe,CAAC;YAChC,WAAW;YACX,IAAA,oBAAU,EAAC,IAAI,CAAC,MAAM,CAAC;SACxB,CAAC;KACH;SAAM,IAAI,IAAA,6CAA6B,EAAC,IAAI,CAAC,EAAE;QAC9C,OAAO;YACL,OAAO;YACP,IAAA,oBAAU,EAAC,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AAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC9B,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CACb,0EAA0E,MAAM,EAAE,CACnF,CAAC;QACJ,CAAC;QAED,IAAI,SAA6B,CAAC;QAClC,IAAI,OAAO,MAAM,CAAC,EAAE,KAAK,QAAQ,EAAE,CAAC;YAClC,SAAS,GAAG,MAAM,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;QACzD,CAAC;QAED,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;YACtD,CAAC,CAAC,6BAA6B,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC;YAC7C,OAAO;QACT,CAAC;QAED,IAAI,OAAO,GAAG,wCAAwC,MAAM,CAAC,MAAM,EAAE,CAAC;QACtE,IAAI,SAAS,EAAE,CAAC;YACd,OAAO,IAAI,wCAAwC,SAAS,EAAE,CAAC;QACjE,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;AACL,CAAC"} |
+2
-1
@@ -1,2 +0,3 @@ | ||
| import { SpawnOptions } from 'child_process'; | ||
| /// <reference types="node" resolution-mode="require"/> | ||
| import { SpawnOptions } from 'node:child_process'; | ||
| export interface SpawnResult { | ||
@@ -3,0 +4,0 @@ code: number | null; |
+9
-16
@@ -1,14 +0,8 @@ | ||
| "use strict"; | ||
| var __importDefault = (this && this.__importDefault) || function (mod) { | ||
| return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
| }; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.spawn = void 0; | ||
| const child_process_1 = require("child_process"); | ||
| const debug_1 = __importDefault(require("debug")); | ||
| const helpers_1 = require("./helpers"); | ||
| const d = (0, debug_1.default)('electron-notarize:spawn'); | ||
| const spawn = (cmd, args = [], opts = {}) => { | ||
| d('spawning cmd:', cmd, 'args:', args.map(arg => ((0, helpers_1.isSecret)(arg) ? '*********' : arg)), 'opts:', opts); | ||
| const child = (0, child_process_1.spawn)(cmd, args, opts); | ||
| import { spawn as cpSpawn } from 'node:child_process'; | ||
| import debug from 'debug'; | ||
| import { isSecret } from './helpers.js'; | ||
| const d = debug('electron-notarize:spawn'); | ||
| export const spawn = (cmd, args = [], opts = {}) => { | ||
| d('spawning cmd:', cmd, 'args:', args.map((arg) => (isSecret(arg) ? '*********' : arg)), 'opts:', opts); | ||
| const child = cpSpawn(cmd, args, opts); | ||
| const out = []; | ||
@@ -19,6 +13,6 @@ const dataHandler = (data) => out.push(data.toString()); | ||
| return new Promise((resolve, reject) => { | ||
| child.on('error', err => { | ||
| child.on('error', (err) => { | ||
| reject(err); | ||
| }); | ||
| child.on('exit', code => { | ||
| child.on('exit', (code) => { | ||
| d(`cmd ${cmd} terminated with code: ${code}`); | ||
@@ -32,3 +26,2 @@ resolve({ | ||
| }; | ||
| exports.spawn = spawn; | ||
| //# sourceMappingURL=spawn.js.map |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"spawn.js","sourceRoot":"","sources":["../src/spawn.ts"],"names":[],"mappings":";;;;;;AAAA,iDAA+D;AAC/D,kDAA0B;AAC1B,uCAAqC;AAErC,MAAM,CAAC,GAAG,IAAA,eAAK,EAAC,yBAAyB,CAAC,CAAC;AAOpC,MAAM,KAAK,GAAG,CACnB,GAAW,EACX,OAAiB,EAAE,EACnB,OAAqB,EAAE,EACD,EAAE;IACxB,CAAC,CACC,eAAe,EACf,GAAG,EACH,OAAO,EACP,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,IAAA,kBAAQ,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EACpD,OAAO,EACP,IAAI,CACL,CAAC;IACF,MAAM,KAAK,GAAG,IAAA,qBAAO,EAAC,GAAG,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ACf,GAAG,EACH,OAAO,EACP,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EACtD,OAAO,EACP,IAAI,CACL,CAAC;IACF,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACvC,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAChE,KAAK,CAAC,MAAO,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACtC,KAAK,CAAC,MAAO,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACtC,OAAO,IAAI,OAAO,CAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAClD,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YACxB,MAAM,CAAC,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;YACxB,CAAC,CAAC,OAAO,GAAG,0BAA0B,IAAI,EAAE,CAAC,CAAC;YAC9C,OAAO,CAAC;gBACN,IAAI;gBACJ,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;aACrB,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"} |
+1
-1
@@ -1,2 +0,2 @@ | ||
| import { NotaryToolNotarizeAppOptions } from './types'; | ||
| import { NotaryToolNotarizeAppOptions } from './types.js'; | ||
| export declare function stapleApp(opts: NotaryToolNotarizeAppOptions): Promise<void>; |
+13
-54
@@ -1,57 +0,16 @@ | ||
| "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]; } }; | ||
| import debug from 'debug'; | ||
| import * as path from 'path'; | ||
| import { spawn } from './spawn.js'; | ||
| const d = debug('electron-notarize:staple'); | ||
| export async function stapleApp(opts) { | ||
| d('attempting to staple app:', opts.appPath); | ||
| const result = await spawn('xcrun', ['stapler', 'staple', '-v', path.basename(opts.appPath)], { | ||
| cwd: path.dirname(opts.appPath), | ||
| }); | ||
| if (result.code !== 0) { | ||
| throw new Error(`Failed to staple your application with code: ${result.code}\n\n${result.output}`); | ||
| } | ||
| 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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
| function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
| return new (P || (P = Promise))(function (resolve, reject) { | ||
| function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
| function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
| function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
| step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
| }); | ||
| }; | ||
| var __importDefault = (this && this.__importDefault) || function (mod) { | ||
| return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
| }; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.stapleApp = void 0; | ||
| const debug_1 = __importDefault(require("debug")); | ||
| const path = __importStar(require("path")); | ||
| const spawn_1 = require("./spawn"); | ||
| const d = (0, debug_1.default)('electron-notarize:staple'); | ||
| function stapleApp(opts) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| d('attempting to staple app:', opts.appPath); | ||
| const result = yield (0, spawn_1.spawn)('xcrun', ['stapler', 'staple', '-v', path.basename(opts.appPath)], { | ||
| cwd: path.dirname(opts.appPath), | ||
| }); | ||
| if (result.code !== 0) { | ||
| throw new Error(`Failed to staple your application with code: ${result.code}\n\n${result.output}`); | ||
| } | ||
| d('staple succeeded'); | ||
| return; | ||
| }); | ||
| d('staple succeeded'); | ||
| return; | ||
| } | ||
| exports.stapleApp = stapleApp; | ||
| //# sourceMappingURL=staple.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"staple.js","sourceRoot":"","sources":["../src/staple.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,2CAA6B;AAE7B,mCAAgC;AAGhC,MAAM,CAAC,GAAG,IAAA,eAAK,EAAC,0BAA0B,CAAC,CAAC;AAE5C,SAAsB,SAAS,CAAC,IAAkC;;QAChE,CAAC,CAAC,2BAA2B,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7C,MAAM,MAAM,GAAG,MAAM,IAAA,aAAK,EAAC,OAAO,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE;YAC5F,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;SAChC,CAAC,CAAC;QAEH,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC,EAAE;YACrB,MAAM,IAAI,KAAK,CACb,gDAAgD,MAAM,CAAC,IAAI,OAAO,MAAM,CAAC,MAAM,EAAE,CAClF,CAAC;SACH;QAED,CAAC,CAAC,kBAAkB,CAAC,CAAC;QACtB,OAAO;IACT,CAAC;CAAA;AAdD,8BAcC"} | ||
| {"version":3,"file":"staple.js","sourceRoot":"","sources":["../src/staple.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGnC,MAAM,CAAC,GAAG,KAAK,CAAC,0BAA0B,CAAC,CAAC;AAE5C,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,IAAkC;IAChE,CAAC,CAAC,2BAA2B,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE;QAC5F,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;KAChC,CAAC,CAAC;IAEH,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CACb,gDAAgD,MAAM,CAAC,IAAI,OAAO,MAAM,CAAC,MAAM,EAAE,CAClF,CAAC;IACJ,CAAC;IAED,CAAC,CAAC,kBAAkB,CAAC,CAAC;IACtB,OAAO;AACT,CAAC"} |
+1
-74
| /** | ||
| * @deprecated This interface was used for Apple's `altool`, which was sunset in 2023 and no longer works. | ||
| * @category Legacy | ||
| */ | ||
| export interface LegacyNotarizePasswordCredentials { | ||
| appleId: string; | ||
| appleIdPassword: string; | ||
| } | ||
| /** | ||
| * You can generate an [app-specific password](https://support.apple.com/en-us/102654) for your Apple ID | ||
@@ -38,10 +30,2 @@ * to notarize your Electron applications. | ||
| /** | ||
| * @deprecated This interface was used for Apple's `altool`, which was sunset in 2023 and no longer works. | ||
| * @category Legacy | ||
| */ | ||
| export interface LegacyNotarizeApiKeyCredentials { | ||
| appleApiKey: string; | ||
| appleApiIssuer: string; | ||
| } | ||
| /** | ||
| * Credentials required for JSON Web Token (JWT) notarization using App Store Connect API keys. | ||
@@ -90,7 +74,2 @@ * | ||
| /** | ||
| * @deprecated This interface was used for Apple's `altool`, which was sunset in 2023 and no longer works. | ||
| * @category Legacy | ||
| */ | ||
| export type LegacyNotarizeCredentials = LegacyNotarizePasswordCredentials | LegacyNotarizeApiKeyCredentials; | ||
| /** | ||
| * Credential options for authenticating `notarytool`. There are three valid stategies available: | ||
@@ -105,10 +84,2 @@ * | ||
| /** | ||
| * @deprecated This interface was used for Apple's `altool`, which was sunset in 2023 and no longer works. | ||
| * @category Legacy | ||
| */ | ||
| export interface LegacyNotarizeAppOptions { | ||
| appPath: string; | ||
| appBundleId: string; | ||
| } | ||
| /** | ||
| * Non-credential options for notarizing your application with `notarytool`. | ||
@@ -125,49 +96,5 @@ * @category Core | ||
| /** | ||
| * @deprecated This interface was used for Apple's `altool`, which was sunset in 2023 and no longer works. | ||
| * @category Legacy | ||
| */ | ||
| interface TransporterOptions { | ||
| ascProvider?: string; | ||
| } | ||
| /** | ||
| * @deprecated This interface was used for Apple's `altool`, which was sunset in 2023 and no longer works. | ||
| * @category Legacy | ||
| */ | ||
| interface NotarizeResult { | ||
| uuid: string; | ||
| } | ||
| /** | ||
| * @deprecated This type was used for Apple's `altool`, which was sunset in 2023 and no longer works. | ||
| * @category Legacy | ||
| */ | ||
| export type LegacyNotarizeStartOptions = LegacyNotarizeAppOptions & LegacyNotarizeCredentials & TransporterOptions; | ||
| /** | ||
| * @deprecated This type was used for Apple's `altool`, which was sunset in 2023 and no longer works. | ||
| * @category Legacy | ||
| */ | ||
| export type LegacyNotarizeWaitOptions = NotarizeResult & LegacyNotarizeCredentials; | ||
| /** | ||
| * @deprecated This type was used for Apple's `altool`, which was sunset in 2023 and no longer works. | ||
| * @category Legacy | ||
| */ | ||
| export type NotarizeOptionsLegacy = { | ||
| tool: 'legacy'; | ||
| } & LegacyNotarizeStartOptions; | ||
| /** | ||
| * Options for notarizing your Electron app with `notarytool`. | ||
| * @category Core | ||
| */ | ||
| export type NotaryToolStartOptions = NotaryToolNotarizeAppOptions & NotaryToolCredentials; | ||
| /** | ||
| * Helper type that specifies that `@electron/notarize` is using the `notarytool` strategy. | ||
| * @category Utility Types | ||
| */ | ||
| export type NotarizeOptionsNotaryTool = { | ||
| tool?: 'notarytool'; | ||
| } & NotaryToolStartOptions; | ||
| /** | ||
| * Options accepted by the `notarize` method. | ||
| * @internal | ||
| */ | ||
| export type NotarizeOptions = NotarizeOptionsLegacy | NotarizeOptionsNotaryTool; | ||
| export {}; | ||
| export type NotarizeOptions = NotaryToolNotarizeAppOptions & NotaryToolCredentials; |
+1
-2
@@ -1,3 +0,2 @@ | ||
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| export {}; | ||
| //# sourceMappingURL=types.js.map |
@@ -1,8 +0,2 @@ | ||
| import { LegacyNotarizeApiKeyCredentials, LegacyNotarizeCredentials, LegacyNotarizePasswordCredentials, NotaryToolApiKeyCredentials, NotaryToolCredentials, NotaryToolKeychainCredentials, NotaryToolPasswordCredentials } from './types'; | ||
| /** @deprecated */ | ||
| export declare function isLegacyPasswordCredentials(opts: LegacyNotarizeCredentials): opts is LegacyNotarizePasswordCredentials; | ||
| /** @deprecated */ | ||
| export declare function isLegacyApiKeyCredentials(opts: LegacyNotarizeCredentials): opts is LegacyNotarizeApiKeyCredentials; | ||
| /** @deprecated */ | ||
| export declare function validateLegacyAuthorizationArgs(opts: LegacyNotarizeCredentials): LegacyNotarizeCredentials; | ||
| import { NotaryToolApiKeyCredentials, NotaryToolCredentials, NotaryToolKeychainCredentials, NotaryToolPasswordCredentials } from './types.js'; | ||
| export declare function isNotaryToolPasswordCredentials(opts: NotaryToolCredentials): opts is NotaryToolPasswordCredentials; | ||
@@ -9,0 +3,0 @@ export declare function isNotaryToolApiKeyCredentials(opts: NotaryToolCredentials): opts is NotaryToolApiKeyCredentials; |
+4
-53
@@ -1,52 +0,6 @@ | ||
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.validateNotaryToolAuthorizationArgs = exports.isNotaryToolKeychainCredentials = exports.isNotaryToolApiKeyCredentials = exports.isNotaryToolPasswordCredentials = exports.validateLegacyAuthorizationArgs = exports.isLegacyApiKeyCredentials = exports.isLegacyPasswordCredentials = void 0; | ||
| /** @deprecated */ | ||
| function isLegacyPasswordCredentials(opts) { | ||
| export function isNotaryToolPasswordCredentials(opts) { | ||
| const creds = opts; | ||
| return creds.appleId !== undefined || creds.appleIdPassword !== undefined; | ||
| } | ||
| exports.isLegacyPasswordCredentials = isLegacyPasswordCredentials; | ||
| /** @deprecated */ | ||
| function isLegacyApiKeyCredentials(opts) { | ||
| const creds = opts; | ||
| return creds.appleApiKey !== undefined || creds.appleApiIssuer !== undefined; | ||
| } | ||
| exports.isLegacyApiKeyCredentials = isLegacyApiKeyCredentials; | ||
| /** @deprecated */ | ||
| function validateLegacyAuthorizationArgs(opts) { | ||
| const isPassword = isLegacyPasswordCredentials(opts); | ||
| const isApiKey = isLegacyApiKeyCredentials(opts); | ||
| if (isPassword && isApiKey) { | ||
| throw new Error('Cannot use both password credentials and API key credentials at once'); | ||
| } | ||
| if (isPassword) { | ||
| const passwordCreds = opts; | ||
| if (!passwordCreds.appleId) { | ||
| throw new Error('The appleId property is required when using notarization with appleIdPassword'); | ||
| } | ||
| else if (!passwordCreds.appleIdPassword) { | ||
| throw new Error('The appleIdPassword property is required when using notarization with appleId'); | ||
| } | ||
| return passwordCreds; | ||
| } | ||
| if (isApiKey) { | ||
| const apiKeyCreds = opts; | ||
| if (!apiKeyCreds.appleApiKey) { | ||
| throw new Error('The appleApiKey property is required when using notarization with appleApiIssuer'); | ||
| } | ||
| else if (!apiKeyCreds.appleApiIssuer) { | ||
| throw new Error('The appleApiIssuer property is required when using notarization with appleApiKey'); | ||
| } | ||
| return apiKeyCreds; | ||
| } | ||
| throw new Error('No authentication properties provided (e.g. appleId, appleApiKey)'); | ||
| } | ||
| exports.validateLegacyAuthorizationArgs = validateLegacyAuthorizationArgs; | ||
| function isNotaryToolPasswordCredentials(opts) { | ||
| const creds = opts; | ||
| return (creds.appleId !== undefined || creds.appleIdPassword !== undefined || creds.teamId !== undefined); | ||
| } | ||
| exports.isNotaryToolPasswordCredentials = isNotaryToolPasswordCredentials; | ||
| function isNotaryToolApiKeyCredentials(opts) { | ||
| export function isNotaryToolApiKeyCredentials(opts) { | ||
| const creds = opts; | ||
@@ -57,12 +11,10 @@ return (creds.appleApiIssuer !== undefined || | ||
| } | ||
| exports.isNotaryToolApiKeyCredentials = isNotaryToolApiKeyCredentials; | ||
| function isNotaryToolKeychainCredentials(opts) { | ||
| export function isNotaryToolKeychainCredentials(opts) { | ||
| const creds = opts; | ||
| return creds.keychain !== undefined || creds.keychainProfile !== undefined; | ||
| } | ||
| exports.isNotaryToolKeychainCredentials = isNotaryToolKeychainCredentials; | ||
| /** | ||
| * @internal | ||
| */ | ||
| function validateNotaryToolAuthorizationArgs(opts) { | ||
| export function validateNotaryToolAuthorizationArgs(opts) { | ||
| const isPassword = isNotaryToolPasswordCredentials(opts); | ||
@@ -109,3 +61,2 @@ const isApiKey = isNotaryToolApiKeyCredentials(opts); | ||
| } | ||
| exports.validateNotaryToolAuthorizationArgs = validateNotaryToolAuthorizationArgs; | ||
| //# sourceMappingURL=validate-args.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"validate-args.js","sourceRoot":"","sources":["../src/validate-args.ts"],"names":[],"mappings":";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I,UAAU,EAAE;QACd,MAAM,aAAa,GAAG,IAAqC,CAAC;QAC5D,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE;YAC1B,MAAM,IAAI,KAAK,CACb,oFAAoF,CACrF,CAAC;SACH;aAAM,IAAI,CAAC,aAAa,CAAC,eAAe,EAAE;YACzC,MAAM,IAAI,KAAK,CACb,4FAA4F,CAC7F,CAAC;SACH;aAAM,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE;YAChC,MAAM,IAAI,KAAK,CACb,mFAAmF,CACpF,CAAC;SACH;QACD,OAAO,aAAa,CAAC;KACtB;IACD,IAAI,QAAQ,EAAE;QACZ,MAAM,WAAW,GAAG,IAAmC,CAAC;QACxD,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE;YAC5B,MAAM,IAAI,KAAK,CACb,mFAAmF,CACpF,CAAC;SACH;aAAM,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE;YACtC,MAAM,IAAI,KAAK,CACb,sFAAsF,CACvF,CAAC;SACH;aAAM,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE;YACrC,MAAM,IAAI,KAAK,CACb,qFAAqF,CACtF,CAAC;SACH;QACD,OAAO,WAAW,CAAC;KACpB;IACD,IAAI,UAAU,EAAE;QACd,MAAM,aAAa,GAAG,IAAqC,CAAC;QAC5D,IAAI,CAAC,aAAa,CAAC,eAAe,EAAE;YAClC,MAAM,IAAI,KAAK,CACb,4FAA4F,CAC7F,CAAC;SACH;QACD,OAAO,aAAa,CAAC;KACtB;IACD,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAC;AACjG,CAAC;AAvDD,kFAuDC"} | ||
| {"version":3,"file":"validate-args.js","sourceRoot":"","sources":["../src/validate-args.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,+BAA+B,CAC7C,IAA2B;IAE3B,MAAM,KAAK,GAAG,IAAqC,CAAC;IACpD,OAAO,CACL,KAAK,CAAC,OAAO,KAAK,SAAS,IAAI,KAAK,CAAC,e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;YAC1C,MAAM,IAAI,KAAK,CACb,4FAA4F,CAC7F,CAAC;QACJ,CAAC;aAAM,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CACb,mFAAmF,CACpF,CAAC;QACJ,CAAC;QACD,OAAO,aAAa,CAAC;IACvB,CAAC;IACD,IAAI,QAAQ,EAAE,CAAC;QACb,MAAM,WAAW,GAAG,IAAmC,CAAC;QACxD,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CACb,mFAAmF,CACpF,CAAC;QACJ,CAAC;aAAM,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC;YACvC,MAAM,IAAI,KAAK,CACb,sFAAsF,CACvF,CAAC;QACJ,CAAC;aAAM,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC;YACtC,MAAM,IAAI,KAAK,CACb,qFAAqF,CACtF,CAAC;QACJ,CAAC;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,IAAI,UAAU,EAAE,CAAC;QACf,MAAM,aAAa,GAAG,IAAqC,CAAC;QAC5D,IAAI,CAAC,aAAa,CAAC,eAAe,EAAE,CAAC;YACnC,MAAM,IAAI,KAAK,CACb,4FAA4F,CAC7F,CAAC;QACJ,CAAC;QACD,OAAO,aAAa,CAAC;IACvB,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAC;AACjG,CAAC"} |
+19
-14
| { | ||
| "name": "@electron/notarize", | ||
| "version": "2.5.0", | ||
| "version": "3.0.0", | ||
| "description": "Notarize your Electron app", | ||
| "main": "lib/index.js", | ||
| "type": "module", | ||
| "exports": "./lib/index.js", | ||
| "typings": "lib/index.d.ts", | ||
@@ -19,5 +20,7 @@ "author": "Samuel Attard", | ||
| "build": "tsc", | ||
| "build:docs": "npx typedoc", | ||
| "lint": "prettier --check \"src/**/*.ts\"", | ||
| "prettier:write": "prettier --write \"src/**/*.ts\"", | ||
| "prepare": "yarn build", | ||
| "test": "jest" | ||
| "test": "vitest run" | ||
| }, | ||
@@ -28,22 +31,24 @@ "files": [ | ||
| "engines": { | ||
| "node": ">= 10.0.0" | ||
| "node": ">= 22.12.0" | ||
| }, | ||
| "publishConfig": { | ||
| "provenance": true | ||
| }, | ||
| "devDependencies": { | ||
| "@types/debug": "^4.1.5", | ||
| "@types/fs-extra": "^9.0.1", | ||
| "@types/jest": "^29.0.0", | ||
| "@types/node": "^13.7.7", | ||
| "@tsconfig/node22": "^22.0.0", | ||
| "@types/debug": "^4.1.12", | ||
| "@types/graceful-fs": "^4.1.9", | ||
| "@types/node": "~22.10.7", | ||
| "@types/promise-retry": "^1.1.3", | ||
| "jest": "^29.0.0", | ||
| "prettier": "^1.18.2", | ||
| "ts-jest": "^29.0.0", | ||
| "prettier": "^3.4.2", | ||
| "typedoc": "~0.25.13", | ||
| "typedoc-plugin-missing-exports": "^2.2.0", | ||
| "typescript": "4.9.3" | ||
| "typescript": "~5.4.5", | ||
| "vitest": "^3.0.8" | ||
| }, | ||
| "dependencies": { | ||
| "debug": "^4.1.1", | ||
| "fs-extra": "^9.0.1", | ||
| "debug": "^4.4.0", | ||
| "graceful-fs": "^4.2.11", | ||
| "promise-retry": "^2.0.1" | ||
| } | ||
| } |
+7
-8
@@ -6,3 +6,3 @@ Electron Notarize | ||
| [](https://circleci.com/gh/electron/notarize) | ||
| [](https://github.com/electron/notarize/actions/workflows/test.yml) | ||
| [](https://npm.im/@electron/notarize) | ||
@@ -44,9 +44,3 @@ | ||
| ### Notarization on older macOS versions | ||
| Xcode 13 is available from macOS 11.3, but notarization can be performed on systems down to macOS 10.15 | ||
| (see [TN3147](https://developer.apple.com/documentation/technotes/tn3147-migrating-to-the-latest-notarization-tool#Enable-notarization-on-an-older-version-of-macOS) for more information). | ||
| To achieve this, you can copy notarytool binary from a newer macOS version and provide its path as `notarytoolPath` option. | ||
| ## API | ||
@@ -56,3 +50,3 @@ | ||
| * `appPath` — the absolute path to your codesigned and packaged Electron application. | ||
| * `notarytoolPath` - String (optional) - Path of the notarytool binary ([more details](#notarization-on-older-macos-versions)) | ||
| * `notarytoolPath` - String (optional) - Path to a custom notarytool binary ([more details](#custom-notarytool)) | ||
| * additional options required for authenticating your Apple ID (see below) | ||
@@ -161,2 +155,7 @@ | ||
| ``` | ||
| ### Custom notarytool | ||
| You can provide a path to a custom `notarytool`. This module allows this option to enable unique edge cases - but this use case is _explicitly unsupported_. | ||
| ## Troubleshooting | ||
@@ -163,0 +162,0 @@ |
| import { LegacyNotarizeStartOptions, LegacyNotarizeWaitOptions } from './types'; | ||
| /** @deprecated */ | ||
| export declare function startLegacyNotarize(opts: LegacyNotarizeStartOptions): Promise<never>; | ||
| /** @deprecated */ | ||
| export declare function waitForLegacyNotarize(opts: LegacyNotarizeWaitOptions): Promise<never>; |
| "use strict"; | ||
| var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
| function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
| return new (P || (P = Promise))(function (resolve, reject) { | ||
| function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
| function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
| function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
| step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
| }); | ||
| }; | ||
| var __importDefault = (this && this.__importDefault) || function (mod) { | ||
| return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
| }; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.waitForLegacyNotarize = exports.startLegacyNotarize = void 0; | ||
| const debug_1 = __importDefault(require("debug")); | ||
| const d = (0, debug_1.default)('electron-notarize:legacy'); | ||
| /** @deprecated */ | ||
| function startLegacyNotarize(opts) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| d('starting notarize process for app:', opts.appPath); | ||
| throw new Error('Cannot start notarization. Legacy notarization (altool) is no longer available'); | ||
| }); | ||
| } | ||
| exports.startLegacyNotarize = startLegacyNotarize; | ||
| /** @deprecated */ | ||
| function waitForLegacyNotarize(opts) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| throw new Error('Cannot wait for notarization. Legacy notarization (altool) is no longer available'); | ||
| }); | ||
| } | ||
| exports.waitForLegacyNotarize = waitForLegacyNotarize; | ||
| //# sourceMappingURL=legacy.js.map |
| {"version":3,"file":"legacy.js","sourceRoot":"","sources":["../src/legacy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAA0B;AAI1B,MAAM,CAAC,GAAG,IAAA,eAAK,EAAC,0BAA0B,CAAC,CAAC;AAE5C,kBAAkB;AAClB,SAAsB,mBAAmB,CAAC,IAAgC;;QACxE,CAAC,CAAC,oCAAoC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACtD,MAAM,IAAI,KAAK,CAAC,gFAAgF,CAAC,CAAC;IACpG,CAAC;CAAA;AAHD,kDAGC;AAED,kBAAkB;AAClB,SAAsB,qBAAqB,CAAC,IAA+B;;QACzE,MAAM,IAAI,KAAK,CACb,mFAAmF,CACpF,CAAC;IACJ,CAAC;CAAA;AAJD,sDAIC"} |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
10
-9.09%Yes
NaN41765
-32.67%27
-10%481
-44%190
-0.52%+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
Updated