diff options
Diffstat (limited to 'desktop/node_modules/@electron/notarize/lib')
24 files changed, 615 insertions, 0 deletions
diff --git a/desktop/node_modules/@electron/notarize/lib/helpers.d.ts b/desktop/node_modules/@electron/notarize/lib/helpers.d.ts new file mode 100644 index 0000000..774dc2e --- /dev/null +++ b/desktop/node_modules/@electron/notarize/lib/helpers.d.ts @@ -0,0 +1,13 @@ +export declare function withTempDir<T>(fn: (dir: string) => Promise<T>): Promise<T>; +export declare function makeSecret(s: string): string; +export declare function isSecret(s: string): boolean; +export interface NotarizationInfo { + uuid: string; + date: Date; + status: 'invalid' | 'in progress' | 'success'; + logFileUrl: string | null; + statusCode?: 0 | 2; + statusMessage?: string; +} +export declare function parseNotarizationInfo(info: string): NotarizationInfo; +export declare function delay(ms: number): Promise<void>; diff --git a/desktop/node_modules/@electron/notarize/lib/helpers.js b/desktop/node_modules/@electron/notarize/lib/helpers.js new file mode 100644 index 0000000..875894f --- /dev/null +++ b/desktop/node_modules/@electron/notarize/lib/helpers.js @@ -0,0 +1,79 @@ +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()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.delay = exports.parseNotarizationInfo = exports.isSecret = exports.makeSecret = exports.withTempDir = void 0; +const debug = require("debug"); +const fs = require("fs-extra"); +const os = require("os"); +const path = require("path"); +const d = debug('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 { + constructor(value) { + this.value = value; + } + toString() { + return this.value; + } + inspect() { + return '******'; + } +} +function makeSecret(s) { + return new Secret(s); +} +exports.makeSecret = makeSecret; +function isSecret(s) { + return s instanceof Secret; +} +exports.isSecret = isSecret; +function parseNotarizationInfo(info) { + const out = {}; + const matchToProperty = (key, r, modifier) => { + const exec = r.exec(info); + if (exec) { + out[key] = modifier ? modifier(exec[1]) : exec[1]; + } + }; + matchToProperty('uuid', /\n *RequestUUID: (.+?)\n/); + 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('statusMessage', /\n *Status Message: (.+?)\n/); + if (out.logFileUrl === '(null)') { + out.logFileUrl = null; + } + return out; +} +exports.parseNotarizationInfo = parseNotarizationInfo; +function delay(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); +} +exports.delay = delay; +//# sourceMappingURL=helpers.js.map
\ No newline at end of file diff --git a/desktop/node_modules/@electron/notarize/lib/helpers.js.map b/desktop/node_modules/@electron/notarize/lib/helpers.js.map new file mode 100644 index 0000000..4e58fa3 --- /dev/null +++ b/desktop/node_modules/@electron/notarize/lib/helpers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+BAA+B;AAC/B,+BAA+B;AAC/B,yBAAyB;AACzB,6BAA6B;AAE7B,MAAM,CAAC,GAAG,KAAK,CAAC,2BAA2B,CAAC,CAAC;AAE7C,SAAsB,WAAW,CAAI,EAA+B;;QAClE,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,OAAO,CAA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,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACnD;IACH,CAAC,CAAC;IACF,eAAe,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC;IACpD,eAAe,CAAC,MAAM,EAAE,mBAAmB,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/D,eAAe,CAAC,QAAQ,EAAE,qBAAqB,CAAC,CAAC;IACjD,eAAe,CAAC,YAAY,EAAE,yBAAyB,CAAC,CAAC;IACzD,eAAe,CAAC,YAAY,EAAE,0BAA0B,EAAE,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAQ,CAAC,CAAC;IACvF,eAAe,CAAC,eAAe,EAAE,6BAA6B,CAAC,CAAC;IAEhE,IAAI,GAAG,CAAC,UAAU,KAAK,QAAQ,EAAE;QAC/B,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC;KACvB;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAxBD,sDAwBC;AAED,SAAgB,KAAK,CAAC,EAAU;IAC9B,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AACzD,CAAC;AAFD,sBAEC"}
\ No newline at end of file diff --git a/desktop/node_modules/@electron/notarize/lib/index.d.ts b/desktop/node_modules/@electron/notarize/lib/index.d.ts new file mode 100644 index 0000000..b013467 --- /dev/null +++ b/desktop/node_modules/@electron/notarize/lib/index.d.ts @@ -0,0 +1,4 @@ +import { NotarizeOptions } from './types'; +export { NotarizeOptions }; +export { validateLegacyAuthorizationArgs as validateAuthorizationArgs } from './validate-args'; +export declare function notarize({ appPath, ...otherOptions }: NotarizeOptions): Promise<void>; diff --git a/desktop/node_modules/@electron/notarize/lib/index.js b/desktop/node_modules/@electron/notarize/lib/index.js new file mode 100644 index 0000000..7951823 --- /dev/null +++ b/desktop/node_modules/@electron/notarize/lib/index.js @@ -0,0 +1,63 @@ +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 __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; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.notarize = exports.validateAuthorizationArgs = void 0; +const debug = require("debug"); +const helpers_1 = require("./helpers"); +const legacy_1 = require("./legacy"); +const notarytool_1 = require("./notarytool"); +const staple_1 = require("./staple"); +const d = debug('electron-notarize'); +var validate_args_1 = require("./validate-args"); +Object.defineProperty(exports, "validateAuthorizationArgs", { enumerable: true, get: function () { return validate_args_1.validateLegacyAuthorizationArgs; } }); +function notarize(_a) { + var { appPath } = _a, otherOptions = __rest(_a, ["appPath"]); + return __awaiter(this, void 0, void 0, function* () { + if (otherOptions.tool === 'notarytool') { + d('notarizing using the new notarytool system'); + if (!(yield (0, notarytool_1.isNotaryToolAvailable)())) { + throw new Error('notarytool is not available, you must be on at least Xcode 13'); + } + yield (0, notarytool_1.notarizeAndWaitForNotaryTool)(Object.assign({ appPath }, otherOptions)); + } + else { + console.warn('Notarizing using the legacy altool system. The altool system will be disabled on November 1 2023. Please switch to the notarytool system before then.'); + console.warn('You can do this by setting "tool: notarytool" in your "@electron/notarize" options. Please note that the credentials options may be slightly different between tools.'); + d('notarizing using the legacy notarization system, this will be slow'); + const { uuid } = yield (0, legacy_1.startLegacyNotarize)(Object.assign({ appPath }, otherOptions)); + /** + * Wait for Apples API to initialize the status UUID + * + * If we start checking too quickly the UUID is not ready yet + * and this step will fail. It takes Apple a number of minutes + * to actually complete the job so an extra 10 second delay here + * is not a big deal + */ + d('notarization started, waiting for 10 seconds before pinging Apple for status'); + yield (0, helpers_1.delay)(10000); + d('starting to poll for notarization status'); + yield (0, legacy_1.waitForLegacyNotarize)(Object.assign({ uuid }, otherOptions)); + } + yield (0, staple_1.stapleApp)({ appPath }); + }); +} +exports.notarize = notarize; +//# sourceMappingURL=index.js.map
\ No newline at end of file diff --git a/desktop/node_modules/@electron/notarize/lib/index.js.map b/desktop/node_modules/@electron/notarize/lib/index.js.map new file mode 100644 index 0000000..51c2caa --- /dev/null +++ b/desktop/node_modules/@electron/notarize/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA+B;AAC/B,uCAAkC;AAClC,qCAAsE;AACtE,6CAAmF;AACnF,qCAAqC;AAGrC,MAAM,CAAC,GAAG,KAAK,CAAC,mBAAmB,CAAC,CAAC;AAIrC,iDAA+F;AAAtF,0HAAA,+BAA+B,OAA6B;AAErE,SAAsB,QAAQ,CAAC,EAA6C;QAA7C,EAAE,OAAO,OAAoC,EAA/B,YAAY,cAA1B,WAA4B,CAAF;;QACvD,IAAI,YAAY,CAAC,IAAI,KAAK,YAAY,EAAE;YACtC,CAAC,CAAC,4CAA4C,CAAC,CAAC;YAChD,IAAI,CAAC,CAAC,MAAM,IAAA,kCAAqB,GAAE,CAAC,EAAE;gBACpC,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;aAClF;YAED,MAAM,IAAA,yCAA4B,kBAChC,OAAO,IACJ,YAAY,EACf,CAAC;SACJ;aAAM;YACL,OAAO,CAAC,IAAI,CACV,uJAAuJ,CACxJ,CAAC;YACF,OAAO,CAAC,IAAI,CACV,uKAAuK,CACxK,CAAC;YACF,CAAC,CAAC,oEAAoE,CAAC,CAAC;YACxE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,4BAAmB,kBACxC,OAAO,IACJ,YAAY,EACf,CAAC;YACH;;;;;;;eAOG;YACH,CAAC,CAAC,8EAA8E,CAAC,CAAC;YAClF,MAAM,IAAA,eAAK,EAAC,KAAK,CAAC,CAAC;YACnB,CAAC,CAAC,0CAA0C,CAAC,CAAC;YAC9C,MAAM,IAAA,8BAAqB,kBAAG,IAAI,IAAK,YAAY,EAAG,CAAC;SACxD;QAED,MAAM,IAAA,kBAAS,EAAC,EAAE,OAAO,EAAE,CAAC,CAAC;;CAC9B;AAtCD,4BAsCC"}
\ No newline at end of file diff --git a/desktop/node_modules/@electron/notarize/lib/legacy.d.ts b/desktop/node_modules/@electron/notarize/lib/legacy.d.ts new file mode 100644 index 0000000..2534eaa --- /dev/null +++ b/desktop/node_modules/@electron/notarize/lib/legacy.d.ts @@ -0,0 +1,3 @@ +import { NotarizeResult, LegacyNotarizeStartOptions, LegacyNotarizeWaitOptions } from './types'; +export declare function startLegacyNotarize(opts: LegacyNotarizeStartOptions): Promise<NotarizeResult>; +export declare function waitForLegacyNotarize(opts: LegacyNotarizeWaitOptions): Promise<void>; diff --git a/desktop/node_modules/@electron/notarize/lib/legacy.js b/desktop/node_modules/@electron/notarize/lib/legacy.js new file mode 100644 index 0000000..48f28f7 --- /dev/null +++ b/desktop/node_modules/@electron/notarize/lib/legacy.js @@ -0,0 +1,116 @@ +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()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.waitForLegacyNotarize = exports.startLegacyNotarize = void 0; +const debug = require("debug"); +const path = require("path"); +const spawn_1 = require("./spawn"); +const helpers_1 = require("./helpers"); +const validate_args_1 = require("./validate-args"); +const d = debug('electron-notarize:legacy'); +function authorizationArgs(rawOpts) { + const opts = (0, validate_args_1.validateLegacyAuthorizationArgs)(rawOpts); + if ((0, validate_args_1.isLegacyPasswordCredentials)(opts)) { + return ['-u', (0, helpers_1.makeSecret)(opts.appleId), '-p', (0, helpers_1.makeSecret)(opts.appleIdPassword)]; + } + else { + return [ + '--apiKey', + (0, helpers_1.makeSecret)(opts.appleApiKey), + '--apiIssuer', + (0, helpers_1.makeSecret)(opts.appleApiIssuer), + ]; + } +} +function startLegacyNotarize(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 zipPath = path.resolve(dir, `${path.basename(opts.appPath, '.app')}.zip`); + d('zipping application to:', zipPath); + const zipResult = yield (0, spawn_1.spawn)('ditto', ['-c', '-k', '--sequesterRsrc', '--keepParent', path.basename(opts.appPath), zipPath], { + 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 = [ + 'altool', + '--notarize-app', + '-f', + zipPath, + '--primary-bundle-id', + opts.appBundleId, + ...authorizationArgs(opts), + ]; + if (opts.ascProvider) { + notarizeArgs.push('-itc_provider', opts.ascProvider); + } + const result = yield (0, spawn_1.spawn)('xcrun', notarizeArgs); + if (result.code !== 0) { + throw new Error(`Failed to upload app to Apple's notarization servers\n\n${result.output}`); + } + d('upload success'); + const uuidMatch = /\nRequestUUID = (.+?)\n/g.exec(result.output); + if (!uuidMatch) { + throw new Error(`Failed to find request UUID in output:\n\n${result.output}`); + } + d('found UUID:', uuidMatch[1]); + return { + uuid: uuidMatch[1], + }; + })); + }); +} +exports.startLegacyNotarize = startLegacyNotarize; +function waitForLegacyNotarize(opts) { + return __awaiter(this, void 0, void 0, function* () { + d('checking notarization status:', opts.uuid); + const result = yield (0, spawn_1.spawn)('xcrun', [ + 'altool', + '--notarization-info', + opts.uuid, + ...authorizationArgs(opts), + ]); + if (result.code !== 0) { + // These checks could fail for all sorts of reasons, including: + // * The status of a request isn't available as soon as the upload request returns, so + // it may just not be ready yet. + // * If using keychain password, user's mac went to sleep and keychain locked. + // * Regular old connectivity failure. + d(`Failed to check status of notarization request, retrying in 30 seconds: ${opts.uuid}\n\n${result.output}`); + yield (0, helpers_1.delay)(30000); + return waitForLegacyNotarize(opts); + } + const notarizationInfo = (0, helpers_1.parseNotarizationInfo)(result.output); + if (notarizationInfo.status === 'in progress') { + d('still in progress, waiting 30 seconds'); + yield (0, helpers_1.delay)(30000); + return waitForLegacyNotarize(opts); + } + d('notarzation done with info:', notarizationInfo); + if (notarizationInfo.status === 'invalid') { + d('notarization failed'); + throw new Error(`Apple failed to notarize your application, check the logs for more info + +Status Code: ${notarizationInfo.statusCode || 'No Code'} +Message: ${notarizationInfo.statusMessage || 'No Message'} +Logs: ${notarizationInfo.logFileUrl}`); + } + if (notarizationInfo.status !== 'success') { + throw new Error(`Unrecognized notarization status: "${notarizationInfo.status}"`); + } + d('notarization was successful'); + return; + }); +} +exports.waitForLegacyNotarize = waitForLegacyNotarize; +//# sourceMappingURL=legacy.js.map
\ No newline at end of file diff --git a/desktop/node_modules/@electron/notarize/lib/legacy.js.map b/desktop/node_modules/@electron/notarize/lib/legacy.js.map new file mode 100644 index 0000000..537c4a3 --- /dev/null +++ b/desktop/node_modules/@electron/notarize/lib/legacy.js.map @@ -0,0 +1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CAAC,CAAC,6BAA6B,CAAC,CAAC;QACjC,OAAO;IACT,CAAC;CAAA;AA7CD,sDA6CC"}
\ No newline at end of file diff --git a/desktop/node_modules/@electron/notarize/lib/notarytool.d.ts b/desktop/node_modules/@electron/notarize/lib/notarytool.d.ts new file mode 100644 index 0000000..7eab59d --- /dev/null +++ b/desktop/node_modules/@electron/notarize/lib/notarytool.d.ts @@ -0,0 +1,3 @@ +import { NotaryToolStartOptions } from './types'; +export declare function isNotaryToolAvailable(): Promise<boolean>; +export declare function notarizeAndWaitForNotaryTool(opts: NotaryToolStartOptions): Promise<void>; diff --git a/desktop/node_modules/@electron/notarize/lib/notarytool.js b/desktop/node_modules/@electron/notarize/lib/notarytool.js new file mode 100644 index 0000000..4a700e2 --- /dev/null +++ b/desktop/node_modules/@electron/notarize/lib/notarytool.js @@ -0,0 +1,101 @@ +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()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.notarizeAndWaitForNotaryTool = exports.isNotaryToolAvailable = void 0; +const debug = require("debug"); +const path = require("path"); +const spawn_1 = require("./spawn"); +const helpers_1 = require("./helpers"); +const validate_args_1 = require("./validate-args"); +const d = debug('electron-notarize:notarytool'); +function authorizationArgs(rawOpts) { + const opts = (0, validate_args_1.validateNotaryToolAuthorizationArgs)(rawOpts); + if ((0, validate_args_1.isNotaryToolPasswordCredentials)(opts)) { + return [ + '--apple-id', + (0, helpers_1.makeSecret)(opts.appleId), + '--password', + (0, helpers_1.makeSecret)(opts.appleIdPassword), + '--team-id', + (0, helpers_1.makeSecret)(opts.teamId), + ]; + } + else if ((0, validate_args_1.isNotaryToolApiKeyCredentials)(opts)) { + return [ + '--key', + (0, helpers_1.makeSecret)(opts.appleApiKey), + '--key-id', + (0, helpers_1.makeSecret)(opts.appleApiKeyId), + '--issuer', + (0, helpers_1.makeSecret)(opts.appleApiIssuer), + ]; + } + else { + // --keychain is optional -- when not specified, the iCloud keychain is used by notarytool + if (opts.keychain) { + return ['--keychain', opts.keychain, '--keychain-profile', opts.keychainProfile]; + } + return ['--keychain-profile', opts.keychainProfile]; + } +} +function isNotaryToolAvailable() { + return __awaiter(this, void 0, void 0, function* () { + const result = yield (0, spawn_1.spawn)('xcrun', ['--find', 'notarytool']); + return result.code === 0; + }); +} +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 zipPath = path.resolve(dir, `${path.parse(opts.appPath).name}.zip`); + d('zipping application to:', zipPath); + const zipResult = yield (0, spawn_1.spawn)('ditto', ['-c', '-k', '--sequesterRsrc', '--keepParent', path.basename(opts.appPath), zipPath], { + 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 = [ + 'notarytool', + 'submit', + zipPath, + ...authorizationArgs(opts), + '--wait', + '--output-format', + 'json', + ]; + const result = yield (0, spawn_1.spawn)('xcrun', notarizeArgs); + if (result.code !== 0) { + try { + const parsed = JSON.parse(result.output.trim()); + if (parsed && parsed.id) { + const logResult = yield (0, spawn_1.spawn)('xcrun', [ + 'notarytool', + 'log', + parsed.id, + ...authorizationArgs(opts), + ]); + d('notarization log', logResult.output); + } + } + catch (e) { + d('failed to pull notarization logs', e); + } + throw new Error(`Failed to notarize via notarytool\n\n${result.output}`); + } + d('notarization success'); + })); + }); +} +exports.notarizeAndWaitForNotaryTool = notarizeAndWaitForNotaryTool; +//# sourceMappingURL=notarytool.js.map
\ No newline at end of file diff --git a/desktop/node_modules/@electron/notarize/lib/notarytool.js.map b/desktop/node_modules/@electron/notarize/lib/notarytool.js.map new file mode 100644 index 0000000..c1fb412 --- /dev/null +++ b/desktop/node_modules/@electron/notarize/lib/notarytool.js.map @@ -0,0 +1 @@ +{"version":3,"file":"notarytool.js","sourceRoot":"","sources":["../src/notarytool.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+BAA+B;AAC/B,6BAA6B;AAE7B,mCAAgC;AAChC,uCAAoD;AACpD,mDAIyB;AAGzB,MAAM,CAAC,GAAG,KAAK,CAAC,8BAA8B,CAAC,CAAC;AAEhD,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,IAAI,CAAC,WAAW,CAAC;YAC5B,UAAU;YACV,IAAA,oBAAU,EAAC,IAAI,CAAC,aAAa,CAAC;YAC9B,UAAU;YACV,IAAA,oBAAU,EAAC,IAAI,CAAC,cAAc,CAAC;SAChC,CAAC;KACH;SAAM;QACL,0FAA0F;QAC1F,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,QAAQ,EAAE,oBAAoB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AC,IAAI,CAAC;gBAC1B,QAAQ;gBACR,iBAAiB;gBACjB,MAAM;aACP,CAAC;YAEF,MAAM,MAAM,GAAG,MAAM,IAAA,aAAK,EAAC,OAAO,EAAE,YAAY,CAAC,CAAC;YAElD,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC,EAAE;gBACrB,IAAI;oBACF,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;oBAChD,IAAI,MAAM,IAAI,MAAM,CAAC,EAAE,EAAE;wBACvB,MAAM,SAAS,GAAG,MAAM,IAAA,aAAK,EAAC,OAAO,EAAE;4BACrC,YAAY;4BACZ,KAAK;4BACL,MAAM,CAAC,EAAE;4BACT,GAAG,iBAAiB,CAAC,IAAI,CAAC;yBAC3B,CAAC,CAAC;wBACH,CAAC,CAAC,kBAAkB,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;qBACzC;iBACF;gBAAC,OAAO,CAAC,EAAE;oBACV,CAAC,CAAC,kCAAkC,EAAE,CAAC,CAAC,CAAC;iBAC1C;gBACD,MAAM,IAAI,KAAK,CAAC,wCAAwC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;aAC1E;YACD,CAAC,CAAC,sBAAsB,CAAC,CAAC;QAC5B,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;CAAA;AAlDD,oEAkDC"}
\ No newline at end of file diff --git a/desktop/node_modules/@electron/notarize/lib/spawn.d.ts b/desktop/node_modules/@electron/notarize/lib/spawn.d.ts new file mode 100644 index 0000000..e1dfc1e --- /dev/null +++ b/desktop/node_modules/@electron/notarize/lib/spawn.d.ts @@ -0,0 +1,6 @@ +import { SpawnOptions } from 'child_process'; +export interface SpawnResult { + code: number | null; + output: string; +} +export declare const spawn: (cmd: string, args?: string[], opts?: SpawnOptions) => Promise<SpawnResult>; diff --git a/desktop/node_modules/@electron/notarize/lib/spawn.js b/desktop/node_modules/@electron/notarize/lib/spawn.js new file mode 100644 index 0000000..2e3947f --- /dev/null +++ b/desktop/node_modules/@electron/notarize/lib/spawn.js @@ -0,0 +1,28 @@ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.spawn = void 0; +const child_process_1 = require("child_process"); +const debug = require("debug"); +const helpers_1 = require("./helpers"); +const d = debug('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); + const out = []; + const dataHandler = (data) => out.push(data.toString()); + child.stdout.on('data', dataHandler); + child.stderr.on('data', dataHandler); + return new Promise((resolve, reject) => { + child.on('error', err => { + reject(err); + }); + child.on('exit', code => { + d(`cmd ${cmd} terminated with code: ${code}`); + resolve({ + code, + output: out.join(''), + }); + }); + }); +}; +exports.spawn = spawn; +//# sourceMappingURL=spawn.js.map
\ No newline at end of file diff --git a/desktop/node_modules/@electron/notarize/lib/spawn.js.map b/desktop/node_modules/@electron/notarize/lib/spawn.js.map new file mode 100644 index 0000000..bcf35cf --- /dev/null +++ b/desktop/node_modules/@electron/notarize/lib/spawn.js.map @@ -0,0 +1 @@ +{"version":3,"file":"spawn.js","sourceRoot":"","sources":["../src/spawn.ts"],"names":[],"mappings":";;AAAA,iDAA+D;AAC/D,+BAA+B;AAC/B,uCAAqC;AAErC,MAAM,CAAC,GAAG,KAAK,CAAC,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,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,GAAG,CAAC,EAAE;YACtB,MAAM,CAAC,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE;YACtB,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;AA9BW,QAAA,KAAK,SA8BhB"}
\ No newline at end of file diff --git a/desktop/node_modules/@electron/notarize/lib/staple.d.ts b/desktop/node_modules/@electron/notarize/lib/staple.d.ts new file mode 100644 index 0000000..e507c1e --- /dev/null +++ b/desktop/node_modules/@electron/notarize/lib/staple.d.ts @@ -0,0 +1,2 @@ +import { NotarizeStapleOptions } from './types'; +export declare function stapleApp(opts: NotarizeStapleOptions): Promise<void>; diff --git a/desktop/node_modules/@electron/notarize/lib/staple.js b/desktop/node_modules/@electron/notarize/lib/staple.js new file mode 100644 index 0000000..4809133 --- /dev/null +++ b/desktop/node_modules/@electron/notarize/lib/staple.js @@ -0,0 +1,30 @@ +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()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.stapleApp = void 0; +const debug = require("debug"); +const path = require("path"); +const spawn_1 = require("./spawn"); +const d = debug('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; + }); +} +exports.stapleApp = stapleApp; +//# sourceMappingURL=staple.js.map
\ No newline at end of file diff --git a/desktop/node_modules/@electron/notarize/lib/staple.js.map b/desktop/node_modules/@electron/notarize/lib/staple.js.map new file mode 100644 index 0000000..a0a6ebc --- /dev/null +++ b/desktop/node_modules/@electron/notarize/lib/staple.js.map @@ -0,0 +1 @@ +{"version":3,"file":"staple.js","sourceRoot":"","sources":["../src/staple.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+BAA+B;AAC/B,6BAA6B;AAE7B,mCAAgC;AAGhC,MAAM,CAAC,GAAG,KAAK,CAAC,0BAA0B,CAAC,CAAC;AAE5C,SAAsB,SAAS,CAAC,IAA2B;;QACzD,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"}
\ No newline at end of file diff --git a/desktop/node_modules/@electron/notarize/lib/types.d.ts b/desktop/node_modules/@electron/notarize/lib/types.d.ts new file mode 100644 index 0000000..b04ec91 --- /dev/null +++ b/desktop/node_modules/@electron/notarize/lib/types.d.ts @@ -0,0 +1,47 @@ +export interface LegacyNotarizePasswordCredentials { + appleId: string; + appleIdPassword: string; +} +export interface NotaryToolPasswordCredentials { + appleId: string; + appleIdPassword: string; + teamId: string; +} +export interface LegacyNotarizeApiKeyCredentials { + appleApiKey: string; + appleApiIssuer: string; +} +export interface NotaryToolApiKeyCredentials { + appleApiKey: string; + appleApiKeyId: string; + appleApiIssuer: string; +} +export interface NotaryToolKeychainCredentials { + keychainProfile: string; + keychain?: string; +} +export type LegacyNotarizeCredentials = LegacyNotarizePasswordCredentials | LegacyNotarizeApiKeyCredentials; +export type NotaryToolCredentials = NotaryToolPasswordCredentials | NotaryToolApiKeyCredentials | NotaryToolKeychainCredentials; +export type NotarizeCredentials = LegacyNotarizeCredentials | NotaryToolCredentials; +export interface LegacyNotarizeAppOptions { + appPath: string; + appBundleId: string; +} +export interface NotaryToolNotarizeAppOptions { + appPath: string; +} +export interface TransporterOptions { + ascProvider?: string; +} +export interface NotarizeResult { + uuid: string; +} +export type LegacyNotarizeStartOptions = LegacyNotarizeAppOptions & LegacyNotarizeCredentials & TransporterOptions; +export type NotaryToolStartOptions = NotaryToolNotarizeAppOptions & NotaryToolCredentials; +export type LegacyNotarizeWaitOptions = NotarizeResult & LegacyNotarizeCredentials; +export type NotarizeStapleOptions = Pick<LegacyNotarizeAppOptions, 'appPath'>; +export type NotarizeOptions = ({ + tool?: 'legacy'; +} & LegacyNotarizeStartOptions) | ({ + tool: 'notarytool'; +} & NotaryToolStartOptions); diff --git a/desktop/node_modules/@electron/notarize/lib/types.js b/desktop/node_modules/@electron/notarize/lib/types.js new file mode 100644 index 0000000..5fb9015 --- /dev/null +++ b/desktop/node_modules/@electron/notarize/lib/types.js @@ -0,0 +1,2 @@ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map
\ No newline at end of file diff --git a/desktop/node_modules/@electron/notarize/lib/types.js.map b/desktop/node_modules/@electron/notarize/lib/types.js.map new file mode 100644 index 0000000..c768b79 --- /dev/null +++ b/desktop/node_modules/@electron/notarize/lib/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/notarize/lib/validate-args.d.ts b/desktop/node_modules/@electron/notarize/lib/validate-args.d.ts new file mode 100644 index 0000000..20b815b --- /dev/null +++ b/desktop/node_modules/@electron/notarize/lib/validate-args.d.ts @@ -0,0 +1,8 @@ +import { LegacyNotarizeApiKeyCredentials, LegacyNotarizeCredentials, LegacyNotarizePasswordCredentials, NotaryToolApiKeyCredentials, NotaryToolCredentials, NotaryToolKeychainCredentials, NotaryToolPasswordCredentials } from './types'; +export declare function isLegacyPasswordCredentials(opts: LegacyNotarizeCredentials): opts is LegacyNotarizePasswordCredentials; +export declare function isLegacyApiKeyCredentials(opts: LegacyNotarizeCredentials): opts is LegacyNotarizeApiKeyCredentials; +export declare function validateLegacyAuthorizationArgs(opts: LegacyNotarizeCredentials): LegacyNotarizeCredentials; +export declare function isNotaryToolPasswordCredentials(opts: NotaryToolCredentials): opts is NotaryToolPasswordCredentials; +export declare function isNotaryToolApiKeyCredentials(opts: NotaryToolCredentials): opts is NotaryToolApiKeyCredentials; +export declare function isNotaryToolKeychainCredentials(opts: NotaryToolCredentials): opts is NotaryToolKeychainCredentials; +export declare function validateNotaryToolAuthorizationArgs(opts: NotaryToolCredentials): NotaryToolCredentials; diff --git a/desktop/node_modules/@electron/notarize/lib/validate-args.js b/desktop/node_modules/@electron/notarize/lib/validate-args.js new file mode 100644 index 0000000..2a4f484 --- /dev/null +++ b/desktop/node_modules/@electron/notarize/lib/validate-args.js @@ -0,0 +1,102 @@ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateNotaryToolAuthorizationArgs = exports.isNotaryToolKeychainCredentials = exports.isNotaryToolApiKeyCredentials = exports.isNotaryToolPasswordCredentials = exports.validateLegacyAuthorizationArgs = exports.isLegacyApiKeyCredentials = exports.isLegacyPasswordCredentials = void 0; +function isLegacyPasswordCredentials(opts) { + const creds = opts; + return creds.appleId !== undefined || creds.appleIdPassword !== undefined; +} +exports.isLegacyPasswordCredentials = isLegacyPasswordCredentials; +function isLegacyApiKeyCredentials(opts) { + const creds = opts; + return creds.appleApiKey !== undefined || creds.appleApiIssuer !== undefined; +} +exports.isLegacyApiKeyCredentials = isLegacyApiKeyCredentials; +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) { + const creds = opts; + return (creds.appleApiIssuer !== undefined || + creds.appleApiKey !== undefined || + creds.appleApiKeyId !== undefined); +} +exports.isNotaryToolApiKeyCredentials = isNotaryToolApiKeyCredentials; +function isNotaryToolKeychainCredentials(opts) { + const creds = opts; + return creds.keychain !== undefined || creds.keychainProfile !== undefined; +} +exports.isNotaryToolKeychainCredentials = isNotaryToolKeychainCredentials; +function validateNotaryToolAuthorizationArgs(opts) { + const isPassword = isNotaryToolPasswordCredentials(opts); + const isApiKey = isNotaryToolApiKeyCredentials(opts); + const isKeychain = isNotaryToolKeychainCredentials(opts); + if ((isPassword ? 1 : 0) + (isApiKey ? 1 : 0) + (isKeychain ? 1 : 0) > 1) { + throw new Error('Cannot use password credentials, API key credentials and keychain credentials at once'); + } + if (isPassword) { + const passwordCreds = opts; + if (!passwordCreds.appleId) { + throw new Error('The appleId property is required when using notarization with password credentials'); + } + else if (!passwordCreds.appleIdPassword) { + throw new Error('The appleIdPassword property is required when using notarization with password credentials'); + } + else if (!passwordCreds.teamId) { + throw new Error('The teamId property is required when using notarization with password credentials'); + } + return passwordCreds; + } + if (isApiKey) { + const apiKeyCreds = opts; + if (!apiKeyCreds.appleApiKey) { + throw new Error('The appleApiKey property is required when using notarization with ASC credentials'); + } + else if (!apiKeyCreds.appleApiIssuer) { + throw new Error('The appleApiIssuer property is required when using notarization with ASC credentials'); + } + else if (!apiKeyCreds.appleApiKeyId) { + throw new Error('The appleApiKeyId property is required when using notarization with ASC credentials'); + } + return apiKeyCreds; + } + if (isKeychain) { + const keychainCreds = opts; + if (!keychainCreds.keychainProfile) { + throw new Error('The keychainProfile property is required when using notarization with keychain credentials'); + } + return keychainCreds; + } + throw new Error('No authentication properties provided (e.g. appleId, appleApiKey, keychain)'); +} +exports.validateNotaryToolAuthorizationArgs = validateNotaryToolAuthorizationArgs; +//# sourceMappingURL=validate-args.js.map
\ No newline at end of file diff --git a/desktop/node_modules/@electron/notarize/lib/validate-args.js.map b/desktop/node_modules/@electron/notarize/lib/validate-args.js.map new file mode 100644 index 0000000..fafdd3b --- /dev/null +++ b/desktop/node_modules/@electron/notarize/lib/validate-args.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validate-args.js","sourceRoot":"","sources":["../src/validate-args.ts"],"names":[],"mappings":";;AAUA,SAAgB,2BAA2B,CACzC,IAA+B;IAE/B,MAAM,KAAK,GAAG,IAAyC,CAAC;IACxD,OAAO,KAAK,CAAC,OAAO,KAAK,SAAS,IAAI,KAAK,CAAC,eAAe,KAAK,SAAS,CAAC;AAC5E,CAAC;AALD,kEAKC;AAED,SAAgB,yBAAyB,CACvC,IAA+B;IAE/B,MAAM,KAAK,GAAG,IAAuC,CAAC;IACtD,OAAO,KAAK,CAAC,WAAW,KAAK,SAAS,IAAI,KAAK,CAAC,cAAc,KAAK,SAAS,CAAC;AAC/E,CAAC;AALD,8DAKC;AAED,SAAgB,+BAA+B,CAC7C,IAA+B;IAE/B,MAAM,UAAU,GAAG,2BAA2B,CAAC,IAAI,CAAC,CAAC;IACrD,MAAM,QAAQ,GAAG,yBAAyB,CAAC,IAAI,CAAC,CAAC;IACjD,IAAI,UAAU,IAAI,QAAQ,EAAE;QAC1B,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;KACzF;IACD,IAAI,UAAU,EAAE;QACd,MAAM,aAAa,GAAG,IAAyC,CAAC;QAChE,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE;YAC1B,MAAM,IAAI,KAAK,CACb,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