@base44-preview/cli 0.0.31-pr.189.9302b52 → 0.0.31-pr.189.c893c9c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +942 -926
- package/dist/cli/index.js.map +24 -25
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -8883,8 +8883,8 @@ var require_package = __commonJS((exports, module) => {
|
|
|
8883
8883
|
|
|
8884
8884
|
// node_modules/ejs/lib/ejs.js
|
|
8885
8885
|
var require_ejs = __commonJS((exports) => {
|
|
8886
|
-
var
|
|
8887
|
-
var
|
|
8886
|
+
var fs14 = __require("fs");
|
|
8887
|
+
var path11 = __require("path");
|
|
8888
8888
|
var utils = require_utils5();
|
|
8889
8889
|
var scopeOptionWarned = false;
|
|
8890
8890
|
var _VERSION_STRING = require_package().version;
|
|
@@ -8911,13 +8911,13 @@ var require_ejs = __commonJS((exports) => {
|
|
|
8911
8911
|
var _BOM = /^\uFEFF/;
|
|
8912
8912
|
var _JS_IDENTIFIER = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/;
|
|
8913
8913
|
exports.cache = utils.cache;
|
|
8914
|
-
exports.fileLoader =
|
|
8914
|
+
exports.fileLoader = fs14.readFileSync;
|
|
8915
8915
|
exports.localsName = _DEFAULT_LOCALS_NAME;
|
|
8916
8916
|
exports.promiseImpl = new Function("return this;")().Promise;
|
|
8917
8917
|
exports.resolveInclude = function(name2, filename, isDir) {
|
|
8918
|
-
var dirname6 =
|
|
8919
|
-
var extname =
|
|
8920
|
-
var resolve =
|
|
8918
|
+
var dirname6 = path11.dirname;
|
|
8919
|
+
var extname = path11.extname;
|
|
8920
|
+
var resolve = path11.resolve;
|
|
8921
8921
|
var includePath = resolve(isDir ? filename : dirname6(filename), name2);
|
|
8922
8922
|
var ext = extname(name2);
|
|
8923
8923
|
if (!ext) {
|
|
@@ -8929,35 +8929,35 @@ var require_ejs = __commonJS((exports) => {
|
|
|
8929
8929
|
var filePath;
|
|
8930
8930
|
if (paths.some(function(v2) {
|
|
8931
8931
|
filePath = exports.resolveInclude(name2, v2, true);
|
|
8932
|
-
return
|
|
8932
|
+
return fs14.existsSync(filePath);
|
|
8933
8933
|
})) {
|
|
8934
8934
|
return filePath;
|
|
8935
8935
|
}
|
|
8936
8936
|
}
|
|
8937
|
-
function getIncludePath(
|
|
8937
|
+
function getIncludePath(path12, options) {
|
|
8938
8938
|
var includePath;
|
|
8939
8939
|
var filePath;
|
|
8940
8940
|
var views = options.views;
|
|
8941
|
-
var match = /^[A-Za-z]+:\\|^\//.exec(
|
|
8941
|
+
var match = /^[A-Za-z]+:\\|^\//.exec(path12);
|
|
8942
8942
|
if (match && match.length) {
|
|
8943
|
-
|
|
8943
|
+
path12 = path12.replace(/^\/*/, "");
|
|
8944
8944
|
if (Array.isArray(options.root)) {
|
|
8945
|
-
includePath = resolvePaths(
|
|
8945
|
+
includePath = resolvePaths(path12, options.root);
|
|
8946
8946
|
} else {
|
|
8947
|
-
includePath = exports.resolveInclude(
|
|
8947
|
+
includePath = exports.resolveInclude(path12, options.root || "/", true);
|
|
8948
8948
|
}
|
|
8949
8949
|
} else {
|
|
8950
8950
|
if (options.filename) {
|
|
8951
|
-
filePath = exports.resolveInclude(
|
|
8952
|
-
if (
|
|
8951
|
+
filePath = exports.resolveInclude(path12, options.filename);
|
|
8952
|
+
if (fs14.existsSync(filePath)) {
|
|
8953
8953
|
includePath = filePath;
|
|
8954
8954
|
}
|
|
8955
8955
|
}
|
|
8956
8956
|
if (!includePath && Array.isArray(views)) {
|
|
8957
|
-
includePath = resolvePaths(
|
|
8957
|
+
includePath = resolvePaths(path12, views);
|
|
8958
8958
|
}
|
|
8959
8959
|
if (!includePath && typeof options.includer !== "function") {
|
|
8960
|
-
throw new Error('Could not find the include file "' + options.escapeFunction(
|
|
8960
|
+
throw new Error('Could not find the include file "' + options.escapeFunction(path12) + '"');
|
|
8961
8961
|
}
|
|
8962
8962
|
}
|
|
8963
8963
|
return includePath;
|
|
@@ -9016,11 +9016,11 @@ var require_ejs = __commonJS((exports) => {
|
|
|
9016
9016
|
function fileLoader(filePath) {
|
|
9017
9017
|
return exports.fileLoader(filePath);
|
|
9018
9018
|
}
|
|
9019
|
-
function includeFile(
|
|
9019
|
+
function includeFile(path12, options) {
|
|
9020
9020
|
var opts = utils.shallowCopy(utils.createNullProtoObjWherePossible(), options);
|
|
9021
|
-
opts.filename = getIncludePath(
|
|
9021
|
+
opts.filename = getIncludePath(path12, opts);
|
|
9022
9022
|
if (typeof options.includer === "function") {
|
|
9023
|
-
var includerResult = options.includer(
|
|
9023
|
+
var includerResult = options.includer(path12, opts.filename);
|
|
9024
9024
|
if (includerResult) {
|
|
9025
9025
|
if (includerResult.filename) {
|
|
9026
9026
|
opts.filename = includerResult.filename;
|
|
@@ -9162,9 +9162,9 @@ var require_ejs = __commonJS((exports) => {
|
|
|
9162
9162
|
createRegex: function() {
|
|
9163
9163
|
var str = _REGEX_STRING;
|
|
9164
9164
|
var delim = utils.escapeRegExpChars(this.opts.delimiter);
|
|
9165
|
-
var
|
|
9165
|
+
var open = utils.escapeRegExpChars(this.opts.openDelimiter);
|
|
9166
9166
|
var close = utils.escapeRegExpChars(this.opts.closeDelimiter);
|
|
9167
|
-
str = str.replace(/%/g, delim).replace(/</g,
|
|
9167
|
+
str = str.replace(/%/g, delim).replace(/</g, open).replace(/>/g, close);
|
|
9168
9168
|
return new RegExp(str);
|
|
9169
9169
|
},
|
|
9170
9170
|
compile: function() {
|
|
@@ -9285,18 +9285,18 @@ var require_ejs = __commonJS((exports) => {
|
|
|
9285
9285
|
throw e2;
|
|
9286
9286
|
}
|
|
9287
9287
|
var returnedFn = opts.client ? fn : function anonymous(data) {
|
|
9288
|
-
var include = function(
|
|
9288
|
+
var include = function(path12, includeData) {
|
|
9289
9289
|
var d3 = utils.shallowCopy(utils.createNullProtoObjWherePossible(), data);
|
|
9290
9290
|
if (includeData) {
|
|
9291
9291
|
d3 = utils.shallowCopy(d3, includeData);
|
|
9292
9292
|
}
|
|
9293
|
-
return includeFile(
|
|
9293
|
+
return includeFile(path12, opts)(d3);
|
|
9294
9294
|
};
|
|
9295
9295
|
return fn.apply(opts.context, [data || utils.createNullProtoObjWherePossible(), escapeFn, include, rethrow]);
|
|
9296
9296
|
};
|
|
9297
9297
|
if (opts.filename && typeof Object.defineProperty === "function") {
|
|
9298
9298
|
var filename = opts.filename;
|
|
9299
|
-
var basename3 =
|
|
9299
|
+
var basename3 = path11.basename(filename, path11.extname(filename));
|
|
9300
9300
|
try {
|
|
9301
9301
|
Object.defineProperty(returnedFn, "name", {
|
|
9302
9302
|
value: basename3,
|
|
@@ -12282,8 +12282,8 @@ var require_js_yaml2 = __commonJS((exports, module) => {
|
|
|
12282
12282
|
var require_front_matter = __commonJS((exports, module) => {
|
|
12283
12283
|
var parser = require_js_yaml2();
|
|
12284
12284
|
var optionalByteOrderMark = "\\ufeff?";
|
|
12285
|
-
var
|
|
12286
|
-
var pattern = "^(" + optionalByteOrderMark + "(= yaml =|---)" + "$([\\s\\S]*?)" + "^(?:\\2|\\.\\.\\.)\\s*" + "$" + (
|
|
12285
|
+
var platform5 = typeof process !== "undefined" ? process.platform : "";
|
|
12286
|
+
var pattern = "^(" + optionalByteOrderMark + "(= yaml =|---)" + "$([\\s\\S]*?)" + "^(?:\\2|\\.\\.\\.)\\s*" + "$" + (platform5 === "win32" ? "\\r?" : "") + "(?:\\n)?)";
|
|
12287
12287
|
var regex = new RegExp(pattern, "m");
|
|
12288
12288
|
module.exports = extractor;
|
|
12289
12289
|
module.exports.test = test;
|
|
@@ -12349,8 +12349,8 @@ var require_front_matter = __commonJS((exports, module) => {
|
|
|
12349
12349
|
var require_windows = __commonJS((exports, module) => {
|
|
12350
12350
|
module.exports = isexe;
|
|
12351
12351
|
isexe.sync = sync;
|
|
12352
|
-
var
|
|
12353
|
-
function checkPathExt(
|
|
12352
|
+
var fs15 = __require("fs");
|
|
12353
|
+
function checkPathExt(path11, options) {
|
|
12354
12354
|
var pathext = options.pathExt !== undefined ? options.pathExt : process.env.PATHEXT;
|
|
12355
12355
|
if (!pathext) {
|
|
12356
12356
|
return true;
|
|
@@ -12361,25 +12361,25 @@ var require_windows = __commonJS((exports, module) => {
|
|
|
12361
12361
|
}
|
|
12362
12362
|
for (var i = 0;i < pathext.length; i++) {
|
|
12363
12363
|
var p2 = pathext[i].toLowerCase();
|
|
12364
|
-
if (p2 &&
|
|
12364
|
+
if (p2 && path11.substr(-p2.length).toLowerCase() === p2) {
|
|
12365
12365
|
return true;
|
|
12366
12366
|
}
|
|
12367
12367
|
}
|
|
12368
12368
|
return false;
|
|
12369
12369
|
}
|
|
12370
|
-
function checkStat(stat,
|
|
12370
|
+
function checkStat(stat, path11, options) {
|
|
12371
12371
|
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
12372
12372
|
return false;
|
|
12373
12373
|
}
|
|
12374
|
-
return checkPathExt(
|
|
12374
|
+
return checkPathExt(path11, options);
|
|
12375
12375
|
}
|
|
12376
|
-
function isexe(
|
|
12377
|
-
|
|
12378
|
-
cb(er, er ? false : checkStat(stat,
|
|
12376
|
+
function isexe(path11, options, cb) {
|
|
12377
|
+
fs15.stat(path11, function(er, stat) {
|
|
12378
|
+
cb(er, er ? false : checkStat(stat, path11, options));
|
|
12379
12379
|
});
|
|
12380
12380
|
}
|
|
12381
|
-
function sync(
|
|
12382
|
-
return checkStat(
|
|
12381
|
+
function sync(path11, options) {
|
|
12382
|
+
return checkStat(fs15.statSync(path11), path11, options);
|
|
12383
12383
|
}
|
|
12384
12384
|
});
|
|
12385
12385
|
|
|
@@ -12387,14 +12387,14 @@ var require_windows = __commonJS((exports, module) => {
|
|
|
12387
12387
|
var require_mode = __commonJS((exports, module) => {
|
|
12388
12388
|
module.exports = isexe;
|
|
12389
12389
|
isexe.sync = sync;
|
|
12390
|
-
var
|
|
12391
|
-
function isexe(
|
|
12392
|
-
|
|
12390
|
+
var fs15 = __require("fs");
|
|
12391
|
+
function isexe(path11, options, cb) {
|
|
12392
|
+
fs15.stat(path11, function(er, stat) {
|
|
12393
12393
|
cb(er, er ? false : checkStat(stat, options));
|
|
12394
12394
|
});
|
|
12395
12395
|
}
|
|
12396
|
-
function sync(
|
|
12397
|
-
return checkStat(
|
|
12396
|
+
function sync(path11, options) {
|
|
12397
|
+
return checkStat(fs15.statSync(path11), options);
|
|
12398
12398
|
}
|
|
12399
12399
|
function checkStat(stat, options) {
|
|
12400
12400
|
return stat.isFile() && checkMode(stat, options);
|
|
@@ -12416,7 +12416,7 @@ var require_mode = __commonJS((exports, module) => {
|
|
|
12416
12416
|
|
|
12417
12417
|
// node_modules/isexe/index.js
|
|
12418
12418
|
var require_isexe = __commonJS((exports, module) => {
|
|
12419
|
-
var
|
|
12419
|
+
var fs15 = __require("fs");
|
|
12420
12420
|
var core2;
|
|
12421
12421
|
if (process.platform === "win32" || global.TESTING_WINDOWS) {
|
|
12422
12422
|
core2 = require_windows();
|
|
@@ -12425,7 +12425,7 @@ var require_isexe = __commonJS((exports, module) => {
|
|
|
12425
12425
|
}
|
|
12426
12426
|
module.exports = isexe;
|
|
12427
12427
|
isexe.sync = sync;
|
|
12428
|
-
function isexe(
|
|
12428
|
+
function isexe(path11, options, cb) {
|
|
12429
12429
|
if (typeof options === "function") {
|
|
12430
12430
|
cb = options;
|
|
12431
12431
|
options = {};
|
|
@@ -12435,7 +12435,7 @@ var require_isexe = __commonJS((exports, module) => {
|
|
|
12435
12435
|
throw new TypeError("callback not provided");
|
|
12436
12436
|
}
|
|
12437
12437
|
return new Promise(function(resolve2, reject) {
|
|
12438
|
-
isexe(
|
|
12438
|
+
isexe(path11, options || {}, function(er, is) {
|
|
12439
12439
|
if (er) {
|
|
12440
12440
|
reject(er);
|
|
12441
12441
|
} else {
|
|
@@ -12444,7 +12444,7 @@ var require_isexe = __commonJS((exports, module) => {
|
|
|
12444
12444
|
});
|
|
12445
12445
|
});
|
|
12446
12446
|
}
|
|
12447
|
-
core2(
|
|
12447
|
+
core2(path11, options || {}, function(er, is) {
|
|
12448
12448
|
if (er) {
|
|
12449
12449
|
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
12450
12450
|
er = null;
|
|
@@ -12454,9 +12454,9 @@ var require_isexe = __commonJS((exports, module) => {
|
|
|
12454
12454
|
cb(er, is);
|
|
12455
12455
|
});
|
|
12456
12456
|
}
|
|
12457
|
-
function sync(
|
|
12457
|
+
function sync(path11, options) {
|
|
12458
12458
|
try {
|
|
12459
|
-
return core2.sync(
|
|
12459
|
+
return core2.sync(path11, options || {});
|
|
12460
12460
|
} catch (er) {
|
|
12461
12461
|
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
12462
12462
|
return false;
|
|
@@ -12470,7 +12470,7 @@ var require_isexe = __commonJS((exports, module) => {
|
|
|
12470
12470
|
// node_modules/which/which.js
|
|
12471
12471
|
var require_which = __commonJS((exports, module) => {
|
|
12472
12472
|
var isWindows4 = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
12473
|
-
var
|
|
12473
|
+
var path11 = __require("path");
|
|
12474
12474
|
var COLON = isWindows4 ? ";" : ":";
|
|
12475
12475
|
var isexe = require_isexe();
|
|
12476
12476
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
@@ -12506,7 +12506,7 @@ var require_which = __commonJS((exports, module) => {
|
|
|
12506
12506
|
return opt.all && found.length ? resolve2(found) : reject(getNotFoundError(cmd));
|
|
12507
12507
|
const ppRaw = pathEnv[i];
|
|
12508
12508
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
12509
|
-
const pCmd =
|
|
12509
|
+
const pCmd = path11.join(pathPart, cmd);
|
|
12510
12510
|
const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
12511
12511
|
resolve2(subStep(p2, i, 0));
|
|
12512
12512
|
});
|
|
@@ -12533,7 +12533,7 @@ var require_which = __commonJS((exports, module) => {
|
|
|
12533
12533
|
for (let i = 0;i < pathEnv.length; i++) {
|
|
12534
12534
|
const ppRaw = pathEnv[i];
|
|
12535
12535
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
12536
|
-
const pCmd =
|
|
12536
|
+
const pCmd = path11.join(pathPart, cmd);
|
|
12537
12537
|
const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
12538
12538
|
for (let j2 = 0;j2 < pathExt.length; j2++) {
|
|
12539
12539
|
const cur = p2 + pathExt[j2];
|
|
@@ -12562,8 +12562,8 @@ var require_which = __commonJS((exports, module) => {
|
|
|
12562
12562
|
var require_path_key = __commonJS((exports, module) => {
|
|
12563
12563
|
var pathKey = (options = {}) => {
|
|
12564
12564
|
const environment = options.env || process.env;
|
|
12565
|
-
const
|
|
12566
|
-
if (
|
|
12565
|
+
const platform6 = options.platform || process.platform;
|
|
12566
|
+
if (platform6 !== "win32") {
|
|
12567
12567
|
return "PATH";
|
|
12568
12568
|
}
|
|
12569
12569
|
return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
@@ -12574,7 +12574,7 @@ var require_path_key = __commonJS((exports, module) => {
|
|
|
12574
12574
|
|
|
12575
12575
|
// node_modules/cross-spawn/lib/util/resolveCommand.js
|
|
12576
12576
|
var require_resolveCommand = __commonJS((exports, module) => {
|
|
12577
|
-
var
|
|
12577
|
+
var path11 = __require("path");
|
|
12578
12578
|
var which = require_which();
|
|
12579
12579
|
var getPathKey = require_path_key();
|
|
12580
12580
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -12591,7 +12591,7 @@ var require_resolveCommand = __commonJS((exports, module) => {
|
|
|
12591
12591
|
try {
|
|
12592
12592
|
resolved = which.sync(parsed.command, {
|
|
12593
12593
|
path: env2[getPathKey({ env: env2 })],
|
|
12594
|
-
pathExt: withoutPathExt ?
|
|
12594
|
+
pathExt: withoutPathExt ? path11.delimiter : undefined
|
|
12595
12595
|
});
|
|
12596
12596
|
} catch (e2) {} finally {
|
|
12597
12597
|
if (shouldSwitchCwd) {
|
|
@@ -12599,7 +12599,7 @@ var require_resolveCommand = __commonJS((exports, module) => {
|
|
|
12599
12599
|
}
|
|
12600
12600
|
}
|
|
12601
12601
|
if (resolved) {
|
|
12602
|
-
resolved =
|
|
12602
|
+
resolved = path11.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
12603
12603
|
}
|
|
12604
12604
|
return resolved;
|
|
12605
12605
|
}
|
|
@@ -12644,8 +12644,8 @@ var require_shebang_command = __commonJS((exports, module) => {
|
|
|
12644
12644
|
if (!match) {
|
|
12645
12645
|
return null;
|
|
12646
12646
|
}
|
|
12647
|
-
const [
|
|
12648
|
-
const binary =
|
|
12647
|
+
const [path11, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
12648
|
+
const binary = path11.split("/").pop();
|
|
12649
12649
|
if (binary === "env") {
|
|
12650
12650
|
return argument;
|
|
12651
12651
|
}
|
|
@@ -12655,16 +12655,16 @@ var require_shebang_command = __commonJS((exports, module) => {
|
|
|
12655
12655
|
|
|
12656
12656
|
// node_modules/cross-spawn/lib/util/readShebang.js
|
|
12657
12657
|
var require_readShebang = __commonJS((exports, module) => {
|
|
12658
|
-
var
|
|
12658
|
+
var fs15 = __require("fs");
|
|
12659
12659
|
var shebangCommand = require_shebang_command();
|
|
12660
12660
|
function readShebang(command) {
|
|
12661
12661
|
const size = 150;
|
|
12662
12662
|
const buffer = Buffer.alloc(size);
|
|
12663
12663
|
let fd;
|
|
12664
12664
|
try {
|
|
12665
|
-
fd =
|
|
12666
|
-
|
|
12667
|
-
|
|
12665
|
+
fd = fs15.openSync(command, "r");
|
|
12666
|
+
fs15.readSync(fd, buffer, 0, size, 0);
|
|
12667
|
+
fs15.closeSync(fd);
|
|
12668
12668
|
} catch (e2) {}
|
|
12669
12669
|
return shebangCommand(buffer.toString());
|
|
12670
12670
|
}
|
|
@@ -12673,7 +12673,7 @@ var require_readShebang = __commonJS((exports, module) => {
|
|
|
12673
12673
|
|
|
12674
12674
|
// node_modules/cross-spawn/lib/parse.js
|
|
12675
12675
|
var require_parse4 = __commonJS((exports, module) => {
|
|
12676
|
-
var
|
|
12676
|
+
var path11 = __require("path");
|
|
12677
12677
|
var resolveCommand = require_resolveCommand();
|
|
12678
12678
|
var escape2 = require_escape();
|
|
12679
12679
|
var readShebang = require_readShebang();
|
|
@@ -12698,7 +12698,7 @@ var require_parse4 = __commonJS((exports, module) => {
|
|
|
12698
12698
|
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
12699
12699
|
if (parsed.options.forceShell || needsShell) {
|
|
12700
12700
|
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
12701
|
-
parsed.command =
|
|
12701
|
+
parsed.command = path11.normalize(parsed.command);
|
|
12702
12702
|
parsed.command = escape2.command(parsed.command);
|
|
12703
12703
|
parsed.args = parsed.args.map((arg) => escape2.argument(arg, needsDoubleEscapeMetaChars));
|
|
12704
12704
|
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
@@ -185082,11 +185082,7 @@ var IntegrationTypeSchema = exports_external.union([
|
|
|
185082
185082
|
exports_external.enum(KnownIntegrationTypes),
|
|
185083
185083
|
CustomTypeSchema
|
|
185084
185084
|
]);
|
|
185085
|
-
var ConnectorStatusSchema = exports_external.enum([
|
|
185086
|
-
"active",
|
|
185087
|
-
"disconnected",
|
|
185088
|
-
"expired"
|
|
185089
|
-
]);
|
|
185085
|
+
var ConnectorStatusSchema = exports_external.enum(["active", "disconnected", "expired"]);
|
|
185090
185086
|
var UpstreamConnectorSchema = exports_external.object({
|
|
185091
185087
|
integration_type: IntegrationTypeSchema,
|
|
185092
185088
|
status: ConnectorStatusSchema,
|
|
@@ -185095,15 +185091,29 @@ var UpstreamConnectorSchema = exports_external.object({
|
|
|
185095
185091
|
});
|
|
185096
185092
|
var ListConnectorsResponseSchema = exports_external.object({
|
|
185097
185093
|
integrations: exports_external.array(UpstreamConnectorSchema)
|
|
185098
|
-
})
|
|
185094
|
+
}).transform((data) => ({
|
|
185095
|
+
integrations: data.integrations.map((i) => ({
|
|
185096
|
+
integrationType: i.integration_type,
|
|
185097
|
+
status: i.status,
|
|
185098
|
+
scopes: i.scopes,
|
|
185099
|
+
userEmail: i.user_email
|
|
185100
|
+
}))
|
|
185101
|
+
}));
|
|
185099
185102
|
var SetConnectorResponseSchema = exports_external.object({
|
|
185100
185103
|
redirect_url: exports_external.string().nullable(),
|
|
185101
185104
|
connection_id: exports_external.string().nullable(),
|
|
185102
185105
|
already_authorized: exports_external.boolean(),
|
|
185103
|
-
error: exports_external.string().nullable()
|
|
185104
|
-
error_message: exports_external.string().nullable()
|
|
185105
|
-
other_user_email: exports_external.string().nullable()
|
|
185106
|
-
})
|
|
185106
|
+
error: exports_external.string().nullable(),
|
|
185107
|
+
error_message: exports_external.string().nullable(),
|
|
185108
|
+
other_user_email: exports_external.string().nullable()
|
|
185109
|
+
}).transform((data) => ({
|
|
185110
|
+
redirectUrl: data.redirect_url,
|
|
185111
|
+
connectionId: data.connection_id,
|
|
185112
|
+
alreadyAuthorized: data.already_authorized,
|
|
185113
|
+
error: data.error,
|
|
185114
|
+
errorMessage: data.error_message,
|
|
185115
|
+
otherUserEmail: data.other_user_email
|
|
185116
|
+
}));
|
|
185107
185117
|
var ConnectorOAuthStatusSchema = exports_external.enum([
|
|
185108
185118
|
"ACTIVE",
|
|
185109
185119
|
"FAILED",
|
|
@@ -185115,7 +185125,10 @@ var OAuthStatusResponseSchema = exports_external.object({
|
|
|
185115
185125
|
var RemoveConnectorResponseSchema = exports_external.object({
|
|
185116
185126
|
status: exports_external.literal("removed"),
|
|
185117
185127
|
integration_type: IntegrationTypeSchema
|
|
185118
|
-
})
|
|
185128
|
+
}).transform((data) => ({
|
|
185129
|
+
status: data.status,
|
|
185130
|
+
integrationType: data.integration_type
|
|
185131
|
+
}));
|
|
185119
185132
|
|
|
185120
185133
|
// src/core/resources/connector/api.ts
|
|
185121
185134
|
async function listConnectors() {
|
|
@@ -185201,6 +185214,10 @@ async function readAllConnectors(connectorsDir) {
|
|
|
185201
185214
|
absolute: true
|
|
185202
185215
|
});
|
|
185203
185216
|
const connectors = await Promise.all(files.map((filePath) => readConnectorFile(filePath)));
|
|
185217
|
+
assertNoDuplicateConnectors(connectors);
|
|
185218
|
+
return connectors;
|
|
185219
|
+
}
|
|
185220
|
+
function assertNoDuplicateConnectors(connectors) {
|
|
185204
185221
|
const types = new Set;
|
|
185205
185222
|
for (const connector of connectors) {
|
|
185206
185223
|
if (types.has(connector.type)) {
|
|
@@ -185214,732 +185231,6 @@ async function readAllConnectors(connectorsDir) {
|
|
|
185214
185231
|
}
|
|
185215
185232
|
types.add(connector.type);
|
|
185216
185233
|
}
|
|
185217
|
-
return connectors;
|
|
185218
|
-
}
|
|
185219
|
-
// node_modules/open/index.js
|
|
185220
|
-
import process11 from "node:process";
|
|
185221
|
-
import path11 from "node:path";
|
|
185222
|
-
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
185223
|
-
import childProcess3 from "node:child_process";
|
|
185224
|
-
import fs18, { constants as fsConstants2 } from "node:fs/promises";
|
|
185225
|
-
|
|
185226
|
-
// node_modules/wsl-utils/index.js
|
|
185227
|
-
import { promisify as promisify4 } from "node:util";
|
|
185228
|
-
import childProcess2 from "node:child_process";
|
|
185229
|
-
import fs17, { constants as fsConstants } from "node:fs/promises";
|
|
185230
|
-
|
|
185231
|
-
// node_modules/is-wsl/index.js
|
|
185232
|
-
import process5 from "node:process";
|
|
185233
|
-
import os from "node:os";
|
|
185234
|
-
import fs16 from "node:fs";
|
|
185235
|
-
|
|
185236
|
-
// node_modules/is-inside-container/index.js
|
|
185237
|
-
import fs15 from "node:fs";
|
|
185238
|
-
|
|
185239
|
-
// node_modules/is-docker/index.js
|
|
185240
|
-
import fs14 from "node:fs";
|
|
185241
|
-
var isDockerCached;
|
|
185242
|
-
function hasDockerEnv() {
|
|
185243
|
-
try {
|
|
185244
|
-
fs14.statSync("/.dockerenv");
|
|
185245
|
-
return true;
|
|
185246
|
-
} catch {
|
|
185247
|
-
return false;
|
|
185248
|
-
}
|
|
185249
|
-
}
|
|
185250
|
-
function hasDockerCGroup() {
|
|
185251
|
-
try {
|
|
185252
|
-
return fs14.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
|
|
185253
|
-
} catch {
|
|
185254
|
-
return false;
|
|
185255
|
-
}
|
|
185256
|
-
}
|
|
185257
|
-
function isDocker() {
|
|
185258
|
-
if (isDockerCached === undefined) {
|
|
185259
|
-
isDockerCached = hasDockerEnv() || hasDockerCGroup();
|
|
185260
|
-
}
|
|
185261
|
-
return isDockerCached;
|
|
185262
|
-
}
|
|
185263
|
-
|
|
185264
|
-
// node_modules/is-inside-container/index.js
|
|
185265
|
-
var cachedResult;
|
|
185266
|
-
var hasContainerEnv = () => {
|
|
185267
|
-
try {
|
|
185268
|
-
fs15.statSync("/run/.containerenv");
|
|
185269
|
-
return true;
|
|
185270
|
-
} catch {
|
|
185271
|
-
return false;
|
|
185272
|
-
}
|
|
185273
|
-
};
|
|
185274
|
-
function isInsideContainer() {
|
|
185275
|
-
if (cachedResult === undefined) {
|
|
185276
|
-
cachedResult = hasContainerEnv() || isDocker();
|
|
185277
|
-
}
|
|
185278
|
-
return cachedResult;
|
|
185279
|
-
}
|
|
185280
|
-
|
|
185281
|
-
// node_modules/is-wsl/index.js
|
|
185282
|
-
var isWsl = () => {
|
|
185283
|
-
if (process5.platform !== "linux") {
|
|
185284
|
-
return false;
|
|
185285
|
-
}
|
|
185286
|
-
if (os.release().toLowerCase().includes("microsoft")) {
|
|
185287
|
-
if (isInsideContainer()) {
|
|
185288
|
-
return false;
|
|
185289
|
-
}
|
|
185290
|
-
return true;
|
|
185291
|
-
}
|
|
185292
|
-
try {
|
|
185293
|
-
return fs16.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
|
|
185294
|
-
} catch {
|
|
185295
|
-
return false;
|
|
185296
|
-
}
|
|
185297
|
-
};
|
|
185298
|
-
var is_wsl_default = process5.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
185299
|
-
|
|
185300
|
-
// node_modules/powershell-utils/index.js
|
|
185301
|
-
import process6 from "node:process";
|
|
185302
|
-
import { Buffer as Buffer3 } from "node:buffer";
|
|
185303
|
-
import { promisify as promisify3 } from "node:util";
|
|
185304
|
-
import childProcess from "node:child_process";
|
|
185305
|
-
var execFile = promisify3(childProcess.execFile);
|
|
185306
|
-
var powerShellPath = () => `${process6.env.SYSTEMROOT || process6.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
185307
|
-
var executePowerShell = async (command, options = {}) => {
|
|
185308
|
-
const {
|
|
185309
|
-
powerShellPath: psPath,
|
|
185310
|
-
...execFileOptions
|
|
185311
|
-
} = options;
|
|
185312
|
-
const encodedCommand = executePowerShell.encodeCommand(command);
|
|
185313
|
-
return execFile(psPath ?? powerShellPath(), [
|
|
185314
|
-
...executePowerShell.argumentsPrefix,
|
|
185315
|
-
encodedCommand
|
|
185316
|
-
], {
|
|
185317
|
-
encoding: "utf8",
|
|
185318
|
-
...execFileOptions
|
|
185319
|
-
});
|
|
185320
|
-
};
|
|
185321
|
-
executePowerShell.argumentsPrefix = [
|
|
185322
|
-
"-NoProfile",
|
|
185323
|
-
"-NonInteractive",
|
|
185324
|
-
"-ExecutionPolicy",
|
|
185325
|
-
"Bypass",
|
|
185326
|
-
"-EncodedCommand"
|
|
185327
|
-
];
|
|
185328
|
-
executePowerShell.encodeCommand = (command) => Buffer3.from(command, "utf16le").toString("base64");
|
|
185329
|
-
executePowerShell.escapeArgument = (value) => `'${String(value).replaceAll("'", "''")}'`;
|
|
185330
|
-
|
|
185331
|
-
// node_modules/wsl-utils/utilities.js
|
|
185332
|
-
function parseMountPointFromConfig(content) {
|
|
185333
|
-
for (const line of content.split(`
|
|
185334
|
-
`)) {
|
|
185335
|
-
if (/^\s*#/.test(line)) {
|
|
185336
|
-
continue;
|
|
185337
|
-
}
|
|
185338
|
-
const match = /^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(line);
|
|
185339
|
-
if (!match) {
|
|
185340
|
-
continue;
|
|
185341
|
-
}
|
|
185342
|
-
return match.groups.mountPoint.trim().replaceAll(/^["']|["']$/g, "");
|
|
185343
|
-
}
|
|
185344
|
-
}
|
|
185345
|
-
|
|
185346
|
-
// node_modules/wsl-utils/index.js
|
|
185347
|
-
var execFile2 = promisify4(childProcess2.execFile);
|
|
185348
|
-
var wslDrivesMountPoint = (() => {
|
|
185349
|
-
const defaultMountPoint = "/mnt/";
|
|
185350
|
-
let mountPoint;
|
|
185351
|
-
return async function() {
|
|
185352
|
-
if (mountPoint) {
|
|
185353
|
-
return mountPoint;
|
|
185354
|
-
}
|
|
185355
|
-
const configFilePath = "/etc/wsl.conf";
|
|
185356
|
-
let isConfigFileExists = false;
|
|
185357
|
-
try {
|
|
185358
|
-
await fs17.access(configFilePath, fsConstants.F_OK);
|
|
185359
|
-
isConfigFileExists = true;
|
|
185360
|
-
} catch {}
|
|
185361
|
-
if (!isConfigFileExists) {
|
|
185362
|
-
return defaultMountPoint;
|
|
185363
|
-
}
|
|
185364
|
-
const configContent = await fs17.readFile(configFilePath, { encoding: "utf8" });
|
|
185365
|
-
const parsedMountPoint = parseMountPointFromConfig(configContent);
|
|
185366
|
-
if (parsedMountPoint === undefined) {
|
|
185367
|
-
return defaultMountPoint;
|
|
185368
|
-
}
|
|
185369
|
-
mountPoint = parsedMountPoint;
|
|
185370
|
-
mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
|
|
185371
|
-
return mountPoint;
|
|
185372
|
-
};
|
|
185373
|
-
})();
|
|
185374
|
-
var powerShellPathFromWsl = async () => {
|
|
185375
|
-
const mountPoint = await wslDrivesMountPoint();
|
|
185376
|
-
return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
|
|
185377
|
-
};
|
|
185378
|
-
var powerShellPath2 = is_wsl_default ? powerShellPathFromWsl : powerShellPath;
|
|
185379
|
-
var canAccessPowerShellPromise;
|
|
185380
|
-
var canAccessPowerShell = async () => {
|
|
185381
|
-
canAccessPowerShellPromise ??= (async () => {
|
|
185382
|
-
try {
|
|
185383
|
-
const psPath = await powerShellPath2();
|
|
185384
|
-
await fs17.access(psPath, fsConstants.X_OK);
|
|
185385
|
-
return true;
|
|
185386
|
-
} catch {
|
|
185387
|
-
return false;
|
|
185388
|
-
}
|
|
185389
|
-
})();
|
|
185390
|
-
return canAccessPowerShellPromise;
|
|
185391
|
-
};
|
|
185392
|
-
var wslDefaultBrowser = async () => {
|
|
185393
|
-
const psPath = await powerShellPath2();
|
|
185394
|
-
const command = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`;
|
|
185395
|
-
const { stdout } = await executePowerShell(command, { powerShellPath: psPath });
|
|
185396
|
-
return stdout.trim();
|
|
185397
|
-
};
|
|
185398
|
-
var convertWslPathToWindows = async (path11) => {
|
|
185399
|
-
if (/^[a-z]+:\/\//i.test(path11)) {
|
|
185400
|
-
return path11;
|
|
185401
|
-
}
|
|
185402
|
-
try {
|
|
185403
|
-
const { stdout } = await execFile2("wslpath", ["-aw", path11], { encoding: "utf8" });
|
|
185404
|
-
return stdout.trim();
|
|
185405
|
-
} catch {
|
|
185406
|
-
return path11;
|
|
185407
|
-
}
|
|
185408
|
-
};
|
|
185409
|
-
|
|
185410
|
-
// node_modules/define-lazy-prop/index.js
|
|
185411
|
-
function defineLazyProperty(object2, propertyName, valueGetter) {
|
|
185412
|
-
const define2 = (value) => Object.defineProperty(object2, propertyName, { value, enumerable: true, writable: true });
|
|
185413
|
-
Object.defineProperty(object2, propertyName, {
|
|
185414
|
-
configurable: true,
|
|
185415
|
-
enumerable: true,
|
|
185416
|
-
get() {
|
|
185417
|
-
const result = valueGetter();
|
|
185418
|
-
define2(result);
|
|
185419
|
-
return result;
|
|
185420
|
-
},
|
|
185421
|
-
set(value) {
|
|
185422
|
-
define2(value);
|
|
185423
|
-
}
|
|
185424
|
-
});
|
|
185425
|
-
return object2;
|
|
185426
|
-
}
|
|
185427
|
-
|
|
185428
|
-
// node_modules/default-browser/index.js
|
|
185429
|
-
import { promisify as promisify8 } from "node:util";
|
|
185430
|
-
import process9 from "node:process";
|
|
185431
|
-
import { execFile as execFile6 } from "node:child_process";
|
|
185432
|
-
|
|
185433
|
-
// node_modules/default-browser-id/index.js
|
|
185434
|
-
import { promisify as promisify5 } from "node:util";
|
|
185435
|
-
import process7 from "node:process";
|
|
185436
|
-
import { execFile as execFile3 } from "node:child_process";
|
|
185437
|
-
var execFileAsync = promisify5(execFile3);
|
|
185438
|
-
async function defaultBrowserId() {
|
|
185439
|
-
if (process7.platform !== "darwin") {
|
|
185440
|
-
throw new Error("macOS only");
|
|
185441
|
-
}
|
|
185442
|
-
const { stdout } = await execFileAsync("defaults", ["read", "com.apple.LaunchServices/com.apple.launchservices.secure", "LSHandlers"]);
|
|
185443
|
-
const match = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout);
|
|
185444
|
-
const browserId = match?.groups.id ?? "com.apple.Safari";
|
|
185445
|
-
if (browserId === "com.apple.safari") {
|
|
185446
|
-
return "com.apple.Safari";
|
|
185447
|
-
}
|
|
185448
|
-
return browserId;
|
|
185449
|
-
}
|
|
185450
|
-
|
|
185451
|
-
// node_modules/run-applescript/index.js
|
|
185452
|
-
import process8 from "node:process";
|
|
185453
|
-
import { promisify as promisify6 } from "node:util";
|
|
185454
|
-
import { execFile as execFile4, execFileSync } from "node:child_process";
|
|
185455
|
-
var execFileAsync2 = promisify6(execFile4);
|
|
185456
|
-
async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
|
|
185457
|
-
if (process8.platform !== "darwin") {
|
|
185458
|
-
throw new Error("macOS only");
|
|
185459
|
-
}
|
|
185460
|
-
const outputArguments = humanReadableOutput ? [] : ["-ss"];
|
|
185461
|
-
const execOptions = {};
|
|
185462
|
-
if (signal) {
|
|
185463
|
-
execOptions.signal = signal;
|
|
185464
|
-
}
|
|
185465
|
-
const { stdout } = await execFileAsync2("osascript", ["-e", script, outputArguments], execOptions);
|
|
185466
|
-
return stdout.trim();
|
|
185467
|
-
}
|
|
185468
|
-
|
|
185469
|
-
// node_modules/bundle-name/index.js
|
|
185470
|
-
async function bundleName(bundleId) {
|
|
185471
|
-
return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string
|
|
185472
|
-
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
|
|
185473
|
-
}
|
|
185474
|
-
|
|
185475
|
-
// node_modules/default-browser/windows.js
|
|
185476
|
-
import { promisify as promisify7 } from "node:util";
|
|
185477
|
-
import { execFile as execFile5 } from "node:child_process";
|
|
185478
|
-
var execFileAsync3 = promisify7(execFile5);
|
|
185479
|
-
var windowsBrowserProgIds = {
|
|
185480
|
-
MSEdgeHTM: { name: "Edge", id: "com.microsoft.edge" },
|
|
185481
|
-
MSEdgeBHTML: { name: "Edge Beta", id: "com.microsoft.edge.beta" },
|
|
185482
|
-
MSEdgeDHTML: { name: "Edge Dev", id: "com.microsoft.edge.dev" },
|
|
185483
|
-
AppXq0fevzme2pys62n3e0fbqa7peapykr8v: { name: "Edge", id: "com.microsoft.edge.old" },
|
|
185484
|
-
ChromeHTML: { name: "Chrome", id: "com.google.chrome" },
|
|
185485
|
-
ChromeBHTML: { name: "Chrome Beta", id: "com.google.chrome.beta" },
|
|
185486
|
-
ChromeDHTML: { name: "Chrome Dev", id: "com.google.chrome.dev" },
|
|
185487
|
-
ChromiumHTM: { name: "Chromium", id: "org.chromium.Chromium" },
|
|
185488
|
-
BraveHTML: { name: "Brave", id: "com.brave.Browser" },
|
|
185489
|
-
BraveBHTML: { name: "Brave Beta", id: "com.brave.Browser.beta" },
|
|
185490
|
-
BraveDHTML: { name: "Brave Dev", id: "com.brave.Browser.dev" },
|
|
185491
|
-
BraveSSHTM: { name: "Brave Nightly", id: "com.brave.Browser.nightly" },
|
|
185492
|
-
FirefoxURL: { name: "Firefox", id: "org.mozilla.firefox" },
|
|
185493
|
-
OperaStable: { name: "Opera", id: "com.operasoftware.Opera" },
|
|
185494
|
-
VivaldiHTM: { name: "Vivaldi", id: "com.vivaldi.Vivaldi" },
|
|
185495
|
-
"IE.HTTP": { name: "Internet Explorer", id: "com.microsoft.ie" }
|
|
185496
|
-
};
|
|
185497
|
-
var _windowsBrowserProgIdMap = new Map(Object.entries(windowsBrowserProgIds));
|
|
185498
|
-
|
|
185499
|
-
class UnknownBrowserError extends Error {
|
|
185500
|
-
}
|
|
185501
|
-
async function defaultBrowser(_execFileAsync = execFileAsync3) {
|
|
185502
|
-
const { stdout } = await _execFileAsync("reg", [
|
|
185503
|
-
"QUERY",
|
|
185504
|
-
" HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
|
|
185505
|
-
"/v",
|
|
185506
|
-
"ProgId"
|
|
185507
|
-
]);
|
|
185508
|
-
const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
|
|
185509
|
-
if (!match) {
|
|
185510
|
-
throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);
|
|
185511
|
-
}
|
|
185512
|
-
const { id } = match.groups;
|
|
185513
|
-
const dotIndex = id.lastIndexOf(".");
|
|
185514
|
-
const hyphenIndex = id.lastIndexOf("-");
|
|
185515
|
-
const baseIdByDot = dotIndex === -1 ? undefined : id.slice(0, dotIndex);
|
|
185516
|
-
const baseIdByHyphen = hyphenIndex === -1 ? undefined : id.slice(0, hyphenIndex);
|
|
185517
|
-
return windowsBrowserProgIds[id] ?? windowsBrowserProgIds[baseIdByDot] ?? windowsBrowserProgIds[baseIdByHyphen] ?? { name: id, id };
|
|
185518
|
-
}
|
|
185519
|
-
|
|
185520
|
-
// node_modules/default-browser/index.js
|
|
185521
|
-
var execFileAsync4 = promisify8(execFile6);
|
|
185522
|
-
var titleize = (string4) => string4.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x2) => x2.toUpperCase());
|
|
185523
|
-
async function defaultBrowser2() {
|
|
185524
|
-
if (process9.platform === "darwin") {
|
|
185525
|
-
const id = await defaultBrowserId();
|
|
185526
|
-
const name2 = await bundleName(id);
|
|
185527
|
-
return { name: name2, id };
|
|
185528
|
-
}
|
|
185529
|
-
if (process9.platform === "linux") {
|
|
185530
|
-
const { stdout } = await execFileAsync4("xdg-mime", ["query", "default", "x-scheme-handler/http"]);
|
|
185531
|
-
const id = stdout.trim();
|
|
185532
|
-
const name2 = titleize(id.replace(/.desktop$/, "").replace("-", " "));
|
|
185533
|
-
return { name: name2, id };
|
|
185534
|
-
}
|
|
185535
|
-
if (process9.platform === "win32") {
|
|
185536
|
-
return defaultBrowser();
|
|
185537
|
-
}
|
|
185538
|
-
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
185539
|
-
}
|
|
185540
|
-
|
|
185541
|
-
// node_modules/is-in-ssh/index.js
|
|
185542
|
-
import process10 from "node:process";
|
|
185543
|
-
var isInSsh = Boolean(process10.env.SSH_CONNECTION || process10.env.SSH_CLIENT || process10.env.SSH_TTY);
|
|
185544
|
-
var is_in_ssh_default = isInSsh;
|
|
185545
|
-
|
|
185546
|
-
// node_modules/open/index.js
|
|
185547
|
-
var fallbackAttemptSymbol = Symbol("fallbackAttempt");
|
|
185548
|
-
var __dirname3 = import.meta.url ? path11.dirname(fileURLToPath3(import.meta.url)) : "";
|
|
185549
|
-
var localXdgOpenPath = path11.join(__dirname3, "xdg-open");
|
|
185550
|
-
var { platform: platform5, arch } = process11;
|
|
185551
|
-
var tryEachApp = async (apps, opener) => {
|
|
185552
|
-
if (apps.length === 0) {
|
|
185553
|
-
return;
|
|
185554
|
-
}
|
|
185555
|
-
const errors3 = [];
|
|
185556
|
-
for (const app of apps) {
|
|
185557
|
-
try {
|
|
185558
|
-
return await opener(app);
|
|
185559
|
-
} catch (error48) {
|
|
185560
|
-
errors3.push(error48);
|
|
185561
|
-
}
|
|
185562
|
-
}
|
|
185563
|
-
throw new AggregateError(errors3, "Failed to open in all supported apps");
|
|
185564
|
-
};
|
|
185565
|
-
var baseOpen = async (options) => {
|
|
185566
|
-
options = {
|
|
185567
|
-
wait: false,
|
|
185568
|
-
background: false,
|
|
185569
|
-
newInstance: false,
|
|
185570
|
-
allowNonzeroExitCode: false,
|
|
185571
|
-
...options
|
|
185572
|
-
};
|
|
185573
|
-
const isFallbackAttempt = options[fallbackAttemptSymbol] === true;
|
|
185574
|
-
delete options[fallbackAttemptSymbol];
|
|
185575
|
-
if (Array.isArray(options.app)) {
|
|
185576
|
-
return tryEachApp(options.app, (singleApp) => baseOpen({
|
|
185577
|
-
...options,
|
|
185578
|
-
app: singleApp,
|
|
185579
|
-
[fallbackAttemptSymbol]: true
|
|
185580
|
-
}));
|
|
185581
|
-
}
|
|
185582
|
-
let { name: app, arguments: appArguments = [] } = options.app ?? {};
|
|
185583
|
-
appArguments = [...appArguments];
|
|
185584
|
-
if (Array.isArray(app)) {
|
|
185585
|
-
return tryEachApp(app, (appName) => baseOpen({
|
|
185586
|
-
...options,
|
|
185587
|
-
app: {
|
|
185588
|
-
name: appName,
|
|
185589
|
-
arguments: appArguments
|
|
185590
|
-
},
|
|
185591
|
-
[fallbackAttemptSymbol]: true
|
|
185592
|
-
}));
|
|
185593
|
-
}
|
|
185594
|
-
if (app === "browser" || app === "browserPrivate") {
|
|
185595
|
-
const ids = {
|
|
185596
|
-
"com.google.chrome": "chrome",
|
|
185597
|
-
"google-chrome.desktop": "chrome",
|
|
185598
|
-
"com.brave.browser": "brave",
|
|
185599
|
-
"org.mozilla.firefox": "firefox",
|
|
185600
|
-
"firefox.desktop": "firefox",
|
|
185601
|
-
"com.microsoft.msedge": "edge",
|
|
185602
|
-
"com.microsoft.edge": "edge",
|
|
185603
|
-
"com.microsoft.edgemac": "edge",
|
|
185604
|
-
"microsoft-edge.desktop": "edge",
|
|
185605
|
-
"com.apple.safari": "safari"
|
|
185606
|
-
};
|
|
185607
|
-
const flags = {
|
|
185608
|
-
chrome: "--incognito",
|
|
185609
|
-
brave: "--incognito",
|
|
185610
|
-
firefox: "--private-window",
|
|
185611
|
-
edge: "--inPrivate"
|
|
185612
|
-
};
|
|
185613
|
-
let browser;
|
|
185614
|
-
if (is_wsl_default) {
|
|
185615
|
-
const progId = await wslDefaultBrowser();
|
|
185616
|
-
const browserInfo = _windowsBrowserProgIdMap.get(progId);
|
|
185617
|
-
browser = browserInfo ?? {};
|
|
185618
|
-
} else {
|
|
185619
|
-
browser = await defaultBrowser2();
|
|
185620
|
-
}
|
|
185621
|
-
if (browser.id in ids) {
|
|
185622
|
-
const browserName = ids[browser.id.toLowerCase()];
|
|
185623
|
-
if (app === "browserPrivate") {
|
|
185624
|
-
if (browserName === "safari") {
|
|
185625
|
-
throw new Error("Safari doesn't support opening in private mode via command line");
|
|
185626
|
-
}
|
|
185627
|
-
appArguments.push(flags[browserName]);
|
|
185628
|
-
}
|
|
185629
|
-
return baseOpen({
|
|
185630
|
-
...options,
|
|
185631
|
-
app: {
|
|
185632
|
-
name: apps[browserName],
|
|
185633
|
-
arguments: appArguments
|
|
185634
|
-
}
|
|
185635
|
-
});
|
|
185636
|
-
}
|
|
185637
|
-
throw new Error(`${browser.name} is not supported as a default browser`);
|
|
185638
|
-
}
|
|
185639
|
-
let command;
|
|
185640
|
-
const cliArguments = [];
|
|
185641
|
-
const childProcessOptions = {};
|
|
185642
|
-
let shouldUseWindowsInWsl = false;
|
|
185643
|
-
if (is_wsl_default && !isInsideContainer() && !is_in_ssh_default && !app) {
|
|
185644
|
-
shouldUseWindowsInWsl = await canAccessPowerShell();
|
|
185645
|
-
}
|
|
185646
|
-
if (platform5 === "darwin") {
|
|
185647
|
-
command = "open";
|
|
185648
|
-
if (options.wait) {
|
|
185649
|
-
cliArguments.push("--wait-apps");
|
|
185650
|
-
}
|
|
185651
|
-
if (options.background) {
|
|
185652
|
-
cliArguments.push("--background");
|
|
185653
|
-
}
|
|
185654
|
-
if (options.newInstance) {
|
|
185655
|
-
cliArguments.push("--new");
|
|
185656
|
-
}
|
|
185657
|
-
if (app) {
|
|
185658
|
-
cliArguments.push("-a", app);
|
|
185659
|
-
}
|
|
185660
|
-
} else if (platform5 === "win32" || shouldUseWindowsInWsl) {
|
|
185661
|
-
command = await powerShellPath2();
|
|
185662
|
-
cliArguments.push(...executePowerShell.argumentsPrefix);
|
|
185663
|
-
if (!is_wsl_default) {
|
|
185664
|
-
childProcessOptions.windowsVerbatimArguments = true;
|
|
185665
|
-
}
|
|
185666
|
-
if (is_wsl_default && options.target) {
|
|
185667
|
-
options.target = await convertWslPathToWindows(options.target);
|
|
185668
|
-
}
|
|
185669
|
-
const encodedArguments = ["$ProgressPreference = 'SilentlyContinue';", "Start"];
|
|
185670
|
-
if (options.wait) {
|
|
185671
|
-
encodedArguments.push("-Wait");
|
|
185672
|
-
}
|
|
185673
|
-
if (app) {
|
|
185674
|
-
encodedArguments.push(executePowerShell.escapeArgument(app));
|
|
185675
|
-
if (options.target) {
|
|
185676
|
-
appArguments.push(options.target);
|
|
185677
|
-
}
|
|
185678
|
-
} else if (options.target) {
|
|
185679
|
-
encodedArguments.push(executePowerShell.escapeArgument(options.target));
|
|
185680
|
-
}
|
|
185681
|
-
if (appArguments.length > 0) {
|
|
185682
|
-
appArguments = appArguments.map((argument) => executePowerShell.escapeArgument(argument));
|
|
185683
|
-
encodedArguments.push("-ArgumentList", appArguments.join(","));
|
|
185684
|
-
}
|
|
185685
|
-
options.target = executePowerShell.encodeCommand(encodedArguments.join(" "));
|
|
185686
|
-
if (!options.wait) {
|
|
185687
|
-
childProcessOptions.stdio = "ignore";
|
|
185688
|
-
}
|
|
185689
|
-
} else {
|
|
185690
|
-
if (app) {
|
|
185691
|
-
command = app;
|
|
185692
|
-
} else {
|
|
185693
|
-
const isBundled = !__dirname3 || __dirname3 === "/";
|
|
185694
|
-
let exeLocalXdgOpen = false;
|
|
185695
|
-
try {
|
|
185696
|
-
await fs18.access(localXdgOpenPath, fsConstants2.X_OK);
|
|
185697
|
-
exeLocalXdgOpen = true;
|
|
185698
|
-
} catch {}
|
|
185699
|
-
const useSystemXdgOpen = process11.versions.electron ?? (platform5 === "android" || isBundled || !exeLocalXdgOpen);
|
|
185700
|
-
command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
|
|
185701
|
-
}
|
|
185702
|
-
if (appArguments.length > 0) {
|
|
185703
|
-
cliArguments.push(...appArguments);
|
|
185704
|
-
}
|
|
185705
|
-
if (!options.wait) {
|
|
185706
|
-
childProcessOptions.stdio = "ignore";
|
|
185707
|
-
childProcessOptions.detached = true;
|
|
185708
|
-
}
|
|
185709
|
-
}
|
|
185710
|
-
if (platform5 === "darwin" && appArguments.length > 0) {
|
|
185711
|
-
cliArguments.push("--args", ...appArguments);
|
|
185712
|
-
}
|
|
185713
|
-
if (options.target) {
|
|
185714
|
-
cliArguments.push(options.target);
|
|
185715
|
-
}
|
|
185716
|
-
const subprocess = childProcess3.spawn(command, cliArguments, childProcessOptions);
|
|
185717
|
-
if (options.wait) {
|
|
185718
|
-
return new Promise((resolve, reject) => {
|
|
185719
|
-
subprocess.once("error", reject);
|
|
185720
|
-
subprocess.once("close", (exitCode) => {
|
|
185721
|
-
if (!options.allowNonzeroExitCode && exitCode !== 0) {
|
|
185722
|
-
reject(new Error(`Exited with code ${exitCode}`));
|
|
185723
|
-
return;
|
|
185724
|
-
}
|
|
185725
|
-
resolve(subprocess);
|
|
185726
|
-
});
|
|
185727
|
-
});
|
|
185728
|
-
}
|
|
185729
|
-
if (isFallbackAttempt) {
|
|
185730
|
-
return new Promise((resolve, reject) => {
|
|
185731
|
-
subprocess.once("error", reject);
|
|
185732
|
-
subprocess.once("spawn", () => {
|
|
185733
|
-
subprocess.once("close", (exitCode) => {
|
|
185734
|
-
subprocess.off("error", reject);
|
|
185735
|
-
if (exitCode !== 0) {
|
|
185736
|
-
reject(new Error(`Exited with code ${exitCode}`));
|
|
185737
|
-
return;
|
|
185738
|
-
}
|
|
185739
|
-
subprocess.unref();
|
|
185740
|
-
resolve(subprocess);
|
|
185741
|
-
});
|
|
185742
|
-
});
|
|
185743
|
-
});
|
|
185744
|
-
}
|
|
185745
|
-
subprocess.unref();
|
|
185746
|
-
return new Promise((resolve, reject) => {
|
|
185747
|
-
subprocess.once("error", reject);
|
|
185748
|
-
subprocess.once("spawn", () => {
|
|
185749
|
-
subprocess.off("error", reject);
|
|
185750
|
-
resolve(subprocess);
|
|
185751
|
-
});
|
|
185752
|
-
});
|
|
185753
|
-
};
|
|
185754
|
-
var open = (target, options) => {
|
|
185755
|
-
if (typeof target !== "string") {
|
|
185756
|
-
throw new TypeError("Expected a `target`");
|
|
185757
|
-
}
|
|
185758
|
-
return baseOpen({
|
|
185759
|
-
...options,
|
|
185760
|
-
target
|
|
185761
|
-
});
|
|
185762
|
-
};
|
|
185763
|
-
function detectArchBinary(binary) {
|
|
185764
|
-
if (typeof binary === "string" || Array.isArray(binary)) {
|
|
185765
|
-
return binary;
|
|
185766
|
-
}
|
|
185767
|
-
const { [arch]: archBinary } = binary;
|
|
185768
|
-
if (!archBinary) {
|
|
185769
|
-
throw new Error(`${arch} is not supported`);
|
|
185770
|
-
}
|
|
185771
|
-
return archBinary;
|
|
185772
|
-
}
|
|
185773
|
-
function detectPlatformBinary({ [platform5]: platformBinary }, { wsl } = {}) {
|
|
185774
|
-
if (wsl && is_wsl_default) {
|
|
185775
|
-
return detectArchBinary(wsl);
|
|
185776
|
-
}
|
|
185777
|
-
if (!platformBinary) {
|
|
185778
|
-
throw new Error(`${platform5} is not supported`);
|
|
185779
|
-
}
|
|
185780
|
-
return detectArchBinary(platformBinary);
|
|
185781
|
-
}
|
|
185782
|
-
var apps = {
|
|
185783
|
-
browser: "browser",
|
|
185784
|
-
browserPrivate: "browserPrivate"
|
|
185785
|
-
};
|
|
185786
|
-
defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
|
|
185787
|
-
darwin: "google chrome",
|
|
185788
|
-
win32: "chrome",
|
|
185789
|
-
linux: ["google-chrome", "google-chrome-stable", "chromium", "chromium-browser"]
|
|
185790
|
-
}, {
|
|
185791
|
-
wsl: {
|
|
185792
|
-
ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
|
|
185793
|
-
x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
|
|
185794
|
-
}
|
|
185795
|
-
}));
|
|
185796
|
-
defineLazyProperty(apps, "brave", () => detectPlatformBinary({
|
|
185797
|
-
darwin: "brave browser",
|
|
185798
|
-
win32: "brave",
|
|
185799
|
-
linux: ["brave-browser", "brave"]
|
|
185800
|
-
}, {
|
|
185801
|
-
wsl: {
|
|
185802
|
-
ia32: "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",
|
|
185803
|
-
x64: ["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe", "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]
|
|
185804
|
-
}
|
|
185805
|
-
}));
|
|
185806
|
-
defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
|
|
185807
|
-
darwin: "firefox",
|
|
185808
|
-
win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
|
|
185809
|
-
linux: "firefox"
|
|
185810
|
-
}, {
|
|
185811
|
-
wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"
|
|
185812
|
-
}));
|
|
185813
|
-
defineLazyProperty(apps, "edge", () => detectPlatformBinary({
|
|
185814
|
-
darwin: "microsoft edge",
|
|
185815
|
-
win32: "msedge",
|
|
185816
|
-
linux: ["microsoft-edge", "microsoft-edge-dev"]
|
|
185817
|
-
}, {
|
|
185818
|
-
wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
|
|
185819
|
-
}));
|
|
185820
|
-
defineLazyProperty(apps, "safari", () => detectPlatformBinary({
|
|
185821
|
-
darwin: "Safari"
|
|
185822
|
-
}));
|
|
185823
|
-
var open_default = open;
|
|
185824
|
-
|
|
185825
|
-
// node_modules/p-wait-for/index.js
|
|
185826
|
-
var resolveValue = Symbol("resolveValue");
|
|
185827
|
-
var sleep = (ms, signal) => new Promise((resolve, reject) => {
|
|
185828
|
-
if (signal?.aborted) {
|
|
185829
|
-
reject(signal.reason);
|
|
185830
|
-
return;
|
|
185831
|
-
}
|
|
185832
|
-
const timeout2 = setTimeout(resolve, ms);
|
|
185833
|
-
if (signal) {
|
|
185834
|
-
signal.addEventListener("abort", () => {
|
|
185835
|
-
clearTimeout(timeout2);
|
|
185836
|
-
reject(signal.reason);
|
|
185837
|
-
}, { once: true });
|
|
185838
|
-
}
|
|
185839
|
-
});
|
|
185840
|
-
var validateOptions = (interval, timeout2) => {
|
|
185841
|
-
if (typeof interval !== "number" || !Number.isFinite(interval) || interval < 0) {
|
|
185842
|
-
throw new TypeError("Expected interval to be a finite non-negative number");
|
|
185843
|
-
}
|
|
185844
|
-
if (typeof timeout2 === "object" && timeout2 !== null) {
|
|
185845
|
-
if (typeof timeout2.milliseconds !== "number" || Number.isNaN(timeout2.milliseconds) || timeout2.milliseconds < 0) {
|
|
185846
|
-
throw new TypeError("Expected timeout.milliseconds to be a finite non-negative number");
|
|
185847
|
-
}
|
|
185848
|
-
} else if (typeof timeout2 === "number" && (Number.isNaN(timeout2) || timeout2 < 0)) {
|
|
185849
|
-
throw new TypeError("Expected timeout to be a finite non-negative number");
|
|
185850
|
-
}
|
|
185851
|
-
};
|
|
185852
|
-
var createTimeoutError = (timeout2) => {
|
|
185853
|
-
if (timeout2.message instanceof Error) {
|
|
185854
|
-
return timeout2.message;
|
|
185855
|
-
}
|
|
185856
|
-
const message = timeout2.message ?? `Promise timed out after ${timeout2.milliseconds} milliseconds`;
|
|
185857
|
-
return new TimeoutError2(message);
|
|
185858
|
-
};
|
|
185859
|
-
var handleFallback = (timeout2) => {
|
|
185860
|
-
if (timeout2.fallback) {
|
|
185861
|
-
return timeout2.fallback();
|
|
185862
|
-
}
|
|
185863
|
-
throw createTimeoutError(timeout2);
|
|
185864
|
-
};
|
|
185865
|
-
var handleAbortError = (timeoutSignal, timeout2, signal) => {
|
|
185866
|
-
if (timeoutSignal?.aborted) {
|
|
185867
|
-
if (typeof timeout2 === "object") {
|
|
185868
|
-
return handleFallback(timeout2);
|
|
185869
|
-
}
|
|
185870
|
-
throw new TimeoutError2;
|
|
185871
|
-
}
|
|
185872
|
-
throw signal.reason;
|
|
185873
|
-
};
|
|
185874
|
-
async function pWaitFor(condition, options = {}) {
|
|
185875
|
-
const {
|
|
185876
|
-
interval = 20,
|
|
185877
|
-
timeout: timeout2 = Number.POSITIVE_INFINITY,
|
|
185878
|
-
before = true,
|
|
185879
|
-
signal
|
|
185880
|
-
} = options;
|
|
185881
|
-
validateOptions(interval, timeout2);
|
|
185882
|
-
const timeoutMs = typeof timeout2 === "number" ? timeout2 : timeout2?.milliseconds ?? Number.POSITIVE_INFINITY;
|
|
185883
|
-
const timeoutSignal = timeoutMs === Number.POSITIVE_INFINITY ? undefined : AbortSignal.timeout(timeoutMs);
|
|
185884
|
-
const combinedSignal = timeoutSignal && signal ? AbortSignal.any([timeoutSignal, signal]) : timeoutSignal ?? signal;
|
|
185885
|
-
if (!before) {
|
|
185886
|
-
await sleep(interval, combinedSignal);
|
|
185887
|
-
}
|
|
185888
|
-
if (combinedSignal?.aborted) {
|
|
185889
|
-
return handleAbortError(timeoutSignal, timeout2, signal);
|
|
185890
|
-
}
|
|
185891
|
-
while (true) {
|
|
185892
|
-
try {
|
|
185893
|
-
const value = await condition();
|
|
185894
|
-
if (typeof value === "object" && value !== null && resolveValue in value) {
|
|
185895
|
-
return value[resolveValue];
|
|
185896
|
-
}
|
|
185897
|
-
if (value === true) {
|
|
185898
|
-
return;
|
|
185899
|
-
}
|
|
185900
|
-
if (value === false) {
|
|
185901
|
-
await sleep(interval, combinedSignal);
|
|
185902
|
-
continue;
|
|
185903
|
-
}
|
|
185904
|
-
throw new TypeError("Expected condition to return a boolean");
|
|
185905
|
-
} catch (error48) {
|
|
185906
|
-
if (error48 === combinedSignal?.reason) {
|
|
185907
|
-
return handleAbortError(timeoutSignal, timeout2, signal);
|
|
185908
|
-
}
|
|
185909
|
-
throw error48;
|
|
185910
|
-
}
|
|
185911
|
-
}
|
|
185912
|
-
}
|
|
185913
|
-
pWaitFor.resolveWith = (value) => ({ [resolveValue]: value });
|
|
185914
|
-
|
|
185915
|
-
class TimeoutError2 extends Error {
|
|
185916
|
-
constructor(message = "Promise timed out") {
|
|
185917
|
-
super(message);
|
|
185918
|
-
this.name = "TimeoutError";
|
|
185919
|
-
}
|
|
185920
|
-
}
|
|
185921
|
-
|
|
185922
|
-
// src/core/resources/connector/oauth.ts
|
|
185923
|
-
var POLL_INTERVAL_MS = 2000;
|
|
185924
|
-
var POLL_TIMEOUT_MS = 2 * 60 * 1000;
|
|
185925
|
-
async function runOAuthFlow(params) {
|
|
185926
|
-
await open_default(params.redirectUrl);
|
|
185927
|
-
let finalStatus = "PENDING";
|
|
185928
|
-
await pWaitFor(async () => {
|
|
185929
|
-
const response = await getOAuthStatus(params.type, params.connectionId);
|
|
185930
|
-
finalStatus = response.status;
|
|
185931
|
-
return response.status !== "PENDING";
|
|
185932
|
-
}, {
|
|
185933
|
-
interval: POLL_INTERVAL_MS,
|
|
185934
|
-
timeout: POLL_TIMEOUT_MS
|
|
185935
|
-
}).catch((err) => {
|
|
185936
|
-
if (err instanceof TimeoutError2) {
|
|
185937
|
-
finalStatus = "PENDING";
|
|
185938
|
-
} else {
|
|
185939
|
-
throw err;
|
|
185940
|
-
}
|
|
185941
|
-
});
|
|
185942
|
-
return { type: params.type, status: finalStatus };
|
|
185943
185234
|
}
|
|
185944
185235
|
// src/core/resources/connector/push.ts
|
|
185945
185236
|
async function pushConnectors(connectors) {
|
|
@@ -185949,7 +185240,7 @@ async function pushConnectors(connectors) {
|
|
|
185949
185240
|
for (const connector of connectors) {
|
|
185950
185241
|
try {
|
|
185951
185242
|
const response = await setConnector(connector.type, connector.scopes ?? []);
|
|
185952
|
-
results.push(
|
|
185243
|
+
results.push(getConnectorSyncResult(connector.type, response));
|
|
185953
185244
|
} catch (err) {
|
|
185954
185245
|
results.push({
|
|
185955
185246
|
type: connector.type,
|
|
@@ -185959,16 +185250,16 @@ async function pushConnectors(connectors) {
|
|
|
185959
185250
|
}
|
|
185960
185251
|
}
|
|
185961
185252
|
for (const upstreamConnector of upstream.integrations) {
|
|
185962
|
-
if (!localTypes.has(upstreamConnector.
|
|
185253
|
+
if (!localTypes.has(upstreamConnector.integrationType)) {
|
|
185963
185254
|
try {
|
|
185964
|
-
await removeConnector(upstreamConnector.
|
|
185255
|
+
await removeConnector(upstreamConnector.integrationType);
|
|
185965
185256
|
results.push({
|
|
185966
|
-
type: upstreamConnector.
|
|
185257
|
+
type: upstreamConnector.integrationType,
|
|
185967
185258
|
action: "removed"
|
|
185968
185259
|
});
|
|
185969
185260
|
} catch (err) {
|
|
185970
185261
|
results.push({
|
|
185971
|
-
type: upstreamConnector.
|
|
185262
|
+
type: upstreamConnector.integrationType,
|
|
185972
185263
|
action: "error",
|
|
185973
185264
|
error: err instanceof Error ? err.message : String(err)
|
|
185974
185265
|
});
|
|
@@ -185977,23 +185268,23 @@ async function pushConnectors(connectors) {
|
|
|
185977
185268
|
}
|
|
185978
185269
|
return { results };
|
|
185979
185270
|
}
|
|
185980
|
-
function
|
|
185271
|
+
function getConnectorSyncResult(type, response) {
|
|
185981
185272
|
if (response.error === "different_user") {
|
|
185982
185273
|
return {
|
|
185983
185274
|
type,
|
|
185984
185275
|
action: "error",
|
|
185985
|
-
error: response.
|
|
185276
|
+
error: response.errorMessage || `Already connected by ${response.otherUserEmail ?? "another user"}`
|
|
185986
185277
|
};
|
|
185987
185278
|
}
|
|
185988
|
-
if (response.
|
|
185279
|
+
if (response.alreadyAuthorized) {
|
|
185989
185280
|
return { type, action: "synced" };
|
|
185990
185281
|
}
|
|
185991
|
-
if (response.
|
|
185282
|
+
if (response.redirectUrl) {
|
|
185992
185283
|
return {
|
|
185993
185284
|
type,
|
|
185994
185285
|
action: "needs_oauth",
|
|
185995
|
-
redirectUrl: response.
|
|
185996
|
-
connectionId: response.
|
|
185286
|
+
redirectUrl: response.redirectUrl,
|
|
185287
|
+
connectionId: response.connectionId ?? undefined
|
|
185997
185288
|
};
|
|
185998
185289
|
}
|
|
185999
185290
|
return { type, action: "synced" };
|
|
@@ -187002,16 +186293,16 @@ var ansiStyles = assembleStyles();
|
|
|
187002
186293
|
var ansi_styles_default = ansiStyles;
|
|
187003
186294
|
|
|
187004
186295
|
// node_modules/chalk/source/vendor/supports-color/index.js
|
|
187005
|
-
import
|
|
187006
|
-
import
|
|
186296
|
+
import process5 from "node:process";
|
|
186297
|
+
import os from "node:os";
|
|
187007
186298
|
import tty from "node:tty";
|
|
187008
|
-
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args :
|
|
186299
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process5.argv) {
|
|
187009
186300
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
187010
186301
|
const position = argv.indexOf(prefix + flag);
|
|
187011
186302
|
const terminatorPosition = argv.indexOf("--");
|
|
187012
186303
|
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
187013
186304
|
}
|
|
187014
|
-
var { env } =
|
|
186305
|
+
var { env } = process5;
|
|
187015
186306
|
var flagForceColor;
|
|
187016
186307
|
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
187017
186308
|
flagForceColor = 0;
|
|
@@ -187067,8 +186358,8 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
187067
186358
|
if (env.TERM === "dumb") {
|
|
187068
186359
|
return min;
|
|
187069
186360
|
}
|
|
187070
|
-
if (
|
|
187071
|
-
const osRelease =
|
|
186361
|
+
if (process5.platform === "win32") {
|
|
186362
|
+
const osRelease = os.release().split(".");
|
|
187072
186363
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
187073
186364
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
187074
186365
|
}
|
|
@@ -187260,18 +186551,18 @@ var proto = Object.defineProperties(() => {}, {
|
|
|
187260
186551
|
}
|
|
187261
186552
|
}
|
|
187262
186553
|
});
|
|
187263
|
-
var createStyler = (
|
|
186554
|
+
var createStyler = (open, close, parent) => {
|
|
187264
186555
|
let openAll;
|
|
187265
186556
|
let closeAll;
|
|
187266
186557
|
if (parent === undefined) {
|
|
187267
|
-
openAll =
|
|
186558
|
+
openAll = open;
|
|
187268
186559
|
closeAll = close;
|
|
187269
186560
|
} else {
|
|
187270
|
-
openAll = parent.openAll +
|
|
186561
|
+
openAll = parent.openAll + open;
|
|
187271
186562
|
closeAll = close + parent.closeAll;
|
|
187272
186563
|
}
|
|
187273
186564
|
return {
|
|
187274
|
-
open
|
|
186565
|
+
open,
|
|
187275
186566
|
close,
|
|
187276
186567
|
openAll,
|
|
187277
186568
|
closeAll,
|
|
@@ -187353,7 +186644,7 @@ var theme = {
|
|
|
187353
186644
|
};
|
|
187354
186645
|
|
|
187355
186646
|
// src/cli/utils/animate.ts
|
|
187356
|
-
function
|
|
186647
|
+
function sleep(ms) {
|
|
187357
186648
|
return new Promise((resolve2) => setTimeout(resolve2, ms));
|
|
187358
186649
|
}
|
|
187359
186650
|
async function animateLineReveal(line, duration3) {
|
|
@@ -187373,7 +186664,7 @@ async function animateLineReveal(line, duration3) {
|
|
|
187373
186664
|
}
|
|
187374
186665
|
}
|
|
187375
186666
|
process.stdout.write(`\r${output}`);
|
|
187376
|
-
await
|
|
186667
|
+
await sleep(stepDuration);
|
|
187377
186668
|
}
|
|
187378
186669
|
process.stdout.write(`\r${theme.colors.base44Orange(line)}
|
|
187379
186670
|
`);
|
|
@@ -187398,7 +186689,7 @@ async function shimmerPass(lines, duration3) {
|
|
|
187398
186689
|
}
|
|
187399
186690
|
console.log(output);
|
|
187400
186691
|
}
|
|
187401
|
-
await
|
|
186692
|
+
await sleep(stepDuration);
|
|
187402
186693
|
}
|
|
187403
186694
|
process.stdout.write(moveUp);
|
|
187404
186695
|
for (const line of lines) {
|
|
@@ -187412,7 +186703,7 @@ async function printAnimatedLines(lines) {
|
|
|
187412
186703
|
const line = lines[i];
|
|
187413
186704
|
await animateLineReveal(line, 100);
|
|
187414
186705
|
if (i < lines.length - 1) {
|
|
187415
|
-
await
|
|
186706
|
+
await sleep(lineDelay - 100);
|
|
187416
186707
|
}
|
|
187417
186708
|
}
|
|
187418
186709
|
await shimmerPass(lines, 200);
|
|
@@ -187450,6 +186741,103 @@ var onPromptCancel = () => {
|
|
|
187450
186741
|
xe("Operation cancelled.");
|
|
187451
186742
|
throw new CLIExitError(0);
|
|
187452
186743
|
};
|
|
186744
|
+
// node_modules/p-wait-for/index.js
|
|
186745
|
+
var resolveValue = Symbol("resolveValue");
|
|
186746
|
+
var sleep2 = (ms, signal) => new Promise((resolve2, reject) => {
|
|
186747
|
+
if (signal?.aborted) {
|
|
186748
|
+
reject(signal.reason);
|
|
186749
|
+
return;
|
|
186750
|
+
}
|
|
186751
|
+
const timeout2 = setTimeout(resolve2, ms);
|
|
186752
|
+
if (signal) {
|
|
186753
|
+
signal.addEventListener("abort", () => {
|
|
186754
|
+
clearTimeout(timeout2);
|
|
186755
|
+
reject(signal.reason);
|
|
186756
|
+
}, { once: true });
|
|
186757
|
+
}
|
|
186758
|
+
});
|
|
186759
|
+
var validateOptions = (interval, timeout2) => {
|
|
186760
|
+
if (typeof interval !== "number" || !Number.isFinite(interval) || interval < 0) {
|
|
186761
|
+
throw new TypeError("Expected interval to be a finite non-negative number");
|
|
186762
|
+
}
|
|
186763
|
+
if (typeof timeout2 === "object" && timeout2 !== null) {
|
|
186764
|
+
if (typeof timeout2.milliseconds !== "number" || Number.isNaN(timeout2.milliseconds) || timeout2.milliseconds < 0) {
|
|
186765
|
+
throw new TypeError("Expected timeout.milliseconds to be a finite non-negative number");
|
|
186766
|
+
}
|
|
186767
|
+
} else if (typeof timeout2 === "number" && (Number.isNaN(timeout2) || timeout2 < 0)) {
|
|
186768
|
+
throw new TypeError("Expected timeout to be a finite non-negative number");
|
|
186769
|
+
}
|
|
186770
|
+
};
|
|
186771
|
+
var createTimeoutError = (timeout2) => {
|
|
186772
|
+
if (timeout2.message instanceof Error) {
|
|
186773
|
+
return timeout2.message;
|
|
186774
|
+
}
|
|
186775
|
+
const message = timeout2.message ?? `Promise timed out after ${timeout2.milliseconds} milliseconds`;
|
|
186776
|
+
return new TimeoutError2(message);
|
|
186777
|
+
};
|
|
186778
|
+
var handleFallback = (timeout2) => {
|
|
186779
|
+
if (timeout2.fallback) {
|
|
186780
|
+
return timeout2.fallback();
|
|
186781
|
+
}
|
|
186782
|
+
throw createTimeoutError(timeout2);
|
|
186783
|
+
};
|
|
186784
|
+
var handleAbortError = (timeoutSignal, timeout2, signal) => {
|
|
186785
|
+
if (timeoutSignal?.aborted) {
|
|
186786
|
+
if (typeof timeout2 === "object") {
|
|
186787
|
+
return handleFallback(timeout2);
|
|
186788
|
+
}
|
|
186789
|
+
throw new TimeoutError2;
|
|
186790
|
+
}
|
|
186791
|
+
throw signal.reason;
|
|
186792
|
+
};
|
|
186793
|
+
async function pWaitFor(condition, options = {}) {
|
|
186794
|
+
const {
|
|
186795
|
+
interval = 20,
|
|
186796
|
+
timeout: timeout2 = Number.POSITIVE_INFINITY,
|
|
186797
|
+
before = true,
|
|
186798
|
+
signal
|
|
186799
|
+
} = options;
|
|
186800
|
+
validateOptions(interval, timeout2);
|
|
186801
|
+
const timeoutMs = typeof timeout2 === "number" ? timeout2 : timeout2?.milliseconds ?? Number.POSITIVE_INFINITY;
|
|
186802
|
+
const timeoutSignal = timeoutMs === Number.POSITIVE_INFINITY ? undefined : AbortSignal.timeout(timeoutMs);
|
|
186803
|
+
const combinedSignal = timeoutSignal && signal ? AbortSignal.any([timeoutSignal, signal]) : timeoutSignal ?? signal;
|
|
186804
|
+
if (!before) {
|
|
186805
|
+
await sleep2(interval, combinedSignal);
|
|
186806
|
+
}
|
|
186807
|
+
if (combinedSignal?.aborted) {
|
|
186808
|
+
return handleAbortError(timeoutSignal, timeout2, signal);
|
|
186809
|
+
}
|
|
186810
|
+
while (true) {
|
|
186811
|
+
try {
|
|
186812
|
+
const value = await condition();
|
|
186813
|
+
if (typeof value === "object" && value !== null && resolveValue in value) {
|
|
186814
|
+
return value[resolveValue];
|
|
186815
|
+
}
|
|
186816
|
+
if (value === true) {
|
|
186817
|
+
return;
|
|
186818
|
+
}
|
|
186819
|
+
if (value === false) {
|
|
186820
|
+
await sleep2(interval, combinedSignal);
|
|
186821
|
+
continue;
|
|
186822
|
+
}
|
|
186823
|
+
throw new TypeError("Expected condition to return a boolean");
|
|
186824
|
+
} catch (error48) {
|
|
186825
|
+
if (error48 === combinedSignal?.reason) {
|
|
186826
|
+
return handleAbortError(timeoutSignal, timeout2, signal);
|
|
186827
|
+
}
|
|
186828
|
+
throw error48;
|
|
186829
|
+
}
|
|
186830
|
+
}
|
|
186831
|
+
}
|
|
186832
|
+
pWaitFor.resolveWith = (value) => ({ [resolveValue]: value });
|
|
186833
|
+
|
|
186834
|
+
class TimeoutError2 extends Error {
|
|
186835
|
+
constructor(message = "Promise timed out") {
|
|
186836
|
+
super(message);
|
|
186837
|
+
this.name = "TimeoutError";
|
|
186838
|
+
}
|
|
186839
|
+
}
|
|
186840
|
+
|
|
187453
186841
|
// src/cli/commands/auth/login-flow.ts
|
|
187454
186842
|
async function generateAndDisplayDeviceCode() {
|
|
187455
186843
|
const deviceCodeResponse = await runTask("Generating device code...", async () => {
|
|
@@ -187522,7 +186910,7 @@ function isPlainObject2(value) {
|
|
|
187522
186910
|
}
|
|
187523
186911
|
|
|
187524
186912
|
// node_modules/execa/lib/arguments/file-url.js
|
|
187525
|
-
import { fileURLToPath as
|
|
186913
|
+
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
187526
186914
|
var safeNormalizeFileUrl = (file2, name2) => {
|
|
187527
186915
|
const fileString = normalizeFileUrl(normalizeDenoExecPath(file2));
|
|
187528
186916
|
if (typeof fileString !== "string") {
|
|
@@ -187532,7 +186920,7 @@ var safeNormalizeFileUrl = (file2, name2) => {
|
|
|
187532
186920
|
};
|
|
187533
186921
|
var normalizeDenoExecPath = (file2) => isDenoExecPath(file2) ? file2.toString() : file2;
|
|
187534
186922
|
var isDenoExecPath = (file2) => typeof file2 !== "string" && file2 && Object.getPrototypeOf(file2) === String.prototype;
|
|
187535
|
-
var normalizeFileUrl = (file2) => file2 instanceof URL ?
|
|
186923
|
+
var normalizeFileUrl = (file2) => file2 instanceof URL ? fileURLToPath3(file2) : file2;
|
|
187536
186924
|
|
|
187537
186925
|
// node_modules/execa/lib/methods/parameters.js
|
|
187538
186926
|
var normalizeParameters = (rawFile, rawArguments = [], rawOptions = {}) => {
|
|
@@ -187714,9 +187102,9 @@ import { spawnSync } from "node:child_process";
|
|
|
187714
187102
|
import { debuglog } from "node:util";
|
|
187715
187103
|
|
|
187716
187104
|
// node_modules/execa/lib/utils/standard-stream.js
|
|
187717
|
-
import
|
|
187105
|
+
import process6 from "node:process";
|
|
187718
187106
|
var isStandardStream = (stream) => STANDARD_STREAMS.includes(stream);
|
|
187719
|
-
var STANDARD_STREAMS = [
|
|
187107
|
+
var STANDARD_STREAMS = [process6.stdin, process6.stdout, process6.stderr];
|
|
187720
187108
|
var STANDARD_STREAMS_ALIASES = ["stdin", "stdout", "stderr"];
|
|
187721
187109
|
var getStreamName = (fdNumber) => STANDARD_STREAMS_ALIASES[fdNumber] ?? `stdio[${fdNumber}]`;
|
|
187722
187110
|
|
|
@@ -187806,7 +187194,7 @@ var VERBOSE_VALUES = ["none", "short", "full"];
|
|
|
187806
187194
|
import { inspect } from "node:util";
|
|
187807
187195
|
|
|
187808
187196
|
// node_modules/execa/lib/arguments/escape.js
|
|
187809
|
-
import { platform as
|
|
187197
|
+
import { platform as platform5 } from "node:process";
|
|
187810
187198
|
import { stripVTControlCharacters } from "node:util";
|
|
187811
187199
|
var joinCommand = (filePath, rawArguments) => {
|
|
187812
187200
|
const fileAndArguments = [filePath, ...rawArguments];
|
|
@@ -187848,16 +187236,16 @@ var quoteString = (escapedArgument) => {
|
|
|
187848
187236
|
if (NO_ESCAPE_REGEXP.test(escapedArgument)) {
|
|
187849
187237
|
return escapedArgument;
|
|
187850
187238
|
}
|
|
187851
|
-
return
|
|
187239
|
+
return platform5 === "win32" ? `"${escapedArgument.replaceAll('"', '""')}"` : `'${escapedArgument.replaceAll("'", "'\\''")}'`;
|
|
187852
187240
|
};
|
|
187853
187241
|
var NO_ESCAPE_REGEXP = /^[\w./-]+$/;
|
|
187854
187242
|
|
|
187855
187243
|
// node_modules/is-unicode-supported/index.js
|
|
187856
|
-
import
|
|
187244
|
+
import process7 from "node:process";
|
|
187857
187245
|
function isUnicodeSupported() {
|
|
187858
|
-
const { env: env2 } =
|
|
187246
|
+
const { env: env2 } = process7;
|
|
187859
187247
|
const { TERM, TERM_PROGRAM } = env2;
|
|
187860
|
-
if (
|
|
187248
|
+
if (process7.platform !== "win32") {
|
|
187861
187249
|
return TERM !== "linux";
|
|
187862
187250
|
}
|
|
187863
187251
|
return Boolean(env2.WT_SESSION) || Boolean(env2.TERMINUS_SUBLIME) || env2.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env2.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
@@ -188142,11 +187530,11 @@ var replacements = Object.entries(specialMainSymbols);
|
|
|
188142
187530
|
// node_modules/yoctocolors/base.js
|
|
188143
187531
|
import tty2 from "node:tty";
|
|
188144
187532
|
var hasColors = tty2?.WriteStream?.prototype?.hasColors?.() ?? false;
|
|
188145
|
-
var format = (
|
|
187533
|
+
var format = (open, close) => {
|
|
188146
187534
|
if (!hasColors) {
|
|
188147
187535
|
return (input) => input;
|
|
188148
187536
|
}
|
|
188149
|
-
const openCode = `\x1B[${
|
|
187537
|
+
const openCode = `\x1B[${open}m`;
|
|
188150
187538
|
const closeCode = `\x1B[${close}m`;
|
|
188151
187539
|
return (input) => {
|
|
188152
187540
|
const string4 = input + "";
|
|
@@ -188363,43 +187751,43 @@ var handleCommand = (filePath, rawArguments, rawOptions) => {
|
|
|
188363
187751
|
|
|
188364
187752
|
// node_modules/execa/lib/arguments/options.js
|
|
188365
187753
|
var import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
188366
|
-
import
|
|
188367
|
-
import
|
|
187754
|
+
import path15 from "node:path";
|
|
187755
|
+
import process10 from "node:process";
|
|
188368
187756
|
|
|
188369
187757
|
// node_modules/npm-run-path/index.js
|
|
188370
|
-
import
|
|
188371
|
-
import
|
|
187758
|
+
import process8 from "node:process";
|
|
187759
|
+
import path12 from "node:path";
|
|
188372
187760
|
|
|
188373
187761
|
// node_modules/npm-run-path/node_modules/path-key/index.js
|
|
188374
187762
|
function pathKey(options = {}) {
|
|
188375
187763
|
const {
|
|
188376
187764
|
env: env2 = process.env,
|
|
188377
|
-
platform:
|
|
187765
|
+
platform: platform6 = process.platform
|
|
188378
187766
|
} = options;
|
|
188379
|
-
if (
|
|
187767
|
+
if (platform6 !== "win32") {
|
|
188380
187768
|
return "PATH";
|
|
188381
187769
|
}
|
|
188382
187770
|
return Object.keys(env2).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
188383
187771
|
}
|
|
188384
187772
|
|
|
188385
187773
|
// node_modules/npm-run-path/node_modules/unicorn-magic/node.js
|
|
188386
|
-
import { promisify as
|
|
187774
|
+
import { promisify as promisify3 } from "node:util";
|
|
188387
187775
|
import { execFile as execFileCallback2, execFileSync as execFileSyncOriginal2 } from "node:child_process";
|
|
188388
|
-
import
|
|
188389
|
-
import { fileURLToPath as
|
|
188390
|
-
var execFileOriginal2 =
|
|
187776
|
+
import path11 from "node:path";
|
|
187777
|
+
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
187778
|
+
var execFileOriginal2 = promisify3(execFileCallback2);
|
|
188391
187779
|
function toPath2(urlOrPath) {
|
|
188392
|
-
return urlOrPath instanceof URL ?
|
|
187780
|
+
return urlOrPath instanceof URL ? fileURLToPath4(urlOrPath) : urlOrPath;
|
|
188393
187781
|
}
|
|
188394
187782
|
function traversePathUp(startPath) {
|
|
188395
187783
|
return {
|
|
188396
187784
|
*[Symbol.iterator]() {
|
|
188397
|
-
let currentPath =
|
|
187785
|
+
let currentPath = path11.resolve(toPath2(startPath));
|
|
188398
187786
|
let previousPath;
|
|
188399
187787
|
while (previousPath !== currentPath) {
|
|
188400
187788
|
yield currentPath;
|
|
188401
187789
|
previousPath = currentPath;
|
|
188402
|
-
currentPath =
|
|
187790
|
+
currentPath = path11.resolve(currentPath, "..");
|
|
188403
187791
|
}
|
|
188404
187792
|
}
|
|
188405
187793
|
};
|
|
@@ -188408,38 +187796,38 @@ var TEN_MEGABYTES_IN_BYTES2 = 10 * 1024 * 1024;
|
|
|
188408
187796
|
|
|
188409
187797
|
// node_modules/npm-run-path/index.js
|
|
188410
187798
|
var npmRunPath = ({
|
|
188411
|
-
cwd =
|
|
188412
|
-
path: pathOption =
|
|
187799
|
+
cwd = process8.cwd(),
|
|
187800
|
+
path: pathOption = process8.env[pathKey()],
|
|
188413
187801
|
preferLocal = true,
|
|
188414
|
-
execPath =
|
|
187802
|
+
execPath = process8.execPath,
|
|
188415
187803
|
addExecPath = true
|
|
188416
187804
|
} = {}) => {
|
|
188417
|
-
const cwdPath =
|
|
187805
|
+
const cwdPath = path12.resolve(toPath2(cwd));
|
|
188418
187806
|
const result = [];
|
|
188419
|
-
const pathParts = pathOption.split(
|
|
187807
|
+
const pathParts = pathOption.split(path12.delimiter);
|
|
188420
187808
|
if (preferLocal) {
|
|
188421
187809
|
applyPreferLocal(result, pathParts, cwdPath);
|
|
188422
187810
|
}
|
|
188423
187811
|
if (addExecPath) {
|
|
188424
187812
|
applyExecPath(result, pathParts, execPath, cwdPath);
|
|
188425
187813
|
}
|
|
188426
|
-
return pathOption === "" || pathOption ===
|
|
187814
|
+
return pathOption === "" || pathOption === path12.delimiter ? `${result.join(path12.delimiter)}${pathOption}` : [...result, pathOption].join(path12.delimiter);
|
|
188427
187815
|
};
|
|
188428
187816
|
var applyPreferLocal = (result, pathParts, cwdPath) => {
|
|
188429
187817
|
for (const directory of traversePathUp(cwdPath)) {
|
|
188430
|
-
const pathPart =
|
|
187818
|
+
const pathPart = path12.join(directory, "node_modules/.bin");
|
|
188431
187819
|
if (!pathParts.includes(pathPart)) {
|
|
188432
187820
|
result.push(pathPart);
|
|
188433
187821
|
}
|
|
188434
187822
|
}
|
|
188435
187823
|
};
|
|
188436
187824
|
var applyExecPath = (result, pathParts, execPath, cwdPath) => {
|
|
188437
|
-
const pathPart =
|
|
187825
|
+
const pathPart = path12.resolve(cwdPath, toPath2(execPath), "..");
|
|
188438
187826
|
if (!pathParts.includes(pathPart)) {
|
|
188439
187827
|
result.push(pathPart);
|
|
188440
187828
|
}
|
|
188441
187829
|
};
|
|
188442
|
-
var npmRunPathEnv = ({ env: env2 =
|
|
187830
|
+
var npmRunPathEnv = ({ env: env2 = process8.env, ...options } = {}) => {
|
|
188443
187831
|
env2 = { ...env2 };
|
|
188444
187832
|
const pathName = pathKey({ env: env2 });
|
|
188445
187833
|
options.path = env2[pathName];
|
|
@@ -188988,7 +188376,7 @@ var terminateOnCancel = async (subprocess, cancelSignal, context, { signal }) =>
|
|
|
188988
188376
|
import { scheduler as scheduler2 } from "node:timers/promises";
|
|
188989
188377
|
|
|
188990
188378
|
// node_modules/execa/lib/ipc/send.js
|
|
188991
|
-
import { promisify as
|
|
188379
|
+
import { promisify as promisify4 } from "node:util";
|
|
188992
188380
|
|
|
188993
188381
|
// node_modules/execa/lib/ipc/validation.js
|
|
188994
188382
|
var validateIpcMethod = ({ methodName, isSubprocess, ipc, isConnected }) => {
|
|
@@ -189453,7 +188841,7 @@ var getSendMethod = (anyProcess) => {
|
|
|
189453
188841
|
if (PROCESS_SEND_METHODS.has(anyProcess)) {
|
|
189454
188842
|
return PROCESS_SEND_METHODS.get(anyProcess);
|
|
189455
188843
|
}
|
|
189456
|
-
const sendMethod =
|
|
188844
|
+
const sendMethod = promisify4(anyProcess.send.bind(anyProcess));
|
|
189457
188845
|
PROCESS_SEND_METHODS.set(anyProcess, sendMethod);
|
|
189458
188846
|
return sendMethod;
|
|
189459
188847
|
};
|
|
@@ -189583,7 +188971,7 @@ var killAfterTimeout = async (subprocess, timeout2, context, { signal }) => {
|
|
|
189583
188971
|
|
|
189584
188972
|
// node_modules/execa/lib/methods/node.js
|
|
189585
188973
|
import { execPath, execArgv } from "node:process";
|
|
189586
|
-
import
|
|
188974
|
+
import path13 from "node:path";
|
|
189587
188975
|
var mapNode = ({ options }) => {
|
|
189588
188976
|
if (options.node === false) {
|
|
189589
188977
|
throw new TypeError('The "node" option cannot be false with `execaNode()`.');
|
|
@@ -189602,7 +188990,7 @@ var handleNodeOption = (file2, commandArguments, {
|
|
|
189602
188990
|
throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');
|
|
189603
188991
|
}
|
|
189604
188992
|
const normalizedNodePath = safeNormalizeFileUrl(nodePath2, 'The "nodePath" option');
|
|
189605
|
-
const resolvedNodePath =
|
|
188993
|
+
const resolvedNodePath = path13.resolve(cwd, normalizedNodePath);
|
|
189606
188994
|
const newOptions = {
|
|
189607
188995
|
...options,
|
|
189608
188996
|
nodePath: resolvedNodePath,
|
|
@@ -189612,7 +189000,7 @@ var handleNodeOption = (file2, commandArguments, {
|
|
|
189612
189000
|
if (!shouldHandleNode) {
|
|
189613
189001
|
return [file2, commandArguments, newOptions];
|
|
189614
189002
|
}
|
|
189615
|
-
if (
|
|
189003
|
+
if (path13.basename(file2, ".exe") === "node") {
|
|
189616
189004
|
throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');
|
|
189617
189005
|
}
|
|
189618
189006
|
return [
|
|
@@ -189701,15 +189089,15 @@ var serializeEncoding = (encoding) => typeof encoding === "string" ? `"${encodin
|
|
|
189701
189089
|
|
|
189702
189090
|
// node_modules/execa/lib/arguments/cwd.js
|
|
189703
189091
|
import { statSync } from "node:fs";
|
|
189704
|
-
import
|
|
189705
|
-
import
|
|
189092
|
+
import path14 from "node:path";
|
|
189093
|
+
import process9 from "node:process";
|
|
189706
189094
|
var normalizeCwd = (cwd = getDefaultCwd()) => {
|
|
189707
189095
|
const cwdString = safeNormalizeFileUrl(cwd, 'The "cwd" option');
|
|
189708
|
-
return
|
|
189096
|
+
return path14.resolve(cwdString);
|
|
189709
189097
|
};
|
|
189710
189098
|
var getDefaultCwd = () => {
|
|
189711
189099
|
try {
|
|
189712
|
-
return
|
|
189100
|
+
return process9.cwd();
|
|
189713
189101
|
} catch (error48) {
|
|
189714
189102
|
error48.message = `The current directory does not exist.
|
|
189715
189103
|
${error48.message}`;
|
|
@@ -189752,7 +189140,7 @@ var normalizeOptions3 = (filePath, rawArguments, rawOptions) => {
|
|
|
189752
189140
|
options.killSignal = normalizeKillSignal(options.killSignal);
|
|
189753
189141
|
options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
|
|
189754
189142
|
options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
|
|
189755
|
-
if (
|
|
189143
|
+
if (process10.platform === "win32" && path15.basename(file2, ".exe") === "cmd") {
|
|
189756
189144
|
commandArguments.unshift("/q");
|
|
189757
189145
|
}
|
|
189758
189146
|
return { file: file2, commandArguments, options };
|
|
@@ -189793,7 +189181,7 @@ var addDefaultOptions = ({
|
|
|
189793
189181
|
serialization
|
|
189794
189182
|
});
|
|
189795
189183
|
var getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath: nodePath2 }) => {
|
|
189796
|
-
const env2 = extendEnv ? { ...
|
|
189184
|
+
const env2 = extendEnv ? { ...process10.env, ...envOption } : envOption;
|
|
189797
189185
|
if (preferLocal || node) {
|
|
189798
189186
|
return npmRunPathEnv({
|
|
189799
189187
|
env: env2,
|
|
@@ -190962,7 +190350,7 @@ var normalizeGenerator = ({ stdioItem, stdioItem: { value }, index, newTransform
|
|
|
190962
190350
|
var sortTransforms = (newTransforms, direction) => direction === "input" ? newTransforms.reverse() : newTransforms;
|
|
190963
190351
|
|
|
190964
190352
|
// node_modules/execa/lib/stdio/direction.js
|
|
190965
|
-
import
|
|
190353
|
+
import process11 from "node:process";
|
|
190966
190354
|
var getStreamDirection = (stdioItems, fdNumber, optionName) => {
|
|
190967
190355
|
const directions = stdioItems.map((stdioItem) => getStdioItemDirection(stdioItem, fdNumber));
|
|
190968
190356
|
if (directions.includes("input") && directions.includes("output")) {
|
|
@@ -191004,10 +190392,10 @@ var guessStreamDirection = {
|
|
|
191004
190392
|
}
|
|
191005
190393
|
};
|
|
191006
190394
|
var getStandardStreamDirection = (value) => {
|
|
191007
|
-
if ([0,
|
|
190395
|
+
if ([0, process11.stdin].includes(value)) {
|
|
191008
190396
|
return "input";
|
|
191009
190397
|
}
|
|
191010
|
-
if ([1, 2,
|
|
190398
|
+
if ([1, 2, process11.stdout, process11.stderr].includes(value)) {
|
|
191011
190399
|
return "output";
|
|
191012
190400
|
}
|
|
191013
190401
|
};
|
|
@@ -191527,10 +190915,10 @@ var linesUint8ArrayInfo = {
|
|
|
191527
190915
|
};
|
|
191528
190916
|
|
|
191529
190917
|
// node_modules/execa/lib/transform/validate.js
|
|
191530
|
-
import { Buffer as
|
|
190918
|
+
import { Buffer as Buffer3 } from "node:buffer";
|
|
191531
190919
|
var getValidateTransformInput = (writableObjectMode, optionName) => writableObjectMode ? undefined : validateStringTransformInput.bind(undefined, optionName);
|
|
191532
190920
|
var validateStringTransformInput = function* (optionName, chunk) {
|
|
191533
|
-
if (typeof chunk !== "string" && !isUint8Array(chunk) && !
|
|
190921
|
+
if (typeof chunk !== "string" && !isUint8Array(chunk) && !Buffer3.isBuffer(chunk)) {
|
|
191534
190922
|
throw new TypeError(`The \`${optionName}\` option's transform must use "objectMode: true" to receive as input: ${typeof chunk}.`);
|
|
191535
190923
|
}
|
|
191536
190924
|
yield chunk;
|
|
@@ -191556,7 +190944,7 @@ Instead, \`yield\` should either be called with a value, or not be called at all
|
|
|
191556
190944
|
};
|
|
191557
190945
|
|
|
191558
190946
|
// node_modules/execa/lib/transform/encoding-transform.js
|
|
191559
|
-
import { Buffer as
|
|
190947
|
+
import { Buffer as Buffer4 } from "node:buffer";
|
|
191560
190948
|
import { StringDecoder as StringDecoder3 } from "node:string_decoder";
|
|
191561
190949
|
var getEncodingTransformGenerator = (binary, encoding, skipped) => {
|
|
191562
190950
|
if (skipped) {
|
|
@@ -191572,7 +190960,7 @@ var getEncodingTransformGenerator = (binary, encoding, skipped) => {
|
|
|
191572
190960
|
};
|
|
191573
190961
|
};
|
|
191574
190962
|
var encodingUint8ArrayGenerator = function* (textEncoder3, chunk) {
|
|
191575
|
-
if (
|
|
190963
|
+
if (Buffer4.isBuffer(chunk)) {
|
|
191576
190964
|
yield bufferToUint8Array(chunk);
|
|
191577
190965
|
} else if (typeof chunk === "string") {
|
|
191578
190966
|
yield textEncoder3.encode(chunk);
|
|
@@ -191889,13 +191277,13 @@ var logOutputSync = ({ serializedResult, fdNumber, state, verboseInfo, encoding,
|
|
|
191889
191277
|
}
|
|
191890
191278
|
};
|
|
191891
191279
|
var writeToFiles = (serializedResult, stdioItems, outputFiles) => {
|
|
191892
|
-
for (const { path:
|
|
191893
|
-
const pathString = typeof
|
|
191280
|
+
for (const { path: path16, append } of stdioItems.filter(({ type }) => FILE_TYPES.has(type))) {
|
|
191281
|
+
const pathString = typeof path16 === "string" ? path16 : path16.toString();
|
|
191894
191282
|
if (append || outputFiles.has(pathString)) {
|
|
191895
|
-
appendFileSync(
|
|
191283
|
+
appendFileSync(path16, serializedResult);
|
|
191896
191284
|
} else {
|
|
191897
191285
|
outputFiles.add(pathString);
|
|
191898
|
-
writeFileSync(
|
|
191286
|
+
writeFileSync(path16, serializedResult);
|
|
191899
191287
|
}
|
|
191900
191288
|
}
|
|
191901
191289
|
};
|
|
@@ -192114,7 +191502,7 @@ import { setMaxListeners } from "node:events";
|
|
|
192114
191502
|
import { spawn } from "node:child_process";
|
|
192115
191503
|
|
|
192116
191504
|
// node_modules/execa/lib/ipc/methods.js
|
|
192117
|
-
import
|
|
191505
|
+
import process12 from "node:process";
|
|
192118
191506
|
|
|
192119
191507
|
// node_modules/execa/lib/ipc/get-one.js
|
|
192120
191508
|
import { once as once6, on as on3 } from "node:events";
|
|
@@ -192253,9 +191641,9 @@ var addIpcMethods = (subprocess, { ipc }) => {
|
|
|
192253
191641
|
Object.assign(subprocess, getIpcMethods(subprocess, false, ipc));
|
|
192254
191642
|
};
|
|
192255
191643
|
var getIpcExport = () => {
|
|
192256
|
-
const anyProcess =
|
|
191644
|
+
const anyProcess = process12;
|
|
192257
191645
|
const isSubprocess = true;
|
|
192258
|
-
const ipc =
|
|
191646
|
+
const ipc = process12.channel !== undefined;
|
|
192259
191647
|
return {
|
|
192260
191648
|
...getIpcMethods(anyProcess, isSubprocess, ipc),
|
|
192261
191649
|
getCancelSignal: getCancelSignal.bind(undefined, {
|
|
@@ -192339,7 +191727,7 @@ var handleDummyPromise = async (error48, verboseInfo, options) => handleResult(e
|
|
|
192339
191727
|
|
|
192340
191728
|
// node_modules/execa/lib/stdio/handle-async.js
|
|
192341
191729
|
import { createReadStream, createWriteStream } from "node:fs";
|
|
192342
|
-
import { Buffer as
|
|
191730
|
+
import { Buffer as Buffer5 } from "node:buffer";
|
|
192343
191731
|
import { Readable as Readable4, Writable as Writable2, Duplex as Duplex2 } from "node:stream";
|
|
192344
191732
|
var handleStdioAsync = (options, verboseInfo) => handleStdio(addPropertiesAsync, options, verboseInfo, false);
|
|
192345
191733
|
var forbiddenIfAsync = ({ type, optionName }) => {
|
|
@@ -192367,7 +191755,7 @@ var addPropertiesAsync = {
|
|
|
192367
191755
|
iterable: ({ value }) => ({ stream: Readable4.from(value) }),
|
|
192368
191756
|
asyncIterable: ({ value }) => ({ stream: Readable4.from(value) }),
|
|
192369
191757
|
string: ({ value }) => ({ stream: Readable4.from(value) }),
|
|
192370
|
-
uint8Array: ({ value }) => ({ stream: Readable4.from(
|
|
191758
|
+
uint8Array: ({ value }) => ({ stream: Readable4.from(Buffer5.from(value)) })
|
|
192371
191759
|
},
|
|
192372
191760
|
output: {
|
|
192373
191761
|
...addProperties2,
|
|
@@ -192483,7 +191871,7 @@ if (process.platform === "linux") {
|
|
|
192483
191871
|
}
|
|
192484
191872
|
|
|
192485
191873
|
// node_modules/signal-exit/dist/mjs/index.js
|
|
192486
|
-
var processOk = (
|
|
191874
|
+
var processOk = (process13) => !!process13 && typeof process13 === "object" && typeof process13.removeListener === "function" && typeof process13.emit === "function" && typeof process13.reallyExit === "function" && typeof process13.listeners === "function" && typeof process13.kill === "function" && typeof process13.pid === "number" && typeof process13.on === "function";
|
|
192487
191875
|
var kExitEmitter = Symbol.for("signal-exit emitter");
|
|
192488
191876
|
var global2 = globalThis;
|
|
192489
191877
|
var ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
@@ -192566,22 +191954,22 @@ class SignalExitFallback extends SignalExitBase {
|
|
|
192566
191954
|
}
|
|
192567
191955
|
|
|
192568
191956
|
class SignalExit extends SignalExitBase {
|
|
192569
|
-
#hupSig =
|
|
191957
|
+
#hupSig = process13.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
192570
191958
|
#emitter = new Emitter;
|
|
192571
191959
|
#process;
|
|
192572
191960
|
#originalProcessEmit;
|
|
192573
191961
|
#originalProcessReallyExit;
|
|
192574
191962
|
#sigListeners = {};
|
|
192575
191963
|
#loaded = false;
|
|
192576
|
-
constructor(
|
|
191964
|
+
constructor(process13) {
|
|
192577
191965
|
super();
|
|
192578
|
-
this.#process =
|
|
191966
|
+
this.#process = process13;
|
|
192579
191967
|
this.#sigListeners = {};
|
|
192580
191968
|
for (const sig of signals) {
|
|
192581
191969
|
this.#sigListeners[sig] = () => {
|
|
192582
191970
|
const listeners = this.#process.listeners(sig);
|
|
192583
191971
|
let { count: count2 } = this.#emitter;
|
|
192584
|
-
const p2 =
|
|
191972
|
+
const p2 = process13;
|
|
192585
191973
|
if (typeof p2.__signal_exit_emitter__ === "object" && typeof p2.__signal_exit_emitter__.count === "number") {
|
|
192586
191974
|
count2 += p2.__signal_exit_emitter__.count;
|
|
192587
191975
|
}
|
|
@@ -192590,12 +191978,12 @@ class SignalExit extends SignalExitBase {
|
|
|
192590
191978
|
const ret = this.#emitter.emit("exit", null, sig);
|
|
192591
191979
|
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
192592
191980
|
if (!ret)
|
|
192593
|
-
|
|
191981
|
+
process13.kill(process13.pid, s);
|
|
192594
191982
|
}
|
|
192595
191983
|
};
|
|
192596
191984
|
}
|
|
192597
|
-
this.#originalProcessReallyExit =
|
|
192598
|
-
this.#originalProcessEmit =
|
|
191985
|
+
this.#originalProcessReallyExit = process13.reallyExit;
|
|
191986
|
+
this.#originalProcessEmit = process13.emit;
|
|
192599
191987
|
}
|
|
192600
191988
|
onExit(cb, opts) {
|
|
192601
191989
|
if (!processOk(this.#process)) {
|
|
@@ -192673,12 +192061,12 @@ class SignalExit extends SignalExitBase {
|
|
|
192673
192061
|
}
|
|
192674
192062
|
}
|
|
192675
192063
|
}
|
|
192676
|
-
var
|
|
192064
|
+
var process13 = globalThis.process;
|
|
192677
192065
|
var {
|
|
192678
192066
|
onExit,
|
|
192679
192067
|
load,
|
|
192680
192068
|
unload
|
|
192681
|
-
} = signalExitWrap(processOk(
|
|
192069
|
+
} = signalExitWrap(processOk(process13) ? new SignalExit(process13) : new SignalExitFallback);
|
|
192682
192070
|
|
|
192683
192071
|
// node_modules/execa/lib/terminate/cleanup.js
|
|
192684
192072
|
var cleanupOnExit = (subprocess, { cleanup, detached }, { signal }) => {
|
|
@@ -194163,8 +193551,12 @@ async function runCommand(commandFn, options, context) {
|
|
|
194163
193551
|
const appConfig = await initAppConfig();
|
|
194164
193552
|
context.errorReporter.setContext({ appId: appConfig.id });
|
|
194165
193553
|
}
|
|
194166
|
-
const { outroMessage } = await commandFn();
|
|
194167
|
-
|
|
193554
|
+
const { outroMessage, failed } = await commandFn();
|
|
193555
|
+
if (failed) {
|
|
193556
|
+
xe(outroMessage || "");
|
|
193557
|
+
} else {
|
|
193558
|
+
Se(outroMessage || "");
|
|
193559
|
+
}
|
|
194168
193560
|
} catch (error48) {
|
|
194169
193561
|
const errorMessage = error48 instanceof Error ? error48.message : String(error48);
|
|
194170
193562
|
M2.error(errorMessage);
|
|
@@ -194298,6 +193690,612 @@ function getWhoamiCommand(context) {
|
|
|
194298
193690
|
});
|
|
194299
193691
|
}
|
|
194300
193692
|
|
|
193693
|
+
// node_modules/open/index.js
|
|
193694
|
+
import process20 from "node:process";
|
|
193695
|
+
import path16 from "node:path";
|
|
193696
|
+
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
193697
|
+
import childProcess3 from "node:child_process";
|
|
193698
|
+
import fs19, { constants as fsConstants2 } from "node:fs/promises";
|
|
193699
|
+
|
|
193700
|
+
// node_modules/wsl-utils/index.js
|
|
193701
|
+
import { promisify as promisify6 } from "node:util";
|
|
193702
|
+
import childProcess2 from "node:child_process";
|
|
193703
|
+
import fs18, { constants as fsConstants } from "node:fs/promises";
|
|
193704
|
+
|
|
193705
|
+
// node_modules/is-wsl/index.js
|
|
193706
|
+
import process14 from "node:process";
|
|
193707
|
+
import os2 from "node:os";
|
|
193708
|
+
import fs17 from "node:fs";
|
|
193709
|
+
|
|
193710
|
+
// node_modules/is-inside-container/index.js
|
|
193711
|
+
import fs16 from "node:fs";
|
|
193712
|
+
|
|
193713
|
+
// node_modules/is-docker/index.js
|
|
193714
|
+
import fs15 from "node:fs";
|
|
193715
|
+
var isDockerCached;
|
|
193716
|
+
function hasDockerEnv() {
|
|
193717
|
+
try {
|
|
193718
|
+
fs15.statSync("/.dockerenv");
|
|
193719
|
+
return true;
|
|
193720
|
+
} catch {
|
|
193721
|
+
return false;
|
|
193722
|
+
}
|
|
193723
|
+
}
|
|
193724
|
+
function hasDockerCGroup() {
|
|
193725
|
+
try {
|
|
193726
|
+
return fs15.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
|
|
193727
|
+
} catch {
|
|
193728
|
+
return false;
|
|
193729
|
+
}
|
|
193730
|
+
}
|
|
193731
|
+
function isDocker() {
|
|
193732
|
+
if (isDockerCached === undefined) {
|
|
193733
|
+
isDockerCached = hasDockerEnv() || hasDockerCGroup();
|
|
193734
|
+
}
|
|
193735
|
+
return isDockerCached;
|
|
193736
|
+
}
|
|
193737
|
+
|
|
193738
|
+
// node_modules/is-inside-container/index.js
|
|
193739
|
+
var cachedResult;
|
|
193740
|
+
var hasContainerEnv = () => {
|
|
193741
|
+
try {
|
|
193742
|
+
fs16.statSync("/run/.containerenv");
|
|
193743
|
+
return true;
|
|
193744
|
+
} catch {
|
|
193745
|
+
return false;
|
|
193746
|
+
}
|
|
193747
|
+
};
|
|
193748
|
+
function isInsideContainer() {
|
|
193749
|
+
if (cachedResult === undefined) {
|
|
193750
|
+
cachedResult = hasContainerEnv() || isDocker();
|
|
193751
|
+
}
|
|
193752
|
+
return cachedResult;
|
|
193753
|
+
}
|
|
193754
|
+
|
|
193755
|
+
// node_modules/is-wsl/index.js
|
|
193756
|
+
var isWsl = () => {
|
|
193757
|
+
if (process14.platform !== "linux") {
|
|
193758
|
+
return false;
|
|
193759
|
+
}
|
|
193760
|
+
if (os2.release().toLowerCase().includes("microsoft")) {
|
|
193761
|
+
if (isInsideContainer()) {
|
|
193762
|
+
return false;
|
|
193763
|
+
}
|
|
193764
|
+
return true;
|
|
193765
|
+
}
|
|
193766
|
+
try {
|
|
193767
|
+
return fs17.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
|
|
193768
|
+
} catch {
|
|
193769
|
+
return false;
|
|
193770
|
+
}
|
|
193771
|
+
};
|
|
193772
|
+
var is_wsl_default = process14.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
193773
|
+
|
|
193774
|
+
// node_modules/powershell-utils/index.js
|
|
193775
|
+
import process15 from "node:process";
|
|
193776
|
+
import { Buffer as Buffer6 } from "node:buffer";
|
|
193777
|
+
import { promisify as promisify5 } from "node:util";
|
|
193778
|
+
import childProcess from "node:child_process";
|
|
193779
|
+
var execFile = promisify5(childProcess.execFile);
|
|
193780
|
+
var powerShellPath = () => `${process15.env.SYSTEMROOT || process15.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
193781
|
+
var executePowerShell = async (command, options = {}) => {
|
|
193782
|
+
const {
|
|
193783
|
+
powerShellPath: psPath,
|
|
193784
|
+
...execFileOptions
|
|
193785
|
+
} = options;
|
|
193786
|
+
const encodedCommand = executePowerShell.encodeCommand(command);
|
|
193787
|
+
return execFile(psPath ?? powerShellPath(), [
|
|
193788
|
+
...executePowerShell.argumentsPrefix,
|
|
193789
|
+
encodedCommand
|
|
193790
|
+
], {
|
|
193791
|
+
encoding: "utf8",
|
|
193792
|
+
...execFileOptions
|
|
193793
|
+
});
|
|
193794
|
+
};
|
|
193795
|
+
executePowerShell.argumentsPrefix = [
|
|
193796
|
+
"-NoProfile",
|
|
193797
|
+
"-NonInteractive",
|
|
193798
|
+
"-ExecutionPolicy",
|
|
193799
|
+
"Bypass",
|
|
193800
|
+
"-EncodedCommand"
|
|
193801
|
+
];
|
|
193802
|
+
executePowerShell.encodeCommand = (command) => Buffer6.from(command, "utf16le").toString("base64");
|
|
193803
|
+
executePowerShell.escapeArgument = (value) => `'${String(value).replaceAll("'", "''")}'`;
|
|
193804
|
+
|
|
193805
|
+
// node_modules/wsl-utils/utilities.js
|
|
193806
|
+
function parseMountPointFromConfig(content) {
|
|
193807
|
+
for (const line of content.split(`
|
|
193808
|
+
`)) {
|
|
193809
|
+
if (/^\s*#/.test(line)) {
|
|
193810
|
+
continue;
|
|
193811
|
+
}
|
|
193812
|
+
const match = /^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(line);
|
|
193813
|
+
if (!match) {
|
|
193814
|
+
continue;
|
|
193815
|
+
}
|
|
193816
|
+
return match.groups.mountPoint.trim().replaceAll(/^["']|["']$/g, "");
|
|
193817
|
+
}
|
|
193818
|
+
}
|
|
193819
|
+
|
|
193820
|
+
// node_modules/wsl-utils/index.js
|
|
193821
|
+
var execFile2 = promisify6(childProcess2.execFile);
|
|
193822
|
+
var wslDrivesMountPoint = (() => {
|
|
193823
|
+
const defaultMountPoint = "/mnt/";
|
|
193824
|
+
let mountPoint;
|
|
193825
|
+
return async function() {
|
|
193826
|
+
if (mountPoint) {
|
|
193827
|
+
return mountPoint;
|
|
193828
|
+
}
|
|
193829
|
+
const configFilePath = "/etc/wsl.conf";
|
|
193830
|
+
let isConfigFileExists = false;
|
|
193831
|
+
try {
|
|
193832
|
+
await fs18.access(configFilePath, fsConstants.F_OK);
|
|
193833
|
+
isConfigFileExists = true;
|
|
193834
|
+
} catch {}
|
|
193835
|
+
if (!isConfigFileExists) {
|
|
193836
|
+
return defaultMountPoint;
|
|
193837
|
+
}
|
|
193838
|
+
const configContent = await fs18.readFile(configFilePath, { encoding: "utf8" });
|
|
193839
|
+
const parsedMountPoint = parseMountPointFromConfig(configContent);
|
|
193840
|
+
if (parsedMountPoint === undefined) {
|
|
193841
|
+
return defaultMountPoint;
|
|
193842
|
+
}
|
|
193843
|
+
mountPoint = parsedMountPoint;
|
|
193844
|
+
mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
|
|
193845
|
+
return mountPoint;
|
|
193846
|
+
};
|
|
193847
|
+
})();
|
|
193848
|
+
var powerShellPathFromWsl = async () => {
|
|
193849
|
+
const mountPoint = await wslDrivesMountPoint();
|
|
193850
|
+
return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
|
|
193851
|
+
};
|
|
193852
|
+
var powerShellPath2 = is_wsl_default ? powerShellPathFromWsl : powerShellPath;
|
|
193853
|
+
var canAccessPowerShellPromise;
|
|
193854
|
+
var canAccessPowerShell = async () => {
|
|
193855
|
+
canAccessPowerShellPromise ??= (async () => {
|
|
193856
|
+
try {
|
|
193857
|
+
const psPath = await powerShellPath2();
|
|
193858
|
+
await fs18.access(psPath, fsConstants.X_OK);
|
|
193859
|
+
return true;
|
|
193860
|
+
} catch {
|
|
193861
|
+
return false;
|
|
193862
|
+
}
|
|
193863
|
+
})();
|
|
193864
|
+
return canAccessPowerShellPromise;
|
|
193865
|
+
};
|
|
193866
|
+
var wslDefaultBrowser = async () => {
|
|
193867
|
+
const psPath = await powerShellPath2();
|
|
193868
|
+
const command = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`;
|
|
193869
|
+
const { stdout } = await executePowerShell(command, { powerShellPath: psPath });
|
|
193870
|
+
return stdout.trim();
|
|
193871
|
+
};
|
|
193872
|
+
var convertWslPathToWindows = async (path16) => {
|
|
193873
|
+
if (/^[a-z]+:\/\//i.test(path16)) {
|
|
193874
|
+
return path16;
|
|
193875
|
+
}
|
|
193876
|
+
try {
|
|
193877
|
+
const { stdout } = await execFile2("wslpath", ["-aw", path16], { encoding: "utf8" });
|
|
193878
|
+
return stdout.trim();
|
|
193879
|
+
} catch {
|
|
193880
|
+
return path16;
|
|
193881
|
+
}
|
|
193882
|
+
};
|
|
193883
|
+
|
|
193884
|
+
// node_modules/define-lazy-prop/index.js
|
|
193885
|
+
function defineLazyProperty(object2, propertyName, valueGetter) {
|
|
193886
|
+
const define2 = (value) => Object.defineProperty(object2, propertyName, { value, enumerable: true, writable: true });
|
|
193887
|
+
Object.defineProperty(object2, propertyName, {
|
|
193888
|
+
configurable: true,
|
|
193889
|
+
enumerable: true,
|
|
193890
|
+
get() {
|
|
193891
|
+
const result = valueGetter();
|
|
193892
|
+
define2(result);
|
|
193893
|
+
return result;
|
|
193894
|
+
},
|
|
193895
|
+
set(value) {
|
|
193896
|
+
define2(value);
|
|
193897
|
+
}
|
|
193898
|
+
});
|
|
193899
|
+
return object2;
|
|
193900
|
+
}
|
|
193901
|
+
|
|
193902
|
+
// node_modules/default-browser/index.js
|
|
193903
|
+
import { promisify as promisify10 } from "node:util";
|
|
193904
|
+
import process18 from "node:process";
|
|
193905
|
+
import { execFile as execFile6 } from "node:child_process";
|
|
193906
|
+
|
|
193907
|
+
// node_modules/default-browser-id/index.js
|
|
193908
|
+
import { promisify as promisify7 } from "node:util";
|
|
193909
|
+
import process16 from "node:process";
|
|
193910
|
+
import { execFile as execFile3 } from "node:child_process";
|
|
193911
|
+
var execFileAsync = promisify7(execFile3);
|
|
193912
|
+
async function defaultBrowserId() {
|
|
193913
|
+
if (process16.platform !== "darwin") {
|
|
193914
|
+
throw new Error("macOS only");
|
|
193915
|
+
}
|
|
193916
|
+
const { stdout } = await execFileAsync("defaults", ["read", "com.apple.LaunchServices/com.apple.launchservices.secure", "LSHandlers"]);
|
|
193917
|
+
const match = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout);
|
|
193918
|
+
const browserId = match?.groups.id ?? "com.apple.Safari";
|
|
193919
|
+
if (browserId === "com.apple.safari") {
|
|
193920
|
+
return "com.apple.Safari";
|
|
193921
|
+
}
|
|
193922
|
+
return browserId;
|
|
193923
|
+
}
|
|
193924
|
+
|
|
193925
|
+
// node_modules/run-applescript/index.js
|
|
193926
|
+
import process17 from "node:process";
|
|
193927
|
+
import { promisify as promisify8 } from "node:util";
|
|
193928
|
+
import { execFile as execFile4, execFileSync } from "node:child_process";
|
|
193929
|
+
var execFileAsync2 = promisify8(execFile4);
|
|
193930
|
+
async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
|
|
193931
|
+
if (process17.platform !== "darwin") {
|
|
193932
|
+
throw new Error("macOS only");
|
|
193933
|
+
}
|
|
193934
|
+
const outputArguments = humanReadableOutput ? [] : ["-ss"];
|
|
193935
|
+
const execOptions = {};
|
|
193936
|
+
if (signal) {
|
|
193937
|
+
execOptions.signal = signal;
|
|
193938
|
+
}
|
|
193939
|
+
const { stdout } = await execFileAsync2("osascript", ["-e", script, outputArguments], execOptions);
|
|
193940
|
+
return stdout.trim();
|
|
193941
|
+
}
|
|
193942
|
+
|
|
193943
|
+
// node_modules/bundle-name/index.js
|
|
193944
|
+
async function bundleName(bundleId) {
|
|
193945
|
+
return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string
|
|
193946
|
+
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
|
|
193947
|
+
}
|
|
193948
|
+
|
|
193949
|
+
// node_modules/default-browser/windows.js
|
|
193950
|
+
import { promisify as promisify9 } from "node:util";
|
|
193951
|
+
import { execFile as execFile5 } from "node:child_process";
|
|
193952
|
+
var execFileAsync3 = promisify9(execFile5);
|
|
193953
|
+
var windowsBrowserProgIds = {
|
|
193954
|
+
MSEdgeHTM: { name: "Edge", id: "com.microsoft.edge" },
|
|
193955
|
+
MSEdgeBHTML: { name: "Edge Beta", id: "com.microsoft.edge.beta" },
|
|
193956
|
+
MSEdgeDHTML: { name: "Edge Dev", id: "com.microsoft.edge.dev" },
|
|
193957
|
+
AppXq0fevzme2pys62n3e0fbqa7peapykr8v: { name: "Edge", id: "com.microsoft.edge.old" },
|
|
193958
|
+
ChromeHTML: { name: "Chrome", id: "com.google.chrome" },
|
|
193959
|
+
ChromeBHTML: { name: "Chrome Beta", id: "com.google.chrome.beta" },
|
|
193960
|
+
ChromeDHTML: { name: "Chrome Dev", id: "com.google.chrome.dev" },
|
|
193961
|
+
ChromiumHTM: { name: "Chromium", id: "org.chromium.Chromium" },
|
|
193962
|
+
BraveHTML: { name: "Brave", id: "com.brave.Browser" },
|
|
193963
|
+
BraveBHTML: { name: "Brave Beta", id: "com.brave.Browser.beta" },
|
|
193964
|
+
BraveDHTML: { name: "Brave Dev", id: "com.brave.Browser.dev" },
|
|
193965
|
+
BraveSSHTM: { name: "Brave Nightly", id: "com.brave.Browser.nightly" },
|
|
193966
|
+
FirefoxURL: { name: "Firefox", id: "org.mozilla.firefox" },
|
|
193967
|
+
OperaStable: { name: "Opera", id: "com.operasoftware.Opera" },
|
|
193968
|
+
VivaldiHTM: { name: "Vivaldi", id: "com.vivaldi.Vivaldi" },
|
|
193969
|
+
"IE.HTTP": { name: "Internet Explorer", id: "com.microsoft.ie" }
|
|
193970
|
+
};
|
|
193971
|
+
var _windowsBrowserProgIdMap = new Map(Object.entries(windowsBrowserProgIds));
|
|
193972
|
+
|
|
193973
|
+
class UnknownBrowserError extends Error {
|
|
193974
|
+
}
|
|
193975
|
+
async function defaultBrowser(_execFileAsync = execFileAsync3) {
|
|
193976
|
+
const { stdout } = await _execFileAsync("reg", [
|
|
193977
|
+
"QUERY",
|
|
193978
|
+
" HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
|
|
193979
|
+
"/v",
|
|
193980
|
+
"ProgId"
|
|
193981
|
+
]);
|
|
193982
|
+
const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
|
|
193983
|
+
if (!match) {
|
|
193984
|
+
throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);
|
|
193985
|
+
}
|
|
193986
|
+
const { id } = match.groups;
|
|
193987
|
+
const dotIndex = id.lastIndexOf(".");
|
|
193988
|
+
const hyphenIndex = id.lastIndexOf("-");
|
|
193989
|
+
const baseIdByDot = dotIndex === -1 ? undefined : id.slice(0, dotIndex);
|
|
193990
|
+
const baseIdByHyphen = hyphenIndex === -1 ? undefined : id.slice(0, hyphenIndex);
|
|
193991
|
+
return windowsBrowserProgIds[id] ?? windowsBrowserProgIds[baseIdByDot] ?? windowsBrowserProgIds[baseIdByHyphen] ?? { name: id, id };
|
|
193992
|
+
}
|
|
193993
|
+
|
|
193994
|
+
// node_modules/default-browser/index.js
|
|
193995
|
+
var execFileAsync4 = promisify10(execFile6);
|
|
193996
|
+
var titleize = (string4) => string4.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x2) => x2.toUpperCase());
|
|
193997
|
+
async function defaultBrowser2() {
|
|
193998
|
+
if (process18.platform === "darwin") {
|
|
193999
|
+
const id = await defaultBrowserId();
|
|
194000
|
+
const name2 = await bundleName(id);
|
|
194001
|
+
return { name: name2, id };
|
|
194002
|
+
}
|
|
194003
|
+
if (process18.platform === "linux") {
|
|
194004
|
+
const { stdout } = await execFileAsync4("xdg-mime", ["query", "default", "x-scheme-handler/http"]);
|
|
194005
|
+
const id = stdout.trim();
|
|
194006
|
+
const name2 = titleize(id.replace(/.desktop$/, "").replace("-", " "));
|
|
194007
|
+
return { name: name2, id };
|
|
194008
|
+
}
|
|
194009
|
+
if (process18.platform === "win32") {
|
|
194010
|
+
return defaultBrowser();
|
|
194011
|
+
}
|
|
194012
|
+
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
194013
|
+
}
|
|
194014
|
+
|
|
194015
|
+
// node_modules/is-in-ssh/index.js
|
|
194016
|
+
import process19 from "node:process";
|
|
194017
|
+
var isInSsh = Boolean(process19.env.SSH_CONNECTION || process19.env.SSH_CLIENT || process19.env.SSH_TTY);
|
|
194018
|
+
var is_in_ssh_default = isInSsh;
|
|
194019
|
+
|
|
194020
|
+
// node_modules/open/index.js
|
|
194021
|
+
var fallbackAttemptSymbol = Symbol("fallbackAttempt");
|
|
194022
|
+
var __dirname3 = import.meta.url ? path16.dirname(fileURLToPath5(import.meta.url)) : "";
|
|
194023
|
+
var localXdgOpenPath = path16.join(__dirname3, "xdg-open");
|
|
194024
|
+
var { platform: platform6, arch } = process20;
|
|
194025
|
+
var tryEachApp = async (apps, opener) => {
|
|
194026
|
+
if (apps.length === 0) {
|
|
194027
|
+
return;
|
|
194028
|
+
}
|
|
194029
|
+
const errors4 = [];
|
|
194030
|
+
for (const app of apps) {
|
|
194031
|
+
try {
|
|
194032
|
+
return await opener(app);
|
|
194033
|
+
} catch (error48) {
|
|
194034
|
+
errors4.push(error48);
|
|
194035
|
+
}
|
|
194036
|
+
}
|
|
194037
|
+
throw new AggregateError(errors4, "Failed to open in all supported apps");
|
|
194038
|
+
};
|
|
194039
|
+
var baseOpen = async (options) => {
|
|
194040
|
+
options = {
|
|
194041
|
+
wait: false,
|
|
194042
|
+
background: false,
|
|
194043
|
+
newInstance: false,
|
|
194044
|
+
allowNonzeroExitCode: false,
|
|
194045
|
+
...options
|
|
194046
|
+
};
|
|
194047
|
+
const isFallbackAttempt = options[fallbackAttemptSymbol] === true;
|
|
194048
|
+
delete options[fallbackAttemptSymbol];
|
|
194049
|
+
if (Array.isArray(options.app)) {
|
|
194050
|
+
return tryEachApp(options.app, (singleApp) => baseOpen({
|
|
194051
|
+
...options,
|
|
194052
|
+
app: singleApp,
|
|
194053
|
+
[fallbackAttemptSymbol]: true
|
|
194054
|
+
}));
|
|
194055
|
+
}
|
|
194056
|
+
let { name: app, arguments: appArguments = [] } = options.app ?? {};
|
|
194057
|
+
appArguments = [...appArguments];
|
|
194058
|
+
if (Array.isArray(app)) {
|
|
194059
|
+
return tryEachApp(app, (appName) => baseOpen({
|
|
194060
|
+
...options,
|
|
194061
|
+
app: {
|
|
194062
|
+
name: appName,
|
|
194063
|
+
arguments: appArguments
|
|
194064
|
+
},
|
|
194065
|
+
[fallbackAttemptSymbol]: true
|
|
194066
|
+
}));
|
|
194067
|
+
}
|
|
194068
|
+
if (app === "browser" || app === "browserPrivate") {
|
|
194069
|
+
const ids = {
|
|
194070
|
+
"com.google.chrome": "chrome",
|
|
194071
|
+
"google-chrome.desktop": "chrome",
|
|
194072
|
+
"com.brave.browser": "brave",
|
|
194073
|
+
"org.mozilla.firefox": "firefox",
|
|
194074
|
+
"firefox.desktop": "firefox",
|
|
194075
|
+
"com.microsoft.msedge": "edge",
|
|
194076
|
+
"com.microsoft.edge": "edge",
|
|
194077
|
+
"com.microsoft.edgemac": "edge",
|
|
194078
|
+
"microsoft-edge.desktop": "edge",
|
|
194079
|
+
"com.apple.safari": "safari"
|
|
194080
|
+
};
|
|
194081
|
+
const flags = {
|
|
194082
|
+
chrome: "--incognito",
|
|
194083
|
+
brave: "--incognito",
|
|
194084
|
+
firefox: "--private-window",
|
|
194085
|
+
edge: "--inPrivate"
|
|
194086
|
+
};
|
|
194087
|
+
let browser;
|
|
194088
|
+
if (is_wsl_default) {
|
|
194089
|
+
const progId = await wslDefaultBrowser();
|
|
194090
|
+
const browserInfo = _windowsBrowserProgIdMap.get(progId);
|
|
194091
|
+
browser = browserInfo ?? {};
|
|
194092
|
+
} else {
|
|
194093
|
+
browser = await defaultBrowser2();
|
|
194094
|
+
}
|
|
194095
|
+
if (browser.id in ids) {
|
|
194096
|
+
const browserName = ids[browser.id.toLowerCase()];
|
|
194097
|
+
if (app === "browserPrivate") {
|
|
194098
|
+
if (browserName === "safari") {
|
|
194099
|
+
throw new Error("Safari doesn't support opening in private mode via command line");
|
|
194100
|
+
}
|
|
194101
|
+
appArguments.push(flags[browserName]);
|
|
194102
|
+
}
|
|
194103
|
+
return baseOpen({
|
|
194104
|
+
...options,
|
|
194105
|
+
app: {
|
|
194106
|
+
name: apps[browserName],
|
|
194107
|
+
arguments: appArguments
|
|
194108
|
+
}
|
|
194109
|
+
});
|
|
194110
|
+
}
|
|
194111
|
+
throw new Error(`${browser.name} is not supported as a default browser`);
|
|
194112
|
+
}
|
|
194113
|
+
let command;
|
|
194114
|
+
const cliArguments = [];
|
|
194115
|
+
const childProcessOptions = {};
|
|
194116
|
+
let shouldUseWindowsInWsl = false;
|
|
194117
|
+
if (is_wsl_default && !isInsideContainer() && !is_in_ssh_default && !app) {
|
|
194118
|
+
shouldUseWindowsInWsl = await canAccessPowerShell();
|
|
194119
|
+
}
|
|
194120
|
+
if (platform6 === "darwin") {
|
|
194121
|
+
command = "open";
|
|
194122
|
+
if (options.wait) {
|
|
194123
|
+
cliArguments.push("--wait-apps");
|
|
194124
|
+
}
|
|
194125
|
+
if (options.background) {
|
|
194126
|
+
cliArguments.push("--background");
|
|
194127
|
+
}
|
|
194128
|
+
if (options.newInstance) {
|
|
194129
|
+
cliArguments.push("--new");
|
|
194130
|
+
}
|
|
194131
|
+
if (app) {
|
|
194132
|
+
cliArguments.push("-a", app);
|
|
194133
|
+
}
|
|
194134
|
+
} else if (platform6 === "win32" || shouldUseWindowsInWsl) {
|
|
194135
|
+
command = await powerShellPath2();
|
|
194136
|
+
cliArguments.push(...executePowerShell.argumentsPrefix);
|
|
194137
|
+
if (!is_wsl_default) {
|
|
194138
|
+
childProcessOptions.windowsVerbatimArguments = true;
|
|
194139
|
+
}
|
|
194140
|
+
if (is_wsl_default && options.target) {
|
|
194141
|
+
options.target = await convertWslPathToWindows(options.target);
|
|
194142
|
+
}
|
|
194143
|
+
const encodedArguments = ["$ProgressPreference = 'SilentlyContinue';", "Start"];
|
|
194144
|
+
if (options.wait) {
|
|
194145
|
+
encodedArguments.push("-Wait");
|
|
194146
|
+
}
|
|
194147
|
+
if (app) {
|
|
194148
|
+
encodedArguments.push(executePowerShell.escapeArgument(app));
|
|
194149
|
+
if (options.target) {
|
|
194150
|
+
appArguments.push(options.target);
|
|
194151
|
+
}
|
|
194152
|
+
} else if (options.target) {
|
|
194153
|
+
encodedArguments.push(executePowerShell.escapeArgument(options.target));
|
|
194154
|
+
}
|
|
194155
|
+
if (appArguments.length > 0) {
|
|
194156
|
+
appArguments = appArguments.map((argument) => executePowerShell.escapeArgument(argument));
|
|
194157
|
+
encodedArguments.push("-ArgumentList", appArguments.join(","));
|
|
194158
|
+
}
|
|
194159
|
+
options.target = executePowerShell.encodeCommand(encodedArguments.join(" "));
|
|
194160
|
+
if (!options.wait) {
|
|
194161
|
+
childProcessOptions.stdio = "ignore";
|
|
194162
|
+
}
|
|
194163
|
+
} else {
|
|
194164
|
+
if (app) {
|
|
194165
|
+
command = app;
|
|
194166
|
+
} else {
|
|
194167
|
+
const isBundled = !__dirname3 || __dirname3 === "/";
|
|
194168
|
+
let exeLocalXdgOpen = false;
|
|
194169
|
+
try {
|
|
194170
|
+
await fs19.access(localXdgOpenPath, fsConstants2.X_OK);
|
|
194171
|
+
exeLocalXdgOpen = true;
|
|
194172
|
+
} catch {}
|
|
194173
|
+
const useSystemXdgOpen = process20.versions.electron ?? (platform6 === "android" || isBundled || !exeLocalXdgOpen);
|
|
194174
|
+
command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
|
|
194175
|
+
}
|
|
194176
|
+
if (appArguments.length > 0) {
|
|
194177
|
+
cliArguments.push(...appArguments);
|
|
194178
|
+
}
|
|
194179
|
+
if (!options.wait) {
|
|
194180
|
+
childProcessOptions.stdio = "ignore";
|
|
194181
|
+
childProcessOptions.detached = true;
|
|
194182
|
+
}
|
|
194183
|
+
}
|
|
194184
|
+
if (platform6 === "darwin" && appArguments.length > 0) {
|
|
194185
|
+
cliArguments.push("--args", ...appArguments);
|
|
194186
|
+
}
|
|
194187
|
+
if (options.target) {
|
|
194188
|
+
cliArguments.push(options.target);
|
|
194189
|
+
}
|
|
194190
|
+
const subprocess = childProcess3.spawn(command, cliArguments, childProcessOptions);
|
|
194191
|
+
if (options.wait) {
|
|
194192
|
+
return new Promise((resolve2, reject) => {
|
|
194193
|
+
subprocess.once("error", reject);
|
|
194194
|
+
subprocess.once("close", (exitCode) => {
|
|
194195
|
+
if (!options.allowNonzeroExitCode && exitCode !== 0) {
|
|
194196
|
+
reject(new Error(`Exited with code ${exitCode}`));
|
|
194197
|
+
return;
|
|
194198
|
+
}
|
|
194199
|
+
resolve2(subprocess);
|
|
194200
|
+
});
|
|
194201
|
+
});
|
|
194202
|
+
}
|
|
194203
|
+
if (isFallbackAttempt) {
|
|
194204
|
+
return new Promise((resolve2, reject) => {
|
|
194205
|
+
subprocess.once("error", reject);
|
|
194206
|
+
subprocess.once("spawn", () => {
|
|
194207
|
+
subprocess.once("close", (exitCode) => {
|
|
194208
|
+
subprocess.off("error", reject);
|
|
194209
|
+
if (exitCode !== 0) {
|
|
194210
|
+
reject(new Error(`Exited with code ${exitCode}`));
|
|
194211
|
+
return;
|
|
194212
|
+
}
|
|
194213
|
+
subprocess.unref();
|
|
194214
|
+
resolve2(subprocess);
|
|
194215
|
+
});
|
|
194216
|
+
});
|
|
194217
|
+
});
|
|
194218
|
+
}
|
|
194219
|
+
subprocess.unref();
|
|
194220
|
+
return new Promise((resolve2, reject) => {
|
|
194221
|
+
subprocess.once("error", reject);
|
|
194222
|
+
subprocess.once("spawn", () => {
|
|
194223
|
+
subprocess.off("error", reject);
|
|
194224
|
+
resolve2(subprocess);
|
|
194225
|
+
});
|
|
194226
|
+
});
|
|
194227
|
+
};
|
|
194228
|
+
var open = (target, options) => {
|
|
194229
|
+
if (typeof target !== "string") {
|
|
194230
|
+
throw new TypeError("Expected a `target`");
|
|
194231
|
+
}
|
|
194232
|
+
return baseOpen({
|
|
194233
|
+
...options,
|
|
194234
|
+
target
|
|
194235
|
+
});
|
|
194236
|
+
};
|
|
194237
|
+
function detectArchBinary(binary) {
|
|
194238
|
+
if (typeof binary === "string" || Array.isArray(binary)) {
|
|
194239
|
+
return binary;
|
|
194240
|
+
}
|
|
194241
|
+
const { [arch]: archBinary } = binary;
|
|
194242
|
+
if (!archBinary) {
|
|
194243
|
+
throw new Error(`${arch} is not supported`);
|
|
194244
|
+
}
|
|
194245
|
+
return archBinary;
|
|
194246
|
+
}
|
|
194247
|
+
function detectPlatformBinary({ [platform6]: platformBinary }, { wsl } = {}) {
|
|
194248
|
+
if (wsl && is_wsl_default) {
|
|
194249
|
+
return detectArchBinary(wsl);
|
|
194250
|
+
}
|
|
194251
|
+
if (!platformBinary) {
|
|
194252
|
+
throw new Error(`${platform6} is not supported`);
|
|
194253
|
+
}
|
|
194254
|
+
return detectArchBinary(platformBinary);
|
|
194255
|
+
}
|
|
194256
|
+
var apps = {
|
|
194257
|
+
browser: "browser",
|
|
194258
|
+
browserPrivate: "browserPrivate"
|
|
194259
|
+
};
|
|
194260
|
+
defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
|
|
194261
|
+
darwin: "google chrome",
|
|
194262
|
+
win32: "chrome",
|
|
194263
|
+
linux: ["google-chrome", "google-chrome-stable", "chromium", "chromium-browser"]
|
|
194264
|
+
}, {
|
|
194265
|
+
wsl: {
|
|
194266
|
+
ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
|
|
194267
|
+
x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
|
|
194268
|
+
}
|
|
194269
|
+
}));
|
|
194270
|
+
defineLazyProperty(apps, "brave", () => detectPlatformBinary({
|
|
194271
|
+
darwin: "brave browser",
|
|
194272
|
+
win32: "brave",
|
|
194273
|
+
linux: ["brave-browser", "brave"]
|
|
194274
|
+
}, {
|
|
194275
|
+
wsl: {
|
|
194276
|
+
ia32: "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",
|
|
194277
|
+
x64: ["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe", "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]
|
|
194278
|
+
}
|
|
194279
|
+
}));
|
|
194280
|
+
defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
|
|
194281
|
+
darwin: "firefox",
|
|
194282
|
+
win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
|
|
194283
|
+
linux: "firefox"
|
|
194284
|
+
}, {
|
|
194285
|
+
wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"
|
|
194286
|
+
}));
|
|
194287
|
+
defineLazyProperty(apps, "edge", () => detectPlatformBinary({
|
|
194288
|
+
darwin: "microsoft edge",
|
|
194289
|
+
win32: "msedge",
|
|
194290
|
+
linux: ["microsoft-edge", "microsoft-edge-dev"]
|
|
194291
|
+
}, {
|
|
194292
|
+
wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
|
|
194293
|
+
}));
|
|
194294
|
+
defineLazyProperty(apps, "safari", () => detectPlatformBinary({
|
|
194295
|
+
darwin: "Safari"
|
|
194296
|
+
}));
|
|
194297
|
+
var open_default = open;
|
|
194298
|
+
|
|
194301
194299
|
// src/cli/commands/connectors/push.ts
|
|
194302
194300
|
function isPendingOAuth(r2) {
|
|
194303
194301
|
return r2.action === "needs_oauth" && !!r2.redirectUrl && !!r2.connectionId;
|
|
@@ -194341,6 +194339,7 @@ function printSummary(results, oauthOutcomes) {
|
|
|
194341
194339
|
for (const r2 of failed) {
|
|
194342
194340
|
M2.error(`Failed: ${r2.type}${r2.error ? ` - ${r2.error}` : ""}`);
|
|
194343
194341
|
}
|
|
194342
|
+
return { hasFailures: failed.length > 0 };
|
|
194344
194343
|
}
|
|
194345
194344
|
async function pushConnectorsAction() {
|
|
194346
194345
|
const { connectors } = await readProjectConfig();
|
|
@@ -194356,45 +194355,62 @@ async function pushConnectorsAction() {
|
|
|
194356
194355
|
const oauthOutcomes = new Map;
|
|
194357
194356
|
const needsOAuth = results.filter(isPendingOAuth);
|
|
194358
194357
|
let outroMessage = "Connectors pushed to Base44";
|
|
194359
|
-
if (needsOAuth.length
|
|
194360
|
-
|
|
194361
|
-
|
|
194362
|
-
|
|
194363
|
-
|
|
194364
|
-
|
|
194365
|
-
|
|
194366
|
-
|
|
194367
|
-
|
|
194358
|
+
if (needsOAuth.length === 0) {
|
|
194359
|
+
const { hasFailures: hasFailures2 } = printSummary(results, oauthOutcomes);
|
|
194360
|
+
return { outroMessage, failed: hasFailures2 };
|
|
194361
|
+
}
|
|
194362
|
+
M2.warn(`${needsOAuth.length} connector(s) require authorization in your browser:`);
|
|
194363
|
+
for (const connector2 of needsOAuth) {
|
|
194364
|
+
M2.info(` '${connector2.type}': ${theme.styles.dim(connector2.redirectUrl)}`);
|
|
194365
|
+
}
|
|
194366
|
+
const pending = needsOAuth.map((c3) => c3.type).join(", ");
|
|
194367
|
+
if (process.env.CI) {
|
|
194368
|
+
outroMessage = `Skipped OAuth in CI. Pending: ${pending}. Run 'base44 connectors push' locally to authorize.`;
|
|
194369
|
+
} else {
|
|
194370
|
+
const shouldAuth = await ye({
|
|
194371
|
+
message: "Open browser to authorize now?"
|
|
194372
|
+
});
|
|
194373
|
+
if (pD(shouldAuth) || !shouldAuth) {
|
|
194374
|
+
outroMessage = `Authorization skipped. Pending: ${pending}. Run 'base44 connectors push' again to complete.`;
|
|
194368
194375
|
} else {
|
|
194369
|
-
const
|
|
194370
|
-
|
|
194371
|
-
});
|
|
194372
|
-
if (pD(shouldAuth) || !shouldAuth) {
|
|
194373
|
-
outroMessage = `Authorization skipped. Pending: ${pending}. Run 'base44 connectors push' again to complete.`;
|
|
194374
|
-
} else {
|
|
194375
|
-
for (const connector2 of needsOAuth) {
|
|
194376
|
+
for (const connector2 of needsOAuth) {
|
|
194377
|
+
try {
|
|
194376
194378
|
M2.info(`
|
|
194377
|
-
Opening browser for ${connector2.type}...`);
|
|
194378
|
-
|
|
194379
|
-
|
|
194380
|
-
|
|
194381
|
-
|
|
194382
|
-
|
|
194379
|
+
Opening browser for '${connector2.type}'...`);
|
|
194380
|
+
await open_default(connector2.redirectUrl);
|
|
194381
|
+
let finalStatus = "PENDING";
|
|
194382
|
+
await runTask(`Waiting for '${connector2.type}' authorization...`, async () => {
|
|
194383
|
+
await pWaitFor(async () => {
|
|
194384
|
+
const response = await getOAuthStatus(connector2.type, connector2.connectionId);
|
|
194385
|
+
finalStatus = response.status;
|
|
194386
|
+
return response.status !== "PENDING";
|
|
194387
|
+
}, {
|
|
194388
|
+
interval: 2000,
|
|
194389
|
+
timeout: 2 * 60 * 1000
|
|
194383
194390
|
});
|
|
194384
194391
|
}, {
|
|
194385
|
-
successMessage:
|
|
194386
|
-
errorMessage:
|
|
194392
|
+
successMessage: `'${connector2.type}' authorization complete`,
|
|
194393
|
+
errorMessage: `'${connector2.type}' authorization failed`
|
|
194394
|
+
}).catch((err) => {
|
|
194395
|
+
if (err instanceof TimeoutError2) {
|
|
194396
|
+
finalStatus = "PENDING";
|
|
194397
|
+
} else {
|
|
194398
|
+
throw err;
|
|
194399
|
+
}
|
|
194387
194400
|
});
|
|
194388
|
-
oauthOutcomes.set(connector2.type,
|
|
194401
|
+
oauthOutcomes.set(connector2.type, finalStatus);
|
|
194402
|
+
} catch (err) {
|
|
194403
|
+
M2.error(`Failed to authorize '${connector2.type}': ${err instanceof Error ? err.message : String(err)}`);
|
|
194404
|
+
oauthOutcomes.set(connector2.type, "FAILED");
|
|
194389
194405
|
}
|
|
194390
194406
|
}
|
|
194391
194407
|
}
|
|
194392
194408
|
}
|
|
194393
|
-
printSummary(results, oauthOutcomes);
|
|
194394
|
-
return { outroMessage };
|
|
194409
|
+
const { hasFailures } = printSummary(results, oauthOutcomes);
|
|
194410
|
+
return { outroMessage, failed: hasFailures };
|
|
194395
194411
|
}
|
|
194396
194412
|
function getConnectorsPushCommand(context) {
|
|
194397
|
-
return new Command("push").description("Push local connectors to Base44 (
|
|
194413
|
+
return new Command("push").description("Push local connectors to Base44 (overwrites connectors on Base44)").action(async () => {
|
|
194398
194414
|
await runCommand(pushConnectorsAction, { requireAuth: true }, context);
|
|
194399
194415
|
});
|
|
194400
194416
|
}
|
|
@@ -199612,4 +199628,4 @@ export {
|
|
|
199612
199628
|
CLIExitError
|
|
199613
199629
|
};
|
|
199614
199630
|
|
|
199615
|
-
//# debugId=
|
|
199631
|
+
//# debugId=6524DB5099E3419164756E2164756E21
|