vercel 41.5.0 → 41.6.0
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/index.js +829 -672
- package/package.json +3 -3
package/dist/index.js
CHANGED
@@ -4071,14 +4071,14 @@ var require_templates = __commonJS2({
|
|
4071
4071
|
}
|
4072
4072
|
return results;
|
4073
4073
|
}
|
4074
|
-
function buildStyle(
|
4074
|
+
function buildStyle(chalk119, styles) {
|
4075
4075
|
const enabled = {};
|
4076
4076
|
for (const layer of styles) {
|
4077
4077
|
for (const style of layer.styles) {
|
4078
4078
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
4079
4079
|
}
|
4080
4080
|
}
|
4081
|
-
let current =
|
4081
|
+
let current = chalk119;
|
4082
4082
|
for (const [styleName, styles2] of Object.entries(enabled)) {
|
4083
4083
|
if (!Array.isArray(styles2)) {
|
4084
4084
|
continue;
|
@@ -4090,7 +4090,7 @@ var require_templates = __commonJS2({
|
|
4090
4090
|
}
|
4091
4091
|
return current;
|
4092
4092
|
}
|
4093
|
-
module2.exports = (
|
4093
|
+
module2.exports = (chalk119, temporary) => {
|
4094
4094
|
const styles = [];
|
4095
4095
|
const chunks = [];
|
4096
4096
|
let chunk = [];
|
@@ -4100,13 +4100,13 @@ var require_templates = __commonJS2({
|
|
4100
4100
|
} else if (style) {
|
4101
4101
|
const string = chunk.join("");
|
4102
4102
|
chunk = [];
|
4103
|
-
chunks.push(styles.length === 0 ? string : buildStyle(
|
4103
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk119, styles)(string));
|
4104
4104
|
styles.push({ inverse, styles: parseStyle(style) });
|
4105
4105
|
} else if (close2) {
|
4106
4106
|
if (styles.length === 0) {
|
4107
4107
|
throw new Error("Found extraneous } in Chalk template literal");
|
4108
4108
|
}
|
4109
|
-
chunks.push(buildStyle(
|
4109
|
+
chunks.push(buildStyle(chalk119, styles)(chunk.join("")));
|
4110
4110
|
chunk = [];
|
4111
4111
|
styles.pop();
|
4112
4112
|
} else {
|
@@ -4154,16 +4154,16 @@ var require_source = __commonJS2({
|
|
4154
4154
|
}
|
4155
4155
|
};
|
4156
4156
|
var chalkFactory = (options) => {
|
4157
|
-
const
|
4158
|
-
applyOptions(
|
4159
|
-
|
4160
|
-
Object.setPrototypeOf(
|
4161
|
-
Object.setPrototypeOf(
|
4162
|
-
|
4157
|
+
const chalk120 = {};
|
4158
|
+
applyOptions(chalk120, options);
|
4159
|
+
chalk120.template = (...arguments_) => chalkTag(chalk120.template, ...arguments_);
|
4160
|
+
Object.setPrototypeOf(chalk120, Chalk.prototype);
|
4161
|
+
Object.setPrototypeOf(chalk120.template, chalk120);
|
4162
|
+
chalk120.template.constructor = () => {
|
4163
4163
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
4164
4164
|
};
|
4165
|
-
|
4166
|
-
return
|
4165
|
+
chalk120.template.Instance = ChalkClass;
|
4166
|
+
return chalk120.template;
|
4167
4167
|
};
|
4168
4168
|
function Chalk(options) {
|
4169
4169
|
return chalkFactory(options);
|
@@ -4274,7 +4274,7 @@ var require_source = __commonJS2({
|
|
4274
4274
|
return openAll + string + closeAll;
|
4275
4275
|
};
|
4276
4276
|
var template;
|
4277
|
-
var chalkTag = (
|
4277
|
+
var chalkTag = (chalk120, ...strings) => {
|
4278
4278
|
const [firstString] = strings;
|
4279
4279
|
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
4280
4280
|
return strings.join(" ");
|
@@ -4290,14 +4290,14 @@ var require_source = __commonJS2({
|
|
4290
4290
|
if (template === void 0) {
|
4291
4291
|
template = require_templates();
|
4292
4292
|
}
|
4293
|
-
return template(
|
4293
|
+
return template(chalk120, parts.join(""));
|
4294
4294
|
};
|
4295
4295
|
Object.defineProperties(Chalk.prototype, styles);
|
4296
|
-
var
|
4297
|
-
|
4298
|
-
|
4299
|
-
|
4300
|
-
module2.exports =
|
4296
|
+
var chalk119 = Chalk();
|
4297
|
+
chalk119.supportsColor = stdoutColor;
|
4298
|
+
chalk119.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
4299
|
+
chalk119.stderr.supportsColor = stderrColor;
|
4300
|
+
module2.exports = chalk119;
|
4301
4301
|
}
|
4302
4302
|
});
|
4303
4303
|
|
@@ -7208,14 +7208,14 @@ var require_templates2 = __commonJS2({
|
|
7208
7208
|
}
|
7209
7209
|
return results;
|
7210
7210
|
}
|
7211
|
-
function buildStyle(
|
7211
|
+
function buildStyle(chalk119, styles) {
|
7212
7212
|
const enabled = {};
|
7213
7213
|
for (const layer of styles) {
|
7214
7214
|
for (const style of layer.styles) {
|
7215
7215
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
7216
7216
|
}
|
7217
7217
|
}
|
7218
|
-
let current =
|
7218
|
+
let current = chalk119;
|
7219
7219
|
for (const styleName of Object.keys(enabled)) {
|
7220
7220
|
if (Array.isArray(enabled[styleName])) {
|
7221
7221
|
if (!(styleName in current)) {
|
@@ -7230,7 +7230,7 @@ var require_templates2 = __commonJS2({
|
|
7230
7230
|
}
|
7231
7231
|
return current;
|
7232
7232
|
}
|
7233
|
-
module2.exports = (
|
7233
|
+
module2.exports = (chalk119, tmp) => {
|
7234
7234
|
const styles = [];
|
7235
7235
|
const chunks = [];
|
7236
7236
|
let chunk = [];
|
@@ -7240,13 +7240,13 @@ var require_templates2 = __commonJS2({
|
|
7240
7240
|
} else if (style) {
|
7241
7241
|
const str = chunk.join("");
|
7242
7242
|
chunk = [];
|
7243
|
-
chunks.push(styles.length === 0 ? str : buildStyle(
|
7243
|
+
chunks.push(styles.length === 0 ? str : buildStyle(chalk119, styles)(str));
|
7244
7244
|
styles.push({ inverse, styles: parseStyle(style) });
|
7245
7245
|
} else if (close2) {
|
7246
7246
|
if (styles.length === 0) {
|
7247
7247
|
throw new Error("Found extraneous } in Chalk template literal");
|
7248
7248
|
}
|
7249
|
-
chunks.push(buildStyle(
|
7249
|
+
chunks.push(buildStyle(chalk119, styles)(chunk.join("")));
|
7250
7250
|
chunk = [];
|
7251
7251
|
styles.pop();
|
7252
7252
|
} else {
|
@@ -7283,16 +7283,16 @@ var require_chalk = __commonJS2({
|
|
7283
7283
|
}
|
7284
7284
|
function Chalk(options) {
|
7285
7285
|
if (!this || !(this instanceof Chalk) || this.template) {
|
7286
|
-
const
|
7287
|
-
applyOptions(
|
7288
|
-
|
7286
|
+
const chalk119 = {};
|
7287
|
+
applyOptions(chalk119, options);
|
7288
|
+
chalk119.template = function() {
|
7289
7289
|
const args2 = [].slice.call(arguments);
|
7290
|
-
return chalkTag.apply(null, [
|
7290
|
+
return chalkTag.apply(null, [chalk119.template].concat(args2));
|
7291
7291
|
};
|
7292
|
-
Object.setPrototypeOf(
|
7293
|
-
Object.setPrototypeOf(
|
7294
|
-
|
7295
|
-
return
|
7292
|
+
Object.setPrototypeOf(chalk119, Chalk.prototype);
|
7293
|
+
Object.setPrototypeOf(chalk119.template, chalk119);
|
7294
|
+
chalk119.template.constructor = Chalk;
|
7295
|
+
return chalk119.template;
|
7296
7296
|
}
|
7297
7297
|
applyOptions(this, options);
|
7298
7298
|
}
|
@@ -7411,7 +7411,7 @@ var require_chalk = __commonJS2({
|
|
7411
7411
|
ansiStyles.dim.open = originalDim;
|
7412
7412
|
return str;
|
7413
7413
|
}
|
7414
|
-
function chalkTag(
|
7414
|
+
function chalkTag(chalk119, strings) {
|
7415
7415
|
if (!Array.isArray(strings)) {
|
7416
7416
|
return [].slice.call(arguments, 1).join(" ");
|
7417
7417
|
}
|
@@ -7421,7 +7421,7 @@ var require_chalk = __commonJS2({
|
|
7421
7421
|
parts.push(String(args2[i - 1]).replace(/[{}\\]/g, "\\$&"));
|
7422
7422
|
parts.push(String(strings.raw[i]));
|
7423
7423
|
}
|
7424
|
-
return template(
|
7424
|
+
return template(chalk119, parts.join(""));
|
7425
7425
|
}
|
7426
7426
|
Object.defineProperties(Chalk.prototype, styles);
|
7427
7427
|
module2.exports = Chalk();
|
@@ -9372,19 +9372,19 @@ var require_cli_spinners = __commonJS2({
|
|
9372
9372
|
var require_log_symbols = __commonJS2({
|
9373
9373
|
"../../node_modules/.pnpm/log-symbols@2.2.0/node_modules/log-symbols/index.js"(exports2, module2) {
|
9374
9374
|
"use strict";
|
9375
|
-
var
|
9375
|
+
var chalk119 = require_chalk();
|
9376
9376
|
var isSupported = process.platform !== "win32" || process.env.CI || process.env.TERM === "xterm-256color";
|
9377
9377
|
var main14 = {
|
9378
|
-
info:
|
9379
|
-
success:
|
9380
|
-
warning:
|
9381
|
-
error:
|
9378
|
+
info: chalk119.blue("\u2139"),
|
9379
|
+
success: chalk119.green("\u2714"),
|
9380
|
+
warning: chalk119.yellow("\u26A0"),
|
9381
|
+
error: chalk119.red("\u2716")
|
9382
9382
|
};
|
9383
9383
|
var fallbacks = {
|
9384
|
-
info:
|
9385
|
-
success:
|
9386
|
-
warning:
|
9387
|
-
error:
|
9384
|
+
info: chalk119.blue("i"),
|
9385
|
+
success: chalk119.green("\u221A"),
|
9386
|
+
warning: chalk119.yellow("\u203C"),
|
9387
|
+
error: chalk119.red("\xD7")
|
9388
9388
|
};
|
9389
9389
|
module2.exports = isSupported ? main14 : fallbacks;
|
9390
9390
|
}
|
@@ -9780,7 +9780,7 @@ var require_wcwidth = __commonJS2({
|
|
9780
9780
|
var require_ora = __commonJS2({
|
9781
9781
|
"../../node_modules/.pnpm/ora@3.4.0/node_modules/ora/index.js"(exports2, module2) {
|
9782
9782
|
"use strict";
|
9783
|
-
var
|
9783
|
+
var chalk119 = require_chalk();
|
9784
9784
|
var cliCursor = require_cli_cursor();
|
9785
9785
|
var cliSpinners = require_cli_spinners();
|
9786
9786
|
var logSymbols = require_log_symbols();
|
@@ -9869,7 +9869,7 @@ var require_ora = __commonJS2({
|
|
9869
9869
|
const { frames } = this.spinner;
|
9870
9870
|
let frame = frames[this.frameIndex];
|
9871
9871
|
if (this.color) {
|
9872
|
-
frame =
|
9872
|
+
frame = chalk119[this.color](frame);
|
9873
9873
|
}
|
9874
9874
|
this.frameIndex = ++this.frameIndex % frames.length;
|
9875
9875
|
const fullPrefixText = typeof this.prefixText === "string" ? this.prefixText + " " : "";
|
@@ -12994,38 +12994,38 @@ var require_time = __commonJS2({
|
|
12994
12994
|
return Date.now() / ONE_SECOND_IN_MS;
|
12995
12995
|
}
|
12996
12996
|
function createUnixTimestampInSecondsFunc() {
|
12997
|
-
const { performance:
|
12998
|
-
if (!
|
12997
|
+
const { performance: performance3 } = worldwide.GLOBAL_OBJ;
|
12998
|
+
if (!performance3 || !performance3.now) {
|
12999
12999
|
return dateTimestampInSeconds;
|
13000
13000
|
}
|
13001
|
-
const approxStartingTimeOrigin = Date.now() -
|
13002
|
-
const timeOrigin =
|
13001
|
+
const approxStartingTimeOrigin = Date.now() - performance3.now();
|
13002
|
+
const timeOrigin = performance3.timeOrigin == void 0 ? approxStartingTimeOrigin : performance3.timeOrigin;
|
13003
13003
|
return () => {
|
13004
|
-
return (timeOrigin +
|
13004
|
+
return (timeOrigin + performance3.now()) / ONE_SECOND_IN_MS;
|
13005
13005
|
};
|
13006
13006
|
}
|
13007
13007
|
var timestampInSeconds = createUnixTimestampInSecondsFunc();
|
13008
13008
|
var timestampWithMs = timestampInSeconds;
|
13009
13009
|
exports2._browserPerformanceTimeOriginMode = void 0;
|
13010
13010
|
var browserPerformanceTimeOrigin = (() => {
|
13011
|
-
const { performance:
|
13012
|
-
if (!
|
13011
|
+
const { performance: performance3 } = worldwide.GLOBAL_OBJ;
|
13012
|
+
if (!performance3 || !performance3.now) {
|
13013
13013
|
exports2._browserPerformanceTimeOriginMode = "none";
|
13014
13014
|
return void 0;
|
13015
13015
|
}
|
13016
13016
|
const threshold = 3600 * 1e3;
|
13017
|
-
const performanceNow =
|
13017
|
+
const performanceNow = performance3.now();
|
13018
13018
|
const dateNow = Date.now();
|
13019
|
-
const timeOriginDelta =
|
13019
|
+
const timeOriginDelta = performance3.timeOrigin ? Math.abs(performance3.timeOrigin + performanceNow - dateNow) : threshold;
|
13020
13020
|
const timeOriginIsReliable = timeOriginDelta < threshold;
|
13021
|
-
const navigationStart =
|
13021
|
+
const navigationStart = performance3.timing && performance3.timing.navigationStart;
|
13022
13022
|
const hasNavigationStart = typeof navigationStart === "number";
|
13023
13023
|
const navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold;
|
13024
13024
|
const navigationStartIsReliable = navigationStartDelta < threshold;
|
13025
13025
|
if (timeOriginIsReliable || navigationStartIsReliable) {
|
13026
13026
|
if (timeOriginDelta <= navigationStartDelta) {
|
13027
13027
|
exports2._browserPerformanceTimeOriginMode = "timeOrigin";
|
13028
|
-
return
|
13028
|
+
return performance3.timeOrigin;
|
13029
13029
|
} else {
|
13030
13030
|
exports2._browserPerformanceTimeOriginMode = "navigationStart";
|
13031
13031
|
return navigationStart;
|
@@ -22635,9 +22635,9 @@ var require_metrics = __commonJS2({
|
|
22635
22635
|
var _lcpEntry;
|
22636
22636
|
var _clsEntry;
|
22637
22637
|
function startTrackingWebVitals() {
|
22638
|
-
const
|
22639
|
-
if (
|
22640
|
-
if (
|
22638
|
+
const performance3 = getBrowserPerformanceAPI();
|
22639
|
+
if (performance3 && utils.browserPerformanceTimeOrigin) {
|
22640
|
+
if (performance3.mark) {
|
22641
22641
|
types.WINDOW.performance.mark("sentry-tracing-init");
|
22642
22642
|
}
|
22643
22643
|
const fidCallback = _trackFID();
|
@@ -22699,8 +22699,8 @@ var require_metrics = __commonJS2({
|
|
22699
22699
|
});
|
22700
22700
|
}
|
22701
22701
|
function startTrackingINP(interactionIdtoRouteNameMapping, interactionsSampleRate) {
|
22702
|
-
const
|
22703
|
-
if (
|
22702
|
+
const performance3 = getBrowserPerformanceAPI();
|
22703
|
+
if (performance3 && utils.browserPerformanceTimeOrigin) {
|
22704
22704
|
const inpCallback = _trackINP(interactionIdtoRouteNameMapping, interactionsSampleRate);
|
22705
22705
|
return () => {
|
22706
22706
|
inpCallback();
|
@@ -22839,13 +22839,13 @@ var require_metrics = __commonJS2({
|
|
22839
22839
|
});
|
22840
22840
|
}
|
22841
22841
|
function addPerformanceEntries(transaction) {
|
22842
|
-
const
|
22843
|
-
if (!
|
22842
|
+
const performance3 = getBrowserPerformanceAPI();
|
22843
|
+
if (!performance3 || !types.WINDOW.performance.getEntries || !utils.browserPerformanceTimeOrigin) {
|
22844
22844
|
return;
|
22845
22845
|
}
|
22846
22846
|
debugBuild.DEBUG_BUILD && utils.logger.log("[Tracing] Adding & adjusting spans using Performance API");
|
22847
22847
|
const timeOrigin = msToSec(utils.browserPerformanceTimeOrigin);
|
22848
|
-
const performanceEntries =
|
22848
|
+
const performanceEntries = performance3.getEntries();
|
22849
22849
|
const { op, start_timestamp: transactionStartTime } = core.spanToJSON(transaction);
|
22850
22850
|
performanceEntries.slice(_performanceCursor).forEach((entry) => {
|
22851
22851
|
const startTime = msToSec(entry.startTime);
|
@@ -35297,14 +35297,14 @@ var require_templates3 = __commonJS2({
|
|
35297
35297
|
}
|
35298
35298
|
return results;
|
35299
35299
|
}
|
35300
|
-
function buildStyle(
|
35300
|
+
function buildStyle(chalk119, styles) {
|
35301
35301
|
const enabled = {};
|
35302
35302
|
for (const layer of styles) {
|
35303
35303
|
for (const style of layer.styles) {
|
35304
35304
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
35305
35305
|
}
|
35306
35306
|
}
|
35307
|
-
let current =
|
35307
|
+
let current = chalk119;
|
35308
35308
|
for (const [styleName, styles2] of Object.entries(enabled)) {
|
35309
35309
|
if (!Array.isArray(styles2)) {
|
35310
35310
|
continue;
|
@@ -35316,7 +35316,7 @@ var require_templates3 = __commonJS2({
|
|
35316
35316
|
}
|
35317
35317
|
return current;
|
35318
35318
|
}
|
35319
|
-
module2.exports = (
|
35319
|
+
module2.exports = (chalk119, temporary) => {
|
35320
35320
|
const styles = [];
|
35321
35321
|
const chunks = [];
|
35322
35322
|
let chunk = [];
|
@@ -35326,13 +35326,13 @@ var require_templates3 = __commonJS2({
|
|
35326
35326
|
} else if (style) {
|
35327
35327
|
const string = chunk.join("");
|
35328
35328
|
chunk = [];
|
35329
|
-
chunks.push(styles.length === 0 ? string : buildStyle(
|
35329
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk119, styles)(string));
|
35330
35330
|
styles.push({ inverse, styles: parseStyle(style) });
|
35331
35331
|
} else if (close2) {
|
35332
35332
|
if (styles.length === 0) {
|
35333
35333
|
throw new Error("Found extraneous } in Chalk template literal");
|
35334
35334
|
}
|
35335
|
-
chunks.push(buildStyle(
|
35335
|
+
chunks.push(buildStyle(chalk119, styles)(chunk.join("")));
|
35336
35336
|
chunk = [];
|
35337
35337
|
styles.pop();
|
35338
35338
|
} else {
|
@@ -35380,16 +35380,16 @@ var require_source2 = __commonJS2({
|
|
35380
35380
|
}
|
35381
35381
|
};
|
35382
35382
|
var chalkFactory = (options) => {
|
35383
|
-
const
|
35384
|
-
applyOptions(
|
35385
|
-
|
35386
|
-
Object.setPrototypeOf(
|
35387
|
-
Object.setPrototypeOf(
|
35388
|
-
|
35383
|
+
const chalk120 = {};
|
35384
|
+
applyOptions(chalk120, options);
|
35385
|
+
chalk120.template = (...arguments_) => chalkTag(chalk120.template, ...arguments_);
|
35386
|
+
Object.setPrototypeOf(chalk120, Chalk.prototype);
|
35387
|
+
Object.setPrototypeOf(chalk120.template, chalk120);
|
35388
|
+
chalk120.template.constructor = () => {
|
35389
35389
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
35390
35390
|
};
|
35391
|
-
|
35392
|
-
return
|
35391
|
+
chalk120.template.Instance = ChalkClass;
|
35392
|
+
return chalk120.template;
|
35393
35393
|
};
|
35394
35394
|
function Chalk(options) {
|
35395
35395
|
return chalkFactory(options);
|
@@ -35500,7 +35500,7 @@ var require_source2 = __commonJS2({
|
|
35500
35500
|
return openAll + string + closeAll;
|
35501
35501
|
};
|
35502
35502
|
var template;
|
35503
|
-
var chalkTag = (
|
35503
|
+
var chalkTag = (chalk120, ...strings) => {
|
35504
35504
|
const [firstString] = strings;
|
35505
35505
|
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
35506
35506
|
return strings.join(" ");
|
@@ -35516,14 +35516,14 @@ var require_source2 = __commonJS2({
|
|
35516
35516
|
if (template === void 0) {
|
35517
35517
|
template = require_templates3();
|
35518
35518
|
}
|
35519
|
-
return template(
|
35519
|
+
return template(chalk120, parts.join(""));
|
35520
35520
|
};
|
35521
35521
|
Object.defineProperties(Chalk.prototype, styles);
|
35522
|
-
var
|
35523
|
-
|
35524
|
-
|
35525
|
-
|
35526
|
-
module2.exports =
|
35522
|
+
var chalk119 = Chalk();
|
35523
|
+
chalk119.supportsColor = stdoutColor;
|
35524
|
+
chalk119.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
35525
|
+
chalk119.stderr.supportsColor = stderrColor;
|
35526
|
+
module2.exports = chalk119;
|
35527
35527
|
}
|
35528
35528
|
});
|
35529
35529
|
|
@@ -41466,49 +41466,49 @@ var require_ms = __commonJS2({
|
|
41466
41466
|
return void 0;
|
41467
41467
|
}
|
41468
41468
|
}
|
41469
|
-
function fmtShort(
|
41470
|
-
var msAbs = Math.abs(
|
41469
|
+
function fmtShort(ms32) {
|
41470
|
+
var msAbs = Math.abs(ms32);
|
41471
41471
|
if (msAbs >= d) {
|
41472
|
-
return Math.round(
|
41472
|
+
return Math.round(ms32 / d) + "d";
|
41473
41473
|
}
|
41474
41474
|
if (msAbs >= h) {
|
41475
|
-
return Math.round(
|
41475
|
+
return Math.round(ms32 / h) + "h";
|
41476
41476
|
}
|
41477
41477
|
if (msAbs >= m) {
|
41478
|
-
return Math.round(
|
41478
|
+
return Math.round(ms32 / m) + "m";
|
41479
41479
|
}
|
41480
41480
|
if (msAbs >= s) {
|
41481
|
-
return Math.round(
|
41481
|
+
return Math.round(ms32 / s) + "s";
|
41482
41482
|
}
|
41483
|
-
return
|
41483
|
+
return ms32 + "ms";
|
41484
41484
|
}
|
41485
|
-
function fmtLong(
|
41486
|
-
var msAbs = Math.abs(
|
41485
|
+
function fmtLong(ms32) {
|
41486
|
+
var msAbs = Math.abs(ms32);
|
41487
41487
|
if (msAbs >= d) {
|
41488
|
-
return plural11(
|
41488
|
+
return plural11(ms32, msAbs, d, "day");
|
41489
41489
|
}
|
41490
41490
|
if (msAbs >= h) {
|
41491
|
-
return plural11(
|
41491
|
+
return plural11(ms32, msAbs, h, "hour");
|
41492
41492
|
}
|
41493
41493
|
if (msAbs >= m) {
|
41494
|
-
return plural11(
|
41494
|
+
return plural11(ms32, msAbs, m, "minute");
|
41495
41495
|
}
|
41496
41496
|
if (msAbs >= s) {
|
41497
|
-
return plural11(
|
41497
|
+
return plural11(ms32, msAbs, s, "second");
|
41498
41498
|
}
|
41499
|
-
return
|
41499
|
+
return ms32 + " ms";
|
41500
41500
|
}
|
41501
|
-
function plural11(
|
41501
|
+
function plural11(ms32, msAbs, n, name) {
|
41502
41502
|
var isPlural = msAbs >= n * 1.5;
|
41503
|
-
return Math.round(
|
41503
|
+
return Math.round(ms32 / n) + " " + name + (isPlural ? "s" : "");
|
41504
41504
|
}
|
41505
41505
|
}
|
41506
41506
|
});
|
41507
41507
|
|
41508
41508
|
// src/util/sleep.ts
|
41509
|
-
function sleep(
|
41509
|
+
function sleep(ms32) {
|
41510
41510
|
return new Promise((resolve12) => {
|
41511
|
-
setTimeout(resolve12,
|
41511
|
+
setTimeout(resolve12, ms32);
|
41512
41512
|
});
|
41513
41513
|
}
|
41514
41514
|
var init_sleep = __esm({
|
@@ -47707,18 +47707,18 @@ var require_get_polling_delay = __commonJS2({
|
|
47707
47707
|
getPollingDelay: () => getPollingDelay
|
47708
47708
|
});
|
47709
47709
|
module2.exports = __toCommonJS4(get_polling_delay_exports);
|
47710
|
-
var
|
47710
|
+
var import_ms32 = __toESM4(require_ms());
|
47711
47711
|
function getPollingDelay(elapsed2) {
|
47712
|
-
if (elapsed2 <= (0,
|
47713
|
-
return (0,
|
47712
|
+
if (elapsed2 <= (0, import_ms32.default)("15s")) {
|
47713
|
+
return (0, import_ms32.default)("1s");
|
47714
47714
|
}
|
47715
|
-
if (elapsed2 <= (0,
|
47716
|
-
return (0,
|
47715
|
+
if (elapsed2 <= (0, import_ms32.default)("1m")) {
|
47716
|
+
return (0, import_ms32.default)("5s");
|
47717
47717
|
}
|
47718
|
-
if (elapsed2 <= (0,
|
47719
|
-
return (0,
|
47718
|
+
if (elapsed2 <= (0, import_ms32.default)("5m")) {
|
47719
|
+
return (0, import_ms32.default)("15s");
|
47720
47720
|
}
|
47721
|
-
return (0,
|
47721
|
+
return (0, import_ms32.default)("30s");
|
47722
47722
|
}
|
47723
47723
|
}
|
47724
47724
|
});
|
@@ -54638,41 +54638,41 @@ var require_ms2 = __commonJS2({
|
|
54638
54638
|
return void 0;
|
54639
54639
|
}
|
54640
54640
|
}
|
54641
|
-
function fmtShort(
|
54642
|
-
var msAbs = Math.abs(
|
54641
|
+
function fmtShort(ms32) {
|
54642
|
+
var msAbs = Math.abs(ms32);
|
54643
54643
|
if (msAbs >= d) {
|
54644
|
-
return Math.round(
|
54644
|
+
return Math.round(ms32 / d) + "d";
|
54645
54645
|
}
|
54646
54646
|
if (msAbs >= h) {
|
54647
|
-
return Math.round(
|
54647
|
+
return Math.round(ms32 / h) + "h";
|
54648
54648
|
}
|
54649
54649
|
if (msAbs >= m) {
|
54650
|
-
return Math.round(
|
54650
|
+
return Math.round(ms32 / m) + "m";
|
54651
54651
|
}
|
54652
54652
|
if (msAbs >= s) {
|
54653
|
-
return Math.round(
|
54653
|
+
return Math.round(ms32 / s) + "s";
|
54654
54654
|
}
|
54655
|
-
return
|
54655
|
+
return ms32 + "ms";
|
54656
54656
|
}
|
54657
|
-
function fmtLong(
|
54658
|
-
var msAbs = Math.abs(
|
54657
|
+
function fmtLong(ms32) {
|
54658
|
+
var msAbs = Math.abs(ms32);
|
54659
54659
|
if (msAbs >= d) {
|
54660
|
-
return plural11(
|
54660
|
+
return plural11(ms32, msAbs, d, "day");
|
54661
54661
|
}
|
54662
54662
|
if (msAbs >= h) {
|
54663
|
-
return plural11(
|
54663
|
+
return plural11(ms32, msAbs, h, "hour");
|
54664
54664
|
}
|
54665
54665
|
if (msAbs >= m) {
|
54666
|
-
return plural11(
|
54666
|
+
return plural11(ms32, msAbs, m, "minute");
|
54667
54667
|
}
|
54668
54668
|
if (msAbs >= s) {
|
54669
|
-
return plural11(
|
54669
|
+
return plural11(ms32, msAbs, s, "second");
|
54670
54670
|
}
|
54671
|
-
return
|
54671
|
+
return ms32 + " ms";
|
54672
54672
|
}
|
54673
|
-
function plural11(
|
54673
|
+
function plural11(ms32, msAbs, n, name) {
|
54674
54674
|
var isPlural = msAbs >= n * 1.5;
|
54675
|
-
return Math.round(
|
54675
|
+
return Math.round(ms32 / n) + " " + name + (isPlural ? "s" : "");
|
54676
54676
|
}
|
54677
54677
|
}
|
54678
54678
|
});
|
@@ -54715,8 +54715,8 @@ var require_common3 = __commonJS2({
|
|
54715
54715
|
}
|
54716
54716
|
const self2 = debug2;
|
54717
54717
|
const curr = Number(/* @__PURE__ */ new Date());
|
54718
|
-
const
|
54719
|
-
self2.diff =
|
54718
|
+
const ms32 = curr - (prevTime || curr);
|
54719
|
+
self2.diff = ms32;
|
54720
54720
|
self2.prev = prevTime;
|
54721
54721
|
self2.curr = curr;
|
54722
54722
|
prevTime = curr;
|
@@ -78183,7 +78183,7 @@ var require_jsbn = __commonJS2({
|
|
78183
78183
|
}
|
78184
78184
|
if (r == null)
|
78185
78185
|
r = nbi();
|
78186
|
-
var y = nbi(), ts = this.s,
|
78186
|
+
var y = nbi(), ts = this.s, ms32 = m.s;
|
78187
78187
|
var nsh = this.DB - nbits(pm[pm.t - 1]);
|
78188
78188
|
if (nsh > 0) {
|
78189
78189
|
pm.lShiftTo(nsh, y);
|
@@ -78219,7 +78219,7 @@ var require_jsbn = __commonJS2({
|
|
78219
78219
|
}
|
78220
78220
|
if (q != null) {
|
78221
78221
|
r.drShiftTo(ys, q);
|
78222
|
-
if (ts !=
|
78222
|
+
if (ts != ms32)
|
78223
78223
|
BigInteger.ZERO.subTo(q, q);
|
78224
78224
|
}
|
78225
78225
|
r.t = ys;
|
@@ -85874,6 +85874,12 @@ var init_telemetry = __esm({
|
|
85874
85874
|
value: "TRUE"
|
85875
85875
|
});
|
85876
85876
|
}
|
85877
|
+
trackOidcTokenRefresh(count) {
|
85878
|
+
this.track({
|
85879
|
+
key: "oidc-token-refresh",
|
85880
|
+
value: `${count}`
|
85881
|
+
});
|
85882
|
+
}
|
85877
85883
|
trackCPUs() {
|
85878
85884
|
this.track({
|
85879
85885
|
key: "cpu_count",
|
@@ -102753,7 +102759,7 @@ var require_local_file_system_detector = __commonJS2({
|
|
102753
102759
|
LocalFileSystemDetector: () => LocalFileSystemDetector5
|
102754
102760
|
});
|
102755
102761
|
module2.exports = __toCommonJS4(local_file_system_detector_exports);
|
102756
|
-
var
|
102762
|
+
var import_promises3 = __toESM4(require("fs/promises"));
|
102757
102763
|
var import_path41 = require("path");
|
102758
102764
|
var import_filesystem = require_filesystem();
|
102759
102765
|
var import_error_utils38 = require_dist2();
|
@@ -102764,7 +102770,7 @@ var require_local_file_system_detector = __commonJS2({
|
|
102764
102770
|
}
|
102765
102771
|
async _hasPath(name) {
|
102766
102772
|
try {
|
102767
|
-
await
|
102773
|
+
await import_promises3.default.stat(this.getFilePath(name));
|
102768
102774
|
return true;
|
102769
102775
|
} catch (err) {
|
102770
102776
|
if ((0, import_error_utils38.isErrnoException)(err) && err.code === "ENOENT") {
|
@@ -102774,15 +102780,15 @@ var require_local_file_system_detector = __commonJS2({
|
|
102774
102780
|
}
|
102775
102781
|
}
|
102776
102782
|
_readFile(name) {
|
102777
|
-
return
|
102783
|
+
return import_promises3.default.readFile(this.getFilePath(name));
|
102778
102784
|
}
|
102779
102785
|
async _isFile(name) {
|
102780
|
-
const stat2 = await
|
102786
|
+
const stat2 = await import_promises3.default.stat(this.getFilePath(name));
|
102781
102787
|
return stat2.isFile();
|
102782
102788
|
}
|
102783
102789
|
async _readdir(dir) {
|
102784
102790
|
const dirPath = this.getFilePath(dir);
|
102785
|
-
const entries = await
|
102791
|
+
const entries = await import_promises3.default.readdir(dirPath, { withFileTypes: true });
|
102786
102792
|
const result = [];
|
102787
102793
|
for (const entry of entries) {
|
102788
102794
|
let type;
|
@@ -144835,32 +144841,32 @@ var require_ms3 = __commonJS2({
|
|
144835
144841
|
return void 0;
|
144836
144842
|
}
|
144837
144843
|
}
|
144838
|
-
function fmtShort(
|
144839
|
-
if (
|
144840
|
-
return Math.round(
|
144844
|
+
function fmtShort(ms32) {
|
144845
|
+
if (ms32 >= d) {
|
144846
|
+
return Math.round(ms32 / d) + "d";
|
144841
144847
|
}
|
144842
|
-
if (
|
144843
|
-
return Math.round(
|
144848
|
+
if (ms32 >= h) {
|
144849
|
+
return Math.round(ms32 / h) + "h";
|
144844
144850
|
}
|
144845
|
-
if (
|
144846
|
-
return Math.round(
|
144851
|
+
if (ms32 >= m) {
|
144852
|
+
return Math.round(ms32 / m) + "m";
|
144847
144853
|
}
|
144848
|
-
if (
|
144849
|
-
return Math.round(
|
144854
|
+
if (ms32 >= s) {
|
144855
|
+
return Math.round(ms32 / s) + "s";
|
144850
144856
|
}
|
144851
|
-
return
|
144857
|
+
return ms32 + "ms";
|
144852
144858
|
}
|
144853
|
-
function fmtLong(
|
144854
|
-
return plural11(
|
144859
|
+
function fmtLong(ms32) {
|
144860
|
+
return plural11(ms32, d, "day") || plural11(ms32, h, "hour") || plural11(ms32, m, "minute") || plural11(ms32, s, "second") || ms32 + " ms";
|
144855
144861
|
}
|
144856
|
-
function plural11(
|
144857
|
-
if (
|
144862
|
+
function plural11(ms32, n, name) {
|
144863
|
+
if (ms32 < n) {
|
144858
144864
|
return;
|
144859
144865
|
}
|
144860
|
-
if (
|
144861
|
-
return Math.floor(
|
144866
|
+
if (ms32 < n * 1.5) {
|
144867
|
+
return Math.floor(ms32 / n) + " " + name;
|
144862
144868
|
}
|
144863
|
-
return Math.ceil(
|
144869
|
+
return Math.ceil(ms32 / n) + " " + name + "s";
|
144864
144870
|
}
|
144865
144871
|
}
|
144866
144872
|
});
|
@@ -144893,8 +144899,8 @@ var require_debug4 = __commonJS2({
|
|
144893
144899
|
return;
|
144894
144900
|
var self2 = debug2;
|
144895
144901
|
var curr = +/* @__PURE__ */ new Date();
|
144896
|
-
var
|
144897
|
-
self2.diff =
|
144902
|
+
var ms32 = curr - (prevTime || curr);
|
144903
|
+
self2.diff = ms32;
|
144898
144904
|
self2.prev = prevTime;
|
144899
144905
|
self2.curr = curr;
|
144900
144906
|
prevTime = curr;
|
@@ -159206,9 +159212,9 @@ ${error_code}
|
|
159206
159212
|
isCaseSensitive() {
|
159207
159213
|
return this.caseSensitive;
|
159208
159214
|
}
|
159209
|
-
async runDevCommand() {
|
159215
|
+
async runDevCommand(forceRestart = false) {
|
159210
159216
|
const { devCommand: devCommand2, cwd } = this;
|
159211
|
-
if (devCommand2 === this.currentDevCommand) {
|
159217
|
+
if (devCommand2 === this.currentDevCommand && !forceRestart) {
|
159212
159218
|
return;
|
159213
159219
|
}
|
159214
159220
|
this.currentDevCommand = devCommand2;
|
@@ -159280,8 +159286,125 @@ ${error_code}
|
|
159280
159286
|
}
|
159281
159287
|
});
|
159282
159288
|
|
159289
|
+
// src/util/env/constants.ts
|
159290
|
+
var VERCEL_OIDC_TOKEN;
|
159291
|
+
var init_constants = __esm({
|
159292
|
+
"src/util/env/constants.ts"() {
|
159293
|
+
"use strict";
|
159294
|
+
VERCEL_OIDC_TOKEN = "VERCEL_OIDC_TOKEN";
|
159295
|
+
}
|
159296
|
+
});
|
159297
|
+
|
159298
|
+
// src/util/env/refresh-oidc-token.ts
|
159299
|
+
function getMs(defaultValue, overrideValue) {
|
159300
|
+
if (overrideValue) {
|
159301
|
+
const result = (0, import_ms14.default)(overrideValue);
|
159302
|
+
if (Number.isFinite(result) && result > 0)
|
159303
|
+
return result;
|
159304
|
+
}
|
159305
|
+
return defaultValue;
|
159306
|
+
}
|
159307
|
+
async function* refreshOidcToken(signal, client2, projectId, envValues, source, throttleMillis) {
|
159308
|
+
throttleMillis ??= THROTTLE_MILLIS;
|
159309
|
+
let lastPulledEnvAt = clock();
|
159310
|
+
let refreshCount = 0;
|
159311
|
+
while (!signal.aborted) {
|
159312
|
+
const oidcToken = envValues[VERCEL_OIDC_TOKEN];
|
159313
|
+
if (!oidcToken) {
|
159314
|
+
output_manager_default.debug(`${VERCEL_OIDC_TOKEN} is absent; disabling refreshes`);
|
159315
|
+
return;
|
159316
|
+
}
|
159317
|
+
const now = clock();
|
159318
|
+
let expiresAfterMillis;
|
159319
|
+
try {
|
159320
|
+
const { exp } = (0, import_jose.decodeJwt)(oidcToken);
|
159321
|
+
expiresAfterMillis = exp !== void 0 ? exp * 1e3 - now : void 0;
|
159322
|
+
} catch (error3) {
|
159323
|
+
}
|
159324
|
+
if (expiresAfterMillis === void 0 || !Number.isFinite(expiresAfterMillis)) {
|
159325
|
+
output_manager_default.debug(`${VERCEL_OIDC_TOKEN} is invalid; disabling refreshes`);
|
159326
|
+
return;
|
159327
|
+
}
|
159328
|
+
if (refreshCount++ > 0 && expiresAfterMillis > 0) {
|
159329
|
+
yield oidcToken;
|
159330
|
+
}
|
159331
|
+
let refreshAfterMillis = Math.max(
|
159332
|
+
0,
|
159333
|
+
expiresAfterMillis - REFRESH_BEFORE_EXPIRY_MILLIS
|
159334
|
+
);
|
159335
|
+
if (now + refreshAfterMillis - lastPulledEnvAt < throttleMillis) {
|
159336
|
+
refreshAfterMillis = throttleMillis;
|
159337
|
+
}
|
159338
|
+
const expiresAfterSecs = Math.abs(
|
159339
|
+
Math.round(millisToSecs(expiresAfterMillis))
|
159340
|
+
);
|
159341
|
+
const refreshAfterSecs = Math.round(millisToSecs(refreshAfterMillis));
|
159342
|
+
if (expiresAfterMillis < 0) {
|
159343
|
+
output_manager_default.debug(
|
159344
|
+
`${VERCEL_OIDC_TOKEN} expired ${expiresAfterSecs}s ago; refreshing in ${refreshAfterSecs}s`
|
159345
|
+
);
|
159346
|
+
} else {
|
159347
|
+
output_manager_default.debug(
|
159348
|
+
`${VERCEL_OIDC_TOKEN} expires in ${expiresAfterSecs}s; refreshing in ${refreshAfterSecs}s`
|
159349
|
+
);
|
159350
|
+
}
|
159351
|
+
await (0, import_promises2.setTimeout)(refreshAfterMillis, void 0, { signal });
|
159352
|
+
const envValuesOrNull = await pullEnvValuesUntilSuccessful(
|
159353
|
+
signal,
|
159354
|
+
client2,
|
159355
|
+
projectId,
|
159356
|
+
source,
|
159357
|
+
throttleMillis
|
159358
|
+
);
|
159359
|
+
if (!envValuesOrNull)
|
159360
|
+
return;
|
159361
|
+
envValues = envValuesOrNull;
|
159362
|
+
lastPulledEnvAt = clock();
|
159363
|
+
}
|
159364
|
+
}
|
159365
|
+
async function pullEnvValuesUntilSuccessful(signal, client2, projectId, source, millis) {
|
159366
|
+
while (!signal.aborted) {
|
159367
|
+
try {
|
159368
|
+
return (await pullEnvRecords(client2, projectId, source)).env;
|
159369
|
+
} catch (error3) {
|
159370
|
+
output_manager_default.debug(
|
159371
|
+
`Failed to pull environment; trying again in ${Math.round(millisToSecs(millis))}s`
|
159372
|
+
);
|
159373
|
+
await (0, import_promises2.setTimeout)(millis, void 0, { signal });
|
159374
|
+
}
|
159375
|
+
}
|
159376
|
+
return null;
|
159377
|
+
}
|
159378
|
+
function clock() {
|
159379
|
+
return import_perf_hooks.performance.timeOrigin + import_perf_hooks.performance.now();
|
159380
|
+
}
|
159381
|
+
function millisToSecs(millis) {
|
159382
|
+
return millis / 1e3;
|
159383
|
+
}
|
159384
|
+
var import_promises2, import_jose, import_ms14, import_perf_hooks, REFRESH_BEFORE_EXPIRY_MILLIS, THROTTLE_MILLIS;
|
159385
|
+
var init_refresh_oidc_token = __esm({
|
159386
|
+
"src/util/env/refresh-oidc-token.ts"() {
|
159387
|
+
"use strict";
|
159388
|
+
import_promises2 = require("timers/promises");
|
159389
|
+
import_jose = require("jose");
|
159390
|
+
import_ms14 = __toESM3(require_ms());
|
159391
|
+
import_perf_hooks = require("perf_hooks");
|
159392
|
+
init_output_manager();
|
159393
|
+
init_get_env_records();
|
159394
|
+
init_constants();
|
159395
|
+
REFRESH_BEFORE_EXPIRY_MILLIS = getMs(
|
159396
|
+
(0, import_ms14.default)("15m"),
|
159397
|
+
process.env.REFRESH_VERCEL_OIDC_TOKEN_BEFORE_EXPIRY_MILLIS
|
159398
|
+
);
|
159399
|
+
THROTTLE_MILLIS = getMs(
|
159400
|
+
(0, import_ms14.default)("1m"),
|
159401
|
+
process.env.REFRESH_VERCEL_OIDC_TOKEN_THROTTLE_MILLIS
|
159402
|
+
);
|
159403
|
+
}
|
159404
|
+
});
|
159405
|
+
|
159283
159406
|
// src/commands/dev/dev.ts
|
159284
|
-
async function dev(client2, opts, args2) {
|
159407
|
+
async function dev(client2, opts, args2, telemetry2) {
|
159285
159408
|
const [dir = "."] = args2;
|
159286
159409
|
let cwd = (0, import_path36.resolve)(dir);
|
159287
159410
|
const listen4 = parseListen(opts["--listen"] || "3000");
|
@@ -159327,7 +159450,29 @@ async function dev(client2, opts, args2) {
|
|
159327
159450
|
envValues,
|
159328
159451
|
repoRoot
|
159329
159452
|
});
|
159330
|
-
|
159453
|
+
const controller = new AbortController();
|
159454
|
+
const timeout = setTimeout(async () => {
|
159455
|
+
if (link4.status !== "linked")
|
159456
|
+
return;
|
159457
|
+
let refreshCount = 0;
|
159458
|
+
for await (const token of refreshOidcToken(
|
159459
|
+
controller.signal,
|
159460
|
+
client2,
|
159461
|
+
link4.project.id,
|
159462
|
+
envValues,
|
159463
|
+
"vercel-cli:dev"
|
159464
|
+
)) {
|
159465
|
+
output_manager_default.log(`Refreshing ${import_chalk59.default.green(VERCEL_OIDC_TOKEN)}`);
|
159466
|
+
envValues[VERCEL_OIDC_TOKEN] = token;
|
159467
|
+
await devServer.runDevCommand(true);
|
159468
|
+
telemetry2.trackOidcTokenRefresh(++refreshCount);
|
159469
|
+
}
|
159470
|
+
});
|
159471
|
+
process.on("SIGTERM", () => {
|
159472
|
+
clearTimeout(timeout);
|
159473
|
+
controller.abort();
|
159474
|
+
devServer.stop();
|
159475
|
+
});
|
159331
159476
|
if (!devServer.devCommand) {
|
159332
159477
|
const outputDir = (0, import_path36.join)(cwd, OUTPUT_DIR);
|
159333
159478
|
if (await import_fs_extra22.default.pathExists(outputDir)) {
|
@@ -159337,10 +159482,11 @@ async function dev(client2, opts, args2) {
|
|
159337
159482
|
}
|
159338
159483
|
await devServer.start(...listen4);
|
159339
159484
|
}
|
159340
|
-
var import_path36, import_fs_extra22;
|
159485
|
+
var import_chalk59, import_path36, import_fs_extra22;
|
159341
159486
|
var init_dev = __esm({
|
159342
159487
|
"src/commands/dev/dev.ts"() {
|
159343
159488
|
"use strict";
|
159489
|
+
import_chalk59 = __toESM3(require_source());
|
159344
159490
|
import_path36 = require("path");
|
159345
159491
|
import_fs_extra22 = __toESM3(require_lib());
|
159346
159492
|
init_server();
|
@@ -159352,6 +159498,8 @@ var init_dev = __esm({
|
|
159352
159498
|
init_write_build_result();
|
159353
159499
|
init_get_env_records();
|
159354
159500
|
init_output_manager();
|
159501
|
+
init_refresh_oidc_token();
|
159502
|
+
init_constants();
|
159355
159503
|
}
|
159356
159504
|
});
|
159357
159505
|
|
@@ -159396,6 +159544,9 @@ var init_dev2 = __esm({
|
|
159396
159544
|
this.trackCliFlag("confirm");
|
159397
159545
|
}
|
159398
159546
|
}
|
159547
|
+
trackOidcTokenRefresh(count) {
|
159548
|
+
super.trackOidcTokenRefresh(count);
|
159549
|
+
}
|
159399
159550
|
};
|
159400
159551
|
}
|
159401
159552
|
});
|
@@ -159483,7 +159634,7 @@ async function main4(client2) {
|
|
159483
159634
|
return 1;
|
159484
159635
|
}
|
159485
159636
|
try {
|
159486
|
-
return await dev(client2, parsedArgs.flags, args2);
|
159637
|
+
return await dev(client2, parsedArgs.flags, args2, telemetry2);
|
159487
159638
|
} catch (err) {
|
159488
159639
|
if ((0, import_error_utils22.isErrnoException)(err) && err.code === "ENOTFOUND") {
|
159489
159640
|
const matches = /getaddrinfo ENOTFOUND (.*)$/.exec(err.message || "");
|
@@ -159508,17 +159659,17 @@ async function main4(client2) {
|
|
159508
159659
|
function stringifyError(err) {
|
159509
159660
|
if (err instanceof NowError) {
|
159510
159661
|
const errMeta = JSON.stringify(err.meta, null, 2).replace(/\\n/g, "\n");
|
159511
|
-
return `${
|
159662
|
+
return `${import_chalk60.default.red(err.code)} ${err.message}
|
159512
159663
|
${errMeta}`;
|
159513
159664
|
}
|
159514
159665
|
return err.stack;
|
159515
159666
|
}
|
159516
|
-
var import_path37,
|
159667
|
+
var import_path37, import_chalk60, import_error_utils22, COMMAND_CONFIG3;
|
159517
159668
|
var init_dev3 = __esm({
|
159518
159669
|
"src/commands/dev/index.ts"() {
|
159519
159670
|
"use strict";
|
159520
159671
|
import_path37 = __toESM3(require("path"));
|
159521
|
-
|
159672
|
+
import_chalk60 = __toESM3(require_source());
|
159522
159673
|
init_get_args();
|
159523
159674
|
init_get_subcommand();
|
159524
159675
|
init_now_error();
|
@@ -159660,9 +159811,9 @@ async function getDNSData(client2, data) {
|
|
159660
159811
|
const port = await getNumber(client2, `- ${type} port: `);
|
159661
159812
|
const target = await getTrimmedString(client2, `- ${type} target: `);
|
159662
159813
|
output_manager_default.log(
|
159663
|
-
`${
|
159814
|
+
`${import_chalk61.default.cyan(name)} ${import_chalk61.default.bold(type)} ${import_chalk61.default.cyan(
|
159664
159815
|
`${priority}`
|
159665
|
-
)} ${
|
159816
|
+
)} ${import_chalk61.default.cyan(`${weight}`)} ${import_chalk61.default.cyan(`${port}`)} ${import_chalk61.default.cyan(
|
159666
159817
|
target
|
159667
159818
|
)}.`
|
159668
159819
|
);
|
@@ -159681,9 +159832,9 @@ async function getDNSData(client2, data) {
|
|
159681
159832
|
const mxPriority = await getNumber(client2, `- ${type} priority: `);
|
159682
159833
|
const value2 = await getTrimmedString(client2, `- ${type} host: `);
|
159683
159834
|
output_manager_default.log(
|
159684
|
-
`${
|
159835
|
+
`${import_chalk61.default.cyan(name)} ${import_chalk61.default.bold(type)} ${import_chalk61.default.cyan(
|
159685
159836
|
`${mxPriority}`
|
159686
|
-
)} ${
|
159837
|
+
)} ${import_chalk61.default.cyan(value2)}`
|
159687
159838
|
);
|
159688
159839
|
return await verifyData(client2) ? {
|
159689
159840
|
name,
|
@@ -159693,7 +159844,7 @@ async function getDNSData(client2, data) {
|
|
159693
159844
|
} : null;
|
159694
159845
|
}
|
159695
159846
|
const value = await getTrimmedString(client2, `- ${type} value: `);
|
159696
|
-
output_manager_default.log(`${
|
159847
|
+
output_manager_default.log(`${import_chalk61.default.cyan(name)} ${import_chalk61.default.bold(type)} ${import_chalk61.default.cyan(value)}`);
|
159697
159848
|
return await verifyData(client2) ? {
|
159698
159849
|
name,
|
159699
159850
|
type,
|
@@ -159727,11 +159878,11 @@ async function getTrimmedString(client2, label) {
|
|
159727
159878
|
});
|
159728
159879
|
return res.trim();
|
159729
159880
|
}
|
159730
|
-
var
|
159881
|
+
var import_chalk61, RECORD_TYPES;
|
159731
159882
|
var init_get_dns_data = __esm({
|
159732
159883
|
"src/util/dns/get-dns-data.ts"() {
|
159733
159884
|
"use strict";
|
159734
|
-
|
159885
|
+
import_chalk61 = __toESM3(require_source());
|
159735
159886
|
init_output_manager();
|
159736
159887
|
RECORD_TYPES = ["A", "AAAA", "ALIAS", "CAA", "CNAME", "MX", "SRV", "TXT"];
|
159737
159888
|
}
|
@@ -159804,7 +159955,7 @@ async function add2(client2, argv) {
|
|
159804
159955
|
const parsedParams = parseAddArgs(args2);
|
159805
159956
|
if (!parsedParams) {
|
159806
159957
|
output_manager_default.error(
|
159807
|
-
`Invalid number of arguments. See: ${
|
159958
|
+
`Invalid number of arguments. See: ${import_chalk62.default.cyan(
|
159808
159959
|
`${getCommandName("dns --help")}`
|
159809
159960
|
)} for usage.`
|
159810
159961
|
);
|
@@ -159831,23 +159982,23 @@ async function add2(client2, argv) {
|
|
159831
159982
|
const record = await addDNSRecord(client2, domain, data);
|
159832
159983
|
if (record instanceof DomainNotFound) {
|
159833
159984
|
output_manager_default.error(
|
159834
|
-
`The domain ${domain} can't be found under ${
|
159985
|
+
`The domain ${domain} can't be found under ${import_chalk62.default.bold(
|
159835
159986
|
contextName
|
159836
|
-
)} ${
|
159987
|
+
)} ${import_chalk62.default.gray(addStamp())}`
|
159837
159988
|
);
|
159838
159989
|
return 1;
|
159839
159990
|
}
|
159840
159991
|
if (record instanceof DNSPermissionDenied) {
|
159841
159992
|
output_manager_default.error(
|
159842
|
-
`You don't have permissions to add records to domain ${domain} under ${
|
159993
|
+
`You don't have permissions to add records to domain ${domain} under ${import_chalk62.default.bold(
|
159843
159994
|
contextName
|
159844
|
-
)} ${
|
159995
|
+
)} ${import_chalk62.default.gray(addStamp())}`
|
159845
159996
|
);
|
159846
159997
|
return 1;
|
159847
159998
|
}
|
159848
159999
|
if (record instanceof DNSInvalidPort) {
|
159849
160000
|
output_manager_default.error(
|
159850
|
-
`Invalid <port> parameter. A number was expected ${
|
160001
|
+
`Invalid <port> parameter. A number was expected ${import_chalk62.default.gray(
|
159851
160002
|
addStamp()
|
159852
160003
|
)}`
|
159853
160004
|
);
|
@@ -159855,7 +160006,7 @@ async function add2(client2, argv) {
|
|
159855
160006
|
}
|
159856
160007
|
if (record instanceof DNSInvalidType) {
|
159857
160008
|
output_manager_default.error(
|
159858
|
-
`Invalid <type> parameter "${record.meta.type}". Expected one of A, AAAA, ALIAS, CAA, CNAME, MX, SRV, TXT ${
|
160009
|
+
`Invalid <type> parameter "${record.meta.type}". Expected one of A, AAAA, ALIAS, CAA, CNAME, MX, SRV, TXT ${import_chalk62.default.gray(
|
159859
160010
|
addStamp()
|
159860
160011
|
)}`
|
159861
160012
|
);
|
@@ -159866,17 +160017,17 @@ async function add2(client2, argv) {
|
|
159866
160017
|
return 1;
|
159867
160018
|
}
|
159868
160019
|
output_manager_default.success(
|
159869
|
-
`DNS record for domain ${
|
160020
|
+
`DNS record for domain ${import_chalk62.default.bold(domain)} ${import_chalk62.default.gray(
|
159870
160021
|
`(${record.uid})`
|
159871
|
-
)} created under ${
|
160022
|
+
)} created under ${import_chalk62.default.bold(contextName)} ${import_chalk62.default.gray(addStamp())}`
|
159872
160023
|
);
|
159873
160024
|
return 0;
|
159874
160025
|
}
|
159875
|
-
var
|
160026
|
+
var import_chalk62;
|
159876
160027
|
var init_add4 = __esm({
|
159877
160028
|
"src/commands/dns/add.ts"() {
|
159878
160029
|
"use strict";
|
159879
|
-
|
160030
|
+
import_chalk62 = __toESM3(require_source());
|
159880
160031
|
init_errors_ts();
|
159881
160032
|
init_add_dns_record();
|
159882
160033
|
init_get_scope();
|
@@ -159896,7 +160047,7 @@ var init_add4 = __esm({
|
|
159896
160047
|
// src/util/dns/import-zonefile.ts
|
159897
160048
|
async function importZonefile(client2, contextName, domain, zonefilePath) {
|
159898
160049
|
output_manager_default.spinner(
|
159899
|
-
`Importing Zone file for domain ${domain} under ${
|
160050
|
+
`Importing Zone file for domain ${domain} under ${import_chalk63.default.bold(contextName)}`
|
159900
160051
|
);
|
159901
160052
|
const zonefile = (0, import_fs7.readFileSync)((0, import_path38.resolve)(zonefilePath), "utf8");
|
159902
160053
|
try {
|
@@ -159923,11 +160074,11 @@ async function importZonefile(client2, contextName, domain, zonefilePath) {
|
|
159923
160074
|
throw err;
|
159924
160075
|
}
|
159925
160076
|
}
|
159926
|
-
var
|
160077
|
+
var import_chalk63, import_fs7, import_path38;
|
159927
160078
|
var init_import_zonefile = __esm({
|
159928
160079
|
"src/util/dns/import-zonefile.ts"() {
|
159929
160080
|
"use strict";
|
159930
|
-
|
160081
|
+
import_chalk63 = __toESM3(require_source());
|
159931
160082
|
import_fs7 = require("fs");
|
159932
160083
|
import_path38 = require("path");
|
159933
160084
|
init_errors_ts();
|
@@ -159982,7 +160133,7 @@ async function importZone(client2, argv) {
|
|
159982
160133
|
});
|
159983
160134
|
if (args2.length !== 2) {
|
159984
160135
|
output_manager_default.error(
|
159985
|
-
`Invalid number of arguments. Usage: ${
|
160136
|
+
`Invalid number of arguments. Usage: ${import_chalk64.default.cyan(
|
159986
160137
|
`${getCommandName("dns import <domain> <zonefile>")}`
|
159987
160138
|
)}`
|
159988
160139
|
);
|
@@ -160000,32 +160151,32 @@ async function importZone(client2, argv) {
|
|
160000
160151
|
);
|
160001
160152
|
if (recordIds instanceof DomainNotFound) {
|
160002
160153
|
output_manager_default.error(
|
160003
|
-
`The domain ${domain} can't be found under ${
|
160154
|
+
`The domain ${domain} can't be found under ${import_chalk64.default.bold(
|
160004
160155
|
contextName
|
160005
|
-
)} ${
|
160156
|
+
)} ${import_chalk64.default.gray(addStamp())}`
|
160006
160157
|
);
|
160007
160158
|
return 1;
|
160008
160159
|
}
|
160009
160160
|
if (recordIds instanceof InvalidDomain) {
|
160010
160161
|
output_manager_default.error(
|
160011
|
-
`The domain ${domain} doesn't match with the one found in the Zone file ${
|
160162
|
+
`The domain ${domain} doesn't match with the one found in the Zone file ${import_chalk64.default.gray(
|
160012
160163
|
addStamp()
|
160013
160164
|
)}`
|
160014
160165
|
);
|
160015
160166
|
return 1;
|
160016
160167
|
}
|
160017
160168
|
output_manager_default.success(
|
160018
|
-
`${recordIds.length} DNS records for domain ${
|
160169
|
+
`${recordIds.length} DNS records for domain ${import_chalk64.default.bold(
|
160019
160170
|
domain
|
160020
|
-
)} created under ${
|
160171
|
+
)} created under ${import_chalk64.default.bold(contextName)} ${import_chalk64.default.gray(addStamp())}`
|
160021
160172
|
);
|
160022
160173
|
return 0;
|
160023
160174
|
}
|
160024
|
-
var
|
160175
|
+
var import_chalk64;
|
160025
160176
|
var init_import2 = __esm({
|
160026
160177
|
"src/commands/dns/import.ts"() {
|
160027
160178
|
"use strict";
|
160028
|
-
|
160179
|
+
import_chalk64 = __toESM3(require_source());
|
160029
160180
|
init_get_scope();
|
160030
160181
|
init_errors_ts();
|
160031
160182
|
init_stamp();
|
@@ -160068,7 +160219,7 @@ function formatTable(header, align, blocks) {
|
|
160068
160219
|
out += `${block.name}
|
160069
160220
|
`;
|
160070
160221
|
}
|
160071
|
-
const rows = [header.map((s) =>
|
160222
|
+
const rows = [header.map((s) => import_chalk65.default.dim(s))].concat(block.rows);
|
160072
160223
|
if (rows.length > 0) {
|
160073
160224
|
rows[0][0] = ` ${rows[0][0]}`;
|
160074
160225
|
for (let i = 1; i < rows.length; i++) {
|
@@ -160088,11 +160239,11 @@ function formatTable(header, align, blocks) {
|
|
160088
160239
|
}
|
160089
160240
|
return out.slice(0, -1);
|
160090
160241
|
}
|
160091
|
-
var
|
160242
|
+
var import_chalk65;
|
160092
160243
|
var init_format_table = __esm({
|
160093
160244
|
"src/util/format-table.ts"() {
|
160094
160245
|
"use strict";
|
160095
|
-
|
160246
|
+
import_chalk65 = __toESM3(require_source());
|
160096
160247
|
init_table();
|
160097
160248
|
init_strlen();
|
160098
160249
|
}
|
@@ -160176,18 +160327,18 @@ function getAddDomainName(domainNames) {
|
|
160176
160327
|
];
|
160177
160328
|
}
|
160178
160329
|
async function getDomainNames(client2, contextName, next) {
|
160179
|
-
output_manager_default.spinner(`Fetching domains under ${
|
160330
|
+
output_manager_default.spinner(`Fetching domains under ${import_chalk66.default.bold(contextName)}`);
|
160180
160331
|
const { domains: domains2, pagination } = await getDomains(client2, next);
|
160181
160332
|
return { domainNames: domains2.map((domain) => domain.name), pagination };
|
160182
160333
|
}
|
160183
|
-
var
|
160334
|
+
var import_chalk66;
|
160184
160335
|
var init_get_dns_records = __esm({
|
160185
160336
|
"src/util/dns/get-dns-records.ts"() {
|
160186
160337
|
"use strict";
|
160187
160338
|
init_errors_ts();
|
160188
160339
|
init_get_domain_dns_records();
|
160189
160340
|
init_get_domains();
|
160190
|
-
|
160341
|
+
import_chalk66 = __toESM3(require_source());
|
160191
160342
|
init_output_manager();
|
160192
160343
|
}
|
160193
160344
|
});
|
@@ -160252,7 +160403,7 @@ async function ls3(client2, argv) {
|
|
160252
160403
|
telemetry2.trackCliOptionNext(opts["--next"]);
|
160253
160404
|
if (args2.length > 1) {
|
160254
160405
|
output_manager_default.error(
|
160255
|
-
`Invalid number of arguments. Usage: ${
|
160406
|
+
`Invalid number of arguments. Usage: ${import_chalk67.default.cyan(
|
160256
160407
|
`${getCommandName("dns ls [domain]")}`
|
160257
160408
|
)}`
|
160258
160409
|
);
|
@@ -160274,15 +160425,15 @@ async function ls3(client2, argv) {
|
|
160274
160425
|
);
|
160275
160426
|
if (data instanceof DomainNotFound) {
|
160276
160427
|
output_manager_default.error(
|
160277
|
-
`The domain ${domainName} can't be found under ${
|
160428
|
+
`The domain ${domainName} can't be found under ${import_chalk67.default.bold(
|
160278
160429
|
contextName
|
160279
|
-
)} ${
|
160430
|
+
)} ${import_chalk67.default.gray(lsStamp())}`
|
160280
160431
|
);
|
160281
160432
|
return 1;
|
160282
160433
|
}
|
160283
160434
|
const { records, pagination: pagination2 } = data;
|
160284
160435
|
output_manager_default.log(
|
160285
|
-
`${records.length > 0 ? "Records" : "No records"} found under ${
|
160436
|
+
`${records.length > 0 ? "Records" : "No records"} found under ${import_chalk67.default.bold(contextName)} ${import_chalk67.default.gray(lsStamp())}`
|
160286
160437
|
);
|
160287
160438
|
client2.stdout.write(getDNSRecordsTable([{ domainName, records }]));
|
160288
160439
|
if (pagination2 && pagination2.count === 20) {
|
@@ -160302,9 +160453,9 @@ async function ls3(client2, argv) {
|
|
160302
160453
|
);
|
160303
160454
|
const nRecords = dnsRecords.reduce((p, r) => r.records.length + p, 0);
|
160304
160455
|
output_manager_default.log(
|
160305
|
-
`${nRecords > 0 ? "Records" : "No records"} found under ${
|
160456
|
+
`${nRecords > 0 ? "Records" : "No records"} found under ${import_chalk67.default.bold(
|
160306
160457
|
contextName
|
160307
|
-
)} ${
|
160458
|
+
)} ${import_chalk67.default.gray(lsStamp())}`
|
160308
160459
|
);
|
160309
160460
|
output_manager_default.log(getDNSRecordsTable(dnsRecords));
|
160310
160461
|
if (pagination && pagination.count === 20) {
|
@@ -160322,14 +160473,14 @@ function getDNSRecordsTable(dnsRecords) {
|
|
160322
160473
|
["", "id", "name", "type", "value", "created"],
|
160323
160474
|
["l", "r", "l", "l", "l", "l"],
|
160324
160475
|
dnsRecords.map(({ domainName, records }) => ({
|
160325
|
-
name:
|
160476
|
+
name: import_chalk67.default.bold(domainName),
|
160326
160477
|
rows: records.map(getDNSRecordRow)
|
160327
160478
|
}))
|
160328
160479
|
);
|
160329
160480
|
}
|
160330
160481
|
function getDNSRecordRow(record) {
|
160331
160482
|
const isSystemRecord = record.creator === "system";
|
160332
|
-
const createdAt = `${(0,
|
160483
|
+
const createdAt = `${(0, import_ms15.default)(
|
160333
160484
|
Date.now() - new Date(Number(record.createdAt)).getTime()
|
160334
160485
|
)} ago`;
|
160335
160486
|
const priority = record.mxPriority || record.priority || null;
|
@@ -160339,15 +160490,15 @@ function getDNSRecordRow(record) {
|
|
160339
160490
|
record.name,
|
160340
160491
|
record.type,
|
160341
160492
|
priority ? `${priority} ${record.value}` : record.value,
|
160342
|
-
|
160493
|
+
import_chalk67.default.gray(isSystemRecord ? "default" : createdAt)
|
160343
160494
|
];
|
160344
160495
|
}
|
160345
|
-
var
|
160496
|
+
var import_chalk67, import_ms15;
|
160346
160497
|
var init_ls5 = __esm({
|
160347
160498
|
"src/commands/dns/ls.ts"() {
|
160348
160499
|
"use strict";
|
160349
|
-
|
160350
|
-
|
160500
|
+
import_chalk67 = __toESM3(require_source());
|
160501
|
+
import_ms15 = __toESM3(require_ms());
|
160351
160502
|
init_errors_ts();
|
160352
160503
|
init_format_table();
|
160353
160504
|
init_get_dns_records();
|
@@ -160431,7 +160582,7 @@ async function rm3(client2, argv) {
|
|
160431
160582
|
const [recordId] = args2;
|
160432
160583
|
if (args2.length !== 1) {
|
160433
160584
|
output_manager_default.error(
|
160434
|
-
`Invalid number of arguments. Usage: ${
|
160585
|
+
`Invalid number of arguments. Usage: ${import_chalk68.default.cyan(
|
160435
160586
|
`${getCommandName("dns rm <id>")}`
|
160436
160587
|
)}`
|
160437
160588
|
);
|
@@ -160457,7 +160608,7 @@ async function rm3(client2, argv) {
|
|
160457
160608
|
const rmStamp = stamp_default();
|
160458
160609
|
await deleteDNSRecordById(client2, domainName, record.id);
|
160459
160610
|
output_manager_default.success(
|
160460
|
-
`Record ${
|
160611
|
+
`Record ${import_chalk68.default.gray(`${record.id}`)} removed ${import_chalk68.default.gray(rmStamp())}`
|
160461
160612
|
);
|
160462
160613
|
return 0;
|
160463
160614
|
}
|
@@ -160472,7 +160623,7 @@ function readConfirmation2(client2, msg, domainName, record) {
|
|
160472
160623
|
`
|
160473
160624
|
);
|
160474
160625
|
output_manager_default.print(
|
160475
|
-
`${
|
160626
|
+
`${import_chalk68.default.bold.red("> Are you sure?")} ${import_chalk68.default.gray("(y/N) ")}`
|
160476
160627
|
);
|
160477
160628
|
client2.stdin.on("data", (d) => {
|
160478
160629
|
process.stdin.pause();
|
@@ -160484,20 +160635,20 @@ function getDeleteTableRow(domainName, record) {
|
|
160484
160635
|
const recordName = `${record.name.length > 0 ? `${record.name}.` : ""}${domainName}`;
|
160485
160636
|
return [
|
160486
160637
|
record.id,
|
160487
|
-
|
160638
|
+
import_chalk68.default.bold(
|
160488
160639
|
`${recordName} ${record.type} ${record.value} ${record.mxPriority || ""}`
|
160489
160640
|
),
|
160490
|
-
|
160491
|
-
`${(0,
|
160641
|
+
import_chalk68.default.gray(
|
160642
|
+
`${(0, import_ms16.default)(Date.now() - new Date(Number(record.createdAt)).getTime())} ago`
|
160492
160643
|
)
|
160493
160644
|
];
|
160494
160645
|
}
|
160495
|
-
var
|
160646
|
+
var import_chalk68, import_ms16;
|
160496
160647
|
var init_rm4 = __esm({
|
160497
160648
|
"src/commands/dns/rm.ts"() {
|
160498
160649
|
"use strict";
|
160499
|
-
|
160500
|
-
|
160650
|
+
import_chalk68 = __toESM3(require_source());
|
160651
|
+
import_ms16 = __toESM3(require_ms());
|
160501
160652
|
init_table();
|
160502
160653
|
init_delete_dns_record_by_id();
|
160503
160654
|
init_get_dns_record_by_id();
|
@@ -160670,16 +160821,16 @@ function formatNSTable(intendedNameservers, currentNameservers, { extraSpace = "
|
|
160670
160821
|
const rows = [];
|
160671
160822
|
for (let i = 0; i < maxLength; i++) {
|
160672
160823
|
rows.push([
|
160673
|
-
sortedIntended[i] ||
|
160674
|
-
sortedCurrent[i] ||
|
160675
|
-
sortedIntended[i] === sortedCurrent[i] ?
|
160824
|
+
sortedIntended[i] || import_chalk69.default.gray("-"),
|
160825
|
+
sortedCurrent[i] || import_chalk69.default.gray("-"),
|
160826
|
+
sortedIntended[i] === sortedCurrent[i] ? import_chalk69.default.green(chars_default.tick) : import_chalk69.default.red(chars_default.cross)
|
160676
160827
|
]);
|
160677
160828
|
}
|
160678
160829
|
return table(
|
160679
160830
|
[
|
160680
160831
|
[
|
160681
|
-
|
160682
|
-
|
160832
|
+
import_chalk69.default.gray("Intended Nameservers"),
|
160833
|
+
import_chalk69.default.gray("Current Nameservers"),
|
160683
160834
|
""
|
160684
160835
|
],
|
160685
160836
|
...rows
|
@@ -160687,11 +160838,11 @@ function formatNSTable(intendedNameservers, currentNameservers, { extraSpace = "
|
|
160687
160838
|
{ hsep: 4 }
|
160688
160839
|
).replace(/^(.*)/gm, `${extraSpace}$1`);
|
160689
160840
|
}
|
160690
|
-
var
|
160841
|
+
var import_chalk69;
|
160691
160842
|
var init_format_ns_table = __esm({
|
160692
160843
|
"src/util/format-ns-table.ts"() {
|
160693
160844
|
"use strict";
|
160694
|
-
|
160845
|
+
import_chalk69 = __toESM3(require_source());
|
160695
160846
|
init_table();
|
160696
160847
|
init_chars();
|
160697
160848
|
}
|
@@ -160700,7 +160851,7 @@ var init_format_ns_table = __esm({
|
|
160700
160851
|
// src/util/domains/get-domain.ts
|
160701
160852
|
async function getDomain(client2, contextName, domainName) {
|
160702
160853
|
output_manager_default.spinner(
|
160703
|
-
`Fetching domain ${domainName} under ${
|
160854
|
+
`Fetching domain ${domainName} under ${import_chalk70.default.bold(contextName)}`
|
160704
160855
|
);
|
160705
160856
|
try {
|
160706
160857
|
const { domain } = await client2.fetch(
|
@@ -160714,11 +160865,11 @@ async function getDomain(client2, contextName, domainName) {
|
|
160714
160865
|
throw err;
|
160715
160866
|
}
|
160716
160867
|
}
|
160717
|
-
var
|
160868
|
+
var import_chalk70;
|
160718
160869
|
var init_get_domain = __esm({
|
160719
160870
|
"src/util/domains/get-domain.ts"() {
|
160720
160871
|
"use strict";
|
160721
|
-
|
160872
|
+
import_chalk70 = __toESM3(require_source());
|
160722
160873
|
init_errors_ts();
|
160723
160874
|
init_output_manager();
|
160724
160875
|
}
|
@@ -160758,7 +160909,7 @@ var init_get_domain_config = __esm({
|
|
160758
160909
|
// src/util/projects/add-domain-to-project.ts
|
160759
160910
|
async function addDomainToProject(client2, projectNameOrId, domain) {
|
160760
160911
|
output_manager_default.spinner(
|
160761
|
-
`Adding domain ${domain} to project ${
|
160912
|
+
`Adding domain ${domain} to project ${import_chalk71.default.bold(projectNameOrId)}`
|
160762
160913
|
);
|
160763
160914
|
try {
|
160764
160915
|
const response = await client2.fetch(
|
@@ -160787,11 +160938,11 @@ async function addDomainToProject(client2, projectNameOrId, domain) {
|
|
160787
160938
|
throw err;
|
160788
160939
|
}
|
160789
160940
|
}
|
160790
|
-
var
|
160941
|
+
var import_chalk71;
|
160791
160942
|
var init_add_domain_to_project = __esm({
|
160792
160943
|
"src/util/projects/add-domain-to-project.ts"() {
|
160793
160944
|
"use strict";
|
160794
|
-
|
160945
|
+
import_chalk71 = __toESM3(require_source());
|
160795
160946
|
init_errors_ts();
|
160796
160947
|
init_output_manager();
|
160797
160948
|
}
|
@@ -160800,7 +160951,7 @@ var init_add_domain_to_project = __esm({
|
|
160800
160951
|
// src/util/projects/remove-domain-from-project.ts
|
160801
160952
|
async function removeDomainFromProject(client2, projectNameOrId, domain) {
|
160802
160953
|
output_manager_default.spinner(
|
160803
|
-
`Removing domain ${domain} from project ${
|
160954
|
+
`Removing domain ${domain} from project ${import_chalk72.default.bold(projectNameOrId)}`
|
160804
160955
|
);
|
160805
160956
|
try {
|
160806
160957
|
const response = await client2.fetch(
|
@@ -160819,11 +160970,11 @@ async function removeDomainFromProject(client2, projectNameOrId, domain) {
|
|
160819
160970
|
throw err;
|
160820
160971
|
}
|
160821
160972
|
}
|
160822
|
-
var
|
160973
|
+
var import_chalk72;
|
160823
160974
|
var init_remove_domain_from_project = __esm({
|
160824
160975
|
"src/util/projects/remove-domain-from-project.ts"() {
|
160825
160976
|
"use strict";
|
160826
|
-
|
160977
|
+
import_chalk72 = __toESM3(require_source());
|
160827
160978
|
init_errors_ts();
|
160828
160979
|
init_output_manager();
|
160829
160980
|
}
|
@@ -160927,7 +161078,7 @@ async function add3(client2, argv) {
|
|
160927
161078
|
}
|
160928
161079
|
}
|
160929
161080
|
output_manager_default.success(
|
160930
|
-
`Domain ${
|
161081
|
+
`Domain ${import_chalk73.default.bold(domainName)} added to project ${import_chalk73.default.bold(
|
160931
161082
|
projectName
|
160932
161083
|
)}. ${addStamp()}`
|
160933
161084
|
);
|
@@ -160948,11 +161099,11 @@ async function add3(client2, argv) {
|
|
160948
161099
|
"This domain is not configured properly. To configure it you should either:"
|
160949
161100
|
);
|
160950
161101
|
output_manager_default.print(
|
160951
|
-
` ${
|
161102
|
+
` ${import_chalk73.default.grey("a)")} Set the following record on your DNS provider to continue: ${code(`A ${domainName} 76.76.21.21`)} ${import_chalk73.default.grey("[recommended]")}
|
160952
161103
|
`
|
160953
161104
|
);
|
160954
161105
|
output_manager_default.print(
|
160955
|
-
` ${
|
161106
|
+
` ${import_chalk73.default.grey("b)")} Change your Domains's nameservers to the intended set`
|
160956
161107
|
);
|
160957
161108
|
output_manager_default.print(
|
160958
161109
|
`
|
@@ -160975,11 +161126,11 @@ ${formatNSTable(
|
|
160975
161126
|
}
|
160976
161127
|
return 0;
|
160977
161128
|
}
|
160978
|
-
var
|
161129
|
+
var import_chalk73;
|
160979
161130
|
var init_add6 = __esm({
|
160980
161131
|
"src/commands/domains/add.ts"() {
|
160981
161132
|
"use strict";
|
160982
|
-
|
161133
|
+
import_chalk73 = __toESM3(require_source());
|
160983
161134
|
init_errors_ts();
|
160984
161135
|
init_format_ns_table();
|
160985
161136
|
init_get_scope();
|
@@ -161071,7 +161222,7 @@ async function buy(client2, argv) {
|
|
161071
161222
|
}
|
161072
161223
|
if (!(await getDomainStatus(client2, domainName)).available) {
|
161073
161224
|
output_manager_default.error(
|
161074
|
-
`The domain ${param(domainName)} is ${
|
161225
|
+
`The domain ${param(domainName)} is ${import_chalk74.default.underline(
|
161075
161226
|
"unavailable"
|
161076
161227
|
)}! ${availableStamp()}`
|
161077
161228
|
);
|
@@ -161079,22 +161230,22 @@ async function buy(client2, argv) {
|
|
161079
161230
|
}
|
161080
161231
|
const { period, price } = domainPrice;
|
161081
161232
|
output_manager_default.log(
|
161082
|
-
`The domain ${param(domainName)} is ${
|
161233
|
+
`The domain ${param(domainName)} is ${import_chalk74.default.underline(
|
161083
161234
|
"available"
|
161084
|
-
)} to buy under ${
|
161235
|
+
)} to buy under ${import_chalk74.default.bold(contextName)}! ${availableStamp()}`
|
161085
161236
|
);
|
161086
161237
|
let autoRenew;
|
161087
161238
|
if (skipConfirmation) {
|
161088
161239
|
autoRenew = true;
|
161089
161240
|
} else {
|
161090
161241
|
if (!await client2.input.confirm(
|
161091
|
-
`Buy now for ${
|
161242
|
+
`Buy now for ${import_chalk74.default.bold(`$${price}`)} (${`${period}yr${period > 1 ? "s" : ""}`})?`,
|
161092
161243
|
false
|
161093
161244
|
)) {
|
161094
161245
|
return 0;
|
161095
161246
|
}
|
161096
161247
|
autoRenew = await client2.input.confirm(
|
161097
|
-
renewalPrice.period === 1 ? `Auto renew yearly for ${
|
161248
|
+
renewalPrice.period === 1 ? `Auto renew yearly for ${import_chalk74.default.bold(`$${price}`)}?` : `Auto renew every ${renewalPrice.period} years for ${import_chalk74.default.bold(
|
161098
161249
|
`$${price}`
|
161099
161250
|
)}?`,
|
161100
161251
|
true
|
@@ -161178,11 +161329,11 @@ async function buy(client2, argv) {
|
|
161178
161329
|
}
|
161179
161330
|
return 0;
|
161180
161331
|
}
|
161181
|
-
var
|
161332
|
+
var import_chalk74, import_tldts6, import_error_utils23;
|
161182
161333
|
var init_buy2 = __esm({
|
161183
161334
|
"src/commands/domains/buy.ts"() {
|
161184
161335
|
"use strict";
|
161185
|
-
|
161336
|
+
import_chalk74 = __toESM3(require_source());
|
161186
161337
|
import_tldts6 = __toESM3(require_cjs7());
|
161187
161338
|
import_error_utils23 = __toESM3(require_dist2());
|
161188
161339
|
init_errors_ts();
|
@@ -161363,13 +161514,13 @@ async function transferIn(client2, argv) {
|
|
161363
161514
|
const { price } = domainPrice;
|
161364
161515
|
const { contextName } = await getScope(client2);
|
161365
161516
|
output_manager_default.log(
|
161366
|
-
`The domain ${param(domainName)} is ${
|
161517
|
+
`The domain ${param(domainName)} is ${import_chalk75.default.underline(
|
161367
161518
|
"available"
|
161368
|
-
)} to transfer under ${
|
161519
|
+
)} to transfer under ${import_chalk75.default.bold(contextName)}! ${availableStamp()}`
|
161369
161520
|
);
|
161370
161521
|
const authCode = await getAuthCode(client2, opts["--code"]);
|
161371
161522
|
const shouldTransfer = await client2.input.confirm(
|
161372
|
-
transferPolicy === "no-change" ? `Transfer now for ${
|
161523
|
+
transferPolicy === "no-change" ? `Transfer now for ${import_chalk75.default.bold(`$${price}`)}?` : `Transfer now with 1yr renewal for ${import_chalk75.default.bold(`$${price}`)}?`,
|
161373
161524
|
false
|
161374
161525
|
);
|
161375
161526
|
if (!shouldTransfer) {
|
@@ -161437,11 +161588,11 @@ async function transferIn(client2, argv) {
|
|
161437
161588
|
);
|
161438
161589
|
return 0;
|
161439
161590
|
}
|
161440
|
-
var
|
161591
|
+
var import_chalk75;
|
161441
161592
|
var init_transfer_in2 = __esm({
|
161442
161593
|
"src/commands/domains/transfer-in.ts"() {
|
161443
161594
|
"use strict";
|
161444
|
-
|
161595
|
+
import_chalk75 = __toESM3(require_source());
|
161445
161596
|
init_errors_ts();
|
161446
161597
|
init_get_scope();
|
161447
161598
|
init_param();
|
@@ -161553,7 +161704,7 @@ async function inspect2(client2, argv) {
|
|
161553
161704
|
telemetry2.trackCliArgumentDomain(domainName);
|
161554
161705
|
if (args2.length !== 1) {
|
161555
161706
|
output_manager_default.error(
|
161556
|
-
`Invalid number of arguments. Usage: ${
|
161707
|
+
`Invalid number of arguments. Usage: ${import_chalk76.default.cyan(
|
161557
161708
|
`${getCommandName("domains inspect <domain>")}`
|
161558
161709
|
)}`
|
161559
161710
|
);
|
@@ -161562,7 +161713,7 @@ async function inspect2(client2, argv) {
|
|
161562
161713
|
output_manager_default.debug(`Fetching domain info`);
|
161563
161714
|
const { contextName } = await getScope(client2);
|
161564
161715
|
output_manager_default.spinner(
|
161565
|
-
`Fetching Domain ${domainName} under ${
|
161716
|
+
`Fetching Domain ${domainName} under ${import_chalk76.default.bold(contextName)}`
|
161566
161717
|
);
|
161567
161718
|
const information = await fetchInformation({
|
161568
161719
|
client: client2,
|
@@ -161574,38 +161725,38 @@ async function inspect2(client2, argv) {
|
|
161574
161725
|
}
|
161575
161726
|
const { domain, projects, renewalPrice, domainConfig } = information;
|
161576
161727
|
output_manager_default.log(
|
161577
|
-
`Domain ${domainName} found under ${
|
161728
|
+
`Domain ${domainName} found under ${import_chalk76.default.bold(contextName)} ${import_chalk76.default.gray(
|
161578
161729
|
inspectStamp()
|
161579
161730
|
)}`
|
161580
161731
|
);
|
161581
161732
|
output_manager_default.print("\n");
|
161582
|
-
output_manager_default.print(
|
161583
|
-
output_manager_default.print(` ${
|
161733
|
+
output_manager_default.print(import_chalk76.default.bold(" General\n\n"));
|
161734
|
+
output_manager_default.print(` ${import_chalk76.default.cyan("Name")} ${domain.name}
|
161584
161735
|
`);
|
161585
161736
|
output_manager_default.print(
|
161586
|
-
` ${
|
161737
|
+
` ${import_chalk76.default.cyan("Registrar")} ${getDomainRegistrar(domain)}
|
161587
161738
|
`
|
161588
161739
|
);
|
161589
161740
|
output_manager_default.print(
|
161590
|
-
` ${
|
161741
|
+
` ${import_chalk76.default.cyan("Expiration Date")} ${formatDate(domain.expiresAt)}
|
161591
161742
|
`
|
161592
161743
|
);
|
161593
161744
|
output_manager_default.print(
|
161594
|
-
` ${
|
161745
|
+
` ${import_chalk76.default.cyan("Creator")} ${domain.creator.username}
|
161595
161746
|
`
|
161596
161747
|
);
|
161597
161748
|
output_manager_default.print(
|
161598
|
-
` ${
|
161749
|
+
` ${import_chalk76.default.cyan("Created At")} ${formatDate(domain.createdAt)}
|
161599
161750
|
`
|
161600
161751
|
);
|
161601
|
-
output_manager_default.print(` ${
|
161752
|
+
output_manager_default.print(` ${import_chalk76.default.cyan("Edge Network")} yes
|
161602
161753
|
`);
|
161603
161754
|
output_manager_default.print(
|
161604
|
-
` ${
|
161755
|
+
` ${import_chalk76.default.cyan("Renewal Price")} ${domain.boughtAt && renewalPrice ? `$${renewalPrice} USD` : import_chalk76.default.gray("-")}
|
161605
161756
|
`
|
161606
161757
|
);
|
161607
161758
|
output_manager_default.print("\n");
|
161608
|
-
output_manager_default.print(
|
161759
|
+
output_manager_default.print(import_chalk76.default.bold(" Nameservers\n\n"));
|
161609
161760
|
output_manager_default.print(
|
161610
161761
|
`${formatNSTable(domain.intendedNameservers, domain.nameservers, {
|
161611
161762
|
extraSpace: " "
|
@@ -161614,7 +161765,7 @@ async function inspect2(client2, argv) {
|
|
161614
161765
|
);
|
161615
161766
|
output_manager_default.print("\n");
|
161616
161767
|
if (Array.isArray(projects) && projects.length > 0) {
|
161617
|
-
output_manager_default.print(
|
161768
|
+
output_manager_default.print(import_chalk76.default.bold(" Projects\n"));
|
161618
161769
|
const table2 = formatTable(
|
161619
161770
|
["Project", "Domains"],
|
161620
161771
|
["l", "l"],
|
@@ -161644,11 +161795,11 @@ async function inspect2(client2, argv) {
|
|
161644
161795
|
null
|
161645
161796
|
);
|
161646
161797
|
output_manager_default.print(
|
161647
|
-
` ${
|
161798
|
+
` ${import_chalk76.default.grey("a)")} Set the following record on your DNS provider to continue: ${code(`A ${domainName} 76.76.21.21`)} ${import_chalk76.default.grey("[recommended]")}
|
161648
161799
|
`
|
161649
161800
|
);
|
161650
161801
|
output_manager_default.print(
|
161651
|
-
` ${
|
161802
|
+
` ${import_chalk76.default.grey("b)")} Change your Domains's nameservers to the intended set detailed above.
|
161652
161803
|
|
161653
161804
|
`
|
161654
161805
|
);
|
@@ -161707,11 +161858,11 @@ async function fetchInformation({
|
|
161707
161858
|
domainConfig
|
161708
161859
|
};
|
161709
161860
|
}
|
161710
|
-
var
|
161861
|
+
var import_chalk76;
|
161711
161862
|
var init_inspect2 = __esm({
|
161712
161863
|
"src/commands/domains/inspect.ts"() {
|
161713
161864
|
"use strict";
|
161714
|
-
|
161865
|
+
import_chalk76 = __toESM3(require_source());
|
161715
161866
|
init_errors_ts();
|
161716
161867
|
init_stamp();
|
161717
161868
|
init_format_date();
|
@@ -161790,21 +161941,21 @@ async function ls4(client2, argv) {
|
|
161790
161941
|
const lsStamp = stamp_default();
|
161791
161942
|
if (args2.length !== 0) {
|
161792
161943
|
output_manager_default.error(
|
161793
|
-
`Invalid number of arguments. Usage: ${
|
161944
|
+
`Invalid number of arguments. Usage: ${import_chalk77.default.cyan(
|
161794
161945
|
`${getCommandName("domains ls")}`
|
161795
161946
|
)}`
|
161796
161947
|
);
|
161797
161948
|
return 1;
|
161798
161949
|
}
|
161799
|
-
output_manager_default.spinner(`Fetching Domains under ${
|
161950
|
+
output_manager_default.spinner(`Fetching Domains under ${import_chalk77.default.bold(contextName)}`);
|
161800
161951
|
const { domains: domains2, pagination } = await getDomains(
|
161801
161952
|
client2,
|
161802
161953
|
...paginationOptions
|
161803
161954
|
);
|
161804
161955
|
output_manager_default.log(
|
161805
|
-
`${(0, import_pluralize8.default)("Domain", domains2.length, true)} found under ${
|
161956
|
+
`${(0, import_pluralize8.default)("Domain", domains2.length, true)} found under ${import_chalk77.default.bold(
|
161806
161957
|
contextName
|
161807
|
-
)} ${
|
161958
|
+
)} ${import_chalk77.default.gray(lsStamp())}`
|
161808
161959
|
);
|
161809
161960
|
if (domains2.length > 0) {
|
161810
161961
|
output_manager_default.print(
|
@@ -161826,14 +161977,14 @@ function formatDomainsTable(domains2) {
|
|
161826
161977
|
const current = Date.now();
|
161827
161978
|
const rows = domains2.map((domain) => {
|
161828
161979
|
const expiration = formatDateWithoutTime(domain.expiresAt);
|
161829
|
-
const age = domain.createdAt ? (0,
|
161980
|
+
const age = domain.createdAt ? (0, import_ms17.default)(current - domain.createdAt) : "-";
|
161830
161981
|
return [
|
161831
161982
|
domain.name,
|
161832
161983
|
getDomainRegistrar(domain),
|
161833
161984
|
isDomainExternal(domain) ? "Third Party" : "Vercel",
|
161834
161985
|
expiration,
|
161835
161986
|
domain.creator.username,
|
161836
|
-
|
161987
|
+
import_chalk77.default.gray(age)
|
161837
161988
|
];
|
161838
161989
|
});
|
161839
161990
|
return formatTable(
|
@@ -161842,12 +161993,12 @@ function formatDomainsTable(domains2) {
|
|
161842
161993
|
[{ rows }]
|
161843
161994
|
);
|
161844
161995
|
}
|
161845
|
-
var
|
161996
|
+
var import_ms17, import_chalk77, import_pluralize8;
|
161846
161997
|
var init_ls7 = __esm({
|
161847
161998
|
"src/commands/domains/ls.ts"() {
|
161848
161999
|
"use strict";
|
161849
|
-
|
161850
|
-
|
162000
|
+
import_ms17 = __toESM3(require_ms());
|
162001
|
+
import_chalk77 = __toESM3(require_source());
|
161851
162002
|
import_pluralize8 = __toESM3(require_pluralize());
|
161852
162003
|
init_get_domains();
|
161853
162004
|
init_get_scope();
|
@@ -161996,7 +162147,7 @@ async function rm4(client2, argv) {
|
|
161996
162147
|
const { contextName } = await getScope(client2);
|
161997
162148
|
if (args2.length !== 1) {
|
161998
162149
|
output_manager_default.error(
|
161999
|
-
`Invalid number of arguments. Usage: ${
|
162150
|
+
`Invalid number of arguments. Usage: ${import_chalk78.default.cyan(
|
162000
162151
|
`${getCommandName("domains rm <domain>")}`
|
162001
162152
|
)}`
|
162002
162153
|
);
|
@@ -162005,14 +162156,14 @@ async function rm4(client2, argv) {
|
|
162005
162156
|
const domain = await getDomainByName(client2, contextName, domainName);
|
162006
162157
|
if (domain instanceof DomainNotFound || domain.name !== domainName) {
|
162007
162158
|
output_manager_default.error(
|
162008
|
-
`Domain not found by "${domainName}" under ${
|
162159
|
+
`Domain not found by "${domainName}" under ${import_chalk78.default.bold(contextName)}`
|
162009
162160
|
);
|
162010
162161
|
output_manager_default.log(`Run ${getCommandName(`domains ls`)} to see your domains.`);
|
162011
162162
|
return 1;
|
162012
162163
|
}
|
162013
162164
|
if (domain instanceof DomainPermissionDenied) {
|
162014
162165
|
output_manager_default.error(
|
162015
|
-
`You don't have access to the domain ${domainName} under ${
|
162166
|
+
`You don't have access to the domain ${domainName} under ${import_chalk78.default.bold(
|
162016
162167
|
contextName
|
162017
162168
|
)}`
|
162018
162169
|
);
|
@@ -162072,15 +162223,15 @@ async function removeDomain(client2, contextName, skipConfirmation, domain, alia
|
|
162072
162223
|
domain.name
|
162073
162224
|
);
|
162074
162225
|
if (removeResult instanceof DomainNotFound) {
|
162075
|
-
output_manager_default.error(`Domain not found under ${
|
162226
|
+
output_manager_default.error(`Domain not found under ${import_chalk78.default.bold(contextName)}`);
|
162076
162227
|
output_manager_default.log(`Run ${getCommandName(`domains ls`)} to see your domains.`);
|
162077
162228
|
return 1;
|
162078
162229
|
}
|
162079
162230
|
if (removeResult instanceof DomainPermissionDenied) {
|
162080
162231
|
output_manager_default.error(
|
162081
|
-
`You don't have permissions over domain ${
|
162232
|
+
`You don't have permissions over domain ${import_chalk78.default.underline(
|
162082
162233
|
removeResult.meta.domain
|
162083
|
-
)} under ${
|
162234
|
+
)} under ${import_chalk78.default.bold(removeResult.meta.context)}.`
|
162084
162235
|
);
|
162085
162236
|
return 1;
|
162086
162237
|
}
|
@@ -162122,21 +162273,21 @@ async function removeDomain(client2, contextName, skipConfirmation, domain, alia
|
|
162122
162273
|
);
|
162123
162274
|
if (aliases.length > 0) {
|
162124
162275
|
output_manager_default.warn(
|
162125
|
-
`This domain's ${
|
162276
|
+
`This domain's ${import_chalk78.default.bold(
|
162126
162277
|
(0, import_pluralize9.default)("alias", aliases.length, true)
|
162127
162278
|
)} will be removed. Run ${getCommandName(`alias ls`)} to list them.`
|
162128
162279
|
);
|
162129
162280
|
}
|
162130
162281
|
if (certs.length > 0) {
|
162131
162282
|
output_manager_default.warn(
|
162132
|
-
`This domain's ${
|
162283
|
+
`This domain's ${import_chalk78.default.bold(
|
162133
162284
|
(0, import_pluralize9.default)("certificate", certs.length, true)
|
162134
162285
|
)} will be removed. Run ${getCommandName(`cert ls`)} to list them.`
|
162135
162286
|
);
|
162136
162287
|
}
|
162137
162288
|
if (suffix2) {
|
162138
162289
|
output_manager_default.warn(
|
162139
|
-
`The ${
|
162290
|
+
`The ${import_chalk78.default.bold(`custom suffix`)} associated with this domain.`
|
162140
162291
|
);
|
162141
162292
|
}
|
162142
162293
|
if (!skipConfirmation && !await client2.input.confirm(
|
@@ -162157,14 +162308,14 @@ async function removeDomain(client2, contextName, skipConfirmation, domain, alia
|
|
162157
162308
|
attempt + 1
|
162158
162309
|
);
|
162159
162310
|
}
|
162160
|
-
output_manager_default.success(`Domain ${
|
162311
|
+
output_manager_default.success(`Domain ${import_chalk78.default.bold(domain.name)} removed ${removeStamp()}`);
|
162161
162312
|
return 0;
|
162162
162313
|
}
|
162163
|
-
var
|
162314
|
+
var import_chalk78, import_pluralize9;
|
162164
162315
|
var init_rm6 = __esm({
|
162165
162316
|
"src/commands/domains/rm.ts"() {
|
162166
162317
|
"use strict";
|
162167
|
-
|
162318
|
+
import_chalk78 = __toESM3(require_source());
|
162168
162319
|
import_pluralize9 = __toESM3(require_pluralize());
|
162169
162320
|
init_errors_ts();
|
162170
162321
|
init_delete_cert_by_id();
|
@@ -162303,15 +162454,15 @@ async function move2(client2, argv) {
|
|
162303
162454
|
}
|
162304
162455
|
const domain = await getDomainByName(client2, contextName, domainName);
|
162305
162456
|
if (domain instanceof DomainNotFound) {
|
162306
|
-
output_manager_default.error(`Domain not found under ${
|
162457
|
+
output_manager_default.error(`Domain not found under ${import_chalk79.default.bold(contextName)}`);
|
162307
162458
|
output_manager_default.log(`Run ${getCommandName(`domains ls`)} to see your domains.`);
|
162308
162459
|
return 1;
|
162309
162460
|
}
|
162310
162461
|
if (domain instanceof DomainPermissionDenied) {
|
162311
162462
|
output_manager_default.error(
|
162312
|
-
`You don't have permissions over domain ${
|
162463
|
+
`You don't have permissions over domain ${import_chalk79.default.underline(
|
162313
162464
|
domain.meta.domain
|
162314
|
-
)} under ${
|
162465
|
+
)} under ${import_chalk79.default.bold(domain.meta.context)}.`
|
162315
162466
|
);
|
162316
162467
|
return 1;
|
162317
162468
|
}
|
@@ -162341,7 +162492,7 @@ async function move2(client2, argv) {
|
|
162341
162492
|
const aliases = await getDomainAliases(client2, domainName);
|
162342
162493
|
if (aliases.length > 0) {
|
162343
162494
|
output_manager_default.warn(
|
162344
|
-
`This domain's ${
|
162495
|
+
`This domain's ${import_chalk79.default.bold(
|
162345
162496
|
(0, import_pluralize10.default)("alias", aliases.length, true)
|
162346
162497
|
)} will be removed. Run ${getCommandName(`alias ls`)} to list them.`
|
162347
162498
|
);
|
@@ -162382,21 +162533,21 @@ async function move2(client2, argv) {
|
|
162382
162533
|
return 1;
|
162383
162534
|
}
|
162384
162535
|
if (moveTokenResult instanceof DomainNotFound) {
|
162385
|
-
output_manager_default.error(`Domain not found under ${
|
162536
|
+
output_manager_default.error(`Domain not found under ${import_chalk79.default.bold(contextName)}`);
|
162386
162537
|
output_manager_default.log(`Run ${getCommandName(`domains ls`)} to see your domains.`);
|
162387
162538
|
return 1;
|
162388
162539
|
}
|
162389
162540
|
if (moveTokenResult instanceof DomainPermissionDenied) {
|
162390
162541
|
output_manager_default.error(
|
162391
|
-
`You don't have permissions over domain ${
|
162542
|
+
`You don't have permissions over domain ${import_chalk79.default.underline(
|
162392
162543
|
moveTokenResult.meta.domain
|
162393
|
-
)} under ${
|
162544
|
+
)} under ${import_chalk79.default.bold(moveTokenResult.meta.context)}.`
|
162394
162545
|
);
|
162395
162546
|
return 1;
|
162396
162547
|
}
|
162397
162548
|
if (moveTokenResult instanceof InvalidMoveDestination) {
|
162398
162549
|
output_manager_default.error(
|
162399
|
-
`Destination ${
|
162550
|
+
`Destination ${import_chalk79.default.bold(
|
162400
162551
|
destination
|
162401
162552
|
)} is invalid. Please supply a valid username, email, team slug, user id, or team id.`
|
162402
162553
|
);
|
@@ -162441,11 +162592,11 @@ async function findDestinationMatch(destination, user, teams2) {
|
|
162441
162592
|
}
|
162442
162593
|
return null;
|
162443
162594
|
}
|
162444
|
-
var
|
162595
|
+
var import_chalk79, import_pluralize10;
|
162445
162596
|
var init_move2 = __esm({
|
162446
162597
|
"src/commands/domains/move.ts"() {
|
162447
162598
|
"use strict";
|
162448
|
-
|
162599
|
+
import_chalk79 = __toESM3(require_source());
|
162449
162600
|
import_pluralize10 = __toESM3(require_pluralize());
|
162450
162601
|
init_errors_ts();
|
162451
162602
|
init_get_scope();
|
@@ -162659,7 +162810,7 @@ async function addEnvRecord(client2, projectId, upsert, type, key, value, target
|
|
162659
162810
|
const target = [];
|
162660
162811
|
const customEnvironmentIds = [];
|
162661
162812
|
for (const t of targets) {
|
162662
|
-
const arr =
|
162813
|
+
const arr = import_constants6.PROJECT_ENV_TARGET.includes(t) ? target : customEnvironmentIds;
|
162663
162814
|
arr.push(t);
|
162664
162815
|
}
|
162665
162816
|
const body = {
|
@@ -162677,11 +162828,11 @@ async function addEnvRecord(client2, projectId, upsert, type, key, value, target
|
|
162677
162828
|
body
|
162678
162829
|
});
|
162679
162830
|
}
|
162680
|
-
var
|
162831
|
+
var import_constants6;
|
162681
162832
|
var init_add_env_record = __esm({
|
162682
162833
|
"src/util/env/add-env-record.ts"() {
|
162683
162834
|
"use strict";
|
162684
|
-
|
162835
|
+
import_constants6 = __toESM3(require_dist4());
|
162685
162836
|
init_output_manager();
|
162686
162837
|
}
|
162687
162838
|
});
|
@@ -162971,20 +163122,20 @@ async function add4(client2, argv) {
|
|
162971
163122
|
}
|
162972
163123
|
output_manager_default.print(
|
162973
163124
|
`${prependEmoji(
|
162974
|
-
`${opts["--force"] ? "Overrode" : "Added"} Environment Variable ${
|
163125
|
+
`${opts["--force"] ? "Overrode" : "Added"} Environment Variable ${import_chalk80.default.bold(envName)} to Project ${import_chalk80.default.bold(
|
162975
163126
|
project.name
|
162976
|
-
)} ${
|
163127
|
+
)} ${import_chalk80.default.gray(addStamp())}`,
|
162977
163128
|
emoji("success")
|
162978
163129
|
)}
|
162979
163130
|
`
|
162980
163131
|
);
|
162981
163132
|
return 0;
|
162982
163133
|
}
|
162983
|
-
var
|
163134
|
+
var import_chalk80;
|
162984
163135
|
var init_add8 = __esm({
|
162985
163136
|
"src/commands/env/add.ts"() {
|
162986
163137
|
"use strict";
|
162987
|
-
|
163138
|
+
import_chalk80 = __toESM3(require_source());
|
162988
163139
|
init_stamp();
|
162989
163140
|
init_add_env_record();
|
162990
163141
|
init_get_env_records();
|
@@ -163019,7 +163170,7 @@ var init_ellipsis = __esm({
|
|
163019
163170
|
// src/util/target/format-environment.ts
|
163020
163171
|
function formatEnvironment(orgSlug, projectSlug, environment) {
|
163021
163172
|
const projectUrl = `https://vercel.com/${orgSlug}/${projectSlug}`;
|
163022
|
-
const boldName =
|
163173
|
+
const boldName = import_chalk81.default.bold(
|
163023
163174
|
STANDARD_ENVIRONMENTS.includes(environment.slug) ? (0, import_title4.default)(environment.slug) : environment.slug
|
163024
163175
|
);
|
163025
163176
|
return output_manager_default.link(
|
@@ -163028,11 +163179,11 @@ function formatEnvironment(orgSlug, projectSlug, environment) {
|
|
163028
163179
|
{ fallback: () => boldName, color: false }
|
163029
163180
|
);
|
163030
163181
|
}
|
163031
|
-
var
|
163182
|
+
var import_chalk81, import_title4;
|
163032
163183
|
var init_format_environment = __esm({
|
163033
163184
|
"src/util/target/format-environment.ts"() {
|
163034
163185
|
"use strict";
|
163035
|
-
|
163186
|
+
import_chalk81 = __toESM3(require_source());
|
163036
163187
|
init_output_manager();
|
163037
163188
|
init_standard_environments();
|
163038
163189
|
import_title4 = __toESM3(require_lib4());
|
@@ -163142,11 +163293,11 @@ async function ls5(client2, argv) {
|
|
163142
163293
|
const projectSlugLink = formatProject(org.slug, project.name);
|
163143
163294
|
if (envs.length === 0) {
|
163144
163295
|
output_manager_default.log(
|
163145
|
-
`No Environment Variables found for ${projectSlugLink} ${
|
163296
|
+
`No Environment Variables found for ${projectSlugLink} ${import_chalk82.default.gray(lsStamp())}`
|
163146
163297
|
);
|
163147
163298
|
} else {
|
163148
163299
|
output_manager_default.log(
|
163149
|
-
`Environment Variables found for ${projectSlugLink} ${
|
163300
|
+
`Environment Variables found for ${projectSlugLink} ${import_chalk82.default.gray(lsStamp())}`
|
163150
163301
|
);
|
163151
163302
|
client2.stdout.write(`${getTable(link4, envs, customEnvs)}
|
163152
163303
|
`);
|
@@ -163170,26 +163321,26 @@ function getRow(link4, env, customEnvironments) {
|
|
163170
163321
|
let value;
|
163171
163322
|
if (env.type === "plain") {
|
163172
163323
|
const singleLineValue = env.value.replace(/\s/g, " ");
|
163173
|
-
value =
|
163324
|
+
value = import_chalk82.default.gray(ellipsis(singleLineValue, 19));
|
163174
163325
|
} else if (env.type === "system") {
|
163175
|
-
value =
|
163326
|
+
value = import_chalk82.default.gray.italic(env.value);
|
163176
163327
|
} else {
|
163177
|
-
value =
|
163328
|
+
value = import_chalk82.default.gray.italic("Encrypted");
|
163178
163329
|
}
|
163179
163330
|
const now = Date.now();
|
163180
163331
|
return [
|
163181
|
-
|
163332
|
+
import_chalk82.default.bold(env.key),
|
163182
163333
|
value,
|
163183
163334
|
formatEnvironments(link4, env, customEnvironments),
|
163184
|
-
env.createdAt ? `${(0,
|
163335
|
+
env.createdAt ? `${(0, import_ms18.default)(now - env.createdAt)} ago` : ""
|
163185
163336
|
];
|
163186
163337
|
}
|
163187
|
-
var
|
163338
|
+
var import_chalk82, import_ms18;
|
163188
163339
|
var init_ls9 = __esm({
|
163189
163340
|
"src/commands/env/ls.ts"() {
|
163190
163341
|
"use strict";
|
163191
|
-
|
163192
|
-
|
163342
|
+
import_chalk82 = __toESM3(require_source());
|
163343
|
+
import_ms18 = __toESM3(require_ms());
|
163193
163344
|
init_format_table();
|
163194
163345
|
init_get_env_records();
|
163195
163346
|
init_env_target();
|
@@ -163348,7 +163499,7 @@ async function rm5(client2, argv) {
|
|
163348
163499
|
link4,
|
163349
163500
|
env,
|
163350
163501
|
customEnvironments
|
163351
|
-
)} in Project ${
|
163502
|
+
)} in Project ${import_chalk83.default.bold(project.name)}. Are you sure?`,
|
163352
163503
|
false
|
163353
163504
|
)) {
|
163354
163505
|
output_manager_default.log("Canceled");
|
@@ -163367,18 +163518,18 @@ async function rm5(client2, argv) {
|
|
163367
163518
|
}
|
163368
163519
|
output_manager_default.print(
|
163369
163520
|
`${prependEmoji(
|
163370
|
-
`Removed Environment Variable ${
|
163521
|
+
`Removed Environment Variable ${import_chalk83.default.gray(rmStamp())}`,
|
163371
163522
|
emoji("success")
|
163372
163523
|
)}
|
163373
163524
|
`
|
163374
163525
|
);
|
163375
163526
|
return 0;
|
163376
163527
|
}
|
163377
|
-
var
|
163528
|
+
var import_chalk83;
|
163378
163529
|
var init_rm8 = __esm({
|
163379
163530
|
"src/commands/env/rm.ts"() {
|
163380
163531
|
"use strict";
|
163381
|
-
|
163532
|
+
import_chalk83 = __toESM3(require_source());
|
163382
163533
|
init_remove_env_record();
|
163383
163534
|
init_get_env_records();
|
163384
163535
|
init_format_environments();
|
@@ -163593,7 +163744,7 @@ async function connect(client2, argv) {
|
|
163593
163744
|
const confirm = Boolean(opts["--yes"]);
|
163594
163745
|
if (args2.length > 1) {
|
163595
163746
|
output_manager_default.error(
|
163596
|
-
`Invalid number of arguments. Usage: ${
|
163747
|
+
`Invalid number of arguments. Usage: ${import_chalk84.default.cyan(
|
163597
163748
|
`${getCommandName("project connect")}`
|
163598
163749
|
)}`
|
163599
163750
|
);
|
@@ -163640,7 +163791,7 @@ async function connect(client2, argv) {
|
|
163640
163791
|
}
|
163641
163792
|
if (!gitConfig) {
|
163642
163793
|
output_manager_default.error(
|
163643
|
-
`No local Git repository found. Run ${
|
163794
|
+
`No local Git repository found. Run ${import_chalk84.default.cyan(
|
163644
163795
|
"`git clone <url>`"
|
163645
163796
|
)} to clone a remote Git repository first.`
|
163646
163797
|
);
|
@@ -163649,7 +163800,7 @@ async function connect(client2, argv) {
|
|
163649
163800
|
const remoteUrls = pluckRemoteUrls(gitConfig);
|
163650
163801
|
if (!remoteUrls) {
|
163651
163802
|
output_manager_default.error(
|
163652
|
-
`No remote URLs found in your Git config. Make sure you've configured a remote repo in your local Git config. Run ${
|
163803
|
+
`No remote URLs found in your Git config. Make sure you've configured a remote repo in your local Git config. Run ${import_chalk84.default.cyan(
|
163653
163804
|
"`git remote --help`"
|
163654
163805
|
)} for more details.`
|
163655
163806
|
);
|
@@ -163693,7 +163844,7 @@ async function connect(client2, argv) {
|
|
163693
163844
|
return checkAndConnect;
|
163694
163845
|
}
|
163695
163846
|
output_manager_default.log(
|
163696
|
-
`Connected ${formatProvider(provider)} repository ${
|
163847
|
+
`Connected ${formatProvider(provider)} repository ${import_chalk84.default.cyan(repoPath)}!`
|
163697
163848
|
);
|
163698
163849
|
return 0;
|
163699
163850
|
}
|
@@ -163730,7 +163881,7 @@ async function connectArg({
|
|
163730
163881
|
return connect2;
|
163731
163882
|
}
|
163732
163883
|
output_manager_default.log(
|
163733
|
-
`Connected ${formatProvider(provider)} repository ${
|
163884
|
+
`Connected ${formatProvider(provider)} repository ${import_chalk84.default.cyan(repoPath)}!`
|
163734
163885
|
);
|
163735
163886
|
return 0;
|
163736
163887
|
}
|
@@ -163772,7 +163923,7 @@ async function connectArgWithLocalGit({
|
|
163772
163923
|
return connect2;
|
163773
163924
|
}
|
163774
163925
|
output_manager_default.log(
|
163775
|
-
`Connected ${formatProvider(provider)} repository ${
|
163926
|
+
`Connected ${formatProvider(provider)} repository ${import_chalk84.default.cyan(
|
163776
163927
|
repoPath
|
163777
163928
|
)}!`
|
163778
163929
|
);
|
@@ -163803,7 +163954,7 @@ async function promptConnectArg({
|
|
163803
163954
|
return true;
|
163804
163955
|
}
|
163805
163956
|
output_manager_default.log(
|
163806
|
-
`Found a repository in your local Git Config: ${
|
163957
|
+
`Found a repository in your local Git Config: ${import_chalk84.default.cyan(
|
163807
163958
|
Object.values(remoteUrls)[0]
|
163808
163959
|
)}`
|
163809
163960
|
);
|
@@ -163850,7 +164001,7 @@ async function checkExistsAndConnect({
|
|
163850
164001
|
const isSameRepo = connectedProvider === provider && connectedOrg === gitOrg && connectedRepo === repo;
|
163851
164002
|
if (isSameRepo) {
|
163852
164003
|
output_manager_default.log(
|
163853
|
-
`${
|
164004
|
+
`${import_chalk84.default.cyan(connectedRepoPath)} is already connected to your project.`
|
163854
164005
|
);
|
163855
164006
|
return 1;
|
163856
164007
|
}
|
@@ -163881,7 +164032,7 @@ async function confirmRepoConnect(client2, yes, connectedProvider, connectedRepo
|
|
163881
164032
|
shouldReplaceProject = await client2.input.confirm(
|
163882
164033
|
`Looks like you already have a ${formatProvider(
|
163883
164034
|
connectedProvider
|
163884
|
-
)} repository connected: ${
|
164035
|
+
)} repository connected: ${import_chalk84.default.cyan(
|
163885
164036
|
connectedRepoPath
|
163886
164037
|
)}. Do you want to replace it?`,
|
163887
164038
|
true
|
@@ -163896,7 +164047,7 @@ async function selectRemoteUrl(client2, remoteUrls) {
|
|
163896
164047
|
const choices = [];
|
163897
164048
|
for (const [urlKey, urlValue] of Object.entries(remoteUrls)) {
|
163898
164049
|
choices.push({
|
163899
|
-
name: `${urlValue} ${
|
164050
|
+
name: `${urlValue} ${import_chalk84.default.gray(`(${urlKey})`)}`,
|
163900
164051
|
value: urlValue,
|
163901
164052
|
short: urlKey
|
163902
164053
|
});
|
@@ -163906,11 +164057,11 @@ async function selectRemoteUrl(client2, remoteUrls) {
|
|
163906
164057
|
choices
|
163907
164058
|
});
|
163908
164059
|
}
|
163909
|
-
var
|
164060
|
+
var import_chalk84, import_path39;
|
163910
164061
|
var init_connect2 = __esm({
|
163911
164062
|
"src/commands/git/connect.ts"() {
|
163912
164063
|
"use strict";
|
163913
|
-
|
164064
|
+
import_chalk84 = __toESM3(require_source());
|
163914
164065
|
import_path39 = require("path");
|
163915
164066
|
init_create_git_meta();
|
163916
164067
|
init_list();
|
@@ -163974,7 +164125,7 @@ async function disconnect(client2, argv) {
|
|
163974
164125
|
}
|
163975
164126
|
if (args2.length !== 0) {
|
163976
164127
|
output_manager_default.error(
|
163977
|
-
`Invalid number of arguments. Usage: ${
|
164128
|
+
`Invalid number of arguments. Usage: ${import_chalk85.default.cyan(
|
163978
164129
|
`${getCommandName("project disconnect")}`
|
163979
164130
|
)}`
|
163980
164131
|
);
|
@@ -163996,14 +164147,14 @@ async function disconnect(client2, argv) {
|
|
163996
164147
|
`
|
163997
164148
|
);
|
163998
164149
|
const confirmDisconnect = autoConfirm || await client2.input.confirm(
|
163999
|
-
`Are you sure you want to disconnect ${
|
164150
|
+
`Are you sure you want to disconnect ${import_chalk85.default.cyan(
|
164000
164151
|
`${linkOrg}/${repo}`
|
164001
164152
|
)} from your project?`,
|
164002
164153
|
false
|
164003
164154
|
);
|
164004
164155
|
if (confirmDisconnect) {
|
164005
164156
|
await disconnectGitProvider(client2, org, project.id);
|
164006
|
-
output_manager_default.log(`Disconnected ${
|
164157
|
+
output_manager_default.log(`Disconnected ${import_chalk85.default.cyan(`${linkOrg}/${repo}`)}.`);
|
164007
164158
|
} else {
|
164008
164159
|
output_manager_default.log("Canceled");
|
164009
164160
|
}
|
@@ -164017,11 +164168,11 @@ async function disconnect(client2, argv) {
|
|
164017
164168
|
}
|
164018
164169
|
return 0;
|
164019
164170
|
}
|
164020
|
-
var
|
164171
|
+
var import_chalk85;
|
164021
164172
|
var init_disconnect2 = __esm({
|
164022
164173
|
"src/commands/git/disconnect.ts"() {
|
164023
164174
|
"use strict";
|
164024
|
-
|
164175
|
+
import_chalk85 = __toESM3(require_source());
|
164025
164176
|
init_pkg_name();
|
164026
164177
|
init_connect_git_provider();
|
164027
164178
|
init_output_manager();
|
@@ -164123,11 +164274,11 @@ var init_git2 = __esm({
|
|
164123
164274
|
});
|
164124
164275
|
|
164125
164276
|
// src/util/output/list-item.ts
|
164126
|
-
var
|
164277
|
+
var import_chalk86, listItem, list_item_default;
|
164127
164278
|
var init_list_item = __esm({
|
164128
164279
|
"src/util/output/list-item.ts"() {
|
164129
164280
|
"use strict";
|
164130
|
-
|
164281
|
+
import_chalk86 = __toESM3(require_source());
|
164131
164282
|
listItem = (msg, n) => {
|
164132
164283
|
if (!n) {
|
164133
164284
|
n = "-";
|
@@ -164135,7 +164286,7 @@ var init_list_item = __esm({
|
|
164135
164286
|
if (Number(n)) {
|
164136
164287
|
n += ".";
|
164137
164288
|
}
|
164138
|
-
return `${(0,
|
164289
|
+
return `${(0, import_chalk86.default)(n.toString())} ${msg}`;
|
164139
164290
|
};
|
164140
164291
|
list_item_default = listItem;
|
164141
164292
|
}
|
@@ -164328,9 +164479,9 @@ async function extractExample(client2, name, dir, force, ver = "v2") {
|
|
164328
164479
|
extractor.on("finish", resolve12);
|
164329
164480
|
res.body.pipe(extractor);
|
164330
164481
|
});
|
164331
|
-
const successLog = `Initialized "${
|
164482
|
+
const successLog = `Initialized "${import_chalk87.default.bold(
|
164332
164483
|
name
|
164333
|
-
)}" example in ${
|
164484
|
+
)}" example in ${import_chalk87.default.bold(humanizePath(folder))}.`;
|
164334
164485
|
const folderRel = import_node_path2.default.relative(client2.cwd, folder);
|
164335
164486
|
const deployHint = folderRel === "" ? list_item_default(`To deploy, run ${getCommandName()}.`) : list_item_default(
|
164336
164487
|
`To deploy, ${cmd(
|
@@ -164350,14 +164501,14 @@ function prepareFolder(cwd, folder, force) {
|
|
164350
164501
|
if (import_node_fs.default.existsSync(dest)) {
|
164351
164502
|
if (!import_node_fs.default.lstatSync(dest).isDirectory()) {
|
164352
164503
|
throw new Error(
|
164353
|
-
`Destination path "${
|
164504
|
+
`Destination path "${import_chalk87.default.bold(
|
164354
164505
|
folder
|
164355
164506
|
)}" already exists and is not a directory.`
|
164356
164507
|
);
|
164357
164508
|
}
|
164358
164509
|
if (!force && import_node_fs.default.readdirSync(dest).length !== 0) {
|
164359
164510
|
throw new Error(
|
164360
|
-
`Destination path "${
|
164511
|
+
`Destination path "${import_chalk87.default.bold(
|
164361
164512
|
folder
|
164362
164513
|
)}" already exists and is not an empty directory. You may use ${cmd(
|
164363
164514
|
"--force"
|
@@ -164368,14 +164519,14 @@ function prepareFolder(cwd, folder, force) {
|
|
164368
164519
|
try {
|
164369
164520
|
import_node_fs.default.mkdirSync(dest);
|
164370
164521
|
} catch (e2) {
|
164371
|
-
throw new Error(`Could not create directory "${
|
164522
|
+
throw new Error(`Could not create directory "${import_chalk87.default.bold(folder)}".`);
|
164372
164523
|
}
|
164373
164524
|
}
|
164374
164525
|
return dest;
|
164375
164526
|
}
|
164376
164527
|
async function guess(client2, exampleList, name) {
|
164377
164528
|
const GuessError = new Error(
|
164378
|
-
`No example found for ${
|
164529
|
+
`No example found for ${import_chalk87.default.bold(name)}, run ${getCommandName(
|
164379
164530
|
"init"
|
164380
164531
|
)} to see the list of available examples.`
|
164381
164532
|
);
|
@@ -164384,21 +164535,21 @@ async function guess(client2, exampleList, name) {
|
|
164384
164535
|
}
|
164385
164536
|
const found = did_you_mean_default(name, exampleList, 0.7);
|
164386
164537
|
if (typeof found === "string") {
|
164387
|
-
if (await client2.input.confirm(`Did you mean ${
|
164538
|
+
if (await client2.input.confirm(`Did you mean ${import_chalk87.default.bold(found)}?`, false)) {
|
164388
164539
|
return found;
|
164389
164540
|
}
|
164390
164541
|
} else {
|
164391
164542
|
throw GuessError;
|
164392
164543
|
}
|
164393
164544
|
}
|
164394
|
-
var import_node_fs, import_node_path2, import_tar_fs,
|
164545
|
+
var import_node_fs, import_node_path2, import_tar_fs, import_chalk87, EXAMPLE_API;
|
164395
164546
|
var init_init = __esm({
|
164396
164547
|
"src/commands/init/init.ts"() {
|
164397
164548
|
"use strict";
|
164398
164549
|
import_node_fs = __toESM3(require("fs"));
|
164399
164550
|
import_node_path2 = __toESM3(require("path"));
|
164400
164551
|
import_tar_fs = __toESM3(require_tar_fs());
|
164401
|
-
|
164552
|
+
import_chalk87 = __toESM3(require_source());
|
164402
164553
|
init_list();
|
164403
164554
|
init_list_item();
|
164404
164555
|
init_humanize_path();
|
@@ -164514,11 +164665,11 @@ var init_build_state = __esm({
|
|
164514
164665
|
});
|
164515
164666
|
|
164516
164667
|
// src/util/output/builds.ts
|
164517
|
-
var
|
164668
|
+
var import_chalk88, import_bytes7, padding, MAX_BUILD_GROUPS, MAX_OUTPUTS_PER_GROUP, hasOutput, getCommonPath, styleBuild, styleHiddenBuilds, styleOutput, getDirPath, sortByEntrypoint, groupBuilds, builds_default;
|
164518
164669
|
var init_builds = __esm({
|
164519
164670
|
"src/util/output/builds.ts"() {
|
164520
164671
|
"use strict";
|
164521
|
-
|
164672
|
+
import_chalk88 = __toESM3(require_source());
|
164522
164673
|
import_bytes7 = __toESM3(require_bytes());
|
164523
164674
|
init_build_state();
|
164524
164675
|
padding = 8;
|
@@ -164547,48 +164698,48 @@ var init_builds = __esm({
|
|
164547
164698
|
styleBuild = (build2, times, longestSource) => {
|
164548
164699
|
const { entrypoint, id } = build2;
|
164549
164700
|
const time = typeof times[id] === "string" ? times[id] : "";
|
164550
|
-
let pathColor =
|
164701
|
+
let pathColor = import_chalk88.default.cyan;
|
164551
164702
|
if (isFailed(build2)) {
|
164552
|
-
pathColor =
|
164703
|
+
pathColor = import_chalk88.default.red;
|
164553
164704
|
}
|
164554
164705
|
const entry = entrypoint.padEnd(longestSource + padding);
|
164555
164706
|
const prefix = hasOutput(build2) ? "\u250C" : "\u2576";
|
164556
|
-
return `${
|
164707
|
+
return `${import_chalk88.default.grey(prefix)} ${pathColor(entry)}${time}`;
|
164557
164708
|
};
|
164558
164709
|
styleHiddenBuilds = (commonPath, buildGroup, times, longestSource, isHidden2 = false) => {
|
164559
164710
|
const { id } = buildGroup[0];
|
164560
164711
|
const entry = commonPath.padEnd(longestSource + padding);
|
164561
164712
|
const time = typeof times[id] === "string" ? times[id] : "";
|
164562
164713
|
const prefix = isHidden2 === false && buildGroup.some(hasOutput) ? "\u250C" : "\u2576";
|
164563
|
-
let pathColor =
|
164714
|
+
let pathColor = import_chalk88.default.cyan;
|
164564
164715
|
if (buildGroup.every(isFailed)) {
|
164565
|
-
pathColor =
|
164716
|
+
pathColor = import_chalk88.default.red;
|
164566
164717
|
}
|
164567
164718
|
if (isHidden2) {
|
164568
|
-
pathColor =
|
164719
|
+
pathColor = import_chalk88.default.grey;
|
164569
164720
|
}
|
164570
|
-
return `${
|
164721
|
+
return `${import_chalk88.default.grey(prefix)} ${pathColor(entry)}${time}`;
|
164571
164722
|
};
|
164572
164723
|
styleOutput = (output2, readyState, isLast) => {
|
164573
164724
|
const { type, path: path11, size, lambda } = output2;
|
164574
164725
|
const prefix = type === "lambda" ? "\u03BB " : "";
|
164575
|
-
const finalSize = size ? ` ${
|
164576
|
-
let color =
|
164726
|
+
const finalSize = size ? ` ${import_chalk88.default.grey(`(${(0, import_bytes7.default)(size)})`)}` : "";
|
164727
|
+
let color = import_chalk88.default.grey;
|
164577
164728
|
let finalRegion = "";
|
164578
164729
|
if (isReady({ readyState })) {
|
164579
|
-
color =
|
164730
|
+
color = import_chalk88.default;
|
164580
164731
|
} else if (isFailed({ readyState })) {
|
164581
|
-
color =
|
164732
|
+
color = import_chalk88.default.red;
|
164582
164733
|
}
|
164583
164734
|
if (lambda) {
|
164584
164735
|
const { deployedTo } = lambda;
|
164585
164736
|
if (deployedTo && deployedTo.length > 0) {
|
164586
|
-
finalRegion = ` ${
|
164737
|
+
finalRegion = ` ${import_chalk88.default.grey(`[${deployedTo.join(", ")}]`)}`;
|
164587
164738
|
}
|
164588
164739
|
}
|
164589
164740
|
const corner = isLast ? "\u2514\u2500\u2500" : "\u251C\u2500\u2500";
|
164590
164741
|
const main14 = prefix + path11 + finalSize + finalRegion;
|
164591
|
-
return `${
|
164742
|
+
return `${import_chalk88.default.grey(corner)} ${color(main14)}`;
|
164592
164743
|
};
|
164593
164744
|
getDirPath = (path11, level = 0, highestLevel = null) => {
|
164594
164745
|
const parts = path11.split("/").slice(0, -1);
|
@@ -164720,7 +164871,7 @@ var init_builds = __esm({
|
|
164720
164871
|
);
|
164721
164872
|
if (outputs.length > MAX_OUTPUTS_PER_GROUP) {
|
164722
164873
|
final.push(
|
164723
|
-
|
164874
|
+
import_chalk88.default.grey(
|
164724
164875
|
`\u2514\u2500\u2500 ${outputs.length - MAX_OUTPUTS_PER_GROUP} output items hidden
|
164725
164876
|
`
|
164726
164877
|
)
|
@@ -164768,19 +164919,19 @@ function routes(routes2) {
|
|
164768
164919
|
const padding2 = 6;
|
164769
164920
|
const space = " ".repeat(padding2);
|
164770
164921
|
const destSpace = " ".repeat(longestDest || 10);
|
164771
|
-
const arrow =
|
164922
|
+
const arrow = import_chalk89.default.grey("->");
|
164772
164923
|
for (const item of routes2) {
|
164773
164924
|
if ("handle" in item) {
|
164774
|
-
toPrint += `${
|
164925
|
+
toPrint += `${import_chalk89.default.grey("\u2576")} ${import_chalk89.default.cyan(item.handle)}`;
|
164775
164926
|
continue;
|
164776
164927
|
}
|
164777
164928
|
const { src, dest, status: status2, headers } = item;
|
164778
164929
|
const last = routes2.indexOf(item) === routes2.length - 1;
|
164779
164930
|
const suffix = last ? "" : `
|
164780
164931
|
`;
|
164781
|
-
const finalSrc =
|
164932
|
+
const finalSrc = import_chalk89.default.cyan(src.padEnd(longestSrc + padding2));
|
164782
164933
|
const finalDest = dest ? `${arrow}${space}${dest}` : ` ${space}${destSpace}`;
|
164783
|
-
const finalStatus = status2 ?
|
164934
|
+
const finalStatus = status2 ? import_chalk89.default.grey(`[${status2}]`) : "";
|
164784
164935
|
let finalHeaders = null;
|
164785
164936
|
if (headers) {
|
164786
164937
|
finalHeaders = `
|
@@ -164791,21 +164942,21 @@ function routes(routes2) {
|
|
164791
164942
|
const last2 = headerKeys.indexOf(header) === headerKeys.length - 1;
|
164792
164943
|
const suffix2 = last2 ? "" : `
|
164793
164944
|
`;
|
164794
|
-
const prefix2 =
|
164945
|
+
const prefix2 = import_chalk89.default.grey(last2 ? "\u2514\u2500\u2500" : "\u251C\u2500\u2500");
|
164795
164946
|
finalHeaders += `${prefix2} ${header}: ${value}${suffix2}`;
|
164796
164947
|
}
|
164797
164948
|
}
|
164798
|
-
const prefix =
|
164949
|
+
const prefix = import_chalk89.default.grey(finalHeaders ? "\u250C" : "\u2576");
|
164799
164950
|
const fill = `${finalSrc}${finalDest}${space}${finalStatus}`;
|
164800
164951
|
toPrint += `${prefix} ${fill}${finalHeaders || ""}${suffix}`;
|
164801
164952
|
}
|
164802
164953
|
return toPrint;
|
164803
164954
|
}
|
164804
|
-
var
|
164955
|
+
var import_chalk89, longestProperty;
|
164805
164956
|
var init_routes = __esm({
|
164806
164957
|
"src/util/output/routes.ts"() {
|
164807
164958
|
"use strict";
|
164808
|
-
|
164959
|
+
import_chalk89 = __toESM3(require_source());
|
164809
164960
|
longestProperty = (routes2, name) => {
|
164810
164961
|
const longestItem = routes2.sort((a, b) => {
|
164811
164962
|
const aName = a[name];
|
@@ -164901,7 +165052,7 @@ async function inspect3(client2) {
|
|
164901
165052
|
telemetry2.trackCliOptionTimeout(parsedArguments.flags["--timeout"]);
|
164902
165053
|
telemetry2.trackCliFlagLogs(parsedArguments.flags["--logs"]);
|
164903
165054
|
telemetry2.trackCliFlagWait(parsedArguments.flags["--wait"]);
|
164904
|
-
const timeout = (0,
|
165055
|
+
const timeout = (0, import_ms19.default)(parsedArguments.flags["--timeout"] ?? "3m");
|
164905
165056
|
if (timeout === void 0) {
|
164906
165057
|
error3(`Invalid timeout "${parsedArguments.flags["--timeout"]}"`);
|
164907
165058
|
return 1;
|
@@ -164925,7 +165076,7 @@ async function inspect3(client2) {
|
|
164925
165076
|
} catch {
|
164926
165077
|
}
|
164927
165078
|
output_manager_default.spinner(
|
164928
|
-
`Fetching deployment "${deploymentIdOrHost}" in ${
|
165079
|
+
`Fetching deployment "${deploymentIdOrHost}" in ${import_chalk90.default.bold(contextName)}`
|
164929
165080
|
);
|
164930
165081
|
let deployment = await getDeployment(client2, contextName, deploymentIdOrHost);
|
164931
165082
|
let abortController;
|
@@ -164946,13 +165097,13 @@ async function inspect3(client2) {
|
|
164946
165097
|
break;
|
164947
165098
|
}
|
164948
165099
|
if (Date.now() > until) {
|
164949
|
-
warn(`stopped waiting after ${(0,
|
165100
|
+
warn(`stopped waiting after ${(0, import_ms19.default)(timeout, { long: true })}`);
|
164950
165101
|
abortController?.abort();
|
164951
165102
|
break;
|
164952
165103
|
}
|
164953
165104
|
}
|
164954
165105
|
if (withLogs) {
|
164955
|
-
print(`${
|
165106
|
+
print(`${import_chalk90.default.cyan("status")} ${stateString(deployment.readyState)}
|
164956
165107
|
`);
|
164957
165108
|
} else {
|
164958
165109
|
await printDetails({ deployment, contextName, client: client2, startTimestamp });
|
@@ -164965,17 +165116,17 @@ function stateString(s) {
|
|
164965
165116
|
switch (s) {
|
164966
165117
|
case "INITIALIZING":
|
164967
165118
|
case "BUILDING":
|
164968
|
-
return
|
165119
|
+
return import_chalk90.default.yellow(CIRCLE) + sTitle;
|
164969
165120
|
case "ERROR":
|
164970
|
-
return
|
165121
|
+
return import_chalk90.default.red(CIRCLE) + sTitle;
|
164971
165122
|
case "READY":
|
164972
|
-
return
|
165123
|
+
return import_chalk90.default.green(CIRCLE) + sTitle;
|
164973
165124
|
case "QUEUED":
|
164974
|
-
return
|
165125
|
+
return import_chalk90.default.gray(CIRCLE) + sTitle;
|
164975
165126
|
case "CANCELED":
|
164976
|
-
return
|
165127
|
+
return import_chalk90.default.gray(CIRCLE) + sTitle;
|
164977
165128
|
default:
|
164978
|
-
return
|
165129
|
+
return import_chalk90.default.gray("UNKNOWN");
|
164979
165130
|
}
|
164980
165131
|
}
|
164981
165132
|
async function printDetails({
|
@@ -164985,7 +165136,7 @@ async function printDetails({
|
|
164985
165136
|
startTimestamp
|
164986
165137
|
}) {
|
164987
165138
|
output_manager_default.log(
|
164988
|
-
`Fetched deployment "${
|
165139
|
+
`Fetched deployment "${import_chalk90.default.bold(deployment.url)}" in ${import_chalk90.default.bold(
|
164989
165140
|
contextName
|
164990
165141
|
)} ${elapsed(Date.now() - startTimestamp)}`
|
164991
165142
|
);
|
@@ -165001,14 +165152,14 @@ async function printDetails({
|
|
165001
165152
|
const { print, link: link4 } = output_manager_default;
|
165002
165153
|
const { builds } = deployment.version === 2 ? await client2.fetch(`/v11/deployments/${id}/builds`) : { builds: [] };
|
165003
165154
|
print("\n");
|
165004
|
-
print(
|
165005
|
-
print(` ${
|
165155
|
+
print(import_chalk90.default.bold(" General\n\n"));
|
165156
|
+
print(` ${import_chalk90.default.cyan("id")} ${id}
|
165006
165157
|
`);
|
165007
|
-
print(` ${
|
165158
|
+
print(` ${import_chalk90.default.cyan("name")} ${name}
|
165008
165159
|
`);
|
165009
165160
|
const customEnvironmentSlug = deployment.customEnvironment?.slug;
|
165010
165161
|
const target = customEnvironmentSlug ?? deployment.target ?? "preview";
|
165011
|
-
print(` ${
|
165162
|
+
print(` ${import_chalk90.default.cyan("target")} `);
|
165012
165163
|
print(
|
165013
165164
|
deployment.customEnvironment && deployment.team?.slug ? `${link4(
|
165014
165165
|
`${target}`,
|
@@ -165018,13 +165169,13 @@ async function printDetails({
|
|
165018
165169
|
` : `${target}
|
165019
165170
|
`
|
165020
165171
|
);
|
165021
|
-
print(` ${
|
165172
|
+
print(` ${import_chalk90.default.cyan("status")} ${stateString(readyState)}
|
165022
165173
|
`);
|
165023
|
-
print(` ${
|
165174
|
+
print(` ${import_chalk90.default.cyan("url")} https://${url3}
|
165024
165175
|
`);
|
165025
165176
|
if (createdAt) {
|
165026
165177
|
print(
|
165027
|
-
` ${
|
165178
|
+
` ${import_chalk90.default.cyan("created")} ${new Date(createdAt)} ${elapsed(
|
165028
165179
|
Date.now() - createdAt,
|
165029
165180
|
true
|
165030
165181
|
)}
|
@@ -165033,10 +165184,10 @@ async function printDetails({
|
|
165033
165184
|
}
|
165034
165185
|
print("\n\n");
|
165035
165186
|
if (aliases !== void 0 && aliases.length > 0) {
|
165036
|
-
print(
|
165187
|
+
print(import_chalk90.default.bold(" Aliases\n\n"));
|
165037
165188
|
let aliasList = "";
|
165038
165189
|
for (const alias2 of aliases) {
|
165039
|
-
aliasList += `${
|
165190
|
+
aliasList += `${import_chalk90.default.gray("\u2576")} https://${alias2}
|
165040
165191
|
`;
|
165041
165192
|
}
|
165042
165193
|
print(indent_default(aliasList, 4));
|
@@ -165048,12 +165199,12 @@ async function printDetails({
|
|
165048
165199
|
const { id: id2, createdAt: createdAt2, readyStateAt } = build2;
|
165049
165200
|
times[id2] = createdAt2 && readyStateAt ? elapsed(readyStateAt - createdAt2) : null;
|
165050
165201
|
}
|
165051
|
-
print(
|
165202
|
+
print(import_chalk90.default.bold(" Builds\n\n"));
|
165052
165203
|
print(indent_default(builds_default(builds, times).toPrint, 4));
|
165053
165204
|
print("\n\n");
|
165054
165205
|
}
|
165055
165206
|
if (Array.isArray(routes2) && routes2.length > 0) {
|
165056
|
-
print(
|
165207
|
+
print(import_chalk90.default.bold(" Routes\n\n"));
|
165057
165208
|
print(indent_default(routes(routes2), 4));
|
165058
165209
|
print(`
|
165059
165210
|
|
@@ -165066,13 +165217,13 @@ function exitCode(state) {
|
|
165066
165217
|
}
|
165067
165218
|
return 0;
|
165068
165219
|
}
|
165069
|
-
var import_error_utils27,
|
165220
|
+
var import_error_utils27, import_chalk90, import_ms19, import_title6, import_url19;
|
165070
165221
|
var init_inspect4 = __esm({
|
165071
165222
|
"src/commands/inspect/index.ts"() {
|
165072
165223
|
"use strict";
|
165073
165224
|
import_error_utils27 = __toESM3(require_dist2());
|
165074
|
-
|
165075
|
-
|
165225
|
+
import_chalk90 = __toESM3(require_source());
|
165226
|
+
import_ms19 = __toESM3(require_ms());
|
165076
165227
|
import_title6 = __toESM3(require_lib4());
|
165077
165228
|
import_url19 = require("url");
|
165078
165229
|
init_is_deploying();
|
@@ -165525,7 +165676,7 @@ async function add5(client2, args2) {
|
|
165525
165676
|
}
|
165526
165677
|
const installation = teamInstallations[0];
|
165527
165678
|
output_manager_default.log(
|
165528
|
-
`Installing ${
|
165679
|
+
`Installing ${import_chalk91.default.bold(product.name)} by ${import_chalk91.default.bold(integration.name)} under ${import_chalk91.default.bold(contextName)}`
|
165529
165680
|
);
|
165530
165681
|
const metadataSchema = product.metadataSchema;
|
165531
165682
|
const metadataWizard = createMetadataWizard(metadataSchema);
|
@@ -165745,16 +165896,16 @@ async function selectBillingPlan(client2, billingPlans) {
|
|
165745
165896
|
}
|
165746
165897
|
async function confirmProductSelection(client2, product, name, metadata, billingPlan) {
|
165747
165898
|
output_manager_default.print("Selected product:\n");
|
165748
|
-
output_manager_default.print(`${
|
165899
|
+
output_manager_default.print(`${import_chalk91.default.dim(`- ${import_chalk91.default.bold("Name:")} ${name}`)}
|
165749
165900
|
`);
|
165750
165901
|
for (const [key, value] of Object.entries(metadata)) {
|
165751
165902
|
output_manager_default.print(
|
165752
|
-
`${
|
165903
|
+
`${import_chalk91.default.dim(`- ${import_chalk91.default.bold(`${product.metadataSchema.properties[key]["ui:label"]}:`)} ${value}`)}
|
165753
165904
|
`
|
165754
165905
|
);
|
165755
165906
|
}
|
165756
165907
|
output_manager_default.print(
|
165757
|
-
`${
|
165908
|
+
`${import_chalk91.default.dim(`- ${import_chalk91.default.bold("Plan:")} ${billingPlan.name}`)}
|
165758
165909
|
`
|
165759
165910
|
);
|
165760
165911
|
return client2.input.confirm("Confirm selection?", true);
|
@@ -165864,7 +166015,7 @@ async function provisionStorageProduct(client2, product, installation, name, met
|
|
165864
166015
|
]
|
165865
166016
|
});
|
165866
166017
|
output_manager_default.spinner(
|
165867
|
-
`Connecting ${
|
166018
|
+
`Connecting ${import_chalk91.default.bold(name)} to ${import_chalk91.default.bold(project.name)}...`
|
165868
166019
|
);
|
165869
166020
|
try {
|
165870
166021
|
await connectResourceToProject(
|
@@ -165882,17 +166033,17 @@ async function provisionStorageProduct(client2, product, installation, name, met
|
|
165882
166033
|
output_manager_default.stopSpinner();
|
165883
166034
|
}
|
165884
166035
|
output_manager_default.log(
|
165885
|
-
`${
|
166036
|
+
`${import_chalk91.default.bold(name)} successfully connected to ${import_chalk91.default.bold(project.name)}
|
165886
166037
|
|
165887
166038
|
${indent_default(`Run ${cmd(`${packageName} env pull`)} to update the environment variables`, 4)}`
|
165888
166039
|
);
|
165889
166040
|
return 0;
|
165890
166041
|
}
|
165891
|
-
var
|
166042
|
+
var import_chalk91, import_open3;
|
165892
166043
|
var init_add10 = __esm({
|
165893
166044
|
"src/commands/integration/add.ts"() {
|
165894
166045
|
"use strict";
|
165895
|
-
|
166046
|
+
import_chalk91 = __toESM3(require_source());
|
165896
166047
|
import_open3 = __toESM3(require_open());
|
165897
166048
|
init_format_table();
|
165898
166049
|
init_pkg_name();
|
@@ -166212,7 +166363,7 @@ function outputBalanceInformation(prepaymentInfo, resources, integrationSlug) {
|
|
166212
166363
|
}
|
166213
166364
|
}
|
166214
166365
|
output_manager_default.log(
|
166215
|
-
`${
|
166366
|
+
`${import_chalk92.default.bold(`Balances and thresholds for ${integrationSlug}`)}:`
|
166216
166367
|
);
|
166217
166368
|
for (const key in mappings) {
|
166218
166369
|
const mapping = mappings[key];
|
@@ -166238,11 +166389,11 @@ function formattedCurrency(amountInCents) {
|
|
166238
166389
|
currency: "USD"
|
166239
166390
|
}).format(amountInCents / 100);
|
166240
166391
|
}
|
166241
|
-
var
|
166392
|
+
var import_chalk92;
|
166242
166393
|
var init_balance2 = __esm({
|
166243
166394
|
"src/commands/integration/balance.ts"() {
|
166244
166395
|
"use strict";
|
166245
|
-
|
166396
|
+
import_chalk92 = __toESM3(require_source());
|
166246
166397
|
init_output_manager();
|
166247
166398
|
init_get_scope();
|
166248
166399
|
init_fetch_installation_prepayment_info();
|
@@ -166396,18 +166547,18 @@ async function list2(client2) {
|
|
166396
166547
|
return 0;
|
166397
166548
|
}
|
166398
166549
|
output_manager_default.log(
|
166399
|
-
`Integrations in ${
|
166550
|
+
`Integrations in ${import_chalk93.default.bold(contextName)}:
|
166400
166551
|
${table(
|
166401
166552
|
[
|
166402
166553
|
["Name", "Status", "Product", "Integration", "Projects"].map(
|
166403
|
-
(header) =>
|
166554
|
+
(header) => import_chalk93.default.bold(import_chalk93.default.cyan(header))
|
166404
166555
|
),
|
166405
166556
|
...results.map((result) => [
|
166406
|
-
resourceLink(contextName, result) ??
|
166557
|
+
resourceLink(contextName, result) ?? import_chalk93.default.gray("\u2013"),
|
166407
166558
|
resourceStatus(result.status ?? "\u2013"),
|
166408
|
-
result.product ??
|
166409
|
-
integrationLink(result, team) ??
|
166410
|
-
|
166559
|
+
result.product ?? import_chalk93.default.gray("\u2013"),
|
166560
|
+
integrationLink(result, team) ?? import_chalk93.default.gray("\u2013"),
|
166561
|
+
import_chalk93.default.grey(result.projects ? result.projects : "\u2013")
|
166411
166562
|
])
|
166412
166563
|
],
|
166413
166564
|
{ hsep: 8 }
|
@@ -166420,17 +166571,17 @@ function resourceStatus(status2) {
|
|
166420
166571
|
const statusTitleCase = (0, import_title7.default)(status2);
|
166421
166572
|
switch (status2) {
|
166422
166573
|
case "initializing":
|
166423
|
-
return
|
166574
|
+
return import_chalk93.default.yellow(CIRCLE) + statusTitleCase;
|
166424
166575
|
case "error":
|
166425
|
-
return
|
166576
|
+
return import_chalk93.default.red(CIRCLE) + statusTitleCase;
|
166426
166577
|
case "available":
|
166427
|
-
return
|
166578
|
+
return import_chalk93.default.green(CIRCLE) + statusTitleCase;
|
166428
166579
|
case "suspended":
|
166429
|
-
return
|
166580
|
+
return import_chalk93.default.white(CIRCLE) + statusTitleCase;
|
166430
166581
|
case "limits-exceeded-suspended":
|
166431
|
-
return `${
|
166582
|
+
return `${import_chalk93.default.white(CIRCLE)}Limits exceeded`;
|
166432
166583
|
default:
|
166433
|
-
return
|
166584
|
+
return import_chalk93.default.gray(statusTitleCase);
|
166434
166585
|
}
|
166435
166586
|
}
|
166436
166587
|
function resourceLink(orgSlug, resource) {
|
@@ -166451,18 +166602,18 @@ function integrationLink(integration, team) {
|
|
166451
166602
|
if (!integration.configurationId) {
|
166452
166603
|
return integration.integration;
|
166453
166604
|
}
|
166454
|
-
const boldName =
|
166605
|
+
const boldName = import_chalk93.default.bold(integration.integration);
|
166455
166606
|
const integrationDeepLink = buildSSOLink(team, integration.configurationId);
|
166456
166607
|
return output_manager_default.link(boldName, integrationDeepLink, {
|
166457
166608
|
fallback: () => boldName,
|
166458
166609
|
color: false
|
166459
166610
|
});
|
166460
166611
|
}
|
166461
|
-
var
|
166612
|
+
var import_chalk93, import_title7;
|
166462
166613
|
var init_list4 = __esm({
|
166463
166614
|
"src/commands/integration/list.ts"() {
|
166464
166615
|
"use strict";
|
166465
|
-
|
166616
|
+
import_chalk93 = __toESM3(require_source());
|
166466
166617
|
init_get_scope();
|
166467
166618
|
init_link2();
|
166468
166619
|
init_get_resources();
|
@@ -166523,7 +166674,7 @@ async function openIntegration(client2, args2) {
|
|
166523
166674
|
knownIntegrationSlug = !!configuration;
|
166524
166675
|
} catch (error3) {
|
166525
166676
|
output_manager_default.error(
|
166526
|
-
`Failed to fetch configuration for ${
|
166677
|
+
`Failed to fetch configuration for ${import_chalk94.default.bold(`"${integrationSlug}"`)}: ${error3.message}`
|
166527
166678
|
);
|
166528
166679
|
return 1;
|
166529
166680
|
} finally {
|
@@ -166531,19 +166682,19 @@ async function openIntegration(client2, args2) {
|
|
166531
166682
|
}
|
166532
166683
|
if (!configuration) {
|
166533
166684
|
output_manager_default.error(
|
166534
|
-
`No configuration found for ${
|
166685
|
+
`No configuration found for ${import_chalk94.default.bold(`"${integrationSlug}"`)}.`
|
166535
166686
|
);
|
166536
166687
|
return 1;
|
166537
166688
|
}
|
166538
|
-
output_manager_default.print(`Opening the ${
|
166689
|
+
output_manager_default.print(`Opening the ${import_chalk94.default.bold(integrationSlug)} dashboard...`);
|
166539
166690
|
(0, import_open4.default)(buildSSOLink(team, configuration.id));
|
166540
166691
|
return 0;
|
166541
166692
|
}
|
166542
|
-
var
|
166693
|
+
var import_chalk94, import_open4;
|
166543
166694
|
var init_open_integration = __esm({
|
166544
166695
|
"src/commands/integration/open-integration.ts"() {
|
166545
166696
|
"use strict";
|
166546
|
-
|
166697
|
+
import_chalk94 = __toESM3(require_source());
|
166547
166698
|
import_open4 = __toESM3(require_open());
|
166548
166699
|
init_get_scope();
|
166549
166700
|
init_fetch_marketplace_integrations();
|
@@ -166636,7 +166787,7 @@ async function remove3(client2) {
|
|
166636
166787
|
);
|
166637
166788
|
output_manager_default.stopSpinner();
|
166638
166789
|
if (!integrationConfiguration) {
|
166639
|
-
output_manager_default.error(`No integration ${
|
166790
|
+
output_manager_default.error(`No integration ${import_chalk95.default.bold(integrationName)} found.`);
|
166640
166791
|
telemetry2.trackCliArgumentIntegration(integrationName, false);
|
166641
166792
|
return 0;
|
166642
166793
|
}
|
@@ -166655,26 +166806,26 @@ async function remove3(client2) {
|
|
166655
166806
|
await removeIntegration(client2, integrationConfiguration, team);
|
166656
166807
|
} catch (error3) {
|
166657
166808
|
output_manager_default.error(
|
166658
|
-
|
166659
|
-
`Failed to remove ${
|
166809
|
+
import_chalk95.default.red(
|
166810
|
+
`Failed to remove ${import_chalk95.default.bold(integrationName)}: ${error3.message}`
|
166660
166811
|
)
|
166661
166812
|
);
|
166662
166813
|
return 1;
|
166663
166814
|
}
|
166664
|
-
output_manager_default.success(`${
|
166815
|
+
output_manager_default.success(`${import_chalk95.default.bold(integrationName)} successfully removed.`);
|
166665
166816
|
return 0;
|
166666
166817
|
}
|
166667
166818
|
async function confirmIntegrationRemoval(client2, integration, team) {
|
166668
166819
|
output_manager_default.log(
|
166669
|
-
`The ${
|
166820
|
+
`The ${import_chalk95.default.bold(integration)} integration will be removed permanently from team ${import_chalk95.default.bold(team.name)}.`
|
166670
166821
|
);
|
166671
|
-
return client2.input.confirm(`${
|
166822
|
+
return client2.input.confirm(`${import_chalk95.default.red("Are you sure?")}`, false);
|
166672
166823
|
}
|
166673
|
-
var
|
166824
|
+
var import_chalk95;
|
166674
166825
|
var init_remove_integration2 = __esm({
|
166675
166826
|
"src/commands/integration/remove-integration.ts"() {
|
166676
166827
|
"use strict";
|
166677
|
-
|
166828
|
+
import_chalk95 = __toESM3(require_source());
|
166678
166829
|
init_output_manager();
|
166679
166830
|
init_get_args();
|
166680
166831
|
init_get_flags_specification();
|
@@ -166972,18 +167123,18 @@ async function createThreshold(client2) {
|
|
166972
167123
|
);
|
166973
167124
|
output_manager_default.stopSpinner();
|
166974
167125
|
if (!targetedResource) {
|
166975
|
-
output_manager_default.log(`The resource ${
|
167126
|
+
output_manager_default.log(`The resource ${import_chalk96.default.bold(resourceName)} was not found.`);
|
166976
167127
|
return 0;
|
166977
167128
|
}
|
166978
167129
|
if (!targetedResource.product?.integrationConfigurationId) {
|
166979
167130
|
output_manager_default.error(
|
166980
|
-
`The resource ${
|
167131
|
+
`The resource ${import_chalk96.default.bold(resourceName)} does not have an integration configuration.`
|
166981
167132
|
);
|
166982
167133
|
return 1;
|
166983
167134
|
}
|
166984
167135
|
if (targetedResource.billingPlan?.type !== "prepayment") {
|
166985
167136
|
output_manager_default.error(
|
166986
|
-
`The resource ${
|
167137
|
+
`The resource ${import_chalk96.default.bold(resourceName)} is not a prepayment-based resource.`
|
166987
167138
|
);
|
166988
167139
|
return 1;
|
166989
167140
|
}
|
@@ -167011,7 +167162,7 @@ async function createThreshold(client2) {
|
|
167011
167162
|
}
|
167012
167163
|
if (targetedResource.billingPlan.scope !== "resource") {
|
167013
167164
|
output_manager_default.log(
|
167014
|
-
`The resource ${
|
167165
|
+
`The resource ${import_chalk96.default.bold(resourceName)} uses an installation-level balance.`
|
167015
167166
|
);
|
167016
167167
|
return await updateThresholdForInstallation({
|
167017
167168
|
client: client2,
|
@@ -167125,17 +167276,17 @@ async function updateThresholdForInstallation(props) {
|
|
167125
167276
|
async function handleUpdateThreshold(props) {
|
167126
167277
|
if (props.resource.billingPlan?.type !== "prepayment") {
|
167127
167278
|
output_manager_default.log(
|
167128
|
-
`The resource ${
|
167279
|
+
`The resource ${import_chalk96.default.bold(props.resource.name)} is not a prepayment-based resource.`
|
167129
167280
|
);
|
167130
167281
|
return 0;
|
167131
167282
|
}
|
167132
167283
|
if (!props.resource.product?.integrationConfigurationId) {
|
167133
167284
|
output_manager_default.log(
|
167134
|
-
`The resource ${
|
167285
|
+
`The resource ${import_chalk96.default.bold(props.resource.name)} does not have an integration configuration.`
|
167135
167286
|
);
|
167136
167287
|
return 0;
|
167137
167288
|
}
|
167138
|
-
const entityTextReference = props.isInstallationLevel ? `installation ${
|
167289
|
+
const entityTextReference = props.isInstallationLevel ? `installation ${import_chalk96.default.bold(props.resource.product?.name)}` : `resource ${import_chalk96.default.bold(props.resource.name)}`;
|
167139
167290
|
if (props.existingThreshold) {
|
167140
167291
|
const shouldOverwriteThreshold = props.skipConfirmWithYes || await props.client.input.confirm(
|
167141
167292
|
`The ${entityTextReference} already has a threshold. (minimum: $${props.existingThreshold.minimumAmountInCents / 100}, spend: $${props.existingThreshold.purchaseAmountInCents / 100}, limit: ${props.existingThreshold.maximumAmountPerPeriodInCents ? `$${props.existingThreshold.maximumAmountPerPeriodInCents / 100}` : "none set"}). Do you want to overwrite it?`,
|
@@ -167192,11 +167343,11 @@ async function handleUpdateThreshold(props) {
|
|
167192
167343
|
output_manager_default.success(`Threshold for ${entityTextReference} created successfully.`);
|
167193
167344
|
return 0;
|
167194
167345
|
}
|
167195
|
-
var
|
167346
|
+
var import_chalk96;
|
167196
167347
|
var init_create_threshold2 = __esm({
|
167197
167348
|
"src/commands/integration-resource/create-threshold.ts"() {
|
167198
167349
|
"use strict";
|
167199
|
-
|
167350
|
+
import_chalk96 = __toESM3(require_source());
|
167200
167351
|
init_output_manager();
|
167201
167352
|
init_error2();
|
167202
167353
|
init_get_args();
|
@@ -167339,7 +167490,7 @@ async function disconnect2(client2) {
|
|
167339
167490
|
);
|
167340
167491
|
output_manager_default.stopSpinner();
|
167341
167492
|
if (!targetedResource) {
|
167342
|
-
output_manager_default.error(`No resource ${
|
167493
|
+
output_manager_default.error(`No resource ${import_chalk97.default.bold(resourceName)} found.`);
|
167343
167494
|
return 0;
|
167344
167495
|
}
|
167345
167496
|
if (parsedArguments.flags["--all"]) {
|
@@ -167389,7 +167540,7 @@ async function handleDisconnectProject(client2, resource, projectName, skipConfi
|
|
167389
167540
|
);
|
167390
167541
|
if (!project) {
|
167391
167542
|
output_manager_default.log(
|
167392
|
-
`Could not find project ${
|
167543
|
+
`Could not find project ${import_chalk97.default.bold(projectName)} connected to resource ${import_chalk97.default.bold(resource.name)}.`
|
167393
167544
|
);
|
167394
167545
|
return 0;
|
167395
167546
|
}
|
@@ -167401,7 +167552,7 @@ async function handleDisconnectProject(client2, resource, projectName, skipConfi
|
|
167401
167552
|
output_manager_default.spinner("Disconnecting resource\u2026", 500);
|
167402
167553
|
await disconnectResourceFromProject(client2, resource, project);
|
167403
167554
|
output_manager_default.success(
|
167404
|
-
`Disconnected ${
|
167555
|
+
`Disconnected ${import_chalk97.default.bold(project.name)} from ${import_chalk97.default.bold(resource.name)}`
|
167405
167556
|
);
|
167406
167557
|
} catch (error3) {
|
167407
167558
|
output_manager_default.error(
|
@@ -167413,7 +167564,7 @@ async function handleDisconnectProject(client2, resource, projectName, skipConfi
|
|
167413
167564
|
}
|
167414
167565
|
async function handleDisconnectAllProjects(client2, resource, skipConfirmation) {
|
167415
167566
|
if (resource.projectsMetadata?.length === 0) {
|
167416
|
-
output_manager_default.log(`${
|
167567
|
+
output_manager_default.log(`${import_chalk97.default.bold(resource.name)} has no projects to disconnect.`);
|
167417
167568
|
return;
|
167418
167569
|
}
|
167419
167570
|
if (!skipConfirmation && !await confirmDisconnectAllProjects(client2, resource)) {
|
@@ -167423,7 +167574,7 @@ async function handleDisconnectAllProjects(client2, resource, skipConfirmation)
|
|
167423
167574
|
output_manager_default.spinner("Disconnecting projects from resource\u2026", 500);
|
167424
167575
|
await disconnectResourceFromAllProjects(client2, resource);
|
167425
167576
|
output_manager_default.success(
|
167426
|
-
`Disconnected all projects from ${
|
167577
|
+
`Disconnected all projects from ${import_chalk97.default.bold(resource.name)}`
|
167427
167578
|
);
|
167428
167579
|
} catch (error3) {
|
167429
167580
|
throw new FailedError(
|
@@ -167434,9 +167585,9 @@ async function handleDisconnectAllProjects(client2, resource, skipConfirmation)
|
|
167434
167585
|
}
|
167435
167586
|
async function confirmDisconnectProject(client2, resource, project) {
|
167436
167587
|
output_manager_default.log(
|
167437
|
-
`The resource ${
|
167588
|
+
`The resource ${import_chalk97.default.bold(resource.name)} will be disconnected from project ${import_chalk97.default.bold(project.name)}.`
|
167438
167589
|
);
|
167439
|
-
return client2.input.confirm(`${
|
167590
|
+
return client2.input.confirm(`${import_chalk97.default.red("Are you sure?")}`, false);
|
167440
167591
|
}
|
167441
167592
|
async function confirmDisconnectAllProjects(client2, resource) {
|
167442
167593
|
output_manager_default.log("The following projects will be disconnected:");
|
@@ -167447,13 +167598,13 @@ async function confirmDisconnectAllProjects(client2, resource) {
|
|
167447
167598
|
output_manager_default.print(` ${project.name}
|
167448
167599
|
`);
|
167449
167600
|
}
|
167450
|
-
return client2.input.confirm(
|
167601
|
+
return client2.input.confirm(import_chalk97.default.red("Are you sure?"), false);
|
167451
167602
|
}
|
167452
|
-
var
|
167603
|
+
var import_chalk97;
|
167453
167604
|
var init_disconnect4 = __esm({
|
167454
167605
|
"src/commands/integration-resource/disconnect.ts"() {
|
167455
167606
|
"use strict";
|
167456
|
-
|
167607
|
+
import_chalk97 = __toESM3(require_source());
|
167457
167608
|
init_output_manager();
|
167458
167609
|
init_get_args();
|
167459
167610
|
init_get_flags_specification();
|
@@ -167558,7 +167709,7 @@ async function remove4(client2) {
|
|
167558
167709
|
);
|
167559
167710
|
output_manager_default.stopSpinner();
|
167560
167711
|
if (!targetedResource) {
|
167561
|
-
output_manager_default.error(`No resource ${
|
167712
|
+
output_manager_default.error(`No resource ${import_chalk98.default.bold(resourceName)} found.`);
|
167562
167713
|
return 0;
|
167563
167714
|
}
|
167564
167715
|
if (disconnectAll) {
|
@@ -167589,7 +167740,7 @@ async function handleDeleteResource(client2, team, resource, options) {
|
|
167589
167740
|
const hasProjects = resource.projectsMetadata && resource.projectsMetadata?.length > 0;
|
167590
167741
|
if (!options?.skipProjectCheck && hasProjects) {
|
167591
167742
|
output_manager_default.error(
|
167592
|
-
`Cannot delete resource ${
|
167743
|
+
`Cannot delete resource ${import_chalk98.default.bold(resource.name)} while it has connected projects. Please disconnect any projects using this resource first or use the \`--disconnect-all\` flag.`
|
167593
167744
|
);
|
167594
167745
|
return 1;
|
167595
167746
|
}
|
@@ -167600,24 +167751,24 @@ async function handleDeleteResource(client2, team, resource, options) {
|
|
167600
167751
|
try {
|
167601
167752
|
output_manager_default.spinner("Deleting resource\u2026", 500);
|
167602
167753
|
await deleteResource(client2, resource, team);
|
167603
|
-
output_manager_default.success(`${
|
167754
|
+
output_manager_default.success(`${import_chalk98.default.bold(resource.name)} successfully deleted.`);
|
167604
167755
|
} catch (error3) {
|
167605
167756
|
output_manager_default.error(
|
167606
|
-
`A problem occurred when attempting to delete ${
|
167757
|
+
`A problem occurred when attempting to delete ${import_chalk98.default.bold(resource.name)}: ${error3.message}`
|
167607
167758
|
);
|
167608
167759
|
return 1;
|
167609
167760
|
}
|
167610
167761
|
return 0;
|
167611
167762
|
}
|
167612
167763
|
async function confirmDeleteResource(client2, resource) {
|
167613
|
-
output_manager_default.log(`${
|
167614
|
-
return client2.input.confirm(`${
|
167764
|
+
output_manager_default.log(`${import_chalk98.default.bold(resource.name)} will be deleted permanently.`);
|
167765
|
+
return client2.input.confirm(`${import_chalk98.default.red("Are you sure?")}`, false);
|
167615
167766
|
}
|
167616
|
-
var
|
167767
|
+
var import_chalk98;
|
167617
167768
|
var init_remove_resource = __esm({
|
167618
167769
|
"src/commands/integration-resource/remove-resource.ts"() {
|
167619
167770
|
"use strict";
|
167620
|
-
|
167771
|
+
import_chalk98 = __toESM3(require_source());
|
167621
167772
|
init_output_manager();
|
167622
167773
|
init_get_args();
|
167623
167774
|
init_get_flags_specification();
|
@@ -168063,7 +168214,7 @@ async function list3(client2) {
|
|
168063
168214
|
}
|
168064
168215
|
const projectSlugLink = formatProject(contextName, project.name);
|
168065
168216
|
if (!singleDeployment) {
|
168066
|
-
spinner(`Fetching deployments in ${
|
168217
|
+
spinner(`Fetching deployments in ${import_chalk99.default.bold(contextName)}`);
|
168067
168218
|
const start = Date.now();
|
168068
168219
|
debug2("Fetching deployments");
|
168069
168220
|
const query = new URLSearchParams({ limit: "20", projectId: project.id });
|
@@ -168103,26 +168254,26 @@ async function list3(client2) {
|
|
168103
168254
|
const urls = [];
|
168104
168255
|
const tablePrint = table(
|
168105
168256
|
[
|
168106
|
-
headers.map((header) =>
|
168257
|
+
headers.map((header) => import_chalk99.default.bold(import_chalk99.default.cyan(header))),
|
168107
168258
|
...deployments.sort(sortByCreatedAt).map((dep) => {
|
168108
168259
|
urls.push(`https://${dep.url}`);
|
168109
168260
|
const proposedExp = dep.proposedExpiration ? toDate(Math.min(Date.now(), dep.proposedExpiration)) : "No expiration";
|
168110
|
-
const createdAt = (0,
|
168261
|
+
const createdAt = (0, import_ms20.default)(
|
168111
168262
|
Date.now() - (dep?.undeletedAt ?? dep.createdAt)
|
168112
168263
|
);
|
168113
168264
|
const targetName = dep.customEnvironment?.slug || (dep.target === "production" ? "Production" : "Preview");
|
168114
168265
|
const targetSlug = dep.customEnvironment?.id || dep.target || "preview";
|
168115
168266
|
return [
|
168116
|
-
|
168267
|
+
import_chalk99.default.gray(createdAt),
|
168117
168268
|
`https://${dep.url}`,
|
168118
168269
|
stateString2(dep.readyState || ""),
|
168119
168270
|
formatEnvironment(contextName, project.name, {
|
168120
168271
|
id: targetSlug,
|
168121
168272
|
slug: targetName
|
168122
168273
|
}),
|
168123
|
-
...!showPolicy ? [
|
168124
|
-
...!showPolicy ? [
|
168125
|
-
...showPolicy ? [
|
168274
|
+
...!showPolicy ? [import_chalk99.default.gray(getDeploymentDuration(dep))] : [],
|
168275
|
+
...!showPolicy ? [import_chalk99.default.gray(dep.creator?.username)] : [],
|
168276
|
+
...showPolicy ? [import_chalk99.default.gray(proposedExp)] : []
|
168126
168277
|
];
|
168127
168278
|
}).filter(
|
168128
168279
|
(app2) => (
|
@@ -168155,7 +168306,7 @@ function getDeploymentDuration(dep) {
|
|
168155
168306
|
if (!dep || !dep.ready || !dep.buildingAt) {
|
168156
168307
|
return "?";
|
168157
168308
|
}
|
168158
|
-
const duration = (0,
|
168309
|
+
const duration = (0, import_ms20.default)(dep.ready - dep.buildingAt);
|
168159
168310
|
if (duration === "0ms") {
|
168160
168311
|
return "--";
|
168161
168312
|
}
|
@@ -168169,17 +168320,17 @@ function stateString2(s) {
|
|
168169
168320
|
case "BUILDING":
|
168170
168321
|
case "DEPLOYING":
|
168171
168322
|
case "ANALYZING":
|
168172
|
-
return
|
168323
|
+
return import_chalk99.default.yellow(CIRCLE) + sTitle;
|
168173
168324
|
case "ERROR":
|
168174
|
-
return
|
168325
|
+
return import_chalk99.default.red(CIRCLE) + sTitle;
|
168175
168326
|
case "READY":
|
168176
|
-
return
|
168327
|
+
return import_chalk99.default.green(CIRCLE) + sTitle;
|
168177
168328
|
case "QUEUED":
|
168178
|
-
return
|
168329
|
+
return import_chalk99.default.white(CIRCLE) + sTitle;
|
168179
168330
|
case "CANCELED":
|
168180
|
-
return
|
168331
|
+
return import_chalk99.default.gray(sTitle);
|
168181
168332
|
default:
|
168182
|
-
return
|
168333
|
+
return import_chalk99.default.gray("UNKNOWN");
|
168183
168334
|
}
|
168184
168335
|
}
|
168185
168336
|
function sortByCreatedAt(a, b) {
|
@@ -168195,12 +168346,12 @@ function filterUniqueApps() {
|
|
168195
168346
|
return true;
|
168196
168347
|
};
|
168197
168348
|
}
|
168198
|
-
var
|
168349
|
+
var import_ms20, import_chalk99, import_title8, import_error_utils28;
|
168199
168350
|
var init_list6 = __esm({
|
168200
168351
|
"src/commands/list/index.ts"() {
|
168201
168352
|
"use strict";
|
168202
|
-
|
168203
|
-
|
168353
|
+
import_ms20 = __toESM3(require_ms());
|
168354
|
+
import_chalk99 = __toESM3(require_source());
|
168204
168355
|
import_title8 = __toESM3(require_lib4());
|
168205
168356
|
init_table();
|
168206
168357
|
init_get_args();
|
@@ -168364,7 +168515,7 @@ async function logs(client2) {
|
|
168364
168515
|
} catch {
|
168365
168516
|
}
|
168366
168517
|
spinner(
|
168367
|
-
`Fetching deployment "${deploymentIdOrHost}" in ${
|
168518
|
+
`Fetching deployment "${deploymentIdOrHost}" in ${import_chalk100.default.bold(contextName)}`
|
168368
168519
|
);
|
168369
168520
|
let deployment;
|
168370
168521
|
try {
|
@@ -168400,19 +168551,19 @@ function printDisclaimer(deployment) {
|
|
168400
168551
|
`This command now displays runtime logs. To access your build logs, run \`vercel inspect --logs ${deployment.url}\``
|
168401
168552
|
);
|
168402
168553
|
output_manager_default.print(
|
168403
|
-
`Displaying runtime logs for deployment ${deployment.url} (${
|
168554
|
+
`Displaying runtime logs for deployment ${deployment.url} (${import_chalk100.default.dim(
|
168404
168555
|
deployment.id
|
168405
|
-
)}) starting from ${
|
168556
|
+
)}) starting from ${import_chalk100.default.bold((0, import_format2.default)(Date.now(), dateTimeFormat2))}
|
168406
168557
|
|
168407
168558
|
`
|
168408
168559
|
);
|
168409
168560
|
}
|
168410
|
-
var import_error_utils29,
|
168561
|
+
var import_error_utils29, import_chalk100, import_format2, deprecatedFlags, dateTimeFormat2;
|
168411
168562
|
var init_logs3 = __esm({
|
168412
168563
|
"src/commands/logs/index.ts"() {
|
168413
168564
|
"use strict";
|
168414
168565
|
import_error_utils29 = __toESM3(require_dist2());
|
168415
|
-
|
168566
|
+
import_chalk100 = __toESM3(require_source());
|
168416
168567
|
import_format2 = __toESM3(require_format());
|
168417
168568
|
init_build_state();
|
168418
168569
|
init_is_deploying();
|
@@ -168657,8 +168808,8 @@ function canParseURL(url3) {
|
|
168657
168808
|
}
|
168658
168809
|
async function verifyJWT(token) {
|
168659
168810
|
try {
|
168660
|
-
const JWKS = (0,
|
168661
|
-
const { payload } = await (0,
|
168811
|
+
const JWKS = (0, import_jose2.createRemoteJWKSet)((await as()).jwks_uri);
|
168812
|
+
const { payload } = await (0, import_jose2.jwtVerify)(token, JWKS, {
|
168662
168813
|
issuer: "https://vercel.com",
|
168663
168814
|
audience: ["https://api.vercel.com", "https://vercel.com/api"]
|
168664
168815
|
});
|
@@ -168669,12 +168820,12 @@ async function verifyJWT(token) {
|
|
168669
168820
|
return [new Error("Could not verify JWT.", { cause: error3 })];
|
168670
168821
|
}
|
168671
168822
|
}
|
168672
|
-
var import_node_fetch6,
|
168823
|
+
var import_node_fetch6, import_jose2, VERCEL_ISSUER, VERCEL_CLI_CLIENT_ID, _as, OAuthError;
|
168673
168824
|
var init_oauth2 = __esm({
|
168674
168825
|
"src/util/oauth.ts"() {
|
168675
168826
|
"use strict";
|
168676
168827
|
import_node_fetch6 = __toESM3(require_lib7());
|
168677
|
-
|
168828
|
+
import_jose2 = require("jose");
|
168678
168829
|
init_ua();
|
168679
168830
|
VERCEL_ISSUER = new URL("https://vercel.com");
|
168680
168831
|
VERCEL_CLI_CLIENT_ID = "cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp";
|
@@ -168731,8 +168882,14 @@ async function login2(client2) {
|
|
168731
168882
|
`
|
168732
168883
|
\u25B2 Sign in to the Vercel CLI
|
168733
168884
|
|
168734
|
-
Visit ${
|
168735
|
-
|
168885
|
+
Visit ${import_chalk101.default.bold(
|
168886
|
+
output_manager_default.link(
|
168887
|
+
verification_uri.replace("https://", ""),
|
168888
|
+
verification_uri_complete,
|
168889
|
+
{ color: false, fallback: () => verification_uri_complete }
|
168890
|
+
)
|
168891
|
+
)}${output_manager_default.supportsHyperlink ? "" : ` to enter ${import_chalk101.default.bold(user_code)}`}
|
168892
|
+
${import_chalk101.default.grey("Press [ENTER] to open the browser")}
|
168736
168893
|
`,
|
168737
168894
|
() => {
|
168738
168895
|
open5.default(verification_uri_complete);
|
@@ -168803,10 +168960,10 @@ async function login2(client2) {
|
|
168803
168960
|
writeToConfigFile(client2.config);
|
168804
168961
|
output_manager_default.debug(`Saved credentials in "${humanizePath(global_path_default())}"`);
|
168805
168962
|
output_manager_default.print(`
|
168806
|
-
${
|
168963
|
+
${import_chalk101.default.cyan("Congratulations!")} You are now signed in. In order to deploy something, run ${getCommandName()}.
|
168807
168964
|
|
168808
168965
|
${prependEmoji(
|
168809
|
-
`Connect your Git Repositories to deploy every branch push automatically (${
|
168966
|
+
`Connect your Git Repositories to deploy every branch push automatically (${import_chalk101.default.bold(output_manager_default.link("vercel.link/git", "https://vercel.link/git", { color: false }))}).`,
|
168810
168967
|
emoji("tip")
|
168811
168968
|
)}
|
168812
168969
|
`);
|
@@ -168821,12 +168978,12 @@ async function login2(client2) {
|
|
168821
168978
|
printError(error3);
|
168822
168979
|
return 1;
|
168823
168980
|
}
|
168824
|
-
var import_node_readline,
|
168981
|
+
var import_node_readline, import_chalk101, open5;
|
168825
168982
|
var init_future = __esm({
|
168826
168983
|
"src/commands/login/future.ts"() {
|
168827
168984
|
"use strict";
|
168828
168985
|
import_node_readline = __toESM3(require("readline"));
|
168829
|
-
|
168986
|
+
import_chalk101 = __toESM3(require_source());
|
168830
168987
|
open5 = __toESM3(require_open());
|
168831
168988
|
init_error2();
|
168832
168989
|
init_update_current_team_after_login();
|
@@ -168905,7 +169062,7 @@ async function login3(client2) {
|
|
168905
169062
|
writeToConfigFile(client2.config);
|
168906
169063
|
output_manager_default.debug(`Saved credentials in "${humanizePath(global_path_default())}"`);
|
168907
169064
|
output_manager_default.print(
|
168908
|
-
`${
|
169065
|
+
`${import_chalk102.default.cyan("Congratulations!")} You are now logged in. In order to deploy something, run ${getCommandName()}.
|
168909
169066
|
`
|
168910
169067
|
);
|
168911
169068
|
output_manager_default.print(
|
@@ -168917,12 +169074,12 @@ async function login3(client2) {
|
|
168917
169074
|
);
|
168918
169075
|
return 0;
|
168919
169076
|
}
|
168920
|
-
var import_email_validator,
|
169077
|
+
var import_email_validator, import_chalk102;
|
168921
169078
|
var init_login3 = __esm({
|
168922
169079
|
"src/commands/login/index.ts"() {
|
168923
169080
|
"use strict";
|
168924
169081
|
import_email_validator = __toESM3(require_email_validator());
|
168925
|
-
|
169082
|
+
import_chalk102 = __toESM3(require_source());
|
168926
169083
|
init_humanize_path();
|
168927
169084
|
init_get_args();
|
168928
169085
|
init_prompt();
|
@@ -169136,12 +169293,12 @@ async function add6(client2, argv) {
|
|
169136
169293
|
const { args: args2 } = parsedArgs;
|
169137
169294
|
if (args2.length !== 1) {
|
169138
169295
|
output_manager_default.error(
|
169139
|
-
`Invalid number of arguments. Usage: ${
|
169296
|
+
`Invalid number of arguments. Usage: ${import_chalk103.default.cyan(
|
169140
169297
|
`${getCommandName("project add <name>")}`
|
169141
169298
|
)}`
|
169142
169299
|
);
|
169143
169300
|
if (args2.length > 1) {
|
169144
|
-
const example =
|
169301
|
+
const example = import_chalk103.default.cyan(
|
169145
169302
|
`${getCommandName(`project add "${args2.join(" ")}"`)}`
|
169146
169303
|
);
|
169147
169304
|
output_manager_default.log(
|
@@ -169166,21 +169323,21 @@ async function add6(client2, argv) {
|
|
169166
169323
|
throw err;
|
169167
169324
|
}
|
169168
169325
|
}
|
169169
|
-
const elapsed2 = (0,
|
169326
|
+
const elapsed2 = (0, import_ms21.default)(Date.now() - start);
|
169170
169327
|
const { contextName } = await getScope(client2);
|
169171
169328
|
output_manager_default.log(
|
169172
|
-
`${
|
169329
|
+
`${import_chalk103.default.cyan("Success!")} Project ${import_chalk103.default.bold(
|
169173
169330
|
name.toLowerCase()
|
169174
|
-
)} added (${
|
169331
|
+
)} added (${import_chalk103.default.bold(contextName)}) ${import_chalk103.default.gray(`[${elapsed2}]`)}`
|
169175
169332
|
);
|
169176
169333
|
return 0;
|
169177
169334
|
}
|
169178
|
-
var
|
169335
|
+
var import_chalk103, import_ms21;
|
169179
169336
|
var init_add12 = __esm({
|
169180
169337
|
"src/commands/project/add.ts"() {
|
169181
169338
|
"use strict";
|
169182
|
-
|
169183
|
-
|
169339
|
+
import_chalk103 = __toESM3(require_source());
|
169340
|
+
import_ms21 = __toESM3(require_ms());
|
169184
169341
|
init_errors_ts();
|
169185
169342
|
init_pkg_name();
|
169186
169343
|
init_create_project();
|
@@ -169278,7 +169435,7 @@ async function inspect4(client2, argv) {
|
|
169278
169435
|
telemetry2.trackCliFlagYes(parsedArgs.flags["--yes"]);
|
169279
169436
|
if (args2.length !== 0 && args2.length !== 1) {
|
169280
169437
|
output_manager_default.error(
|
169281
|
-
`Invalid number of arguments. Usage: ${
|
169438
|
+
`Invalid number of arguments. Usage: ${import_chalk104.default.cyan(
|
169282
169439
|
`${getCommandName("project inspect <name>")}`
|
169283
169440
|
)}`
|
169284
169441
|
);
|
@@ -169293,52 +169450,52 @@ async function inspect4(client2, argv) {
|
|
169293
169450
|
});
|
169294
169451
|
const org = await getTeamById(client2, project.accountId);
|
169295
169452
|
const projectSlugLink = formatProject(org.slug, project.name);
|
169296
|
-
output_manager_default.log(`Found Project ${projectSlugLink} ${
|
169453
|
+
output_manager_default.log(`Found Project ${projectSlugLink} ${import_chalk104.default.gray(inspectStamp())}`);
|
169297
169454
|
output_manager_default.print("\n");
|
169298
|
-
output_manager_default.print(
|
169299
|
-
output_manager_default.print(` ${
|
169455
|
+
output_manager_default.print(import_chalk104.default.bold(" General\n\n"));
|
169456
|
+
output_manager_default.print(` ${import_chalk104.default.cyan("ID")} ${project.id}
|
169300
169457
|
`);
|
169301
|
-
output_manager_default.print(` ${
|
169458
|
+
output_manager_default.print(` ${import_chalk104.default.cyan("Name")} ${project.name}
|
169302
169459
|
`);
|
169303
|
-
output_manager_default.print(` ${
|
169460
|
+
output_manager_default.print(` ${import_chalk104.default.cyan("Owner")} ${org.name}
|
169304
169461
|
`);
|
169305
169462
|
output_manager_default.print(
|
169306
|
-
` ${
|
169463
|
+
` ${import_chalk104.default.cyan("Created At")} ${formatDate(project.createdAt)}
|
169307
169464
|
`
|
169308
169465
|
);
|
169309
169466
|
output_manager_default.print(
|
169310
|
-
` ${
|
169467
|
+
` ${import_chalk104.default.cyan("Root Directory")} ${project.rootDirectory ?? "."}
|
169311
169468
|
`
|
169312
169469
|
);
|
169313
169470
|
output_manager_default.print(
|
169314
|
-
` ${
|
169471
|
+
` ${import_chalk104.default.cyan("Node.js Version")} ${project.nodeVersion}
|
169315
169472
|
`
|
169316
169473
|
);
|
169317
169474
|
const framework = import_frameworks7.frameworkList.find((f) => f.slug === project.framework);
|
169318
169475
|
output_manager_default.print("\n");
|
169319
|
-
output_manager_default.print(
|
169320
|
-
output_manager_default.print(` ${
|
169476
|
+
output_manager_default.print(import_chalk104.default.bold(" Framework Settings\n\n"));
|
169477
|
+
output_manager_default.print(` ${import_chalk104.default.cyan("Framework Preset")} ${framework?.name}
|
169321
169478
|
`);
|
169322
169479
|
output_manager_default.print(
|
169323
|
-
` ${
|
169480
|
+
` ${import_chalk104.default.cyan("Build Command")} ${project.buildCommand ?? import_chalk104.default.dim(framework?.settings?.buildCommand.placeholder ?? "None")}
|
169324
169481
|
`
|
169325
169482
|
);
|
169326
169483
|
output_manager_default.print(
|
169327
|
-
` ${
|
169484
|
+
` ${import_chalk104.default.cyan("Output Directory")} ${project.outputDirectory ?? import_chalk104.default.dim(framework?.settings?.outputDirectory.placeholder ?? "None")}
|
169328
169485
|
`
|
169329
169486
|
);
|
169330
169487
|
output_manager_default.print(
|
169331
|
-
` ${
|
169488
|
+
` ${import_chalk104.default.cyan("Install Command")} ${project.installCommand ?? import_chalk104.default.dim(framework?.settings?.installCommand.placeholder ?? "None")}
|
169332
169489
|
`
|
169333
169490
|
);
|
169334
169491
|
output_manager_default.print("\n");
|
169335
169492
|
return 0;
|
169336
169493
|
}
|
169337
|
-
var
|
169494
|
+
var import_chalk104, import_frameworks7;
|
169338
169495
|
var init_inspect6 = __esm({
|
169339
169496
|
"src/commands/project/inspect.ts"() {
|
169340
169497
|
"use strict";
|
169341
|
-
|
169498
|
+
import_chalk104 = __toESM3(require_source());
|
169342
169499
|
import_frameworks7 = __toESM3(require_frameworks());
|
169343
169500
|
init_pkg_name();
|
169344
169501
|
init_inspect5();
|
@@ -169397,7 +169554,7 @@ async function list4(client2, argv) {
|
|
169397
169554
|
const { args: args2, flags: opts } = parsedArgs;
|
169398
169555
|
if (args2.length !== 0) {
|
169399
169556
|
output_manager_default.error(
|
169400
|
-
`Invalid number of arguments. Usage: ${
|
169557
|
+
`Invalid number of arguments. Usage: ${import_chalk105.default.cyan(
|
169401
169558
|
`${getCommandName("project ls")}`
|
169402
169559
|
)}`
|
169403
169560
|
);
|
@@ -169405,7 +169562,7 @@ async function list4(client2, argv) {
|
|
169405
169562
|
}
|
169406
169563
|
const start = Date.now();
|
169407
169564
|
const { contextName } = await getScope(client2);
|
169408
|
-
output_manager_default.spinner(`Fetching projects in ${
|
169565
|
+
output_manager_default.spinner(`Fetching projects in ${import_chalk105.default.bold(contextName)}`);
|
169409
169566
|
let projectsUrl = "/v9/projects?limit=20";
|
169410
169567
|
const deprecated = opts["--update-required"] || false;
|
169411
169568
|
telemetryClient.trackCliFlagUpdateRequired(deprecated);
|
@@ -169424,9 +169581,9 @@ async function list4(client2, argv) {
|
|
169424
169581
|
method: "GET"
|
169425
169582
|
});
|
169426
169583
|
output_manager_default.stopSpinner();
|
169427
|
-
const elapsed2 = (0,
|
169584
|
+
const elapsed2 = (0, import_ms22.default)(Date.now() - start);
|
169428
169585
|
output_manager_default.log(
|
169429
|
-
`${projectList.length > 0 ? "Projects" : "No projects"} found under ${
|
169586
|
+
`${projectList.length > 0 ? "Projects" : "No projects"} found under ${import_chalk105.default.bold(contextName)} ${deprecated ? "that are using a deprecated Node.js version" : "\b"} ${import_chalk105.default.gray(`[${elapsed2}]`)}`
|
169430
169587
|
);
|
169431
169588
|
if (projectList.length > 0) {
|
169432
169589
|
const tablePrint = table(
|
@@ -169436,12 +169593,12 @@ async function list4(client2, argv) {
|
|
169436
169593
|
"Latest Production URL",
|
169437
169594
|
"Updated",
|
169438
169595
|
"Node Version"
|
169439
|
-
].map((header) =>
|
169596
|
+
].map((header) => import_chalk105.default.bold(import_chalk105.default.cyan(header))),
|
169440
169597
|
...projectList.flatMap((project) => [
|
169441
169598
|
[
|
169442
|
-
|
169599
|
+
import_chalk105.default.bold(project.name),
|
169443
169600
|
getLatestProdUrl(project),
|
169444
|
-
|
169601
|
+
import_chalk105.default.gray((0, import_ms22.default)(Date.now() - project.updatedAt)),
|
169445
169602
|
project.nodeVersion ?? ""
|
169446
169603
|
]
|
169447
169604
|
])
|
@@ -169466,12 +169623,12 @@ function getLatestProdUrl(project) {
|
|
169466
169623
|
return `https://${alias2}`;
|
169467
169624
|
return "--";
|
169468
169625
|
}
|
169469
|
-
var
|
169626
|
+
var import_ms22, import_chalk105;
|
169470
169627
|
var init_list8 = __esm({
|
169471
169628
|
"src/commands/project/list.ts"() {
|
169472
169629
|
"use strict";
|
169473
|
-
|
169474
|
-
|
169630
|
+
import_ms22 = __toESM3(require_ms());
|
169631
|
+
import_chalk105 = __toESM3(require_source());
|
169475
169632
|
init_table();
|
169476
169633
|
init_get_command_flags();
|
169477
169634
|
init_pkg_name();
|
@@ -169522,7 +169679,7 @@ async function rm6(client2, argv) {
|
|
169522
169679
|
const { args: args2 } = parsedArgs;
|
169523
169680
|
if (args2.length !== 1) {
|
169524
169681
|
output_manager_default.error(
|
169525
|
-
`Invalid number of arguments. Usage: ${
|
169682
|
+
`Invalid number of arguments. Usage: ${import_chalk106.default.cyan(
|
169526
169683
|
`${getCommandName("project rm <name>")}`
|
169527
169684
|
)}`
|
169528
169685
|
);
|
@@ -169550,9 +169707,9 @@ async function rm6(client2, argv) {
|
|
169550
169707
|
return 1;
|
169551
169708
|
}
|
169552
169709
|
}
|
169553
|
-
const elapsed2 = (0,
|
169710
|
+
const elapsed2 = (0, import_ms23.default)(Date.now() - start);
|
169554
169711
|
output_manager_default.log(
|
169555
|
-
`${
|
169712
|
+
`${import_chalk106.default.cyan("Success!")} Project ${import_chalk106.default.bold(name)} removed ${import_chalk106.default.gray(
|
169556
169713
|
`[${elapsed2}]`
|
169557
169714
|
)}`
|
169558
169715
|
);
|
@@ -169561,23 +169718,23 @@ async function rm6(client2, argv) {
|
|
169561
169718
|
async function readConfirmation3(client2, projectName) {
|
169562
169719
|
output_manager_default.print(
|
169563
169720
|
prependEmoji(
|
169564
|
-
`The project ${
|
169721
|
+
`The project ${import_chalk106.default.bold(projectName)} will be removed permanently.
|
169565
169722
|
It will also delete everything under the project including deployments.
|
169566
169723
|
`,
|
169567
169724
|
emoji("warning")
|
169568
169725
|
)
|
169569
169726
|
);
|
169570
169727
|
return await client2.input.confirm(
|
169571
|
-
`${
|
169728
|
+
`${import_chalk106.default.bold.red("Are you sure?")}`,
|
169572
169729
|
false
|
169573
169730
|
);
|
169574
169731
|
}
|
169575
|
-
var
|
169732
|
+
var import_chalk106, import_ms23, e;
|
169576
169733
|
var init_rm10 = __esm({
|
169577
169734
|
"src/commands/project/rm.ts"() {
|
169578
169735
|
"use strict";
|
169579
|
-
|
169580
|
-
|
169736
|
+
import_chalk106 = __toESM3(require_source());
|
169737
|
+
import_ms23 = __toESM3(require_ms());
|
169581
169738
|
init_emoji();
|
169582
169739
|
init_errors_ts();
|
169583
169740
|
init_pkg_name();
|
@@ -169744,7 +169901,7 @@ async function getProjectByDeployment({
|
|
169744
169901
|
let team;
|
169745
169902
|
try {
|
169746
169903
|
output_manager_default?.spinner(
|
169747
|
-
`Fetching deployment "${deployId}" in ${
|
169904
|
+
`Fetching deployment "${deployId}" in ${import_chalk107.default.bold(contextName)}\u2026`
|
169748
169905
|
);
|
169749
169906
|
const [teamResult, deploymentResult] = await Promise.allSettled([
|
169750
169907
|
config2.currentTeam ? getTeamById(client2, config2.currentTeam) : void 0,
|
@@ -169761,12 +169918,12 @@ async function getProjectByDeployment({
|
|
169761
169918
|
team = teamResult.value;
|
169762
169919
|
deployment = deploymentResult.value;
|
169763
169920
|
output_manager_default?.log(
|
169764
|
-
`Fetching deployment "${deployId}" in ${
|
169921
|
+
`Fetching deployment "${deployId}" in ${import_chalk107.default.bold(contextName)}\u2026`
|
169765
169922
|
);
|
169766
169923
|
if (deployment.team?.id) {
|
169767
169924
|
if (!team || deployment.team.id !== team.id) {
|
169768
169925
|
const err = new Error(
|
169769
|
-
team ? `Deployment doesn't belong to current team ${
|
169926
|
+
team ? `Deployment doesn't belong to current team ${import_chalk107.default.bold(
|
169770
169927
|
contextName
|
169771
169928
|
)}` : `Deployment belongs to a different team`
|
169772
169929
|
);
|
@@ -169775,7 +169932,7 @@ async function getProjectByDeployment({
|
|
169775
169932
|
}
|
169776
169933
|
} else if (team) {
|
169777
169934
|
const err = new Error(
|
169778
|
-
`Deployment doesn't belong to current team ${
|
169935
|
+
`Deployment doesn't belong to current team ${import_chalk107.default.bold(contextName)}`
|
169779
169936
|
);
|
169780
169937
|
err.code = "ERR_INVALID_TEAM";
|
169781
169938
|
throw err;
|
@@ -169796,11 +169953,11 @@ async function getProjectByDeployment({
|
|
169796
169953
|
output_manager_default?.stopSpinner();
|
169797
169954
|
}
|
169798
169955
|
}
|
169799
|
-
var
|
169956
|
+
var import_chalk107;
|
169800
169957
|
var init_get_project_by_deployment = __esm({
|
169801
169958
|
"src/util/projects/get-project-by-deployment.ts"() {
|
169802
169959
|
"use strict";
|
169803
|
-
|
169960
|
+
import_chalk107 = __toESM3(require_source());
|
169804
169961
|
init_get_deployment();
|
169805
169962
|
init_get_project_by_id_or_name();
|
169806
169963
|
init_get_scope();
|
@@ -169814,21 +169971,21 @@ var init_get_project_by_deployment = __esm({
|
|
169814
169971
|
// src/util/alias/render-alias-status.ts
|
169815
169972
|
function renderAliasStatus(status2) {
|
169816
169973
|
if (status2 === "completed") {
|
169817
|
-
return
|
169974
|
+
return import_chalk108.default.green(status2);
|
169818
169975
|
}
|
169819
169976
|
if (status2 === "failed") {
|
169820
|
-
return
|
169977
|
+
return import_chalk108.default.red(status2);
|
169821
169978
|
}
|
169822
169979
|
if (status2 === "skipped") {
|
169823
|
-
return
|
169980
|
+
return import_chalk108.default.gray(status2);
|
169824
169981
|
}
|
169825
|
-
return
|
169982
|
+
return import_chalk108.default.yellow(status2);
|
169826
169983
|
}
|
169827
|
-
var
|
169984
|
+
var import_chalk108;
|
169828
169985
|
var init_render_alias_status = __esm({
|
169829
169986
|
"src/util/alias/render-alias-status.ts"() {
|
169830
169987
|
"use strict";
|
169831
|
-
|
169988
|
+
import_chalk108 = __toESM3(require_source());
|
169832
169989
|
}
|
169833
169990
|
});
|
169834
169991
|
|
@@ -169840,8 +169997,8 @@ async function promoteStatus({
|
|
169840
169997
|
project,
|
169841
169998
|
timeout = "3m"
|
169842
169999
|
}) {
|
169843
|
-
const recentThreshold = Date.now() - (0,
|
169844
|
-
const promoteTimeout = Date.now() + (0,
|
170000
|
+
const recentThreshold = Date.now() - (0, import_ms24.default)("3m");
|
170001
|
+
const promoteTimeout = Date.now() + (0, import_ms24.default)(timeout);
|
169845
170002
|
let counter = 0;
|
169846
170003
|
let spinnerMessage = deployment ? "Promote in progress" : `Checking promotion status of ${project.name}`;
|
169847
170004
|
if (!contextName) {
|
@@ -169902,7 +170059,7 @@ async function promoteStatus({
|
|
169902
170059
|
}
|
169903
170060
|
if (requestedAt < recentThreshold || Date.now() >= promoteTimeout) {
|
169904
170061
|
output_manager_default.log(
|
169905
|
-
`The promotion exceeded its deadline - rerun ${
|
170062
|
+
`The promotion exceeded its deadline - rerun ${import_chalk109.default.bold(
|
169906
170063
|
`${packageName} promote ${toDeploymentId}`
|
169907
170064
|
)} to try again`
|
169908
170065
|
);
|
@@ -169966,33 +170123,33 @@ async function renderJobSucceeded({
|
|
169966
170123
|
let deploymentInfo = "";
|
169967
170124
|
try {
|
169968
170125
|
const deployment = await getDeployment(client2, contextName, toDeploymentId);
|
169969
|
-
deploymentInfo = `${
|
170126
|
+
deploymentInfo = `${import_chalk109.default.bold(deployment.url)} (${toDeploymentId})`;
|
169970
170127
|
} catch (err) {
|
169971
170128
|
output_manager_default.debug(
|
169972
170129
|
`Failed to get deployment url for ${toDeploymentId}: ${err?.toString() || err}`
|
169973
170130
|
);
|
169974
|
-
deploymentInfo =
|
170131
|
+
deploymentInfo = import_chalk109.default.bold(toDeploymentId);
|
169975
170132
|
}
|
169976
170133
|
const duration = performingPromote ? elapsed(Date.now() - requestedAt) : "";
|
169977
170134
|
output_manager_default.log(
|
169978
|
-
`Success! ${
|
170135
|
+
`Success! ${import_chalk109.default.bold(
|
169979
170136
|
project.name
|
169980
170137
|
)} was promoted to ${deploymentInfo} ${duration}`
|
169981
170138
|
);
|
169982
170139
|
return 0;
|
169983
170140
|
}
|
169984
|
-
var
|
170141
|
+
var import_chalk109, import_ms24;
|
169985
170142
|
var init_status = __esm({
|
169986
170143
|
"src/commands/promote/status.ts"() {
|
169987
170144
|
"use strict";
|
169988
|
-
|
170145
|
+
import_chalk109 = __toESM3(require_source());
|
169989
170146
|
init_elapsed();
|
169990
170147
|
init_format_date();
|
169991
170148
|
init_get_deployment();
|
169992
170149
|
init_pkg_name();
|
169993
170150
|
init_get_project_by_id_or_name();
|
169994
170151
|
init_get_scope();
|
169995
|
-
|
170152
|
+
import_ms24 = __toESM3(require_ms());
|
169996
170153
|
init_errors_ts();
|
169997
170154
|
init_render_alias_status();
|
169998
170155
|
init_sleep();
|
@@ -170041,7 +170198,7 @@ async function requestPromote({
|
|
170041
170198
|
}
|
170042
170199
|
);
|
170043
170200
|
output_manager_default.log(
|
170044
|
-
`Successfully created new deployment of ${
|
170201
|
+
`Successfully created new deployment of ${import_chalk110.default.bold(project.name)} at ${newDeployment.inspectorUrl}`
|
170045
170202
|
);
|
170046
170203
|
return 0;
|
170047
170204
|
}
|
@@ -170051,9 +170208,9 @@ async function requestPromote({
|
|
170051
170208
|
json: false,
|
170052
170209
|
method: "POST"
|
170053
170210
|
});
|
170054
|
-
if (timeout !== void 0 && (0,
|
170211
|
+
if (timeout !== void 0 && (0, import_ms25.default)(timeout) === 0) {
|
170055
170212
|
output_manager_default.log(
|
170056
|
-
`Successfully requested promote of ${
|
170213
|
+
`Successfully requested promote of ${import_chalk110.default.bold(project.name)} to ${deployment.url} (${deployment.id})`
|
170057
170214
|
);
|
170058
170215
|
output_manager_default.log(`To check promote status, run ${getCommandName("promote")}.`);
|
170059
170216
|
return 0;
|
@@ -170066,14 +170223,14 @@ async function requestPromote({
|
|
170066
170223
|
timeout
|
170067
170224
|
});
|
170068
170225
|
}
|
170069
|
-
var
|
170226
|
+
var import_chalk110, import_ms25;
|
170070
170227
|
var init_request_promote = __esm({
|
170071
170228
|
"src/commands/promote/request-promote.ts"() {
|
170072
170229
|
"use strict";
|
170073
|
-
|
170230
|
+
import_chalk110 = __toESM3(require_source());
|
170074
170231
|
init_pkg_name();
|
170075
170232
|
init_get_project_by_deployment();
|
170076
|
-
|
170233
|
+
import_ms25 = __toESM3(require_ms());
|
170077
170234
|
init_status();
|
170078
170235
|
init_output_manager();
|
170079
170236
|
}
|
@@ -170122,11 +170279,11 @@ var promote_exports = {};
|
|
170122
170279
|
__export3(promote_exports, {
|
170123
170280
|
default: () => promote_default
|
170124
170281
|
});
|
170125
|
-
var
|
170282
|
+
var import_ms26, import_error_utils32, promote_default;
|
170126
170283
|
var init_promote2 = __esm({
|
170127
170284
|
"src/commands/promote/index.ts"() {
|
170128
170285
|
"use strict";
|
170129
|
-
|
170286
|
+
import_ms26 = __toESM3(require_ms());
|
170130
170287
|
init_get_args();
|
170131
170288
|
init_get_project_by_cwd_or_link();
|
170132
170289
|
init_error2();
|
@@ -170161,7 +170318,7 @@ var init_promote2 = __esm({
|
|
170161
170318
|
const yes = parsedArgs.flags["--yes"] ?? false;
|
170162
170319
|
telemetry2.trackCliFlagYes(parsedArgs.flags["--yes"]);
|
170163
170320
|
const timeout = parsedArgs.flags["--timeout"];
|
170164
|
-
if (timeout && (0,
|
170321
|
+
if (timeout && (0, import_ms26.default)(timeout) === void 0) {
|
170165
170322
|
output_manager_default.error(`Invalid timeout "${timeout}"`);
|
170166
170323
|
return 1;
|
170167
170324
|
}
|
@@ -170231,7 +170388,7 @@ async function getDeploymentByIdOrURL({
|
|
170231
170388
|
let team;
|
170232
170389
|
try {
|
170233
170390
|
output_manager_default.spinner(
|
170234
|
-
`Fetching deployment "${deployIdOrUrl}" in ${
|
170391
|
+
`Fetching deployment "${deployIdOrUrl}" in ${import_chalk111.default.bold(contextName)}\u2026`
|
170235
170392
|
);
|
170236
170393
|
const [teamResult, deploymentResult] = await Promise.allSettled([
|
170237
170394
|
config2.currentTeam ? getTeamById(client2, config2.currentTeam) : void 0,
|
@@ -170248,7 +170405,7 @@ async function getDeploymentByIdOrURL({
|
|
170248
170405
|
team = teamResult.value;
|
170249
170406
|
deployment = deploymentResult.value;
|
170250
170407
|
output_manager_default.log(
|
170251
|
-
`Fetching deployment "${deployIdOrUrl}" in ${
|
170408
|
+
`Fetching deployment "${deployIdOrUrl}" in ${import_chalk111.default.bold(contextName)}\u2026`
|
170252
170409
|
);
|
170253
170410
|
} finally {
|
170254
170411
|
output_manager_default.stopSpinner();
|
@@ -170256,7 +170413,7 @@ async function getDeploymentByIdOrURL({
|
|
170256
170413
|
if (deployment.team?.id) {
|
170257
170414
|
if (!team || deployment.team.id !== team.id) {
|
170258
170415
|
const err = new Error(
|
170259
|
-
team ? `Deployment doesn't belong to current team ${
|
170416
|
+
team ? `Deployment doesn't belong to current team ${import_chalk111.default.bold(
|
170260
170417
|
contextName
|
170261
170418
|
)}` : `Deployment belongs to a different team`
|
170262
170419
|
);
|
@@ -170265,18 +170422,18 @@ async function getDeploymentByIdOrURL({
|
|
170265
170422
|
}
|
170266
170423
|
} else if (team) {
|
170267
170424
|
const err = new Error(
|
170268
|
-
`Deployment doesn't belong to current team ${
|
170425
|
+
`Deployment doesn't belong to current team ${import_chalk111.default.bold(contextName)}`
|
170269
170426
|
);
|
170270
170427
|
err.code = "ERR_INVALID_TEAM";
|
170271
170428
|
throw err;
|
170272
170429
|
}
|
170273
170430
|
return deployment;
|
170274
170431
|
}
|
170275
|
-
var
|
170432
|
+
var import_chalk111;
|
170276
170433
|
var init_get_deployment_by_id_or_url = __esm({
|
170277
170434
|
"src/util/deploy/get-deployment-by-id-or-url.ts"() {
|
170278
170435
|
"use strict";
|
170279
|
-
|
170436
|
+
import_chalk111 = __toESM3(require_source());
|
170280
170437
|
init_get_deployment();
|
170281
170438
|
init_get_team_by_id();
|
170282
170439
|
init_is_valid_name();
|
@@ -170415,14 +170572,14 @@ async function redeploy(client2) {
|
|
170415
170572
|
}
|
170416
170573
|
output_manager_default.print(
|
170417
170574
|
`${prependEmoji(
|
170418
|
-
`Inspect: ${
|
170575
|
+
`Inspect: ${import_chalk112.default.bold(deployment.inspectorUrl)} ${deployStamp()}`,
|
170419
170576
|
emoji("inspect")
|
170420
170577
|
)}
|
170421
170578
|
`
|
170422
170579
|
);
|
170423
170580
|
output_manager_default.print(
|
170424
170581
|
prependEmoji(
|
170425
|
-
`${isProdDeployment ? "Production" : "Preview"}: ${
|
170582
|
+
`${isProdDeployment ? "Production" : "Preview"}: ${import_chalk112.default.bold(
|
170426
170583
|
previewUrl
|
170427
170584
|
)} ${deployStamp()}`,
|
170428
170585
|
emoji("success")
|
@@ -170492,17 +170649,17 @@ async function redeploy(client2) {
|
|
170492
170649
|
output_manager_default.prettyError(err);
|
170493
170650
|
if ((0, import_error_utils33.isErrnoException)(err) && err.code === "ERR_INVALID_TEAM") {
|
170494
170651
|
output_manager_default.error(
|
170495
|
-
`Use ${
|
170652
|
+
`Use ${import_chalk112.default.bold("vc switch")} to change your current team`
|
170496
170653
|
);
|
170497
170654
|
}
|
170498
170655
|
return 1;
|
170499
170656
|
}
|
170500
170657
|
}
|
170501
|
-
var
|
170658
|
+
var import_chalk112, import_client13, import_error_utils33;
|
170502
170659
|
var init_redeploy2 = __esm({
|
170503
170660
|
"src/commands/redeploy/index.ts"() {
|
170504
170661
|
"use strict";
|
170505
|
-
|
170662
|
+
import_chalk112 = __toESM3(require_source());
|
170506
170663
|
import_client13 = __toESM3(require_dist7());
|
170507
170664
|
init_emoji();
|
170508
170665
|
init_get_args();
|
@@ -170709,7 +170866,7 @@ async function remove5(client2) {
|
|
170709
170866
|
}
|
170710
170867
|
const { contextName } = await getScope(client2);
|
170711
170868
|
output_manager_default.spinner(
|
170712
|
-
`Fetching deployment(s) ${ids.map((id) => `"${id}"`).join(" ")} in ${
|
170869
|
+
`Fetching deployment(s) ${ids.map((id) => `"${id}"`).join(" ")} in ${import_chalk113.default.bold(contextName)}`
|
170713
170870
|
);
|
170714
170871
|
let aliases;
|
170715
170872
|
let projects;
|
@@ -170775,7 +170932,7 @@ async function remove5(client2) {
|
|
170775
170932
|
});
|
170776
170933
|
if (deployments.length === 0 && projects.length === 0) {
|
170777
170934
|
const safeUnaliased = parsedArgs.flags["--safe"] ? "unaliased" : "any";
|
170778
|
-
const stylizedIds = ids.map((id) =>
|
170935
|
+
const stylizedIds = ids.map((id) => import_chalk113.default.bold(`"${id}"`)).join(", ");
|
170779
170936
|
const commandName = getCommandName("projects ls");
|
170780
170937
|
log2(
|
170781
170938
|
`Could not find ${safeUnaliased} deployments or projects matching ${stylizedIds}. Run ${commandName} to list.`
|
@@ -170783,7 +170940,7 @@ async function remove5(client2) {
|
|
170783
170940
|
return 1;
|
170784
170941
|
}
|
170785
170942
|
log2(
|
170786
|
-
`Found ${deploymentsAndProjects(deployments, projects)} for removal in ${
|
170943
|
+
`Found ${deploymentsAndProjects(deployments, projects)} for removal in ${import_chalk113.default.bold(contextName)} ${elapsed(Date.now() - findStart)}`
|
170787
170944
|
);
|
170788
170945
|
if (deployments.length > 200) {
|
170789
170946
|
output_manager_default.warn(
|
@@ -170810,11 +170967,11 @@ async function remove5(client2) {
|
|
170810
170967
|
`Removed ${deploymentsAndProjects(deployments, projects)} ${elapsed(Date.now() - start)}`
|
170811
170968
|
);
|
170812
170969
|
deployments.forEach((depl) => {
|
170813
|
-
output_manager_default.print(`${
|
170970
|
+
output_manager_default.print(`${import_chalk113.default.gray("-")} ${import_chalk113.default.bold(depl.url)}
|
170814
170971
|
`);
|
170815
170972
|
});
|
170816
170973
|
projects.forEach((project) => {
|
170817
|
-
output_manager_default.print(`${
|
170974
|
+
output_manager_default.print(`${import_chalk113.default.gray("-")} ${import_chalk113.default.bold(project.name)}
|
170818
170975
|
`);
|
170819
170976
|
});
|
170820
170977
|
return 0;
|
@@ -170831,8 +170988,8 @@ function readConfirmation4(deployments, projects) {
|
|
170831
170988
|
);
|
170832
170989
|
const deploymentTable = table(
|
170833
170990
|
deployments.map((depl) => {
|
170834
|
-
const time =
|
170835
|
-
const url3 = depl.url ?
|
170991
|
+
const time = import_chalk113.default.gray(`${(0, import_ms27.default)(Date.now() - depl.createdAt)} ago`);
|
170992
|
+
const url3 = depl.url ? import_chalk113.default.underline(`https://${depl.url}`) : "";
|
170836
170993
|
return [` ${depl.id}`, url3, time];
|
170837
170994
|
}),
|
170838
170995
|
{ align: ["l", "r", "l"], hsep: 6 }
|
@@ -170843,7 +171000,7 @@ function readConfirmation4(deployments, projects) {
|
|
170843
171000
|
for (const depl of deployments) {
|
170844
171001
|
for (const { alias: alias2 } of depl.aliases) {
|
170845
171002
|
output_manager_default.warn(
|
170846
|
-
`${
|
171003
|
+
`${import_chalk113.default.underline(`https://${alias2}`)} is an alias for ${import_chalk113.default.bold(depl.url)} and will be removed`
|
170847
171004
|
);
|
170848
171005
|
}
|
170849
171006
|
}
|
@@ -170857,12 +171014,12 @@ function readConfirmation4(deployments, projects) {
|
|
170857
171014
|
`
|
170858
171015
|
);
|
170859
171016
|
for (const project of projects) {
|
170860
|
-
output_manager_default.print(`${
|
171017
|
+
output_manager_default.print(`${import_chalk113.default.gray("-")} ${import_chalk113.default.bold(project.name)}
|
170861
171018
|
`);
|
170862
171019
|
}
|
170863
171020
|
}
|
170864
171021
|
output_manager_default.print(
|
170865
|
-
`${
|
171022
|
+
`${import_chalk113.default.bold.red("> Are you sure?")} ${import_chalk113.default.gray("(y/N) ")}`
|
170866
171023
|
);
|
170867
171024
|
process.stdin.on("data", (d) => {
|
170868
171025
|
process.stdin.pause();
|
@@ -170879,12 +171036,12 @@ function deploymentsAndProjects(deployments, projects, conjunction = "and") {
|
|
170879
171036
|
}
|
170880
171037
|
return `${(0, import_pluralize11.default)("deployment", deployments.length, true)} ${conjunction} ${(0, import_pluralize11.default)("project", projects.length, true)}`;
|
170881
171038
|
}
|
170882
|
-
var
|
171039
|
+
var import_chalk113, import_ms27, import_pluralize11;
|
170883
171040
|
var init_remove6 = __esm({
|
170884
171041
|
"src/commands/remove/index.ts"() {
|
170885
171042
|
"use strict";
|
170886
|
-
|
170887
|
-
|
171043
|
+
import_chalk113 = __toESM3(require_source());
|
171044
|
+
import_ms27 = __toESM3(require_ms());
|
170888
171045
|
import_pluralize11 = __toESM3(require_pluralize());
|
170889
171046
|
init_table();
|
170890
171047
|
init_util();
|
@@ -170917,8 +171074,8 @@ async function rollbackStatus({
|
|
170917
171074
|
project,
|
170918
171075
|
timeout = "3m"
|
170919
171076
|
}) {
|
170920
|
-
const recentThreshold = Date.now() - (0,
|
170921
|
-
const rollbackTimeout = Date.now() + (0,
|
171077
|
+
const recentThreshold = Date.now() - (0, import_ms28.default)("3m");
|
171078
|
+
const rollbackTimeout = Date.now() + (0, import_ms28.default)(timeout);
|
170922
171079
|
let counter = 0;
|
170923
171080
|
let spinnerMessage = deployment ? "Rollback in progress" : `Checking rollback status of ${project.name}`;
|
170924
171081
|
if (!contextName) {
|
@@ -170979,7 +171136,7 @@ async function rollbackStatus({
|
|
170979
171136
|
}
|
170980
171137
|
if (requestedAt < recentThreshold || Date.now() >= rollbackTimeout) {
|
170981
171138
|
output_manager_default.log(
|
170982
|
-
`The rollback exceeded its deadline - rerun ${
|
171139
|
+
`The rollback exceeded its deadline - rerun ${import_chalk114.default.bold(
|
170983
171140
|
`${packageName} rollback ${toDeploymentId}`
|
170984
171141
|
)} to try again`
|
170985
171142
|
);
|
@@ -171043,33 +171200,33 @@ async function renderJobSucceeded2({
|
|
171043
171200
|
let deploymentInfo = "";
|
171044
171201
|
try {
|
171045
171202
|
const deployment = await getDeployment(client2, contextName, toDeploymentId);
|
171046
|
-
deploymentInfo = `${
|
171203
|
+
deploymentInfo = `${import_chalk114.default.bold(deployment.url)} (${toDeploymentId})`;
|
171047
171204
|
} catch (err) {
|
171048
171205
|
output_manager_default.debug(
|
171049
171206
|
`Failed to get deployment url for ${toDeploymentId}: ${err?.toString() || err}`
|
171050
171207
|
);
|
171051
|
-
deploymentInfo =
|
171208
|
+
deploymentInfo = import_chalk114.default.bold(toDeploymentId);
|
171052
171209
|
}
|
171053
171210
|
const duration = performingRollback ? elapsed(Date.now() - requestedAt) : "";
|
171054
171211
|
output_manager_default.log(
|
171055
|
-
`Success! ${
|
171212
|
+
`Success! ${import_chalk114.default.bold(
|
171056
171213
|
project.name
|
171057
171214
|
)} was rolled back to ${deploymentInfo} ${duration}`
|
171058
171215
|
);
|
171059
171216
|
return 0;
|
171060
171217
|
}
|
171061
|
-
var
|
171218
|
+
var import_chalk114, import_ms28;
|
171062
171219
|
var init_status2 = __esm({
|
171063
171220
|
"src/commands/rollback/status.ts"() {
|
171064
171221
|
"use strict";
|
171065
|
-
|
171222
|
+
import_chalk114 = __toESM3(require_source());
|
171066
171223
|
init_elapsed();
|
171067
171224
|
init_format_date();
|
171068
171225
|
init_get_deployment();
|
171069
171226
|
init_pkg_name();
|
171070
171227
|
init_get_project_by_id_or_name();
|
171071
171228
|
init_get_scope();
|
171072
|
-
|
171229
|
+
import_ms28 = __toESM3(require_ms());
|
171073
171230
|
init_errors_ts();
|
171074
171231
|
init_render_alias_status();
|
171075
171232
|
init_sleep();
|
@@ -171092,9 +171249,9 @@ async function requestRollback({
|
|
171092
171249
|
// required
|
171093
171250
|
method: "POST"
|
171094
171251
|
});
|
171095
|
-
if (timeout !== void 0 && (0,
|
171252
|
+
if (timeout !== void 0 && (0, import_ms29.default)(timeout) === 0) {
|
171096
171253
|
output_manager_default.log(
|
171097
|
-
`Successfully requested rollback of ${
|
171254
|
+
`Successfully requested rollback of ${import_chalk115.default.bold(project.name)} to ${deployment.url} (${deployment.id})`
|
171098
171255
|
);
|
171099
171256
|
output_manager_default.log(`To check rollback status, run ${getCommandName("rollback")}.`);
|
171100
171257
|
return 0;
|
@@ -171107,14 +171264,14 @@ async function requestRollback({
|
|
171107
171264
|
timeout
|
171108
171265
|
});
|
171109
171266
|
}
|
171110
|
-
var
|
171267
|
+
var import_chalk115, import_ms29;
|
171111
171268
|
var init_request_rollback = __esm({
|
171112
171269
|
"src/commands/rollback/request-rollback.ts"() {
|
171113
171270
|
"use strict";
|
171114
|
-
|
171271
|
+
import_chalk115 = __toESM3(require_source());
|
171115
171272
|
init_pkg_name();
|
171116
171273
|
init_get_project_by_deployment();
|
171117
|
-
|
171274
|
+
import_ms29 = __toESM3(require_ms());
|
171118
171275
|
init_status2();
|
171119
171276
|
init_output_manager();
|
171120
171277
|
}
|
@@ -171163,7 +171320,7 @@ var rollback_exports = {};
|
|
171163
171320
|
__export3(rollback_exports, {
|
171164
171321
|
default: () => rollback_default
|
171165
171322
|
});
|
171166
|
-
var import_error_utils34,
|
171323
|
+
var import_error_utils34, import_ms30, rollback_default;
|
171167
171324
|
var init_rollback2 = __esm({
|
171168
171325
|
"src/commands/rollback/index.ts"() {
|
171169
171326
|
"use strict";
|
@@ -171171,7 +171328,7 @@ var init_rollback2 = __esm({
|
|
171171
171328
|
init_get_project_by_cwd_or_link();
|
171172
171329
|
init_error2();
|
171173
171330
|
import_error_utils34 = __toESM3(require_dist2());
|
171174
|
-
|
171331
|
+
import_ms30 = __toESM3(require_ms());
|
171175
171332
|
init_request_rollback();
|
171176
171333
|
init_status2();
|
171177
171334
|
init_help();
|
@@ -171202,7 +171359,7 @@ var init_rollback2 = __esm({
|
|
171202
171359
|
return 2;
|
171203
171360
|
}
|
171204
171361
|
const timeout = parsedArgs.flags["--timeout"];
|
171205
|
-
if (timeout && (0,
|
171362
|
+
if (timeout && (0, import_ms30.default)(timeout) === void 0) {
|
171206
171363
|
output_manager_default.error(`Invalid timeout "${timeout}"`);
|
171207
171364
|
return 1;
|
171208
171365
|
}
|
@@ -171258,17 +171415,17 @@ function formatBranchMatcher(branchMatcher) {
|
|
171258
171415
|
if (branchMatcher?.type === "equals") {
|
171259
171416
|
return branchMatcher.pattern;
|
171260
171417
|
} else if (branchMatcher?.type === "startsWith") {
|
171261
|
-
return `${branchMatcher.pattern}${
|
171418
|
+
return `${branchMatcher.pattern}${import_chalk116.default.dim("*")}`;
|
171262
171419
|
} else if (branchMatcher?.type === "endsWith") {
|
171263
|
-
return `${
|
171420
|
+
return `${import_chalk116.default.dim("*")}${branchMatcher.pattern}`;
|
171264
171421
|
}
|
171265
|
-
return
|
171422
|
+
return import_chalk116.default.dim("No branch configuration");
|
171266
171423
|
}
|
171267
171424
|
async function list5(client2, argv) {
|
171268
171425
|
const { cwd } = client2;
|
171269
171426
|
if (argv.length !== 0) {
|
171270
171427
|
output_manager_default.error(
|
171271
|
-
`Invalid number of arguments. Usage: ${
|
171428
|
+
`Invalid number of arguments. Usage: ${import_chalk116.default.cyan(
|
171272
171429
|
`${getCommandName("target ls")}`
|
171273
171430
|
)}`
|
171274
171431
|
);
|
@@ -171289,15 +171446,15 @@ async function list5(client2, argv) {
|
|
171289
171446
|
accountId: link4.org.id
|
171290
171447
|
});
|
171291
171448
|
output_manager_default.stopSpinner();
|
171292
|
-
const elapsed2 = (0,
|
171449
|
+
const elapsed2 = (0, import_ms31.default)(Date.now() - start);
|
171293
171450
|
result = withDefaultEnvironmentsIncluded(result);
|
171294
171451
|
output_manager_default.log(
|
171295
|
-
`${result.length} Environment${result.length === 1 ? "" : "s"} found under ${projectSlugLink} ${
|
171452
|
+
`${result.length} Environment${result.length === 1 ? "" : "s"} found under ${projectSlugLink} ${import_chalk116.default.gray(`[${elapsed2}]`)}`
|
171296
171453
|
);
|
171297
171454
|
const tablePrint = table(
|
171298
171455
|
[
|
171299
171456
|
["Target Name", "Branch Tracking", "Type", "Updated"].map(
|
171300
|
-
(header) =>
|
171457
|
+
(header) => import_chalk116.default.bold(import_chalk116.default.cyan(header))
|
171301
171458
|
),
|
171302
171459
|
...result.flatMap((target) => {
|
171303
171460
|
return [
|
@@ -171305,8 +171462,8 @@ async function list5(client2, argv) {
|
|
171305
171462
|
formatEnvironment(link4.org.slug, link4.project.name, target),
|
171306
171463
|
BRANCH_TRACKING_MAP[target.type](link4.project, target),
|
171307
171464
|
TYPE_MAP[target.type],
|
171308
|
-
|
171309
|
-
target.updatedAt > 0 ? (0,
|
171465
|
+
import_chalk116.default.gray(
|
171466
|
+
target.updatedAt > 0 ? (0, import_ms31.default)(Date.now() - target.updatedAt) : "-"
|
171310
171467
|
)
|
171311
171468
|
]
|
171312
171469
|
];
|
@@ -171352,12 +171509,12 @@ function withDefaultEnvironmentsIncluded(environments) {
|
|
171352
171509
|
...environments.slice().sort((a, b) => a.slug.localeCompare(b.slug))
|
171353
171510
|
];
|
171354
171511
|
}
|
171355
|
-
var
|
171512
|
+
var import_ms31, import_chalk116, TYPE_MAP, BRANCH_TRACKING_MAP;
|
171356
171513
|
var init_list9 = __esm({
|
171357
171514
|
"src/commands/target/list.ts"() {
|
171358
171515
|
"use strict";
|
171359
|
-
|
171360
|
-
|
171516
|
+
import_ms31 = __toESM3(require_ms());
|
171517
|
+
import_chalk116 = __toESM3(require_source());
|
171361
171518
|
init_table();
|
171362
171519
|
init_output_manager();
|
171363
171520
|
init_command27();
|
@@ -171372,8 +171529,8 @@ var init_list9 = __esm({
|
|
171372
171529
|
};
|
171373
171530
|
BRANCH_TRACKING_MAP = {
|
171374
171531
|
production: (project) => project.link?.productionBranch ?? "main",
|
171375
|
-
preview: (_, env) => env.slug === "preview" ?
|
171376
|
-
development: () =>
|
171532
|
+
preview: (_, env) => env.slug === "preview" ? import_chalk116.default.dim("All unassigned git branches") : formatBranchMatcher(env.branchMatcher),
|
171533
|
+
development: () => import_chalk116.default.dim("Accessible via CLI")
|
171377
171534
|
};
|
171378
171535
|
}
|
171379
171536
|
});
|
@@ -171568,7 +171725,7 @@ async function list6(client2, argv) {
|
|
171568
171725
|
client2.stdout.write("\n");
|
171569
171726
|
const teamTable = table(
|
171570
171727
|
[
|
171571
|
-
["id", "email / name"].map((str) => (0,
|
171728
|
+
["id", "email / name"].map((str) => (0, import_chalk117.gray)(str)),
|
171572
171729
|
...teamList.map((team) => [team.value, team.name])
|
171573
171730
|
],
|
171574
171731
|
{ hsep: 5 }
|
@@ -171585,13 +171742,13 @@ async function list6(client2, argv) {
|
|
171585
171742
|
}
|
171586
171743
|
return 0;
|
171587
171744
|
}
|
171588
|
-
var
|
171745
|
+
var import_chalk117;
|
171589
171746
|
var init_list11 = __esm({
|
171590
171747
|
"src/commands/teams/list.ts"() {
|
171591
171748
|
"use strict";
|
171592
171749
|
init_chars();
|
171593
171750
|
init_table();
|
171594
|
-
|
171751
|
+
import_chalk117 = __toESM3(require_source());
|
171595
171752
|
init_get_user();
|
171596
171753
|
init_get_teams();
|
171597
171754
|
init_pkg_name();
|
@@ -171686,7 +171843,7 @@ Please select a team scope using ${getCommandName(
|
|
171686
171843
|
return 1;
|
171687
171844
|
}
|
171688
171845
|
output_manager_default.log(
|
171689
|
-
introMsg || `Inviting team members to ${
|
171846
|
+
introMsg || `Inviting team members to ${import_chalk118.default.bold(currentTeam.name)}`
|
171690
171847
|
);
|
171691
171848
|
telemetry2.trackCliArgumentEmail(emails);
|
171692
171849
|
if (emails.length > 0) {
|
@@ -171706,10 +171863,10 @@ Please select a team scope using ${getCommandName(
|
|
171706
171863
|
throw err;
|
171707
171864
|
}
|
171708
171865
|
output_manager_default.log(
|
171709
|
-
`${
|
171866
|
+
`${import_chalk118.default.cyan(chars_default.tick)} ${email3}${userInfo ? ` (${userInfo})` : ""} ${elapsed2()}`
|
171710
171867
|
);
|
171711
171868
|
} else {
|
171712
|
-
output_manager_default.log(`${
|
171869
|
+
output_manager_default.log(`${import_chalk118.default.red(`\u2716 ${email3}`)} ${import_chalk118.default.gray("[invalid]")}`);
|
171713
171870
|
}
|
171714
171871
|
}
|
171715
171872
|
return 0;
|
@@ -171742,15 +171899,15 @@ Please select a team scope using ${getCommandName(
|
|
171742
171899
|
);
|
171743
171900
|
email2 = `${email2}${username ? ` (${username})` : ""} ${elapsed2()}`;
|
171744
171901
|
emails.push(email2);
|
171745
|
-
output_manager_default.log(`${
|
171902
|
+
output_manager_default.log(`${import_chalk118.default.cyan(chars_default.tick)} ${sentEmailPrefix}${email2}`);
|
171746
171903
|
if (hasError) {
|
171747
171904
|
hasError = false;
|
171748
171905
|
process.stderr.write(eraseLines(emails.length + 2));
|
171749
171906
|
output_manager_default.log(
|
171750
|
-
introMsg || `Inviting team members to ${
|
171907
|
+
introMsg || `Inviting team members to ${import_chalk118.default.bold(currentTeam.name)}`
|
171751
171908
|
);
|
171752
171909
|
for (const email3 of emails) {
|
171753
|
-
output_manager_default.log(`${
|
171910
|
+
output_manager_default.log(`${import_chalk118.default.cyan(chars_default.tick)} ${inviteUserPrefix}${email3}`);
|
171754
171911
|
}
|
171755
171912
|
}
|
171756
171913
|
} catch (err) {
|
@@ -171759,7 +171916,7 @@ Please select a team scope using ${getCommandName(
|
|
171759
171916
|
output_manager_default.error((0, import_error_utils35.errorToString)(err));
|
171760
171917
|
hasError = true;
|
171761
171918
|
for (const email3 of emails) {
|
171762
|
-
output_manager_default.log(`${
|
171919
|
+
output_manager_default.log(`${import_chalk118.default.cyan(chars_default.tick)} ${sentEmailPrefix}${email3}`);
|
171763
171920
|
}
|
171764
171921
|
}
|
171765
171922
|
}
|
@@ -171772,16 +171929,16 @@ Please select a team scope using ${getCommandName(
|
|
171772
171929
|
} else {
|
171773
171930
|
output_manager_default.success(`Invited ${n} teammate${n > 1 ? "s" : ""}`);
|
171774
171931
|
for (const email3 of emails) {
|
171775
|
-
output_manager_default.log(`${
|
171932
|
+
output_manager_default.log(`${import_chalk118.default.cyan(chars_default.tick)} ${inviteUserPrefix}${email3}`);
|
171776
171933
|
}
|
171777
171934
|
}
|
171778
171935
|
return 0;
|
171779
171936
|
}
|
171780
|
-
var
|
171937
|
+
var import_chalk118, import_error_utils35, validateEmail2, domains;
|
171781
171938
|
var init_invite2 = __esm({
|
171782
171939
|
"src/commands/teams/invite.ts"() {
|
171783
171940
|
"use strict";
|
171784
|
-
|
171941
|
+
import_chalk118 = __toESM3(require_source());
|
171785
171942
|
init_cmd();
|
171786
171943
|
init_stamp();
|
171787
171944
|
init_param();
|
@@ -171857,7 +172014,7 @@ async function add7(client2) {
|
|
171857
172014
|
let team;
|
171858
172015
|
let elapsed2;
|
171859
172016
|
output_manager_default.log(
|
171860
|
-
`Pick a team identifier for its URL (e.g.: ${
|
172017
|
+
`Pick a team identifier for its URL (e.g.: ${import_chalk119.default.cyan(
|
171861
172018
|
"`vercel.com/acme`"
|
171862
172019
|
)})`
|
171863
172020
|
);
|
@@ -171888,7 +172045,7 @@ async function add7(client2) {
|
|
171888
172045
|
output_manager_default.stopSpinner();
|
171889
172046
|
process.stdout.write(eraseLines(2));
|
171890
172047
|
output_manager_default.success(`Team created ${elapsed2()}`);
|
171891
|
-
output_manager_default.log(`${
|
172048
|
+
output_manager_default.log(`${import_chalk119.default.cyan(`${chars_default.tick} `) + teamUrlPrefix + slug}
|
171892
172049
|
`);
|
171893
172050
|
output_manager_default.log("Pick a display name for your team");
|
171894
172051
|
let name;
|
@@ -171911,7 +172068,7 @@ async function add7(client2) {
|
|
171911
172068
|
process.stdout.write(eraseLines(2));
|
171912
172069
|
team = Object.assign(team, res);
|
171913
172070
|
output_manager_default.success(`Team name saved ${elapsed2()}`);
|
171914
|
-
output_manager_default.log(`${
|
172071
|
+
output_manager_default.log(`${import_chalk119.default.cyan(`${chars_default.tick} `) + teamNamePrefix + team.name}
|
171915
172072
|
`);
|
171916
172073
|
output_manager_default.spinner("Saving");
|
171917
172074
|
client2.config.currentTeam = team.id;
|
@@ -171925,11 +172082,11 @@ async function add7(client2) {
|
|
171925
172082
|
});
|
171926
172083
|
return 0;
|
171927
172084
|
}
|
171928
|
-
var
|
172085
|
+
var import_chalk119, import_error_utils36, validateSlug, validateName, teamUrlPrefix, teamNamePrefix;
|
171929
172086
|
var init_add13 = __esm({
|
171930
172087
|
"src/commands/teams/add.ts"() {
|
171931
172088
|
"use strict";
|
171932
|
-
|
172089
|
+
import_chalk119 = __toESM3(require_source());
|
171933
172090
|
init_stamp();
|
171934
172091
|
init_erase_lines();
|
171935
172092
|
init_chars();
|
@@ -171942,7 +172099,7 @@ var init_add13 = __esm({
|
|
171942
172099
|
init_output_manager();
|
171943
172100
|
validateSlug = (value) => /^[a-z]+[a-z0-9_-]*$/.test(value);
|
171944
172101
|
validateName = (value) => /^[ a-zA-Z0-9_-]+$/.test(value);
|
171945
|
-
teamUrlPrefix = "Team URL".padEnd(14) +
|
172102
|
+
teamUrlPrefix = "Team URL".padEnd(14) + import_chalk119.default.gray("vercel.com/");
|
171946
172103
|
teamNamePrefix = "Team Name".padEnd(14);
|
171947
172104
|
}
|
171948
172105
|
});
|
@@ -172001,7 +172158,7 @@ async function change(client2, argv) {
|
|
172001
172158
|
let title9 = `${team.name} (${team.slug})`;
|
172002
172159
|
const selected = team.id === currentTeam?.id;
|
172003
172160
|
if (selected) {
|
172004
|
-
title9 += ` ${
|
172161
|
+
title9 += ` ${import_chalk120.default.bold("(current)")}`;
|
172005
172162
|
}
|
172006
172163
|
if (team.limited) {
|
172007
172164
|
title9 += ` ${emoji("locked")}`;
|
@@ -172013,7 +172170,7 @@ async function change(client2, argv) {
|
|
172013
172170
|
selected
|
172014
172171
|
};
|
172015
172172
|
});
|
172016
|
-
let suffix = personalScopeSelected ? ` ${
|
172173
|
+
let suffix = personalScopeSelected ? ` ${import_chalk120.default.bold("(current)")}` : "";
|
172017
172174
|
if (user.limited) {
|
172018
172175
|
suffix += ` ${emoji("locked")}`;
|
172019
172176
|
}
|
@@ -172059,14 +172216,14 @@ async function change(client2, argv) {
|
|
172059
172216
|
}
|
172060
172217
|
updateCurrentTeam(config2);
|
172061
172218
|
output_manager_default.success(
|
172062
|
-
`Your account (${
|
172219
|
+
`Your account (${import_chalk120.default.bold(user.username)}) is now active!`
|
172063
172220
|
);
|
172064
172221
|
return 0;
|
172065
172222
|
}
|
172066
172223
|
const newTeam = teams2.find((team) => team.slug === desiredSlug);
|
172067
172224
|
if (!newTeam) {
|
172068
172225
|
output_manager_default.error(
|
172069
|
-
`You do not have permission to access scope ${
|
172226
|
+
`You do not have permission to access scope ${import_chalk120.default.bold(desiredSlug)}.`
|
172070
172227
|
);
|
172071
172228
|
return 1;
|
172072
172229
|
}
|
@@ -172084,15 +172241,15 @@ async function change(client2, argv) {
|
|
172084
172241
|
}
|
172085
172242
|
updateCurrentTeam(config2, newTeam);
|
172086
172243
|
output_manager_default.success(
|
172087
|
-
`The team ${
|
172244
|
+
`The team ${import_chalk120.default.bold(newTeam.name)} (${newTeam.slug}) is now active!`
|
172088
172245
|
);
|
172089
172246
|
return 0;
|
172090
172247
|
}
|
172091
|
-
var
|
172248
|
+
var import_chalk120, updateCurrentTeam;
|
172092
172249
|
var init_switch2 = __esm({
|
172093
172250
|
"src/commands/teams/switch.ts"() {
|
172094
172251
|
"use strict";
|
172095
|
-
|
172252
|
+
import_chalk120 = __toESM3(require_source());
|
172096
172253
|
init_emoji();
|
172097
172254
|
init_get_user();
|
172098
172255
|
init_get_teams();
|
@@ -172271,13 +172428,13 @@ var init_teams2 = __esm({
|
|
172271
172428
|
// src/commands/telemetry/status.ts
|
172272
172429
|
async function status(client2) {
|
172273
172430
|
const enabled = client2.config.telemetry?.enabled !== false;
|
172274
|
-
const status2 = enabled ?
|
172431
|
+
const status2 = enabled ? import_chalk121.default.green("Enabled") : import_chalk121.default.red("Disabled");
|
172275
172432
|
output_manager_default.print("\n");
|
172276
|
-
output_manager_default.log(`${
|
172433
|
+
output_manager_default.log(`${import_chalk121.default.bold("Telemetry status")}: ${status2}
|
172277
172434
|
`);
|
172278
172435
|
const learnMoreMessage = `
|
172279
172436
|
|
172280
|
-
Learn more: ${
|
172437
|
+
Learn more: ${import_chalk121.default.cyan("https://vercel.com/docs/cli/about-telemetry")}`;
|
172281
172438
|
if (enabled) {
|
172282
172439
|
output_manager_default.log(`You have opted in to Vercel CLI telemetry${learnMoreMessage}`);
|
172283
172440
|
} else {
|
@@ -172288,11 +172445,11 @@ Learn more: ${import_chalk120.default.cyan("https://vercel.com/docs/cli/about-te
|
|
172288
172445
|
}
|
172289
172446
|
return 0;
|
172290
172447
|
}
|
172291
|
-
var
|
172448
|
+
var import_chalk121;
|
172292
172449
|
var init_status3 = __esm({
|
172293
172450
|
"src/commands/telemetry/status.ts"() {
|
172294
172451
|
"use strict";
|
172295
|
-
|
172452
|
+
import_chalk121 = __toESM3(require_source());
|
172296
172453
|
init_output_manager();
|
172297
172454
|
}
|
172298
172455
|
});
|
@@ -172473,7 +172630,7 @@ async function telemetry(client2) {
|
|
172473
172630
|
default: {
|
172474
172631
|
const errorMessage = parsedArguments.args.length !== 2 ? "Invalid number of arguments" : "Invalid subcommand";
|
172475
172632
|
output_manager_default.print(
|
172476
|
-
`${
|
172633
|
+
`${import_chalk122.default.red("Error")}: ${errorMessage}. See help instructions for usage:
|
172477
172634
|
`
|
172478
172635
|
);
|
172479
172636
|
output_manager_default.print(help2(telemetryCommand, { columns: client2.stderr.columns }));
|
@@ -172481,7 +172638,7 @@ async function telemetry(client2) {
|
|
172481
172638
|
}
|
172482
172639
|
}
|
172483
172640
|
}
|
172484
|
-
var
|
172641
|
+
var import_chalk122, COMMAND_CONFIG14;
|
172485
172642
|
var init_telemetry3 = __esm({
|
172486
172643
|
"src/commands/telemetry/index.ts"() {
|
172487
172644
|
"use strict";
|
@@ -172496,7 +172653,7 @@ var init_telemetry3 = __esm({
|
|
172496
172653
|
init_command29();
|
172497
172654
|
init_get_flags_specification();
|
172498
172655
|
init_telemetry2();
|
172499
|
-
|
172656
|
+
import_chalk122 = __toESM3(require_source());
|
172500
172657
|
init_output_manager();
|
172501
172658
|
init_commands();
|
172502
172659
|
COMMAND_CONFIG14 = {
|
@@ -172571,7 +172728,7 @@ var import_error_utils37 = __toESM3(require_dist2());
|
|
172571
172728
|
var import_path40 = require("path");
|
172572
172729
|
var import_fs8 = require("fs");
|
172573
172730
|
var import_fs_extra23 = __toESM3(require_lib());
|
172574
|
-
var
|
172731
|
+
var import_chalk123 = __toESM3(require_source());
|
172575
172732
|
var import_epipebomb = __toESM3(require_epipebomb());
|
172576
172733
|
|
172577
172734
|
// src/util/get-latest-version/index.ts
|
@@ -173443,13 +173600,13 @@ var main13 = async () => {
|
|
173443
173600
|
const betaCommands = [];
|
173444
173601
|
if (betaCommands.includes(targetOrSubcommand)) {
|
173445
173602
|
output_manager_default.print(
|
173446
|
-
`${
|
173603
|
+
`${import_chalk123.default.grey(
|
173447
173604
|
`${getTitleName()} CLI ${pkg_default.version} ${targetOrSubcommand} (beta) \u2014 https://vercel.com/feedback`
|
173448
173605
|
)}
|
173449
173606
|
`
|
173450
173607
|
);
|
173451
173608
|
} else {
|
173452
|
-
output_manager_default.print(`${
|
173609
|
+
output_manager_default.print(`${import_chalk123.default.grey(`${getTitleName()} CLI ${pkg_default.version}`)}
|
173453
173610
|
`);
|
173454
173611
|
}
|
173455
173612
|
if (!targetOrSubcommand && parsedArgs.flags["--version"]) {
|
@@ -173978,20 +174135,20 @@ main13().then(async (exitCode2) => {
|
|
173978
174135
|
});
|
173979
174136
|
if (latest) {
|
173980
174137
|
const changelog = "https://github.com/vercel/vercel/releases";
|
173981
|
-
const errorMsg = exitCode2 && exitCode2 !== 2 ?
|
174138
|
+
const errorMsg = exitCode2 && exitCode2 !== 2 ? import_chalk123.default.magenta(
|
173982
174139
|
`
|
173983
174140
|
|
173984
|
-
The latest update ${
|
174141
|
+
The latest update ${import_chalk123.default.italic(
|
173985
174142
|
"may"
|
173986
174143
|
)} fix any errors that occurred.`
|
173987
174144
|
) : "";
|
173988
174145
|
output_manager_default.print(
|
173989
174146
|
box(
|
173990
|
-
`Update available! ${
|
174147
|
+
`Update available! ${import_chalk123.default.gray(`v${pkg_default.version}`)} \u226B ${import_chalk123.default.green(
|
173991
174148
|
`v${latest}`
|
173992
174149
|
)}
|
173993
174150
|
Changelog: ${output_manager_default.link(changelog, changelog, { fallback: false })}
|
173994
|
-
Run ${
|
174151
|
+
Run ${import_chalk123.default.cyan(cmd(await getUpdateCommand()))} to update.${errorMsg}`
|
173995
174152
|
)
|
173996
174153
|
);
|
173997
174154
|
output_manager_default.print("\n\n");
|