vercel 50.0.1 → 50.1.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.
Files changed (2) hide show
  1. package/dist/index.js +806 -290
  2. package/package.json +12 -11
package/dist/index.js CHANGED
@@ -1338,8 +1338,8 @@ var require_copy_sync = __commonJS2({
1338
1338
  return getStats(destStat, src, dest, opts);
1339
1339
  }
1340
1340
  function getStats(destStat, src, dest, opts) {
1341
- const statSync2 = opts.dereference ? fs15.statSync : fs15.lstatSync;
1342
- const srcStat = statSync2(src);
1341
+ const statSync3 = opts.dereference ? fs15.statSync : fs15.lstatSync;
1342
+ const srcStat = statSync3(src);
1343
1343
  if (srcStat.isDirectory())
1344
1344
  return onDir(srcStat, destStat, src, dest, opts);
1345
1345
  else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())
@@ -2430,7 +2430,7 @@ var require_jsonfile = __commonJS2({
2430
2430
  return obj;
2431
2431
  }
2432
2432
  var readFile6 = universalify.fromPromise(_readFile);
2433
- function readFileSync3(file, options = {}) {
2433
+ function readFileSync4(file, options = {}) {
2434
2434
  if (typeof options === "string") {
2435
2435
  options = { encoding: options };
2436
2436
  }
@@ -2462,7 +2462,7 @@ var require_jsonfile = __commonJS2({
2462
2462
  }
2463
2463
  var jsonfile = {
2464
2464
  readFile: readFile6,
2465
- readFileSync: readFileSync3,
2465
+ readFileSync: readFileSync4,
2466
2466
  writeFile: writeFile5,
2467
2467
  writeFileSync
2468
2468
  };
@@ -4071,14 +4071,14 @@ var require_templates = __commonJS2({
4071
4071
  }
4072
4072
  return results;
4073
4073
  }
4074
- function buildStyle(chalk137, styles) {
4074
+ function buildStyle(chalk138, 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 = chalk137;
4081
+ let current = chalk138;
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 = (chalk137, temporary) => {
4093
+ module2.exports = (chalk138, 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(chalk137, styles)(string));
4103
+ chunks.push(styles.length === 0 ? string : buildStyle(chalk138, 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(chalk137, styles)(chunk.join("")));
4109
+ chunks.push(buildStyle(chalk138, 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 chalk138 = {};
4158
- applyOptions(chalk138, options);
4159
- chalk138.template = (...arguments_) => chalkTag(chalk138.template, ...arguments_);
4160
- Object.setPrototypeOf(chalk138, Chalk.prototype);
4161
- Object.setPrototypeOf(chalk138.template, chalk138);
4162
- chalk138.template.constructor = () => {
4157
+ const chalk139 = {};
4158
+ applyOptions(chalk139, options);
4159
+ chalk139.template = (...arguments_) => chalkTag(chalk139.template, ...arguments_);
4160
+ Object.setPrototypeOf(chalk139, Chalk.prototype);
4161
+ Object.setPrototypeOf(chalk139.template, chalk139);
4162
+ chalk139.template.constructor = () => {
4163
4163
  throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
4164
4164
  };
4165
- chalk138.template.Instance = ChalkClass;
4166
- return chalk138.template;
4165
+ chalk139.template.Instance = ChalkClass;
4166
+ return chalk139.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 = (chalk138, ...strings) => {
4277
+ var chalkTag = (chalk139, ...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(chalk138, parts.join(""));
4293
+ return template(chalk139, parts.join(""));
4294
4294
  };
4295
4295
  Object.defineProperties(Chalk.prototype, styles);
4296
- var chalk137 = Chalk();
4297
- chalk137.supportsColor = stdoutColor;
4298
- chalk137.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
4299
- chalk137.stderr.supportsColor = stderrColor;
4300
- module2.exports = chalk137;
4296
+ var chalk138 = Chalk();
4297
+ chalk138.supportsColor = stdoutColor;
4298
+ chalk138.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
4299
+ chalk138.stderr.supportsColor = stderrColor;
4300
+ module2.exports = chalk138;
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(chalk137, styles) {
7211
+ function buildStyle(chalk138, 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 = chalk137;
7218
+ let current = chalk138;
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 = (chalk137, tmp) => {
7233
+ module2.exports = (chalk138, 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(chalk137, styles)(str));
7243
+ chunks.push(styles.length === 0 ? str : buildStyle(chalk138, 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(chalk137, styles)(chunk.join("")));
7249
+ chunks.push(buildStyle(chalk138, 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 chalk137 = {};
7287
- applyOptions(chalk137, options);
7288
- chalk137.template = function() {
7286
+ const chalk138 = {};
7287
+ applyOptions(chalk138, options);
7288
+ chalk138.template = function() {
7289
7289
  const args2 = [].slice.call(arguments);
7290
- return chalkTag.apply(null, [chalk137.template].concat(args2));
7290
+ return chalkTag.apply(null, [chalk138.template].concat(args2));
7291
7291
  };
7292
- Object.setPrototypeOf(chalk137, Chalk.prototype);
7293
- Object.setPrototypeOf(chalk137.template, chalk137);
7294
- chalk137.template.constructor = Chalk;
7295
- return chalk137.template;
7292
+ Object.setPrototypeOf(chalk138, Chalk.prototype);
7293
+ Object.setPrototypeOf(chalk138.template, chalk138);
7294
+ chalk138.template.constructor = Chalk;
7295
+ return chalk138.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(chalk137, strings) {
7414
+ function chalkTag(chalk138, 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(chalk137, parts.join(""));
7424
+ return template(chalk138, 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 chalk137 = require_chalk();
9375
+ var chalk138 = require_chalk();
9376
9376
  var isSupported = process.platform !== "win32" || process.env.CI || process.env.TERM === "xterm-256color";
9377
9377
  var main19 = {
9378
- info: chalk137.blue("\u2139"),
9379
- success: chalk137.green("\u2714"),
9380
- warning: chalk137.yellow("\u26A0"),
9381
- error: chalk137.red("\u2716")
9378
+ info: chalk138.blue("\u2139"),
9379
+ success: chalk138.green("\u2714"),
9380
+ warning: chalk138.yellow("\u26A0"),
9381
+ error: chalk138.red("\u2716")
9382
9382
  };
9383
9383
  var fallbacks = {
9384
- info: chalk137.blue("i"),
9385
- success: chalk137.green("\u221A"),
9386
- warning: chalk137.yellow("\u203C"),
9387
- error: chalk137.red("\xD7")
9384
+ info: chalk138.blue("i"),
9385
+ success: chalk138.green("\u221A"),
9386
+ warning: chalk138.yellow("\u203C"),
9387
+ error: chalk138.red("\xD7")
9388
9388
  };
9389
9389
  module2.exports = isSupported ? main19 : 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 chalk137 = require_chalk();
9783
+ var chalk138 = 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 = chalk137[this.color](frame);
9872
+ frame = chalk138[this.color](frame);
9873
9873
  }
9874
9874
  this.frameIndex = ++this.frameIndex % frames.length;
9875
9875
  const fullPrefixText = typeof this.prefixText === "string" ? this.prefixText + " " : "";
@@ -12438,14 +12438,14 @@ var require_path = __commonJS2({
12438
12438
  }
12439
12439
  return root + dir;
12440
12440
  }
12441
- function basename10(path11, ext) {
12441
+ function basename11(path11, ext) {
12442
12442
  let f = splitPath(path11)[2];
12443
12443
  if (ext && f.slice(ext.length * -1) === ext) {
12444
12444
  f = f.slice(0, f.length - ext.length);
12445
12445
  }
12446
12446
  return f;
12447
12447
  }
12448
- exports2.basename = basename10;
12448
+ exports2.basename = basename11;
12449
12449
  exports2.dirname = dirname9;
12450
12450
  exports2.isAbsolute = isAbsolute2;
12451
12451
  exports2.join = join25;
@@ -31221,11 +31221,11 @@ var require_dist3 = __commonJS2({
31221
31221
  getPackageJSON: () => getPackageJSON2
31222
31222
  });
31223
31223
  module2.exports = __toCommonJS4(src_exports2);
31224
- var import_fs9 = __toESM4(require("fs"));
31225
- var import_path42 = __toESM4(require("path"));
31224
+ var import_fs11 = __toESM4(require("fs"));
31225
+ var import_path43 = __toESM4(require("path"));
31226
31226
  var cache = /* @__PURE__ */ new Map();
31227
31227
  function getPackageJSONPath(dir) {
31228
- return import_path42.default.join(dir, "package.json");
31228
+ return import_path43.default.join(dir, "package.json");
31229
31229
  }
31230
31230
  function captureCallerCallSite() {
31231
31231
  const _prepareStackTrace = Error.prepareStackTrace;
@@ -31242,15 +31242,15 @@ var require_dist3 = __commonJS2({
31242
31242
  function getPackageJSON2() {
31243
31243
  const callSite = captureCallerCallSite();
31244
31244
  const filePath = callSite.getFileName() || callSite.getEvalOrigin();
31245
- let rootDir = import_path42.default.dirname(filePath);
31245
+ let rootDir = import_path43.default.dirname(filePath);
31246
31246
  let packageJSONPath = getPackageJSONPath(rootDir);
31247
- while (!import_fs9.default.existsSync(packageJSONPath)) {
31248
- rootDir = import_path42.default.join(rootDir, "..");
31247
+ while (!import_fs11.default.existsSync(packageJSONPath)) {
31248
+ rootDir = import_path43.default.join(rootDir, "..");
31249
31249
  packageJSONPath = getPackageJSONPath(rootDir);
31250
31250
  }
31251
31251
  let packageJSON = cache.get(packageJSONPath);
31252
31252
  if (!packageJSON) {
31253
- packageJSON = JSON.parse(import_fs9.default.readFileSync(packageJSONPath, "utf-8"));
31253
+ packageJSON = JSON.parse(import_fs11.default.readFileSync(packageJSONPath, "utf-8"));
31254
31254
  cache.set(packageJSONPath, packageJSON);
31255
31255
  }
31256
31256
  return packageJSON;
@@ -34137,7 +34137,7 @@ var init_command31 = __esm({
34137
34137
  });
34138
34138
 
34139
34139
  // src/commands/redirects/command.ts
34140
- var listSubcommand8, listVersionsSubcommand, addSubcommand7, removeSubcommand9, promoteSubcommand, restoreSubcommand, redirectsCommand;
34140
+ var listSubcommand8, listVersionsSubcommand, addSubcommand7, uploadSubcommand, removeSubcommand9, promoteSubcommand, restoreSubcommand, redirectsCommand;
34141
34141
  var init_command32 = __esm({
34142
34142
  "src/commands/redirects/command.ts"() {
34143
34143
  "use strict";
@@ -34290,6 +34290,48 @@ var init_command32 = __esm({
34290
34290
  }
34291
34291
  ]
34292
34292
  };
34293
+ uploadSubcommand = {
34294
+ name: "upload",
34295
+ aliases: ["import"],
34296
+ description: "Upload redirects from a CSV or JSON file",
34297
+ arguments: [
34298
+ {
34299
+ name: "file",
34300
+ required: true
34301
+ }
34302
+ ],
34303
+ options: [
34304
+ {
34305
+ ...yesOption,
34306
+ description: "Skip confirmation prompt"
34307
+ },
34308
+ {
34309
+ name: "overwrite",
34310
+ description: "Replace all existing redirects",
34311
+ shorthand: null,
34312
+ type: Boolean,
34313
+ deprecated: false
34314
+ }
34315
+ ],
34316
+ examples: [
34317
+ {
34318
+ name: "Upload redirects from CSV file",
34319
+ value: `${packageName} redirects upload redirects.csv`
34320
+ },
34321
+ {
34322
+ name: "Upload redirects from JSON file",
34323
+ value: `${packageName} redirects upload redirects.json`
34324
+ },
34325
+ {
34326
+ name: "Upload and overwrite existing redirects",
34327
+ value: `${packageName} redirects upload redirects.csv --overwrite`
34328
+ },
34329
+ {
34330
+ name: "Upload without confirmation",
34331
+ value: `${packageName} redirects upload redirects.csv --yes`
34332
+ }
34333
+ ]
34334
+ };
34293
34335
  removeSubcommand9 = {
34294
34336
  name: "remove",
34295
34337
  aliases: ["rm"],
@@ -34368,6 +34410,7 @@ var init_command32 = __esm({
34368
34410
  listSubcommand8,
34369
34411
  listVersionsSubcommand,
34370
34412
  addSubcommand7,
34413
+ uploadSubcommand,
34371
34414
  removeSubcommand9,
34372
34415
  promoteSubcommand,
34373
34416
  restoreSubcommand
@@ -36520,14 +36563,14 @@ var require_templates3 = __commonJS2({
36520
36563
  }
36521
36564
  return results;
36522
36565
  }
36523
- function buildStyle(chalk137, styles) {
36566
+ function buildStyle(chalk138, styles) {
36524
36567
  const enabled = {};
36525
36568
  for (const layer of styles) {
36526
36569
  for (const style of layer.styles) {
36527
36570
  enabled[style[0]] = layer.inverse ? null : style.slice(1);
36528
36571
  }
36529
36572
  }
36530
- let current = chalk137;
36573
+ let current = chalk138;
36531
36574
  for (const [styleName, styles2] of Object.entries(enabled)) {
36532
36575
  if (!Array.isArray(styles2)) {
36533
36576
  continue;
@@ -36539,7 +36582,7 @@ var require_templates3 = __commonJS2({
36539
36582
  }
36540
36583
  return current;
36541
36584
  }
36542
- module2.exports = (chalk137, temporary) => {
36585
+ module2.exports = (chalk138, temporary) => {
36543
36586
  const styles = [];
36544
36587
  const chunks = [];
36545
36588
  let chunk = [];
@@ -36549,13 +36592,13 @@ var require_templates3 = __commonJS2({
36549
36592
  } else if (style) {
36550
36593
  const string = chunk.join("");
36551
36594
  chunk = [];
36552
- chunks.push(styles.length === 0 ? string : buildStyle(chalk137, styles)(string));
36595
+ chunks.push(styles.length === 0 ? string : buildStyle(chalk138, styles)(string));
36553
36596
  styles.push({ inverse, styles: parseStyle(style) });
36554
36597
  } else if (close2) {
36555
36598
  if (styles.length === 0) {
36556
36599
  throw new Error("Found extraneous } in Chalk template literal");
36557
36600
  }
36558
- chunks.push(buildStyle(chalk137, styles)(chunk.join("")));
36601
+ chunks.push(buildStyle(chalk138, styles)(chunk.join("")));
36559
36602
  chunk = [];
36560
36603
  styles.pop();
36561
36604
  } else {
@@ -36603,16 +36646,16 @@ var require_source2 = __commonJS2({
36603
36646
  }
36604
36647
  };
36605
36648
  var chalkFactory = (options) => {
36606
- const chalk138 = {};
36607
- applyOptions(chalk138, options);
36608
- chalk138.template = (...arguments_) => chalkTag(chalk138.template, ...arguments_);
36609
- Object.setPrototypeOf(chalk138, Chalk.prototype);
36610
- Object.setPrototypeOf(chalk138.template, chalk138);
36611
- chalk138.template.constructor = () => {
36649
+ const chalk139 = {};
36650
+ applyOptions(chalk139, options);
36651
+ chalk139.template = (...arguments_) => chalkTag(chalk139.template, ...arguments_);
36652
+ Object.setPrototypeOf(chalk139, Chalk.prototype);
36653
+ Object.setPrototypeOf(chalk139.template, chalk139);
36654
+ chalk139.template.constructor = () => {
36612
36655
  throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
36613
36656
  };
36614
- chalk138.template.Instance = ChalkClass;
36615
- return chalk138.template;
36657
+ chalk139.template.Instance = ChalkClass;
36658
+ return chalk139.template;
36616
36659
  };
36617
36660
  function Chalk(options) {
36618
36661
  return chalkFactory(options);
@@ -36723,7 +36766,7 @@ var require_source2 = __commonJS2({
36723
36766
  return openAll + string + closeAll;
36724
36767
  };
36725
36768
  var template;
36726
- var chalkTag = (chalk138, ...strings) => {
36769
+ var chalkTag = (chalk139, ...strings) => {
36727
36770
  const [firstString] = strings;
36728
36771
  if (!isArray(firstString) || !isArray(firstString.raw)) {
36729
36772
  return strings.join(" ");
@@ -36739,14 +36782,14 @@ var require_source2 = __commonJS2({
36739
36782
  if (template === void 0) {
36740
36783
  template = require_templates3();
36741
36784
  }
36742
- return template(chalk138, parts.join(""));
36785
+ return template(chalk139, parts.join(""));
36743
36786
  };
36744
36787
  Object.defineProperties(Chalk.prototype, styles);
36745
- var chalk137 = Chalk();
36746
- chalk137.supportsColor = stdoutColor;
36747
- chalk137.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
36748
- chalk137.stderr.supportsColor = stderrColor;
36749
- module2.exports = chalk137;
36788
+ var chalk138 = Chalk();
36789
+ chalk138.supportsColor = stdoutColor;
36790
+ chalk138.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
36791
+ chalk138.stderr.supportsColor = stderrColor;
36792
+ module2.exports = chalk138;
36750
36793
  }
36751
36794
  });
36752
36795
 
@@ -47828,8 +47871,8 @@ var require_copy_sync3 = __commonJS2({
47828
47871
  return getStats(destStat, src, dest, opts);
47829
47872
  }
47830
47873
  function getStats(destStat, src, dest, opts) {
47831
- const statSync2 = opts.dereference ? fs15.statSync : fs15.lstatSync;
47832
- const srcStat = statSync2(src);
47874
+ const statSync3 = opts.dereference ? fs15.statSync : fs15.lstatSync;
47875
+ const srcStat = statSync3(src);
47833
47876
  if (srcStat.isDirectory())
47834
47877
  return onDir(srcStat, destStat, src, dest, opts);
47835
47878
  else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())
@@ -48871,7 +48914,7 @@ var require_jsonfile3 = __commonJS2({
48871
48914
  callback(null, obj);
48872
48915
  });
48873
48916
  }
48874
- function readFileSync3(file, options) {
48917
+ function readFileSync4(file, options) {
48875
48918
  options = options || {};
48876
48919
  if (typeof options === "string") {
48877
48920
  options = { encoding: options };
@@ -48939,7 +48982,7 @@ var require_jsonfile3 = __commonJS2({
48939
48982
  }
48940
48983
  var jsonfile = {
48941
48984
  readFile: readFile6,
48942
- readFileSync: readFileSync3,
48985
+ readFileSync: readFileSync4,
48943
48986
  writeFile: writeFile5,
48944
48987
  writeFileSync
48945
48988
  };
@@ -50057,7 +50100,7 @@ var require_package = __commonJS2({
50057
50100
  "../client/package.json"(exports2, module2) {
50058
50101
  module2.exports = {
50059
50102
  name: "@vercel/client",
50060
- version: "17.2.16",
50103
+ version: "17.2.17",
50061
50104
  main: "dist/index.js",
50062
50105
  typings: "dist/index.d.ts",
50063
50106
  homepage: "https://vercel.com",
@@ -50944,8 +50987,8 @@ var require_readdir_recursive = __commonJS2({
50944
50987
  default: () => readdir2
50945
50988
  });
50946
50989
  module2.exports = __toCommonJS4(readdir_recursive_exports);
50947
- var import_fs9 = __toESM4(require("fs"));
50948
- var import_path42 = __toESM4(require("path"));
50990
+ var import_fs11 = __toESM4(require("fs"));
50991
+ var import_path43 = __toESM4(require("path"));
50949
50992
  var import_minimatch5 = __toESM4(require_minimatch());
50950
50993
  function patternMatcher(pattern) {
50951
50994
  return function(path11, stats) {
@@ -50964,7 +51007,7 @@ var require_readdir_recursive = __commonJS2({
50964
51007
  ignores = ignores.map(toMatcherFunction);
50965
51008
  let list10 = [];
50966
51009
  return new Promise(function(resolve13, reject) {
50967
- import_fs9.default.readdir(path11, function(err, files) {
51010
+ import_fs11.default.readdir(path11, function(err, files) {
50968
51011
  if (err) {
50969
51012
  return reject(err);
50970
51013
  }
@@ -50973,8 +51016,8 @@ var require_readdir_recursive = __commonJS2({
50973
51016
  return resolve13(list10);
50974
51017
  }
50975
51018
  files.forEach(function(file) {
50976
- const filePath = import_path42.default.join(path11, file);
50977
- import_fs9.default.lstat(filePath, function(_err, stats) {
51019
+ const filePath = import_path43.default.join(path11, file);
51020
+ import_fs11.default.lstat(filePath, function(_err, stats) {
50978
51021
  if (_err) {
50979
51022
  return reject(_err);
50980
51023
  }
@@ -55871,8 +55914,8 @@ var require_pattern = __commonJS2({
55871
55914
  }
55872
55915
  exports2.endsWithSlashGlobStar = endsWithSlashGlobStar;
55873
55916
  function isAffectDepthOfReadingPattern(pattern) {
55874
- const basename10 = path11.basename(pattern);
55875
- return endsWithSlashGlobStar(pattern) || isStaticPattern(basename10);
55917
+ const basename11 = path11.basename(pattern);
55918
+ return endsWithSlashGlobStar(pattern) || isStaticPattern(basename11);
55876
55919
  }
55877
55920
  exports2.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
55878
55921
  function expandPatternsWithBraceExpansion(patterns) {
@@ -56346,11 +56389,11 @@ var require_out = __commonJS2({
56346
56389
  async.read(path11, getSettings(optionsOrSettingsOrCallback), callback);
56347
56390
  }
56348
56391
  exports2.stat = stat2;
56349
- function statSync2(path11, optionsOrSettings) {
56392
+ function statSync3(path11, optionsOrSettings) {
56350
56393
  const settings = getSettings(optionsOrSettings);
56351
56394
  return sync.read(path11, settings);
56352
56395
  }
56353
- exports2.statSync = statSync2;
56396
+ exports2.statSync = statSync3;
56354
56397
  function getSettings(settingsOrOptions = {}) {
56355
56398
  if (settingsOrOptions instanceof settings_1.default) {
56356
56399
  return settingsOrOptions;
@@ -58483,7 +58526,7 @@ var require_utils14 = __commonJS2({
58483
58526
  });
58484
58527
  module2.exports = __toCommonJS4(utils_exports);
58485
58528
  var import_node_fetch7 = __toESM4(require_lib7());
58486
- var import_path42 = require("path");
58529
+ var import_path43 = require("path");
58487
58530
  var import_url20 = require("url");
58488
58531
  var import_ignore = __toESM4(require_ignore());
58489
58532
  var import_pkg5 = require_pkg();
@@ -58556,7 +58599,7 @@ var require_utils14 = __commonJS2({
58556
58599
  debug2("Building file tree...");
58557
58600
  if (isDirectory2 && !Array.isArray(path11)) {
58558
58601
  const ignores2 = (absPath) => {
58559
- const rel = (0, import_path42.relative)(path11, absPath);
58602
+ const rel = (0, import_path43.relative)(path11, absPath);
58560
58603
  const ignored = ig.ignores(rel);
58561
58604
  if (ignored) {
58562
58605
  ignoreList.push(rel);
@@ -58567,7 +58610,7 @@ var require_utils14 = __commonJS2({
58567
58610
  const refs = /* @__PURE__ */ new Set();
58568
58611
  if (prebuilt) {
58569
58612
  const vcConfigFilePaths = fileList.filter(
58570
- (file) => (0, import_path42.basename)(file) === ".vc-config.json"
58613
+ (file) => (0, import_path43.basename)(file) === ".vc-config.json"
58571
58614
  );
58572
58615
  await Promise.all(
58573
58616
  vcConfigFilePaths.map(async (p) => {
@@ -58576,13 +58619,13 @@ var require_utils14 = __commonJS2({
58576
58619
  if (!config2.filePathMap)
58577
58620
  return;
58578
58621
  for (const v of Object.values(config2.filePathMap)) {
58579
- refs.add((0, import_path42.join)(path11, v));
58622
+ refs.add((0, import_path43.join)(path11, v));
58580
58623
  }
58581
58624
  })
58582
58625
  );
58583
58626
  try {
58584
58627
  let microfrontendConfigPath = (0, import_utils6.findConfig)({
58585
- dir: (0, import_path42.join)(path11, rootDirectory || "")
58628
+ dir: (0, import_path43.join)(path11, rootDirectory || "")
58586
58629
  });
58587
58630
  if (!microfrontendConfigPath && !rootDirectory && projectName) {
58588
58631
  microfrontendConfigPath = (0, import_utils6.findConfig)({
@@ -58600,7 +58643,7 @@ var require_utils14 = __commonJS2({
58600
58643
  }
58601
58644
  }
58602
58645
  try {
58603
- const routesJsonPath = (0, import_path42.join)(path11, ".vercel", "routes.json");
58646
+ const routesJsonPath = (0, import_path43.join)(path11, ".vercel", "routes.json");
58604
58647
  const routesJsonContent = await maybeRead(routesJsonPath, null);
58605
58648
  if (routesJsonContent !== null) {
58606
58649
  refs.add(routesJsonPath);
@@ -58634,9 +58677,9 @@ var require_utils14 = __commonJS2({
58634
58677
  if (typeof cwd !== "string") {
58635
58678
  throw new Error(`\`cwd\` must be a "string"`);
58636
58679
  }
58637
- const relOutputDir = (0, import_path42.relative)(cwd, vercelOutputDir);
58680
+ const relOutputDir = (0, import_path43.relative)(cwd, vercelOutputDir);
58638
58681
  ignores = ["*"];
58639
- const parts = relOutputDir.split(import_path42.sep);
58682
+ const parts = relOutputDir.split(import_path43.sep);
58640
58683
  parts.forEach((_, i) => {
58641
58684
  const level = parts.slice(0, i + 1).join("/");
58642
58685
  ignores.push(`!${level}`);
@@ -58676,8 +58719,8 @@ var require_utils14 = __commonJS2({
58676
58719
  const files = await Promise.all(
58677
58720
  cwds.map(async (cwd2) => {
58678
58721
  const [vercelignore, nowignore] = await Promise.all([
58679
- maybeRead((0, import_path42.join)(cwd2, ".vercelignore"), ""),
58680
- maybeRead((0, import_path42.join)(cwd2, ".nowignore"), "")
58722
+ maybeRead((0, import_path43.join)(cwd2, ".vercelignore"), ""),
58723
+ maybeRead((0, import_path43.join)(cwd2, ".nowignore"), "")
58681
58724
  ]);
58682
58725
  if (vercelignore && nowignore) {
58683
58726
  throw new import_build_utils19.NowBuildError({
@@ -58736,9 +58779,9 @@ ${clearRelative(ignoreFile)}`);
58736
58779
  for (const name of file.names) {
58737
58780
  let fileName;
58738
58781
  if (clientOptions.isDirectory) {
58739
- fileName = typeof clientOptions.path === "string" ? (0, import_path42.relative)(clientOptions.path, name) : name;
58782
+ fileName = typeof clientOptions.path === "string" ? (0, import_path43.relative)(clientOptions.path, name) : name;
58740
58783
  } else {
58741
- const segments = name.split(import_path42.sep);
58784
+ const segments = name.split(import_path43.sep);
58742
58785
  fileName = segments[segments.length - 1];
58743
58786
  }
58744
58787
  preparedFiles.push({
@@ -59488,7 +59531,7 @@ var require_upload = __commonJS2({
59488
59531
  var __toCommonJS4 = (mod) => __copyProps4(__defProp4({}, "__esModule", { value: true }), mod);
59489
59532
  var upload_exports = {};
59490
59533
  __export4(upload_exports, {
59491
- upload: () => upload
59534
+ upload: () => upload2
59492
59535
  });
59493
59536
  module2.exports = __toCommonJS4(upload_exports);
59494
59537
  var import_http4 = __toESM4(require("http"));
@@ -59506,7 +59549,7 @@ var require_upload = __commonJS2({
59506
59549
  }
59507
59550
  return false;
59508
59551
  };
59509
- async function* upload(files, clientOptions, deploymentOptions) {
59552
+ async function* upload2(files, clientOptions, deploymentOptions) {
59510
59553
  const { token, teamId, apiUrl: apiUrl2, userAgent: userAgent2 } = clientOptions;
59511
59554
  const debug2 = (0, import_utils6.createDebug)(clientOptions.debug);
59512
59555
  if (!files && !token && !teamId) {
@@ -63863,9 +63906,9 @@ var require_create_deployment = __commonJS2({
63863
63906
  });
63864
63907
  module2.exports = __toCommonJS4(create_deployment_exports);
63865
63908
  var import_fs_extra25 = require_lib8();
63866
- var import_path42 = require("path");
63909
+ var import_path43 = require("path");
63867
63910
  var import_hashes = require_hashes();
63868
- var import_upload = require_upload();
63911
+ var import_upload2 = require_upload();
63869
63912
  var import_utils6 = require_utils14();
63870
63913
  var import_errors4 = require_errors2();
63871
63914
  var import_error_utils38 = require_dist2();
@@ -63898,14 +63941,14 @@ var require_create_deployment = __commonJS2({
63898
63941
  clientOptions.isDirectory = !Array.isArray(path11) && (0, import_fs_extra25.lstatSync)(path11).isDirectory();
63899
63942
  if (Array.isArray(path11)) {
63900
63943
  for (const filePath of path11) {
63901
- if (!(0, import_path42.isAbsolute)(filePath)) {
63944
+ if (!(0, import_path43.isAbsolute)(filePath)) {
63902
63945
  throw new import_errors4.DeploymentError({
63903
63946
  code: "invalid_path",
63904
63947
  message: `Provided path ${filePath} is not absolute`
63905
63948
  });
63906
63949
  }
63907
63950
  }
63908
- } else if (!(0, import_path42.isAbsolute)(path11)) {
63951
+ } else if (!(0, import_path43.isAbsolute)(path11)) {
63909
63952
  throw new import_errors4.DeploymentError({
63910
63953
  code: "invalid_path",
63911
63954
  message: `Provided path ${path11} is not absolute`
@@ -63932,7 +63975,7 @@ var require_create_deployment = __commonJS2({
63932
63975
  if (clientOptions.archive === "tgz") {
63933
63976
  debug2("Packing tarball");
63934
63977
  const tarStream = import_tar_fs2.default.pack(workPath, {
63935
- entries: fileList.map((file) => (0, import_path42.relative)(workPath, file))
63978
+ entries: fileList.map((file) => (0, import_path43.relative)(workPath, file))
63936
63979
  }).pipe((0, import_zlib.createGzip)());
63937
63980
  const chunkedTarBuffers = await (0, import_build_utils19.streamToBufferChunks)(tarStream);
63938
63981
  debug2(`Packed tarball into ${chunkedTarBuffers.length} chunks`);
@@ -63940,7 +63983,7 @@ var require_create_deployment = __commonJS2({
63940
63983
  chunkedTarBuffers.map((chunk, index) => [
63941
63984
  (0, import_hashes.hash)(chunk),
63942
63985
  {
63943
- names: [(0, import_path42.join)(workPath, `.vercel/source.tgz.part${index + 1}`)],
63986
+ names: [(0, import_path43.join)(workPath, `.vercel/source.tgz.part${index + 1}`)],
63944
63987
  data: chunk,
63945
63988
  mode: 438
63946
63989
  }
@@ -63951,9 +63994,9 @@ var require_create_deployment = __commonJS2({
63951
63994
  }
63952
63995
  } catch (err) {
63953
63996
  if (clientOptions.prebuilt && (0, import_error_utils38.isErrnoException)(err) && err.code === "ENOENT" && err.path) {
63954
- const errPath = (0, import_path42.relative)(workPath, err.path);
63955
- err.message = `File does not exist: "${(0, import_path42.relative)(workPath, errPath)}"`;
63956
- if (errPath.split(import_path42.sep).includes("node_modules")) {
63997
+ const errPath = (0, import_path43.relative)(workPath, err.path);
63998
+ err.message = `File does not exist: "${(0, import_path43.relative)(workPath, errPath)}"`;
63999
+ if (errPath.split(import_path43.sep).includes("node_modules")) {
63957
64000
  err.message = `Please ensure project dependencies have been installed:
63958
64001
  ${err.message}`;
63959
64002
  }
@@ -63971,7 +64014,7 @@ ${err.message}`;
63971
64014
  debug2(`Setting platform version to harcoded value 2`);
63972
64015
  deploymentOptions.version = 2;
63973
64016
  debug2(`Creating the deployment and starting upload...`);
63974
- for await (const event of (0, import_upload.upload)(files, clientOptions, deploymentOptions)) {
64017
+ for await (const event of (0, import_upload2.upload)(files, clientOptions, deploymentOptions)) {
63975
64018
  debug2(`Yielding a '${event.type}' event`);
63976
64019
  yield event;
63977
64020
  }
@@ -77373,9 +77416,9 @@ var require_read_config_file = __commonJS2({
77373
77416
  module2.exports = __toCommonJS4(read_config_file_exports);
77374
77417
  var import_js_yaml = __toESM4(require_js_yaml2());
77375
77418
  var import_toml = __toESM4(require_toml());
77376
- var import_fs9 = require("fs");
77419
+ var import_fs11 = require("fs");
77377
77420
  var import_error_utils38 = require_dist2();
77378
- var { readFile: readFile6 } = import_fs9.promises;
77421
+ var { readFile: readFile6 } = import_fs11.promises;
77379
77422
  async function readFileOrNull(file) {
77380
77423
  try {
77381
77424
  const data = await readFile6(file);
@@ -77461,11 +77504,11 @@ var require_frameworks = __commonJS2({
77461
77504
  frameworks: () => frameworks
77462
77505
  });
77463
77506
  module2.exports = __toCommonJS4(frameworks_exports);
77464
- var import_path42 = require("path");
77465
- var import_fs9 = require("fs");
77507
+ var import_path43 = require("path");
77508
+ var import_fs11 = require("fs");
77466
77509
  var import_read_config_file = require_read_config_file();
77467
77510
  __reExport(frameworks_exports, require_types3(), module2.exports);
77468
- var { readdir: readdir2, readFile: readFile6, unlink: unlink2 } = import_fs9.promises;
77511
+ var { readdir: readdir2, readFile: readFile6, unlink: unlink2 } = import_fs11.promises;
77469
77512
  var frameworks = [
77470
77513
  {
77471
77514
  name: "Blitz.js (Legacy)",
@@ -77588,7 +77631,7 @@ var require_frameworks = __commonJS2({
77588
77631
  getOutputDirName: async () => "public",
77589
77632
  defaultRoutes: async (dirPrefix) => {
77590
77633
  try {
77591
- const nowRoutesPath = (0, import_path42.join)(
77634
+ const nowRoutesPath = (0, import_path43.join)(
77592
77635
  dirPrefix,
77593
77636
  "public",
77594
77637
  "__now_routes_g4t5bY.json"
@@ -77876,10 +77919,10 @@ var require_frameworks = __commonJS2({
77876
77919
  getOutputDirName: async (dirPrefix) => {
77877
77920
  const base = "build";
77878
77921
  try {
77879
- const location = (0, import_path42.join)(dirPrefix, base);
77922
+ const location = (0, import_path43.join)(dirPrefix, base);
77880
77923
  const content = await readdir2(location, { withFileTypes: true });
77881
77924
  if (content.length === 1 && content[0].isDirectory()) {
77882
- return (0, import_path42.join)(base, content[0].name);
77925
+ return (0, import_path43.join)(base, content[0].name);
77883
77926
  }
77884
77927
  } catch (error3) {
77885
77928
  console.error(`Error detecting output directory: `, error3);
@@ -77957,10 +78000,10 @@ var require_frameworks = __commonJS2({
77957
78000
  getOutputDirName: async (dirPrefix) => {
77958
78001
  const base = "build";
77959
78002
  try {
77960
- const location = (0, import_path42.join)(dirPrefix, base);
78003
+ const location = (0, import_path43.join)(dirPrefix, base);
77961
78004
  const content = await readdir2(location, { withFileTypes: true });
77962
78005
  if (content.length === 1 && content[0].isDirectory()) {
77963
- return (0, import_path42.join)(base, content[0].name);
78006
+ return (0, import_path43.join)(base, content[0].name);
77964
78007
  }
77965
78008
  } catch (error3) {
77966
78009
  console.error(`Error detecting output directory: `, error3);
@@ -78121,7 +78164,7 @@ var require_frameworks = __commonJS2({
78121
78164
  }
78122
78165
  },
78123
78166
  dependency: "@dojo/cli",
78124
- getOutputDirName: async () => (0, import_path42.join)("output", "dist"),
78167
+ getOutputDirName: async () => (0, import_path43.join)("output", "dist"),
78125
78168
  defaultRoutes: [
78126
78169
  {
78127
78170
  handle: "filesystem"
@@ -78356,12 +78399,12 @@ var require_frameworks = __commonJS2({
78356
78399
  getOutputDirName: async (dirPrefix) => {
78357
78400
  const base = "dist";
78358
78401
  try {
78359
- const location = (0, import_path42.join)(dirPrefix, base);
78402
+ const location = (0, import_path43.join)(dirPrefix, base);
78360
78403
  const content = await readdir2(location, { withFileTypes: true });
78361
78404
  if (content.length === 1 && content[0].isDirectory()) {
78362
- const potentialOutDir = (0, import_path42.join)(base, content[0].name);
78363
- const potentialOutDirWithBrowser = (0, import_path42.join)(potentialOutDir, "browser");
78364
- return (0, import_fs9.existsSync)(potentialOutDirWithBrowser) ? potentialOutDirWithBrowser : potentialOutDir;
78405
+ const potentialOutDir = (0, import_path43.join)(base, content[0].name);
78406
+ const potentialOutDirWithBrowser = (0, import_path43.join)(potentialOutDir, "browser");
78407
+ return (0, import_fs11.existsSync)(potentialOutDirWithBrowser) ? potentialOutDirWithBrowser : potentialOutDir;
78365
78408
  }
78366
78409
  } catch (error3) {
78367
78410
  console.error(`Error detecting output directory: `, error3);
@@ -78413,10 +78456,10 @@ var require_frameworks = __commonJS2({
78413
78456
  getOutputDirName: async (dirPrefix) => {
78414
78457
  const base = "build";
78415
78458
  try {
78416
- const location = (0, import_path42.join)(dirPrefix, base);
78459
+ const location = (0, import_path43.join)(dirPrefix, base);
78417
78460
  const content = await readdir2(location);
78418
78461
  const paths = content.filter((item) => !item.includes("."));
78419
- return (0, import_path42.join)(base, paths[0]);
78462
+ return (0, import_path43.join)(base, paths[0]);
78420
78463
  } catch (error3) {
78421
78464
  console.error(`Error detecting output directory: `, error3);
78422
78465
  }
@@ -79032,7 +79075,7 @@ var require_frameworks = __commonJS2({
79032
79075
  getOutputDirName: async (dirPrefix) => {
79033
79076
  const config2 = await (0, import_read_config_file.readConfigFile)(
79034
79077
  ["config.json", "config.yaml", "config.toml"].map((fileName) => {
79035
- return (0, import_path42.join)(dirPrefix, fileName);
79078
+ return (0, import_path43.join)(dirPrefix, fileName);
79036
79079
  })
79037
79080
  );
79038
79081
  return config2 && config2.publishDir || "public";
@@ -79073,7 +79116,7 @@ var require_frameworks = __commonJS2({
79073
79116
  },
79074
79117
  getOutputDirName: async (dirPrefix) => {
79075
79118
  const config2 = await (0, import_read_config_file.readConfigFile)(
79076
- (0, import_path42.join)(dirPrefix, "_config.yml")
79119
+ (0, import_path43.join)(dirPrefix, "_config.yml")
79077
79120
  );
79078
79121
  return config2 && config2.destination || "_site";
79079
79122
  },
@@ -82949,7 +82992,7 @@ var require_detect_builders = __commonJS2({
82949
82992
  module2.exports = __toCommonJS4(detect_builders_exports);
82950
82993
  var import_minimatch5 = __toESM4(require_minimatch2());
82951
82994
  var import_semver4 = require_semver2();
82952
- var import_path42 = require("path");
82995
+ var import_path43 = require("path");
82953
82996
  var import_frameworks8 = __toESM4(require_frameworks());
82954
82997
  var import_is_official_runtime = require_is_official_runtime();
82955
82998
  var REGEX_MIDDLEWARE_FILES = "middleware.[jt]s";
@@ -82965,7 +83008,7 @@ var require_detect_builders = __commonJS2({
82965
83008
  return new Set(
82966
83009
  builders.filter(
82967
83010
  (b) => Boolean(b.config && b.config.zeroConfig && b.src?.startsWith("api/"))
82968
- ).map((b) => (0, import_path42.extname)(b.src)).filter(Boolean)
83011
+ ).map((b) => (0, import_path43.extname)(b.src)).filter(Boolean)
82969
83012
  );
82970
83013
  }
82971
83014
  function detectApiDirectory3(builders) {
@@ -83500,14 +83543,14 @@ var require_detect_builders = __commonJS2({
83500
83543
  return null;
83501
83544
  }
83502
83545
  function getSegmentName(segment) {
83503
- const { name } = (0, import_path42.parse)(segment);
83546
+ const { name } = (0, import_path43.parse)(segment);
83504
83547
  if (name.startsWith("[") && name.endsWith("]")) {
83505
83548
  return name.slice(1, -1);
83506
83549
  }
83507
83550
  return null;
83508
83551
  }
83509
83552
  function getAbsolutePath(unresolvedPath) {
83510
- const { dir, name } = (0, import_path42.parse)(unresolvedPath);
83553
+ const { dir, name } = (0, import_path43.parse)(unresolvedPath);
83511
83554
  const parts = joinPath(dir, name).split("/");
83512
83555
  return parts.map((part) => part.replace(/\[.*\]/, "1")).join("/");
83513
83556
  }
@@ -83586,7 +83629,7 @@ var require_detect_builders = __commonJS2({
83586
83629
  isDynamic = true;
83587
83630
  return `([^/]+)`;
83588
83631
  } else if (isLast) {
83589
- const { name: fileName2, ext: ext2 } = (0, import_path42.parse)(segment);
83632
+ const { name: fileName2, ext: ext2 } = (0, import_path43.parse)(segment);
83590
83633
  const isIndex22 = fileName2 === "index";
83591
83634
  const prefix = isIndex22 ? "/" : "";
83592
83635
  const names = [
@@ -83598,7 +83641,7 @@ var require_detect_builders = __commonJS2({
83598
83641
  }
83599
83642
  return segment;
83600
83643
  });
83601
- const { name: fileName, ext } = (0, import_path42.parse)(filePath);
83644
+ const { name: fileName, ext } = (0, import_path43.parse)(filePath);
83602
83645
  const isIndex2 = fileName === "index";
83603
83646
  const queryString = `${query.length ? "?" : ""}${query.join("&")}`;
83604
83647
  const src = isIndex2 ? `^/${srcParts.slice(0, -1).join("/")}${srcParts.slice(-1)[0]}$` : `^/${srcParts.join("/")}$`;
@@ -84237,7 +84280,7 @@ var require_filesystem = __commonJS2({
84237
84280
  DetectorFilesystem: () => DetectorFilesystem2
84238
84281
  });
84239
84282
  module2.exports = __toCommonJS4(filesystem_exports);
84240
- var import_path42 = require("path");
84283
+ var import_path43 = require("path");
84241
84284
  var DetectorFilesystem2 = class {
84242
84285
  constructor() {
84243
84286
  this.hasPath = async (path11) => {
@@ -84281,13 +84324,13 @@ var require_filesystem = __commonJS2({
84281
84324
  }
84282
84325
  if (options?.potentialFiles) {
84283
84326
  const filesInReaddirDir = options.potentialFiles.filter(
84284
- (path11) => (0, import_path42.basename)(path11) === path11
84327
+ (path11) => (0, import_path43.basename)(path11) === path11
84285
84328
  );
84286
84329
  const filesThatDoNotExist = filesInReaddirDir.filter(
84287
84330
  (path11) => !directoryFiles.has(path11)
84288
84331
  );
84289
84332
  for (const filePath of filesThatDoNotExist) {
84290
- const fullFilePath = dirPath === "/" ? filePath : import_path42.posix.join(dirPath, filePath);
84333
+ const fullFilePath = dirPath === "/" ? filePath : import_path43.posix.join(dirPath, filePath);
84291
84334
  this.fileCache.set(fullFilePath, Promise.resolve(false));
84292
84335
  this.pathCache.set(fullFilePath, Promise.resolve(false));
84293
84336
  }
@@ -84348,7 +84391,7 @@ var require_local_file_system_detector = __commonJS2({
84348
84391
  });
84349
84392
  module2.exports = __toCommonJS4(local_file_system_detector_exports);
84350
84393
  var import_promises5 = __toESM4(require("fs/promises"));
84351
- var import_path42 = require("path");
84394
+ var import_path43 = require("path");
84352
84395
  var import_filesystem = require_filesystem();
84353
84396
  var import_error_utils38 = require_dist2();
84354
84397
  var LocalFileSystemDetector5 = class _LocalFileSystemDetector extends import_filesystem.DetectorFilesystem {
@@ -84389,7 +84432,7 @@ var require_local_file_system_detector = __commonJS2({
84389
84432
  }
84390
84433
  result.push({
84391
84434
  name: entry.name,
84392
- path: (0, import_path42.join)(this.getRelativeFilePath(dir), entry.name),
84435
+ path: (0, import_path43.join)(this.getRelativeFilePath(dir), entry.name),
84393
84436
  type
84394
84437
  });
84395
84438
  }
@@ -84399,10 +84442,10 @@ var require_local_file_system_detector = __commonJS2({
84399
84442
  return new _LocalFileSystemDetector(this.getFilePath(name));
84400
84443
  }
84401
84444
  getRelativeFilePath(name) {
84402
- return name.startsWith(this.rootPath) ? (0, import_path42.relative)(this.rootPath, name) : name;
84445
+ return name.startsWith(this.rootPath) ? (0, import_path43.relative)(this.rootPath, name) : name;
84403
84446
  }
84404
84447
  getFilePath(name) {
84405
- return (0, import_path42.join)(this.rootPath, this.getRelativeFilePath(name));
84448
+ return (0, import_path43.join)(this.rootPath, this.getRelativeFilePath(name));
84406
84449
  }
84407
84450
  };
84408
84451
  }
@@ -84553,11 +84596,11 @@ var require_get_workspaces = __commonJS2({
84553
84596
  getWorkspaces: () => getWorkspaces3
84554
84597
  });
84555
84598
  module2.exports = __toCommonJS4(get_workspaces_exports);
84556
- var import_path42 = __toESM4(require("path"));
84599
+ var import_path43 = __toESM4(require("path"));
84557
84600
  var import_workspace_managers = require_workspace_managers();
84558
84601
  var import_detect_framework = require_detect_framework();
84559
84602
  var MAX_DEPTH_TRAVERSE = 3;
84560
- var posixPath = import_path42.default.posix;
84603
+ var posixPath = import_path43.default.posix;
84561
84604
  async function getWorkspaces3({
84562
84605
  fs: fs15,
84563
84606
  depth = MAX_DEPTH_TRAVERSE,
@@ -90028,7 +90071,7 @@ var require_get_glob_fs = __commonJS2({
90028
90071
  getGlobFs: () => getGlobFs
90029
90072
  });
90030
90073
  module2.exports = __toCommonJS4(get_glob_fs_exports);
90031
- var import_fs9 = __toESM4(require("fs"));
90074
+ var import_fs11 = __toESM4(require("fs"));
90032
90075
  function removeWindowsPrefix(path11) {
90033
90076
  return path11.replace(/^[a-zA-Z]:/, "");
90034
90077
  }
@@ -90072,7 +90115,7 @@ var require_get_glob_fs = __commonJS2({
90072
90115
  });
90073
90116
  }).catch((err) => callback(err, null));
90074
90117
  };
90075
- return new Proxy(import_fs9.default, {
90118
+ return new Proxy(import_fs11.default, {
90076
90119
  get(_target, prop) {
90077
90120
  switch (prop) {
90078
90121
  case "readdir":
@@ -90125,12 +90168,12 @@ var require_get_workspace_package_paths = __commonJS2({
90125
90168
  getWorkspacePackagePaths: () => getWorkspacePackagePaths3
90126
90169
  });
90127
90170
  module2.exports = __toCommonJS4(get_workspace_package_paths_exports);
90128
- var import_path42 = __toESM4(require("path"));
90171
+ var import_path43 = __toESM4(require("path"));
90129
90172
  var import_js_yaml = __toESM4(require_js_yaml3());
90130
90173
  var import_glob = __toESM4(require_glob());
90131
90174
  var import_json5 = __toESM4(require_lib11());
90132
90175
  var import_get_glob_fs = require_get_glob_fs();
90133
- var posixPath = import_path42.default.posix;
90176
+ var posixPath = import_path43.default.posix;
90134
90177
  async function getWorkspacePackagePaths3({
90135
90178
  fs: fs15,
90136
90179
  workspace
@@ -90497,7 +90540,7 @@ var require_get_monorepo_default_settings = __commonJS2({
90497
90540
  getMonorepoDefaultSettings: () => getMonorepoDefaultSettings2
90498
90541
  });
90499
90542
  module2.exports = __toCommonJS4(get_monorepo_default_settings_exports);
90500
- var import_path42 = require("path");
90543
+ var import_path43 = require("path");
90501
90544
  var import_monorepo_managers = require_monorepo_managers();
90502
90545
  var import_package_managers = require_package_managers();
90503
90546
  var import_detect_framework = require_detect_framework();
@@ -90590,8 +90633,8 @@ var require_get_monorepo_default_settings = __commonJS2({
90590
90633
  const nxJSON = import_json5.default.parse(nxJSONBuf.toString("utf-8"));
90591
90634
  if (!nxJSON?.targetDefaults?.build) {
90592
90635
  const [projectJSONBuf, packageJSONBuf] = await Promise.all([
90593
- detectorFilesystem.readFile((0, import_path42.join)(projectPath, "project.json")).catch(() => null),
90594
- detectorFilesystem.readFile((0, import_path42.join)(projectPath, "package.json")).catch(() => null)
90636
+ detectorFilesystem.readFile((0, import_path43.join)(projectPath, "project.json")).catch(() => null),
90637
+ detectorFilesystem.readFile((0, import_path43.join)(projectPath, "package.json")).catch(() => null)
90595
90638
  ]);
90596
90639
  let hasBuildTarget = false;
90597
90640
  if (projectJSONBuf) {
@@ -91668,14 +91711,12 @@ var init_diff_env_files = __esm({
91668
91711
  function formatEnvValue(value) {
91669
91712
  if (value == null)
91670
91713
  return "";
91671
- if (!/[\r\n]/.test(value)) {
91672
- try {
91673
- const parsed = JSON.parse(value);
91674
- if (typeof parsed === "object" && parsed !== null) {
91675
- return value;
91676
- }
91677
- } catch {
91714
+ try {
91715
+ const parsed = JSON.parse(value);
91716
+ if (typeof parsed === "object" && parsed !== null) {
91717
+ return value.replace(/\n/g, "\\n").replace(/\r/g, "\\r");
91678
91718
  }
91719
+ } catch {
91679
91720
  }
91680
91721
  const needsQuotes = /\s/.test(value) || value.startsWith("#") || value.startsWith('"');
91681
91722
  if (!needsQuotes)
@@ -148273,7 +148314,7 @@ function validateConfig(config2) {
148273
148314
  }
148274
148315
  return null;
148275
148316
  }
148276
- var import_ajv2, import_routing_utils, import_build_utils13, import_client5, imagesSchema, cronsSchema, vercelConfigSchema, ajv, validate;
148317
+ var import_ajv2, import_routing_utils, import_build_utils13, import_client5, imagesSchema, cronsSchema, customErrorPageSchema, vercelConfigSchema, ajv, validate;
148277
148318
  var init_validate_config = __esm({
148278
148319
  "src/util/validate-config.ts"() {
148279
148320
  "use strict";
@@ -148418,6 +148459,26 @@ var init_validate_config = __esm({
148418
148459
  }
148419
148460
  }
148420
148461
  };
148462
+ customErrorPageSchema = {
148463
+ oneOf: [
148464
+ { type: "string", minLength: 1 },
148465
+ {
148466
+ type: "object",
148467
+ additionalProperties: false,
148468
+ minProperties: 1,
148469
+ properties: {
148470
+ default5xx: {
148471
+ type: "string",
148472
+ minLength: 1
148473
+ },
148474
+ default4xx: {
148475
+ type: "string",
148476
+ minLength: 1
148477
+ }
148478
+ }
148479
+ }
148480
+ ]
148481
+ };
148421
148482
  vercelConfigSchema = {
148422
148483
  type: "object",
148423
148484
  // These are not all possibilities because `vc dev`
@@ -148434,6 +148495,7 @@ var init_validate_config = __esm({
148434
148495
  functions: import_build_utils13.functionsSchema,
148435
148496
  images: imagesSchema,
148436
148497
  crons: cronsSchema,
148498
+ customErrorPage: customErrorPageSchema,
148437
148499
  bunVersion: { type: "string" }
148438
148500
  }
148439
148501
  };
@@ -149577,6 +149639,21 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
149577
149639
  if (validateError) {
149578
149640
  throw validateError;
149579
149641
  }
149642
+ if (localConfig.customErrorPage) {
149643
+ const errorPages = typeof localConfig.customErrorPage === "string" ? [localConfig.customErrorPage] : Object.values(localConfig.customErrorPage);
149644
+ for (const page of errorPages) {
149645
+ if (page) {
149646
+ const src = (0, import_path28.join)(workPath, page);
149647
+ if (!(0, import_fs_extra18.existsSync)(src)) {
149648
+ throw new import_build_utils14.NowBuildError({
149649
+ code: "CUSTOM_ERROR_PAGE_NOT_FOUND",
149650
+ message: `The custom error page "${page}" was not found in "${workPath}".`,
149651
+ link: "https://vercel.com/docs/projects/project-configuration#custom-error-page"
149652
+ });
149653
+ }
149654
+ }
149655
+ }
149656
+ }
149580
149657
  const projectSettings = {
149581
149658
  ...project.settings,
149582
149659
  ...pickOverrides(localConfig)
@@ -152896,6 +152973,16 @@ async function processDeployment({
152896
152973
  }
152897
152974
  if (event.type === "alias-assigned") {
152898
152975
  stopSpinner();
152976
+ if (event.payload.target === "production" && event.payload.alias && event.payload.alias.length > 0) {
152977
+ const primaryDomain = event.payload.alias[0];
152978
+ const prodUrl = `https://${primaryDomain}`;
152979
+ output_manager_default.print(
152980
+ prependEmoji(
152981
+ `Aliased: ${import_chalk66.default.bold(prodUrl)} ${deployStamp()}`,
152982
+ emoji("link")
152983
+ ) + "\n"
152984
+ );
152985
+ }
152899
152986
  event.payload.indications = indications;
152900
152987
  return event.payload;
152901
152988
  }
@@ -169641,7 +169728,7 @@ var require_content_disposition = __commonJS2({
169641
169728
  "use strict";
169642
169729
  module2.exports = contentDisposition;
169643
169730
  module2.exports.parse = parse11;
169644
- var basename10 = require("path").basename;
169731
+ var basename11 = require("path").basename;
169645
169732
  var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g;
169646
169733
  var HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/;
169647
169734
  var HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g;
@@ -169676,9 +169763,9 @@ var require_content_disposition = __commonJS2({
169676
169763
  if (typeof fallback === "string" && NON_LATIN1_REGEXP.test(fallback)) {
169677
169764
  throw new TypeError("fallback must be ISO-8859-1 string");
169678
169765
  }
169679
- var name = basename10(filename);
169766
+ var name = basename11(filename);
169680
169767
  var isQuotedString = TEXT_REGEXP.test(name);
169681
- var fallbackName = typeof fallback !== "string" ? fallback && getlatin1(name) : basename10(fallback);
169768
+ var fallbackName = typeof fallback !== "string" ? fallback && getlatin1(name) : basename11(fallback);
169682
169769
  var hasFallback = typeof fallbackName === "string" && fallbackName !== name;
169683
169770
  if (hasFallback || !isQuotedString || HEX_ESCAPE_REGEXP.test(name)) {
169684
169771
  params2["filename*"] = name;
@@ -173133,6 +173220,16 @@ Please ensure that ${cmd(err.path)} is properly installed`;
173133
173220
  this.readJsonFile(configPath)
173134
173221
  ]);
173135
173222
  await this.validateVercelConfig(vercelConfig);
173223
+ if (vercelConfig.customErrorPage) {
173224
+ const errorPages = typeof vercelConfig.customErrorPage === "string" ? [vercelConfig.customErrorPage] : Object.values(vercelConfig.customErrorPage);
173225
+ for (const page of errorPages) {
173226
+ if (page && !import_fs_extra21.default.existsSync((0, import_path36.join)(this.cwd, page))) {
173227
+ output_manager_default.warn(
173228
+ `The custom error page "${page}" was not found in "${this.cwd}". This will cause deployment to fail on Vercel.`
173229
+ );
173230
+ }
173231
+ }
173232
+ }
173136
173233
  this.projectSettings = {
173137
173234
  ...this.originalProjectSettings,
173138
173235
  ...pickOverrides(vercelConfig)
@@ -185942,6 +186039,16 @@ async function redeploy(client2) {
185942
186039
  output_manager_default.spinner("Running Checks", 0);
185943
186040
  } else if (event.type === "alias-assigned" || event.type === "checks-conclusion-failed") {
185944
186041
  output_manager_default.stopSpinner();
186042
+ if (event.type === "alias-assigned" && !Array.isArray(event.payload) && event.payload.target === "production" && event.payload.alias && event.payload.alias.length > 0) {
186043
+ const primaryDomain = event.payload.alias[0];
186044
+ const prodUrl = `https://${primaryDomain}`;
186045
+ output_manager_default.print(
186046
+ prependEmoji(
186047
+ `Aliased: ${import_chalk124.default.bold(prodUrl)} ${deployStamp()}`,
186048
+ emoji("link")
186049
+ ) + "\n"
186050
+ );
186051
+ }
185945
186052
  deployment = event.payload;
185946
186053
  break;
185947
186054
  } else if (event.type === "canceled") {
@@ -186081,7 +186188,7 @@ async function getRedirects(client2, projectId, options = {}) {
186081
186188
  params2.set("versionId", versionId);
186082
186189
  }
186083
186190
  if (diff) {
186084
- params2.set("diff", "true");
186191
+ params2.set("diff", diff === true ? "true" : diff);
186085
186192
  } else {
186086
186193
  params2.set("per_page", perPage.toString());
186087
186194
  if (search) {
@@ -186667,6 +186774,399 @@ var init_add13 = __esm({
186667
186774
  }
186668
186775
  });
186669
186776
 
186777
+ // src/commands/redirects/validate-redirects.ts
186778
+ function validateUploadFile(filePath, options = {}) {
186779
+ const maxSize = options.maxFileSize ?? MAX_FILE_SIZE;
186780
+ const allowedExts = options.allowedExtensions ?? ALLOWED_EXTENSIONS;
186781
+ try {
186782
+ const stats = (0, import_fs8.statSync)(filePath);
186783
+ if (!stats.isFile()) {
186784
+ return { valid: false, error: `Path "${filePath}" is not a file` };
186785
+ }
186786
+ if (stats.size > maxSize) {
186787
+ const sizeMB = Math.round(maxSize / (1024 * 1024));
186788
+ return { valid: false, error: `File must be below ${sizeMB}MB` };
186789
+ }
186790
+ const hasValidExtension = allowedExts.some(
186791
+ (ext) => filePath.toLowerCase().endsWith(ext)
186792
+ );
186793
+ if (!hasValidExtension) {
186794
+ return {
186795
+ valid: false,
186796
+ error: `File must be a .csv or .json file`
186797
+ };
186798
+ }
186799
+ return { valid: true };
186800
+ } catch (err) {
186801
+ if (err.code === "ENOENT") {
186802
+ return { valid: false, error: `File "${filePath}" not found` };
186803
+ }
186804
+ return { valid: false, error: `Error accessing file: ${err.message}` };
186805
+ }
186806
+ }
186807
+ function validateRedirect(redirect2) {
186808
+ if (!redirect2.source) {
186809
+ return { valid: false, error: "Redirect source is required" };
186810
+ }
186811
+ if (redirect2.source.length > MAX_URL_LENGTH) {
186812
+ return { valid: false, error: "Source URL is too long" };
186813
+ }
186814
+ if (!redirect2.source.startsWith("/")) {
186815
+ return { valid: false, error: "Source must be a relative path" };
186816
+ }
186817
+ if (!redirect2.destination) {
186818
+ return { valid: false, error: "Redirect destination is required" };
186819
+ }
186820
+ if (redirect2.destination.length > MAX_URL_LENGTH) {
186821
+ return { valid: false, error: "Destination URL is too long" };
186822
+ }
186823
+ try {
186824
+ new URL(redirect2.destination, "https://vercel.com");
186825
+ } catch {
186826
+ return { valid: false, error: "Destination must be a valid URL" };
186827
+ }
186828
+ if (redirect2.statusCode) {
186829
+ if (!VALID_STATUS_CODES.includes(redirect2.statusCode)) {
186830
+ return {
186831
+ valid: false,
186832
+ error: `Invalid status code. Must be one of: ${VALID_STATUS_CODES.join(", ")}`
186833
+ };
186834
+ }
186835
+ }
186836
+ return { valid: true };
186837
+ }
186838
+ function validateRedirectsArray(redirects) {
186839
+ if (!Array.isArray(redirects)) {
186840
+ return {
186841
+ valid: false,
186842
+ error: "JSON file must contain an array of redirects"
186843
+ };
186844
+ }
186845
+ if (redirects.length === 0) {
186846
+ return { valid: false, error: "No redirects provided" };
186847
+ }
186848
+ if (redirects.length > MAX_REDIRECTS) {
186849
+ return {
186850
+ valid: false,
186851
+ error: `Too many redirects. Maximum allowed: ${MAX_REDIRECTS}`
186852
+ };
186853
+ }
186854
+ for (let i = 0; i < redirects.length; i++) {
186855
+ const result = validateRedirect(redirects[i]);
186856
+ if (!result.valid) {
186857
+ return {
186858
+ valid: false,
186859
+ error: `Redirect ${i + 1}: ${result.error}`
186860
+ };
186861
+ }
186862
+ }
186863
+ return { valid: true };
186864
+ }
186865
+ function validateCSVStructure(content) {
186866
+ const lines2 = content.trim().split("\n");
186867
+ if (lines2.length < 2) {
186868
+ return {
186869
+ valid: false,
186870
+ error: "CSV must have a header and at least one redirect"
186871
+ };
186872
+ }
186873
+ const header = lines2[0].toLowerCase();
186874
+ const hasSource = header.includes("source");
186875
+ const hasDestination = header.includes("destination");
186876
+ if (!hasSource || !hasDestination) {
186877
+ return {
186878
+ valid: false,
186879
+ error: 'CSV must have "source" and "destination" columns'
186880
+ };
186881
+ }
186882
+ return { valid: true };
186883
+ }
186884
+ function validateVersionName(name) {
186885
+ if (!name) {
186886
+ return { valid: false, error: "Name is required" };
186887
+ }
186888
+ if (name.length > 256) {
186889
+ return { valid: false, error: "Name must be 256 characters or less" };
186890
+ }
186891
+ return { valid: true };
186892
+ }
186893
+ var import_fs8, MAX_FILE_SIZE, ALLOWED_EXTENSIONS, MAX_REDIRECTS, MAX_URL_LENGTH, VALID_STATUS_CODES;
186894
+ var init_validate_redirects = __esm({
186895
+ "src/commands/redirects/validate-redirects.ts"() {
186896
+ "use strict";
186897
+ import_fs8 = require("fs");
186898
+ MAX_FILE_SIZE = 50 * 1024 * 1024;
186899
+ ALLOWED_EXTENSIONS = [".csv", ".json"];
186900
+ MAX_REDIRECTS = 1e6;
186901
+ MAX_URL_LENGTH = 2048;
186902
+ VALID_STATUS_CODES = [301, 302, 303, 307, 308];
186903
+ }
186904
+ });
186905
+
186906
+ // src/commands/redirects/upload.ts
186907
+ async function upload(client2, argv) {
186908
+ const parsed = await parseSubcommandArgs(argv, uploadSubcommand);
186909
+ if (typeof parsed === "number")
186910
+ return parsed;
186911
+ const link4 = await ensureProjectLink(client2);
186912
+ if (typeof link4 === "number")
186913
+ return link4;
186914
+ const { project, org } = link4;
186915
+ const teamId = org.type === "team" ? org.id : void 0;
186916
+ const { args: args2, flags } = parsed;
186917
+ const skipPrompts = flags["--yes"];
186918
+ const overwrite = flags["--overwrite"] || false;
186919
+ const filePath = args2[0];
186920
+ if (!filePath) {
186921
+ output_manager_default.error("File path is required. Use: vercel redirects upload <file>");
186922
+ return 1;
186923
+ }
186924
+ const fileValidation = validateUploadFile(filePath);
186925
+ if (!fileValidation.valid) {
186926
+ output_manager_default.error(fileValidation.error);
186927
+ return 1;
186928
+ }
186929
+ const { versions } = await getRedirectVersions(client2, project.id, teamId);
186930
+ const existingStagingVersion = versions.find((v) => v.isStaging);
186931
+ if (!skipPrompts) {
186932
+ const fileName = (0, import_path41.basename)(filePath);
186933
+ const fileType = filePath.endsWith(".csv") ? "CSV" : "JSON";
186934
+ const message2 = overwrite ? `Upload ${fileType} file "${fileName}" and replace all existing redirects?` : `Upload ${fileType} file "${fileName}"?`;
186935
+ const confirmed = await client2.input.confirm(message2, true);
186936
+ if (!confirmed) {
186937
+ output_manager_default.log("Upload cancelled");
186938
+ return 0;
186939
+ }
186940
+ }
186941
+ let versionName;
186942
+ if (!skipPrompts) {
186943
+ const provideName = await client2.input.confirm(
186944
+ "Do you want to provide a name for this version?",
186945
+ false
186946
+ );
186947
+ if (provideName) {
186948
+ versionName = await client2.input.text({
186949
+ message: "Version name (max 256 characters):",
186950
+ validate: (val) => {
186951
+ if (val && val.length > 256) {
186952
+ return "Name must be 256 characters or less";
186953
+ }
186954
+ return true;
186955
+ }
186956
+ });
186957
+ const { valid, error: error3 } = validateVersionName(versionName);
186958
+ if (!valid) {
186959
+ output_manager_default.error(error3);
186960
+ return 1;
186961
+ }
186962
+ }
186963
+ }
186964
+ const uploadStamp = stamp_default();
186965
+ output_manager_default.spinner("Uploading redirects");
186966
+ try {
186967
+ let result;
186968
+ const url3 = "/v1/bulk-redirects";
186969
+ if (filePath.endsWith(".csv")) {
186970
+ const csvContent = (0, import_fs9.readFileSync)(filePath);
186971
+ const fileName = (0, import_path41.basename)(filePath);
186972
+ const csvValidation = validateCSVStructure(csvContent.toString());
186973
+ if (!csvValidation.valid) {
186974
+ output_manager_default.error(`Invalid CSV: ${csvValidation.error}`);
186975
+ return 1;
186976
+ }
186977
+ const form = new import_form_data.default();
186978
+ form.append("teamId", teamId || org.id);
186979
+ form.append("projectId", project.id);
186980
+ form.append("overwrite", String(overwrite));
186981
+ if (versionName) {
186982
+ form.append("name", versionName);
186983
+ }
186984
+ form.append("bulkRedirectsFile", csvContent, {
186985
+ filename: fileName,
186986
+ contentType: "text/csv"
186987
+ });
186988
+ result = await client2.fetch(url3, {
186989
+ method: "PUT",
186990
+ headers: form.getHeaders(),
186991
+ body: form
186992
+ });
186993
+ } else {
186994
+ const content = (0, import_fs9.readFileSync)(filePath, "utf8");
186995
+ let redirects2;
186996
+ try {
186997
+ redirects2 = JSON.parse(content);
186998
+ } catch (err) {
186999
+ output_manager_default.error("Invalid JSON file format");
187000
+ return 1;
187001
+ }
187002
+ const redirectsValidation = validateRedirectsArray(redirects2);
187003
+ if (!redirectsValidation.valid) {
187004
+ output_manager_default.error(redirectsValidation.error);
187005
+ return 1;
187006
+ }
187007
+ const body = {
187008
+ projectId: project.id,
187009
+ redirects: redirects2,
187010
+ overwrite
187011
+ };
187012
+ if (teamId) {
187013
+ body.teamId = teamId;
187014
+ }
187015
+ if (versionName) {
187016
+ body.versionName = versionName;
187017
+ }
187018
+ result = await client2.fetch(url3, {
187019
+ method: "PUT",
187020
+ body
187021
+ });
187022
+ }
187023
+ output_manager_default.log(
187024
+ `${import_chalk128.default.cyan("\u2713")} Redirects uploaded ${import_chalk128.default.gray(uploadStamp())}`
187025
+ );
187026
+ output_manager_default.spinner("Fetching diff");
187027
+ const { redirects } = await getRedirects(client2, project.id, {
187028
+ teamId,
187029
+ versionId: result.version.id,
187030
+ diff: "only"
187031
+ });
187032
+ const redirectCount = redirects.length;
187033
+ output_manager_default.print(`
187034
+ ${import_chalk128.default.bold("Summary:")}
187035
+ `);
187036
+ output_manager_default.print(
187037
+ ` Uploaded ${redirectCount} redirect${redirectCount === 1 ? "" : "s"}
187038
+ `
187039
+ );
187040
+ if (redirectCount > 0) {
187041
+ const added = redirects.filter((r) => r.action === "+");
187042
+ const deleted = redirects.filter((r) => r.action === "-");
187043
+ const edited = redirects.filter((r) => r.action === "~");
187044
+ output_manager_default.print(`
187045
+ ${import_chalk128.default.bold("Changes:")}
187046
+ `);
187047
+ if (added.length > 0) {
187048
+ output_manager_default.print(` ${import_chalk128.default.green(`Added: ${added.length}`)}
187049
+ `);
187050
+ }
187051
+ if (deleted.length > 0) {
187052
+ output_manager_default.print(` ${import_chalk128.default.red(`Deleted: ${deleted.length}`)}
187053
+ `);
187054
+ }
187055
+ if (edited.length > 0) {
187056
+ output_manager_default.print(` ${import_chalk128.default.yellow(`Modified: ${edited.length}`)}
187057
+ `);
187058
+ }
187059
+ output_manager_default.print(`
187060
+ ${import_chalk128.default.bold("Redirect changes:")}
187061
+ `);
187062
+ const displayRedirects = redirects.slice(0, 100);
187063
+ const rows = displayRedirects.map((redirect2) => {
187064
+ const status3 = redirect2.statusCode || (redirect2.permanent ? 308 : 307);
187065
+ const action = redirect2.action || "+";
187066
+ let colorFn;
187067
+ let actionSymbol;
187068
+ switch (action) {
187069
+ case "+":
187070
+ colorFn = import_chalk128.default.green;
187071
+ actionSymbol = "+";
187072
+ break;
187073
+ case "-":
187074
+ colorFn = import_chalk128.default.red;
187075
+ actionSymbol = "-";
187076
+ break;
187077
+ case "~":
187078
+ colorFn = import_chalk128.default.yellow;
187079
+ actionSymbol = "~";
187080
+ break;
187081
+ default:
187082
+ colorFn = (s) => s;
187083
+ actionSymbol = " ";
187084
+ }
187085
+ return [
187086
+ colorFn(`${actionSymbol} ${redirect2.source}`),
187087
+ colorFn(redirect2.destination),
187088
+ colorFn(status3.toString())
187089
+ ];
187090
+ });
187091
+ output_manager_default.print(
187092
+ formatTable(
187093
+ ["Source", "Destination", "Status"],
187094
+ ["l", "l", "l"],
187095
+ [{ rows }]
187096
+ )
187097
+ );
187098
+ if (redirectCount > 100) {
187099
+ output_manager_default.print(
187100
+ `
187101
+ ${import_chalk128.default.gray(`... and ${redirectCount - 100} more redirect${redirectCount - 100 === 1 ? "" : "s"}`)}
187102
+ `
187103
+ );
187104
+ }
187105
+ }
187106
+ if (result.alias) {
187107
+ const testUrl = `https://${result.alias}`;
187108
+ output_manager_default.print(
187109
+ `
187110
+ ${import_chalk128.default.bold("Test your changes:")} ${import_chalk128.default.cyan(testUrl)}
187111
+ `
187112
+ );
187113
+ }
187114
+ const newVersionName = result.version.name || result.version.id;
187115
+ output_manager_default.print(
187116
+ ` ${import_chalk128.default.bold("New staging version:")} ${newVersionName}
187117
+
187118
+ `
187119
+ );
187120
+ if (existingStagingVersion) {
187121
+ output_manager_default.warn(
187122
+ `There are other staged changes. Please review all changes with ${import_chalk128.default.cyan("vercel redirects list --staging")} before promoting to production.`
187123
+ );
187124
+ } else if (!skipPrompts) {
187125
+ const shouldPromote = await client2.input.confirm(
187126
+ "This is the only staged change. Do you want to promote it to production now?",
187127
+ false
187128
+ );
187129
+ if (shouldPromote) {
187130
+ const promoteStamp = stamp_default();
187131
+ output_manager_default.spinner("Promoting to production");
187132
+ await updateRedirectVersion(
187133
+ client2,
187134
+ project.id,
187135
+ result.version.id,
187136
+ "promote",
187137
+ teamId
187138
+ );
187139
+ output_manager_default.log(
187140
+ `${import_chalk128.default.cyan("\u2713")} Version promoted to production ${import_chalk128.default.gray(promoteStamp())}`
187141
+ );
187142
+ }
187143
+ }
187144
+ return 0;
187145
+ } catch (error3) {
187146
+ output_manager_default.error(`Failed to upload redirects: ${error3.message}`);
187147
+ return 1;
187148
+ }
187149
+ }
187150
+ var import_fs9, import_path41, import_chalk128, import_form_data;
187151
+ var init_upload = __esm({
187152
+ "src/commands/redirects/upload.ts"() {
187153
+ "use strict";
187154
+ import_fs9 = require("fs");
187155
+ import_path41 = require("path");
187156
+ import_chalk128 = __toESM3(require_source());
187157
+ import_form_data = __toESM3(require("form-data"));
187158
+ init_output_manager();
187159
+ init_command32();
187160
+ init_shared2();
187161
+ init_stamp();
187162
+ init_get_redirect_versions();
187163
+ init_update_redirect_version();
187164
+ init_get_redirects();
187165
+ init_format_table();
187166
+ init_validate_redirects();
187167
+ }
187168
+ });
187169
+
186670
187170
  // src/util/redirects/delete-redirects.ts
186671
187171
  async function deleteRedirects(client2, projectId, sources, teamId) {
186672
187172
  const params2 = new URLSearchParams();
@@ -186714,17 +187214,17 @@ async function remove5(client2, argv) {
186714
187214
  const redirectToRemove = redirects.find((r) => r.source === source);
186715
187215
  if (!redirectToRemove) {
186716
187216
  output_manager_default.error(
186717
- `Redirect with source "${source}" not found. Run ${import_chalk128.default.cyan(
187217
+ `Redirect with source "${source}" not found. Run ${import_chalk129.default.cyan(
186718
187218
  "vercel redirects list"
186719
187219
  )} to see available redirects.`
186720
187220
  );
186721
187221
  return 1;
186722
187222
  }
186723
187223
  output_manager_default.print(`
186724
- ${import_chalk128.default.bold("Removing redirect:")}
187224
+ ${import_chalk129.default.bold("Removing redirect:")}
186725
187225
  `);
186726
187226
  output_manager_default.print(
186727
- ` ${import_chalk128.default.cyan(redirectToRemove.source)} \u2192 ${import_chalk128.default.cyan(redirectToRemove.destination)}
187227
+ ` ${import_chalk129.default.cyan(redirectToRemove.source)} \u2192 ${import_chalk129.default.cyan(redirectToRemove.destination)}
186728
187228
  `
186729
187229
  );
186730
187230
  const status3 = redirectToRemove.statusCode || (redirectToRemove.permanent ? 308 : 307);
@@ -186742,7 +187242,7 @@ async function remove5(client2, argv) {
186742
187242
  return 0;
186743
187243
  }
186744
187244
  const removeStamp = stamp_default();
186745
- output_manager_default.spinner(`Removing redirect for ${import_chalk128.default.bold(source)}`);
187245
+ output_manager_default.spinner(`Removing redirect for ${import_chalk129.default.bold(source)}`);
186746
187246
  const { alias: alias2, version: version2 } = await deleteRedirects(
186747
187247
  client2,
186748
187248
  project.id,
@@ -186750,13 +187250,13 @@ async function remove5(client2, argv) {
186750
187250
  teamId
186751
187251
  );
186752
187252
  output_manager_default.log(
186753
- `${import_chalk128.default.cyan("\u2713")} Redirect removed ${import_chalk128.default.gray(removeStamp())}`
187253
+ `${import_chalk129.default.cyan("\u2713")} Redirect removed ${import_chalk129.default.gray(removeStamp())}`
186754
187254
  );
186755
187255
  if (alias2) {
186756
187256
  const testUrl = source.startsWith("/") ? `https://${alias2}${source}` : `https://${alias2}`;
186757
187257
  output_manager_default.print(
186758
187258
  `
186759
- ${import_chalk128.default.bold("Test your changes:")} ${import_chalk128.default.cyan(testUrl)}
187259
+ ${import_chalk129.default.bold("Test your changes:")} ${import_chalk129.default.cyan(testUrl)}
186760
187260
  `
186761
187261
  );
186762
187262
  output_manager_default.print(
@@ -186765,7 +187265,7 @@ async function remove5(client2, argv) {
186765
187265
  );
186766
187266
  }
186767
187267
  const versionName = version2.name || version2.id;
186768
- output_manager_default.print(` ${import_chalk128.default.bold("New staging version:")} ${versionName}
187268
+ output_manager_default.print(` ${import_chalk129.default.bold("New staging version:")} ${versionName}
186769
187269
 
186770
187270
  `);
186771
187271
  if (!existingStagingVersion) {
@@ -186784,21 +187284,21 @@ async function remove5(client2, argv) {
186784
187284
  teamId
186785
187285
  );
186786
187286
  output_manager_default.log(
186787
- `${import_chalk128.default.cyan("\u2713")} Version promoted to production ${import_chalk128.default.gray(promoteStamp())}`
187287
+ `${import_chalk129.default.cyan("\u2713")} Version promoted to production ${import_chalk129.default.gray(promoteStamp())}`
186788
187288
  );
186789
187289
  }
186790
187290
  } else {
186791
187291
  output_manager_default.warn(
186792
- `There are other staged changes. Review them with ${import_chalk128.default.cyan("vercel redirects list --staging")} before promoting to production.`
187292
+ `There are other staged changes. Review them with ${import_chalk129.default.cyan("vercel redirects list --staging")} before promoting to production.`
186793
187293
  );
186794
187294
  }
186795
187295
  return 0;
186796
187296
  }
186797
- var import_chalk128;
187297
+ var import_chalk129;
186798
187298
  var init_remove5 = __esm({
186799
187299
  "src/commands/redirects/remove.ts"() {
186800
187300
  "use strict";
186801
- import_chalk128 = __toESM3(require_source());
187301
+ import_chalk129 = __toESM3(require_source());
186802
187302
  init_output_manager();
186803
187303
  init_command32();
186804
187304
  init_shared2();
@@ -186826,14 +187326,14 @@ async function promote(client2, argv) {
186826
187326
  const { project, org } = link4;
186827
187327
  const teamId = org.type === "team" ? org.id : void 0;
186828
187328
  const [versionIdentifier] = parsed.args;
186829
- output_manager_default.spinner(`Fetching redirect versions for ${import_chalk129.default.bold(project.name)}`);
187329
+ output_manager_default.spinner(`Fetching redirect versions for ${import_chalk130.default.bold(project.name)}`);
186830
187330
  const { versions } = await getRedirectVersions(client2, project.id, teamId);
186831
187331
  const version2 = versions.find(
186832
187332
  (v) => v.id === versionIdentifier || v.name === versionIdentifier
186833
187333
  );
186834
187334
  if (!version2) {
186835
187335
  output_manager_default.error(
186836
- `Version with ID or name "${versionIdentifier}" not found. Run ${import_chalk129.default.cyan(
187336
+ `Version with ID or name "${versionIdentifier}" not found. Run ${import_chalk130.default.cyan(
186837
187337
  "vercel redirects list-versions"
186838
187338
  )} to see available versions.`
186839
187339
  );
@@ -186841,16 +187341,16 @@ async function promote(client2, argv) {
186841
187341
  }
186842
187342
  if (version2.isLive) {
186843
187343
  output_manager_default.error(
186844
- `Version ${import_chalk129.default.bold(version2.name || version2.id)} is already live.`
187344
+ `Version ${import_chalk130.default.bold(version2.name || version2.id)} is already live.`
186845
187345
  );
186846
187346
  return 1;
186847
187347
  }
186848
187348
  if (!version2.isStaging) {
186849
187349
  output_manager_default.error(
186850
- `Version ${import_chalk129.default.bold(
187350
+ `Version ${import_chalk130.default.bold(
186851
187351
  version2.name || version2.id
186852
187352
  )} is not staged. Only staging versions can be promoted to production.
186853
- Run ${import_chalk129.default.cyan(
187353
+ Run ${import_chalk130.default.cyan(
186854
187354
  "vercel redirects list-versions"
186855
187355
  )} to see which version is currently staged.`
186856
187356
  );
@@ -186868,13 +187368,13 @@ Run ${import_chalk129.default.cyan(
186868
187368
  );
186869
187369
  if (changedRedirects.length > 0) {
186870
187370
  output_manager_default.print(`
186871
- ${import_chalk129.default.bold("Changes to be promoted:")}
187371
+ ${import_chalk130.default.bold("Changes to be promoted:")}
186872
187372
 
186873
187373
  `);
186874
187374
  const displayRedirects = changedRedirects.slice(0, 20);
186875
187375
  for (const redirect2 of displayRedirects) {
186876
187376
  const status3 = redirect2.statusCode || (redirect2.permanent ? 308 : 307);
186877
- const symbol = redirect2.action === "+" ? import_chalk129.default.green("+") : import_chalk129.default.red("-");
187377
+ const symbol = redirect2.action === "+" ? import_chalk130.default.green("+") : import_chalk130.default.red("-");
186878
187378
  output_manager_default.print(
186879
187379
  ` ${symbol} ${redirect2.source} \u2192 ${redirect2.destination} (${status3})
186880
187380
  `
@@ -186882,7 +187382,7 @@ ${import_chalk129.default.bold("Changes to be promoted:")}
186882
187382
  }
186883
187383
  if (changedRedirects.length > 20) {
186884
187384
  output_manager_default.print(
186885
- import_chalk129.default.gray(`
187385
+ import_chalk130.default.gray(`
186886
187386
  ... and ${changedRedirects.length - 20} more changes
186887
187387
  `)
186888
187388
  );
@@ -186891,7 +187391,7 @@ ${import_chalk129.default.bold("Changes to be promoted:")}
186891
187391
  } else {
186892
187392
  output_manager_default.print(
186893
187393
  `
186894
- ${import_chalk129.default.gray("No changes detected from current production version.")}
187394
+ ${import_chalk130.default.gray("No changes detected from current production version.")}
186895
187395
 
186896
187396
  `
186897
187397
  );
@@ -186899,15 +187399,15 @@ ${import_chalk129.default.gray("No changes detected from current production vers
186899
187399
  const confirmed = await confirmAction(
186900
187400
  client2,
186901
187401
  parsed.flags["--yes"],
186902
- `Promote version ${import_chalk129.default.bold(versionName)} to production?`,
186903
- `This will make it the live version for ${import_chalk129.default.bold(project.name)}.`
187402
+ `Promote version ${import_chalk130.default.bold(versionName)} to production?`,
187403
+ `This will make it the live version for ${import_chalk130.default.bold(project.name)}.`
186904
187404
  );
186905
187405
  if (!confirmed) {
186906
187406
  output_manager_default.log("Canceled");
186907
187407
  return 0;
186908
187408
  }
186909
187409
  const updateStamp = stamp_default();
186910
- output_manager_default.spinner(`Promoting version ${import_chalk129.default.bold(versionName)} to production`);
187410
+ output_manager_default.spinner(`Promoting version ${import_chalk130.default.bold(versionName)} to production`);
186911
187411
  const { version: newVersion } = await updateRedirectVersion(
186912
187412
  client2,
186913
187413
  project.id,
@@ -186916,17 +187416,17 @@ ${import_chalk129.default.gray("No changes detected from current production vers
186916
187416
  teamId
186917
187417
  );
186918
187418
  output_manager_default.log(
186919
- `${import_chalk129.default.cyan("\u2713")} Version ${import_chalk129.default.bold(
187419
+ `${import_chalk130.default.cyan("\u2713")} Version ${import_chalk130.default.bold(
186920
187420
  newVersion.name || newVersion.id
186921
- )} promoted to production ${import_chalk129.default.gray(updateStamp())}`
187421
+ )} promoted to production ${import_chalk130.default.gray(updateStamp())}`
186922
187422
  );
186923
187423
  return 0;
186924
187424
  }
186925
- var import_chalk129;
187425
+ var import_chalk130;
186926
187426
  var init_promote3 = __esm({
186927
187427
  "src/commands/redirects/promote.ts"() {
186928
187428
  "use strict";
186929
- import_chalk129 = __toESM3(require_source());
187429
+ import_chalk130 = __toESM3(require_source());
186930
187430
  init_output_manager();
186931
187431
  init_command32();
186932
187432
  init_shared2();
@@ -186953,14 +187453,14 @@ async function restore(client2, argv) {
186953
187453
  const { project, org } = link4;
186954
187454
  const teamId = org.type === "team" ? org.id : void 0;
186955
187455
  const [versionIdentifier] = parsed.args;
186956
- output_manager_default.spinner(`Fetching redirect versions for ${import_chalk130.default.bold(project.name)}`);
187456
+ output_manager_default.spinner(`Fetching redirect versions for ${import_chalk131.default.bold(project.name)}`);
186957
187457
  const { versions } = await getRedirectVersions(client2, project.id, teamId);
186958
187458
  const version2 = versions.find(
186959
187459
  (v) => v.id === versionIdentifier || v.name === versionIdentifier
186960
187460
  );
186961
187461
  if (!version2) {
186962
187462
  output_manager_default.error(
186963
- `Version with ID or name "${versionIdentifier}" not found. Run ${import_chalk130.default.cyan(
187463
+ `Version with ID or name "${versionIdentifier}" not found. Run ${import_chalk131.default.cyan(
186964
187464
  "vercel redirects list-versions"
186965
187465
  )} to see available versions.`
186966
187466
  );
@@ -186968,10 +187468,10 @@ async function restore(client2, argv) {
186968
187468
  }
186969
187469
  if (version2.isLive) {
186970
187470
  output_manager_default.error(
186971
- `Version ${import_chalk130.default.bold(
187471
+ `Version ${import_chalk131.default.bold(
186972
187472
  version2.name || version2.id
186973
187473
  )} is currently live. You cannot restore the live version.
186974
- Run ${import_chalk130.default.cyan(
187474
+ Run ${import_chalk131.default.cyan(
186975
187475
  "vercel redirects list-versions"
186976
187476
  )} to see previous versions you can restore.`
186977
187477
  );
@@ -186979,7 +187479,7 @@ Run ${import_chalk130.default.cyan(
186979
187479
  }
186980
187480
  if (version2.isStaging) {
186981
187481
  output_manager_default.error(
186982
- `Version ${import_chalk130.default.bold(
187482
+ `Version ${import_chalk131.default.bold(
186983
187483
  version2.name || version2.id
186984
187484
  )} is staged. You can only restore previous versions.`
186985
187485
  );
@@ -186997,13 +187497,13 @@ Run ${import_chalk130.default.cyan(
186997
187497
  );
186998
187498
  if (changedRedirects.length > 0) {
186999
187499
  output_manager_default.print(`
187000
- ${import_chalk130.default.bold("Changes to be restored:")}
187500
+ ${import_chalk131.default.bold("Changes to be restored:")}
187001
187501
 
187002
187502
  `);
187003
187503
  const displayRedirects = changedRedirects.slice(0, 20);
187004
187504
  for (const redirect2 of displayRedirects) {
187005
187505
  const status3 = redirect2.statusCode || (redirect2.permanent ? 308 : 307);
187006
- const symbol = redirect2.action === "+" ? import_chalk130.default.green("+") : import_chalk130.default.red("-");
187506
+ const symbol = redirect2.action === "+" ? import_chalk131.default.green("+") : import_chalk131.default.red("-");
187007
187507
  output_manager_default.print(
187008
187508
  ` ${symbol} ${redirect2.source} \u2192 ${redirect2.destination} (${status3})
187009
187509
  `
@@ -187011,7 +187511,7 @@ ${import_chalk130.default.bold("Changes to be restored:")}
187011
187511
  }
187012
187512
  if (changedRedirects.length > 20) {
187013
187513
  output_manager_default.print(
187014
- import_chalk130.default.gray(`
187514
+ import_chalk131.default.gray(`
187015
187515
  ... and ${changedRedirects.length - 20} more changes
187016
187516
  `)
187017
187517
  );
@@ -187020,7 +187520,7 @@ ${import_chalk130.default.bold("Changes to be restored:")}
187020
187520
  } else {
187021
187521
  output_manager_default.print(
187022
187522
  `
187023
- ${import_chalk130.default.gray("No changes detected from current production version.")}
187523
+ ${import_chalk131.default.gray("No changes detected from current production version.")}
187024
187524
 
187025
187525
  `
187026
187526
  );
@@ -187028,15 +187528,15 @@ ${import_chalk130.default.gray("No changes detected from current production vers
187028
187528
  const confirmed = await confirmAction(
187029
187529
  client2,
187030
187530
  parsed.flags["--yes"],
187031
- `Restore version ${import_chalk130.default.bold(versionName)}?`,
187032
- `This will make it the live version for ${import_chalk130.default.bold(project.name)}.`
187531
+ `Restore version ${import_chalk131.default.bold(versionName)}?`,
187532
+ `This will make it the live version for ${import_chalk131.default.bold(project.name)}.`
187033
187533
  );
187034
187534
  if (!confirmed) {
187035
187535
  output_manager_default.log("Canceled");
187036
187536
  return 0;
187037
187537
  }
187038
187538
  const updateStamp = stamp_default();
187039
- output_manager_default.spinner(`Restoring version ${import_chalk130.default.bold(versionName)}`);
187539
+ output_manager_default.spinner(`Restoring version ${import_chalk131.default.bold(versionName)}`);
187040
187540
  const { version: newVersion } = await updateRedirectVersion(
187041
187541
  client2,
187042
187542
  project.id,
@@ -187045,17 +187545,17 @@ ${import_chalk130.default.gray("No changes detected from current production vers
187045
187545
  teamId
187046
187546
  );
187047
187547
  output_manager_default.log(
187048
- `${import_chalk130.default.cyan("\u2713")} Version ${import_chalk130.default.bold(
187548
+ `${import_chalk131.default.cyan("\u2713")} Version ${import_chalk131.default.bold(
187049
187549
  newVersion.name || newVersion.id
187050
- )} restored to production ${import_chalk130.default.gray(updateStamp())}`
187550
+ )} restored to production ${import_chalk131.default.gray(updateStamp())}`
187051
187551
  );
187052
187552
  return 0;
187053
187553
  }
187054
- var import_chalk130;
187554
+ var import_chalk131;
187055
187555
  var init_restore = __esm({
187056
187556
  "src/commands/redirects/restore.ts"() {
187057
187557
  "use strict";
187058
- import_chalk130 = __toESM3(require_source());
187558
+ import_chalk131 = __toESM3(require_source());
187059
187559
  init_output_manager();
187060
187560
  init_command32();
187061
187561
  init_shared2();
@@ -187091,6 +187591,12 @@ var init_redirects = __esm({
187091
187591
  value: actual
187092
187592
  });
187093
187593
  }
187594
+ trackCliSubcommandUpload(actual) {
187595
+ this.trackCliSubcommand({
187596
+ subcommand: "upload",
187597
+ value: actual
187598
+ });
187599
+ }
187094
187600
  trackCliSubcommandRemove(actual) {
187095
187601
  this.trackCliSubcommand({
187096
187602
  subcommand: "remove",
@@ -187178,6 +187684,14 @@ async function main16(client2) {
187178
187684
  }
187179
187685
  telemetry2.trackCliSubcommandAdd(subcommandOriginal);
187180
187686
  return add7(client2, args2);
187687
+ case "upload":
187688
+ if (needHelp) {
187689
+ telemetry2.trackCliFlagHelp("redirects", subcommandOriginal);
187690
+ printHelp(uploadSubcommand);
187691
+ return 2;
187692
+ }
187693
+ telemetry2.trackCliSubcommandUpload(subcommandOriginal);
187694
+ return upload(client2, args2);
187181
187695
  case "remove":
187182
187696
  if (needHelp) {
187183
187697
  telemetry2.trackCliFlagHelp("redirects", subcommandOriginal);
@@ -187220,6 +187734,7 @@ var init_redirects2 = __esm({
187220
187734
  init_list11();
187221
187735
  init_list_versions();
187222
187736
  init_add13();
187737
+ init_upload();
187223
187738
  init_remove5();
187224
187739
  init_promote3();
187225
187740
  init_restore();
@@ -187232,6 +187747,7 @@ var init_redirects2 = __esm({
187232
187747
  list: getCommandAliases(listSubcommand8),
187233
187748
  "list-versions": getCommandAliases(listVersionsSubcommand),
187234
187749
  add: getCommandAliases(addSubcommand7),
187750
+ upload: getCommandAliases(uploadSubcommand),
187235
187751
  remove: getCommandAliases(removeSubcommand9),
187236
187752
  promote: getCommandAliases(promoteSubcommand),
187237
187753
  restore: getCommandAliases(restoreSubcommand)
@@ -187424,7 +187940,7 @@ async function remove6(client2) {
187424
187940
  }
187425
187941
  const { contextName } = await getScope(client2);
187426
187942
  output_manager_default.spinner(
187427
- `Fetching deployment(s) ${ids.map((id) => `"${id}"`).join(" ")} in ${import_chalk131.default.bold(contextName)}`
187943
+ `Fetching deployment(s) ${ids.map((id) => `"${id}"`).join(" ")} in ${import_chalk132.default.bold(contextName)}`
187428
187944
  );
187429
187945
  let aliases;
187430
187946
  let projects;
@@ -187490,7 +188006,7 @@ async function remove6(client2) {
187490
188006
  });
187491
188007
  if (deployments.length === 0 && projects.length === 0) {
187492
188008
  const safeUnaliased = parsedArgs.flags["--safe"] ? "unaliased" : "any";
187493
- const stylizedIds = ids.map((id) => import_chalk131.default.bold(`"${id}"`)).join(", ");
188009
+ const stylizedIds = ids.map((id) => import_chalk132.default.bold(`"${id}"`)).join(", ");
187494
188010
  const commandName = getCommandName("projects ls");
187495
188011
  log2(
187496
188012
  `Could not find ${safeUnaliased} deployments or projects matching ${stylizedIds}. Run ${commandName} to list.`
@@ -187498,7 +188014,7 @@ async function remove6(client2) {
187498
188014
  return 1;
187499
188015
  }
187500
188016
  log2(
187501
- `Found ${deploymentsAndProjects(deployments, projects)} for removal in ${import_chalk131.default.bold(contextName)} ${elapsed(Date.now() - findStart)}`
188017
+ `Found ${deploymentsAndProjects(deployments, projects)} for removal in ${import_chalk132.default.bold(contextName)} ${elapsed(Date.now() - findStart)}`
187502
188018
  );
187503
188019
  if (deployments.length > 200) {
187504
188020
  output_manager_default.warn(
@@ -187525,11 +188041,11 @@ async function remove6(client2) {
187525
188041
  `Removed ${deploymentsAndProjects(deployments, projects)} ${elapsed(Date.now() - start)}`
187526
188042
  );
187527
188043
  deployments.forEach((depl) => {
187528
- output_manager_default.print(`${import_chalk131.default.gray("-")} ${import_chalk131.default.bold(depl.url)}
188044
+ output_manager_default.print(`${import_chalk132.default.gray("-")} ${import_chalk132.default.bold(depl.url)}
187529
188045
  `);
187530
188046
  });
187531
188047
  projects.forEach((project) => {
187532
- output_manager_default.print(`${import_chalk131.default.gray("-")} ${import_chalk131.default.bold(project.name)}
188048
+ output_manager_default.print(`${import_chalk132.default.gray("-")} ${import_chalk132.default.bold(project.name)}
187533
188049
  `);
187534
188050
  });
187535
188051
  return 0;
@@ -187546,8 +188062,8 @@ function readConfirmation4(deployments, projects) {
187546
188062
  );
187547
188063
  const deploymentTable = table(
187548
188064
  deployments.map((depl) => {
187549
- const time = import_chalk131.default.gray(`${(0, import_ms28.default)(Date.now() - depl.createdAt)} ago`);
187550
- const url3 = depl.url ? import_chalk131.default.underline(`https://${depl.url}`) : "";
188065
+ const time = import_chalk132.default.gray(`${(0, import_ms28.default)(Date.now() - depl.createdAt)} ago`);
188066
+ const url3 = depl.url ? import_chalk132.default.underline(`https://${depl.url}`) : "";
187551
188067
  return [` ${depl.id}`, url3, time];
187552
188068
  }),
187553
188069
  { align: ["l", "r", "l"], hsep: 6 }
@@ -187558,7 +188074,7 @@ function readConfirmation4(deployments, projects) {
187558
188074
  for (const depl of deployments) {
187559
188075
  for (const { alias: alias2 } of depl.aliases) {
187560
188076
  output_manager_default.warn(
187561
- `${import_chalk131.default.underline(`https://${alias2}`)} is an alias for ${import_chalk131.default.bold(depl.url)} and will be removed`
188077
+ `${import_chalk132.default.underline(`https://${alias2}`)} is an alias for ${import_chalk132.default.bold(depl.url)} and will be removed`
187562
188078
  );
187563
188079
  }
187564
188080
  }
@@ -187572,12 +188088,12 @@ function readConfirmation4(deployments, projects) {
187572
188088
  `
187573
188089
  );
187574
188090
  for (const project of projects) {
187575
- output_manager_default.print(`${import_chalk131.default.gray("-")} ${import_chalk131.default.bold(project.name)}
188091
+ output_manager_default.print(`${import_chalk132.default.gray("-")} ${import_chalk132.default.bold(project.name)}
187576
188092
  `);
187577
188093
  }
187578
188094
  }
187579
188095
  output_manager_default.print(
187580
- `${import_chalk131.default.bold.red("> Are you sure?")} ${import_chalk131.default.gray("(y/N) ")}`
188096
+ `${import_chalk132.default.bold.red("> Are you sure?")} ${import_chalk132.default.gray("(y/N) ")}`
187581
188097
  );
187582
188098
  process.stdin.on("data", (d) => {
187583
188099
  process.stdin.pause();
@@ -187594,11 +188110,11 @@ function deploymentsAndProjects(deployments, projects, conjunction = "and") {
187594
188110
  }
187595
188111
  return `${(0, import_pluralize15.default)("deployment", deployments.length, true)} ${conjunction} ${(0, import_pluralize15.default)("project", projects.length, true)}`;
187596
188112
  }
187597
- var import_chalk131, import_ms28, import_pluralize15;
188113
+ var import_chalk132, import_ms28, import_pluralize15;
187598
188114
  var init_remove7 = __esm({
187599
188115
  "src/commands/remove/index.ts"() {
187600
188116
  "use strict";
187601
- import_chalk131 = __toESM3(require_source());
188117
+ import_chalk132 = __toESM3(require_source());
187602
188118
  import_ms28 = __toESM3(require_ms());
187603
188119
  import_pluralize15 = __toESM3(require_pluralize());
187604
188120
  init_table();
@@ -187694,7 +188210,7 @@ async function rollbackStatus({
187694
188210
  }
187695
188211
  if (requestedAt < recentThreshold || Date.now() >= rollbackTimeout) {
187696
188212
  output_manager_default.log(
187697
- `The rollback exceeded its deadline - rerun ${import_chalk132.default.bold(
188213
+ `The rollback exceeded its deadline - rerun ${import_chalk133.default.bold(
187698
188214
  `${packageName} rollback ${toDeploymentId}`
187699
188215
  )} to try again`
187700
188216
  );
@@ -187758,26 +188274,26 @@ async function renderJobSucceeded2({
187758
188274
  let deploymentInfo = "";
187759
188275
  try {
187760
188276
  const deployment = await getDeployment(client2, contextName, toDeploymentId);
187761
- deploymentInfo = `${import_chalk132.default.bold(deployment.url)} (${toDeploymentId})`;
188277
+ deploymentInfo = `${import_chalk133.default.bold(deployment.url)} (${toDeploymentId})`;
187762
188278
  } catch (err) {
187763
188279
  output_manager_default.debug(
187764
188280
  `Failed to get deployment url for ${toDeploymentId}: ${err?.toString() || err}`
187765
188281
  );
187766
- deploymentInfo = import_chalk132.default.bold(toDeploymentId);
188282
+ deploymentInfo = import_chalk133.default.bold(toDeploymentId);
187767
188283
  }
187768
188284
  const duration = performingRollback ? elapsed(Date.now() - requestedAt) : "";
187769
188285
  output_manager_default.log(
187770
- `Success! ${import_chalk132.default.bold(
188286
+ `Success! ${import_chalk133.default.bold(
187771
188287
  project.name
187772
188288
  )} was rolled back to ${deploymentInfo} ${duration}`
187773
188289
  );
187774
188290
  return 0;
187775
188291
  }
187776
- var import_chalk132, import_ms29;
188292
+ var import_chalk133, import_ms29;
187777
188293
  var init_status3 = __esm({
187778
188294
  "src/commands/rollback/status.ts"() {
187779
188295
  "use strict";
187780
- import_chalk132 = __toESM3(require_source());
188296
+ import_chalk133 = __toESM3(require_source());
187781
188297
  init_elapsed();
187782
188298
  init_format_date();
187783
188299
  init_get_deployment();
@@ -187809,7 +188325,7 @@ async function requestRollback({
187809
188325
  });
187810
188326
  if (timeout !== void 0 && (0, import_ms30.default)(timeout) === 0) {
187811
188327
  output_manager_default.log(
187812
- `Successfully requested rollback of ${import_chalk133.default.bold(project.name)} to ${deployment.url} (${deployment.id})`
188328
+ `Successfully requested rollback of ${import_chalk134.default.bold(project.name)} to ${deployment.url} (${deployment.id})`
187813
188329
  );
187814
188330
  output_manager_default.log(`To check rollback status, run ${getCommandName("rollback")}.`);
187815
188331
  return 0;
@@ -187822,11 +188338,11 @@ async function requestRollback({
187822
188338
  timeout
187823
188339
  });
187824
188340
  }
187825
- var import_chalk133, import_ms30;
188341
+ var import_chalk134, import_ms30;
187826
188342
  var init_request_rollback = __esm({
187827
188343
  "src/commands/rollback/request-rollback.ts"() {
187828
188344
  "use strict";
187829
- import_chalk133 = __toESM3(require_source());
188345
+ import_chalk134 = __toESM3(require_source());
187830
188346
  init_pkg_name();
187831
188347
  init_get_project_by_deployment();
187832
188348
  import_ms30 = __toESM3(require_ms());
@@ -188496,11 +189012,11 @@ function formatBranchMatcher(branchMatcher) {
188496
189012
  if (branchMatcher?.type === "equals") {
188497
189013
  return branchMatcher.pattern;
188498
189014
  } else if (branchMatcher?.type === "startsWith") {
188499
- return `${branchMatcher.pattern}${import_chalk134.default.dim("*")}`;
189015
+ return `${branchMatcher.pattern}${import_chalk135.default.dim("*")}`;
188500
189016
  } else if (branchMatcher?.type === "endsWith") {
188501
- return `${import_chalk134.default.dim("*")}${branchMatcher.pattern}`;
189017
+ return `${import_chalk135.default.dim("*")}${branchMatcher.pattern}`;
188502
189018
  }
188503
- return import_chalk134.default.dim("No branch configuration");
189019
+ return import_chalk135.default.dim("No branch configuration");
188504
189020
  }
188505
189021
  async function list8(client2, argv) {
188506
189022
  const { cwd } = client2;
@@ -188531,12 +189047,12 @@ async function list8(client2, argv) {
188531
189047
  const elapsed2 = (0, import_ms32.default)(Date.now() - start);
188532
189048
  result = withDefaultEnvironmentsIncluded(result);
188533
189049
  output_manager_default.log(
188534
- `${result.length} Environment${result.length === 1 ? "" : "s"} found under ${projectSlugLink} ${import_chalk134.default.gray(`[${elapsed2}]`)}`
189050
+ `${result.length} Environment${result.length === 1 ? "" : "s"} found under ${projectSlugLink} ${import_chalk135.default.gray(`[${elapsed2}]`)}`
188535
189051
  );
188536
189052
  const tablePrint = table(
188537
189053
  [
188538
189054
  ["Target Name", "Branch Tracking", "Type", "Updated"].map(
188539
- (header) => import_chalk134.default.bold(import_chalk134.default.cyan(header))
189055
+ (header) => import_chalk135.default.bold(import_chalk135.default.cyan(header))
188540
189056
  ),
188541
189057
  ...result.flatMap((target) => {
188542
189058
  return [
@@ -188544,7 +189060,7 @@ async function list8(client2, argv) {
188544
189060
  formatEnvironment(link4.org.slug, link4.project.name, target),
188545
189061
  BRANCH_TRACKING_MAP[target.type](link4.project, target),
188546
189062
  TYPE_MAP[target.type],
188547
- import_chalk134.default.gray(
189063
+ import_chalk135.default.gray(
188548
189064
  target.updatedAt > 0 ? (0, import_ms32.default)(Date.now() - target.updatedAt) : "-"
188549
189065
  )
188550
189066
  ]
@@ -188591,12 +189107,12 @@ function withDefaultEnvironmentsIncluded(environments) {
188591
189107
  ...environments.slice().sort((a, b) => a.slug.localeCompare(b.slug))
188592
189108
  ];
188593
189109
  }
188594
- var import_ms32, import_chalk134, TYPE_MAP, BRANCH_TRACKING_MAP;
189110
+ var import_ms32, import_chalk135, TYPE_MAP, BRANCH_TRACKING_MAP;
188595
189111
  var init_list12 = __esm({
188596
189112
  "src/commands/target/list.ts"() {
188597
189113
  "use strict";
188598
189114
  import_ms32 = __toESM3(require_ms());
188599
- import_chalk134 = __toESM3(require_source());
189115
+ import_chalk135 = __toESM3(require_source());
188600
189116
  init_table();
188601
189117
  init_output_manager();
188602
189118
  init_command36();
@@ -188611,8 +189127,8 @@ var init_list12 = __esm({
188611
189127
  };
188612
189128
  BRANCH_TRACKING_MAP = {
188613
189129
  production: (project) => project.link?.productionBranch ?? "main",
188614
- preview: (_, env) => env.slug === "preview" ? import_chalk134.default.dim("All unassigned git branches") : formatBranchMatcher(env.branchMatcher),
188615
- development: () => import_chalk134.default.dim("Accessible via CLI")
189130
+ preview: (_, env) => env.slug === "preview" ? import_chalk135.default.dim("All unassigned git branches") : formatBranchMatcher(env.branchMatcher),
189131
+ development: () => import_chalk135.default.dim("Accessible via CLI")
188616
189132
  };
188617
189133
  }
188618
189134
  });
@@ -188816,7 +189332,7 @@ async function list9(client2, argv) {
188816
189332
  client2.stdout.write("\n");
188817
189333
  const teamTable = table(
188818
189334
  [
188819
- ["id", "Team name"].map((str) => (0, import_chalk135.gray)(str)),
189335
+ ["id", "Team name"].map((str) => (0, import_chalk136.gray)(str)),
188820
189336
  ...teamList.map((team) => [team.value, team.name])
188821
189337
  ],
188822
189338
  { hsep: 5 }
@@ -188833,13 +189349,13 @@ async function list9(client2, argv) {
188833
189349
  }
188834
189350
  return 0;
188835
189351
  }
188836
- var import_chalk135;
189352
+ var import_chalk136;
188837
189353
  var init_list14 = __esm({
188838
189354
  "src/commands/teams/list.ts"() {
188839
189355
  "use strict";
188840
189356
  init_chars();
188841
189357
  init_table();
188842
- import_chalk135 = __toESM3(require_source());
189358
+ import_chalk136 = __toESM3(require_source());
188843
189359
  init_get_user();
188844
189360
  init_get_teams();
188845
189361
  init_pkg_name();
@@ -188935,7 +189451,7 @@ Please select a team scope using ${getCommandName(
188935
189451
  return 1;
188936
189452
  }
188937
189453
  output_manager_default.log(
188938
- introMsg || `Inviting team members to ${import_chalk136.default.bold(currentTeam.name)}`
189454
+ introMsg || `Inviting team members to ${import_chalk137.default.bold(currentTeam.name)}`
188939
189455
  );
188940
189456
  telemetry2.trackCliArgumentEmail(emails);
188941
189457
  if (emails.length > 0) {
@@ -188955,10 +189471,10 @@ Please select a team scope using ${getCommandName(
188955
189471
  throw err;
188956
189472
  }
188957
189473
  output_manager_default.log(
188958
- `${import_chalk136.default.cyan(chars_default.tick)} ${email3}${userInfo ? ` (${userInfo})` : ""} ${elapsed2()}`
189474
+ `${import_chalk137.default.cyan(chars_default.tick)} ${email3}${userInfo ? ` (${userInfo})` : ""} ${elapsed2()}`
188959
189475
  );
188960
189476
  } else {
188961
- output_manager_default.log(`${import_chalk136.default.red(`\u2716 ${email3}`)} ${import_chalk136.default.gray("[invalid]")}`);
189477
+ output_manager_default.log(`${import_chalk137.default.red(`\u2716 ${email3}`)} ${import_chalk137.default.gray("[invalid]")}`);
188962
189478
  }
188963
189479
  }
188964
189480
  return 0;
@@ -188991,15 +189507,15 @@ Please select a team scope using ${getCommandName(
188991
189507
  );
188992
189508
  email2 = `${email2}${username ? ` (${username})` : ""} ${elapsed2()}`;
188993
189509
  emails.push(email2);
188994
- output_manager_default.log(`${import_chalk136.default.cyan(chars_default.tick)} ${sentEmailPrefix}${email2}`);
189510
+ output_manager_default.log(`${import_chalk137.default.cyan(chars_default.tick)} ${sentEmailPrefix}${email2}`);
188995
189511
  if (hasError) {
188996
189512
  hasError = false;
188997
189513
  process.stderr.write(eraseLines(emails.length + 2));
188998
189514
  output_manager_default.log(
188999
- introMsg || `Inviting team members to ${import_chalk136.default.bold(currentTeam.name)}`
189515
+ introMsg || `Inviting team members to ${import_chalk137.default.bold(currentTeam.name)}`
189000
189516
  );
189001
189517
  for (const email3 of emails) {
189002
- output_manager_default.log(`${import_chalk136.default.cyan(chars_default.tick)} ${inviteUserPrefix}${email3}`);
189518
+ output_manager_default.log(`${import_chalk137.default.cyan(chars_default.tick)} ${inviteUserPrefix}${email3}`);
189003
189519
  }
189004
189520
  }
189005
189521
  } catch (err) {
@@ -189008,7 +189524,7 @@ Please select a team scope using ${getCommandName(
189008
189524
  output_manager_default.error((0, import_error_utils35.errorToString)(err));
189009
189525
  hasError = true;
189010
189526
  for (const email3 of emails) {
189011
- output_manager_default.log(`${import_chalk136.default.cyan(chars_default.tick)} ${sentEmailPrefix}${email3}`);
189527
+ output_manager_default.log(`${import_chalk137.default.cyan(chars_default.tick)} ${sentEmailPrefix}${email3}`);
189012
189528
  }
189013
189529
  }
189014
189530
  }
@@ -189021,16 +189537,16 @@ Please select a team scope using ${getCommandName(
189021
189537
  } else {
189022
189538
  output_manager_default.success(`Invited ${n} teammate${n > 1 ? "s" : ""}`);
189023
189539
  for (const email3 of emails) {
189024
- output_manager_default.log(`${import_chalk136.default.cyan(chars_default.tick)} ${inviteUserPrefix}${email3}`);
189540
+ output_manager_default.log(`${import_chalk137.default.cyan(chars_default.tick)} ${inviteUserPrefix}${email3}`);
189025
189541
  }
189026
189542
  }
189027
189543
  return 0;
189028
189544
  }
189029
- var import_chalk136, import_error_utils35, validateEmail, domains;
189545
+ var import_chalk137, import_error_utils35, validateEmail, domains;
189030
189546
  var init_invite2 = __esm({
189031
189547
  "src/commands/teams/invite.ts"() {
189032
189548
  "use strict";
189033
- import_chalk136 = __toESM3(require_source());
189549
+ import_chalk137 = __toESM3(require_source());
189034
189550
  init_cmd();
189035
189551
  init_stamp();
189036
189552
  init_param();
@@ -189106,7 +189622,7 @@ async function add8(client2) {
189106
189622
  let team;
189107
189623
  let elapsed2;
189108
189624
  output_manager_default.log(
189109
- `Pick a team identifier for its URL (e.g.: ${import_chalk137.default.cyan(
189625
+ `Pick a team identifier for its URL (e.g.: ${import_chalk138.default.cyan(
189110
189626
  "`vercel.com/acme`"
189111
189627
  )})`
189112
189628
  );
@@ -189137,7 +189653,7 @@ async function add8(client2) {
189137
189653
  output_manager_default.stopSpinner();
189138
189654
  process.stdout.write(eraseLines(2));
189139
189655
  output_manager_default.success(`Team created ${elapsed2()}`);
189140
- output_manager_default.log(`${import_chalk137.default.cyan(`${chars_default.tick} `) + teamUrlPrefix + slug}
189656
+ output_manager_default.log(`${import_chalk138.default.cyan(`${chars_default.tick} `) + teamUrlPrefix + slug}
189141
189657
  `);
189142
189658
  output_manager_default.log("Pick a display name for your team");
189143
189659
  let name;
@@ -189160,7 +189676,7 @@ async function add8(client2) {
189160
189676
  process.stdout.write(eraseLines(2));
189161
189677
  team = Object.assign(team, res);
189162
189678
  output_manager_default.success(`Team name saved ${elapsed2()}`);
189163
- output_manager_default.log(`${import_chalk137.default.cyan(`${chars_default.tick} `) + teamNamePrefix + team.name}
189679
+ output_manager_default.log(`${import_chalk138.default.cyan(`${chars_default.tick} `) + teamNamePrefix + team.name}
189164
189680
  `);
189165
189681
  output_manager_default.spinner("Saving");
189166
189682
  client2.config.currentTeam = team.id;
@@ -189174,11 +189690,11 @@ async function add8(client2) {
189174
189690
  });
189175
189691
  return 0;
189176
189692
  }
189177
- var import_chalk137, import_error_utils36, validateSlug, validateName, teamUrlPrefix, teamNamePrefix;
189693
+ var import_chalk138, import_error_utils36, validateSlug, validateName, teamUrlPrefix, teamNamePrefix;
189178
189694
  var init_add14 = __esm({
189179
189695
  "src/commands/teams/add.ts"() {
189180
189696
  "use strict";
189181
- import_chalk137 = __toESM3(require_source());
189697
+ import_chalk138 = __toESM3(require_source());
189182
189698
  init_stamp();
189183
189699
  init_erase_lines();
189184
189700
  init_chars();
@@ -189191,7 +189707,7 @@ var init_add14 = __esm({
189191
189707
  init_output_manager();
189192
189708
  validateSlug = (value) => /^[a-z]+[a-z0-9_-]*$/.test(value);
189193
189709
  validateName = (value) => /^[ a-zA-Z0-9_-]+$/.test(value);
189194
- teamUrlPrefix = "Team URL".padEnd(14) + import_chalk137.default.gray("vercel.com/");
189710
+ teamUrlPrefix = "Team URL".padEnd(14) + import_chalk138.default.gray("vercel.com/");
189195
189711
  teamNamePrefix = "Team Name".padEnd(14);
189196
189712
  }
189197
189713
  });
@@ -189250,7 +189766,7 @@ async function change(client2, argv) {
189250
189766
  let title9 = `${team.name} (${team.slug})`;
189251
189767
  const selected = team.id === currentTeam?.id;
189252
189768
  if (selected) {
189253
- title9 += ` ${import_chalk138.default.bold("(current)")}`;
189769
+ title9 += ` ${import_chalk139.default.bold("(current)")}`;
189254
189770
  }
189255
189771
  if (team.limited) {
189256
189772
  title9 += ` ${emoji("locked")}`;
@@ -189262,7 +189778,7 @@ async function change(client2, argv) {
189262
189778
  selected
189263
189779
  };
189264
189780
  });
189265
- let suffix = personalScopeSelected ? ` ${import_chalk138.default.bold("(current)")}` : "";
189781
+ let suffix = personalScopeSelected ? ` ${import_chalk139.default.bold("(current)")}` : "";
189266
189782
  if (user.limited) {
189267
189783
  suffix += ` ${emoji("locked")}`;
189268
189784
  }
@@ -189308,14 +189824,14 @@ async function change(client2, argv) {
189308
189824
  }
189309
189825
  updateCurrentTeam(config2);
189310
189826
  output_manager_default.success(
189311
- `Your account (${import_chalk138.default.bold(user.username)}) is now active!`
189827
+ `Your account (${import_chalk139.default.bold(user.username)}) is now active!`
189312
189828
  );
189313
189829
  return 0;
189314
189830
  }
189315
189831
  const newTeam = teams2.find((team) => team.slug === desiredSlug);
189316
189832
  if (!newTeam) {
189317
189833
  output_manager_default.error(
189318
- `You do not have permission to access scope ${import_chalk138.default.bold(desiredSlug)}.`
189834
+ `You do not have permission to access scope ${import_chalk139.default.bold(desiredSlug)}.`
189319
189835
  );
189320
189836
  return 1;
189321
189837
  }
@@ -189333,15 +189849,15 @@ async function change(client2, argv) {
189333
189849
  }
189334
189850
  updateCurrentTeam(config2, newTeam);
189335
189851
  output_manager_default.success(
189336
- `The team ${import_chalk138.default.bold(newTeam.name)} (${newTeam.slug}) is now active!`
189852
+ `The team ${import_chalk139.default.bold(newTeam.name)} (${newTeam.slug}) is now active!`
189337
189853
  );
189338
189854
  return 0;
189339
189855
  }
189340
- var import_chalk138, updateCurrentTeam;
189856
+ var import_chalk139, updateCurrentTeam;
189341
189857
  var init_switch2 = __esm({
189342
189858
  "src/commands/teams/switch.ts"() {
189343
189859
  "use strict";
189344
- import_chalk138 = __toESM3(require_source());
189860
+ import_chalk139 = __toESM3(require_source());
189345
189861
  init_emoji();
189346
189862
  init_get_user();
189347
189863
  init_get_teams();
@@ -189520,13 +190036,13 @@ var init_teams2 = __esm({
189520
190036
  // src/commands/telemetry/status.ts
189521
190037
  async function status2(client2) {
189522
190038
  const enabled = client2.config.telemetry?.enabled !== false;
189523
- const status3 = enabled ? import_chalk139.default.green("Enabled") : import_chalk139.default.red("Disabled");
190039
+ const status3 = enabled ? import_chalk140.default.green("Enabled") : import_chalk140.default.red("Disabled");
189524
190040
  output_manager_default.print("\n");
189525
- output_manager_default.log(`${import_chalk139.default.bold("Telemetry status")}: ${status3}
190041
+ output_manager_default.log(`${import_chalk140.default.bold("Telemetry status")}: ${status3}
189526
190042
  `);
189527
190043
  const learnMoreMessage = `
189528
190044
 
189529
- Learn more: ${import_chalk139.default.cyan("https://vercel.com/docs/cli/about-telemetry")}`;
190045
+ Learn more: ${import_chalk140.default.cyan("https://vercel.com/docs/cli/about-telemetry")}`;
189530
190046
  if (enabled) {
189531
190047
  output_manager_default.log(`You have opted in to Vercel CLI telemetry${learnMoreMessage}`);
189532
190048
  } else {
@@ -189537,11 +190053,11 @@ Learn more: ${import_chalk139.default.cyan("https://vercel.com/docs/cli/about-te
189537
190053
  }
189538
190054
  return 0;
189539
190055
  }
189540
- var import_chalk139;
190056
+ var import_chalk140;
189541
190057
  var init_status4 = __esm({
189542
190058
  "src/commands/telemetry/status.ts"() {
189543
190059
  "use strict";
189544
- import_chalk139 = __toESM3(require_source());
190060
+ import_chalk140 = __toESM3(require_source());
189545
190061
  init_output_manager();
189546
190062
  }
189547
190063
  });
@@ -189722,7 +190238,7 @@ async function telemetry(client2) {
189722
190238
  default: {
189723
190239
  const errorMessage = parsedArguments.args.length !== 2 ? "Invalid number of arguments" : "Invalid subcommand";
189724
190240
  output_manager_default.print(
189725
- `${import_chalk140.default.red("Error")}: ${errorMessage}. See help instructions for usage:
190241
+ `${import_chalk141.default.red("Error")}: ${errorMessage}. See help instructions for usage:
189726
190242
  `
189727
190243
  );
189728
190244
  output_manager_default.print(help(telemetryCommand, { columns: client2.stderr.columns }));
@@ -189730,7 +190246,7 @@ async function telemetry(client2) {
189730
190246
  }
189731
190247
  }
189732
190248
  }
189733
- var import_chalk140, COMMAND_CONFIG21;
190249
+ var import_chalk141, COMMAND_CONFIG21;
189734
190250
  var init_telemetry3 = __esm({
189735
190251
  "src/commands/telemetry/index.ts"() {
189736
190252
  "use strict";
@@ -189745,7 +190261,7 @@ var init_telemetry3 = __esm({
189745
190261
  init_command38();
189746
190262
  init_get_flags_specification();
189747
190263
  init_telemetry2();
189748
- import_chalk140 = __toESM3(require_source());
190264
+ import_chalk141 = __toESM3(require_source());
189749
190265
  init_output_manager();
189750
190266
  init_commands();
189751
190267
  COMMAND_CONFIG21 = {
@@ -189817,10 +190333,10 @@ var init_whoami2 = __esm({
189817
190333
 
189818
190334
  // src/index.ts
189819
190335
  var import_error_utils37 = __toESM3(require_dist2());
189820
- var import_path41 = require("path");
189821
- var import_fs8 = require("fs");
190336
+ var import_path42 = require("path");
190337
+ var import_fs10 = require("fs");
189822
190338
  var import_fs_extra24 = __toESM3(require_lib());
189823
- var import_chalk141 = __toESM3(require_source());
190339
+ var import_chalk142 = __toESM3(require_source());
189824
190340
  var import_epipebomb = __toESM3(require_epipebomb());
189825
190341
 
189826
190342
  // src/util/get-latest-version/index.ts
@@ -190810,13 +191326,13 @@ var main18 = async () => {
190810
191326
  const betaCommands = ["curl"];
190811
191327
  if (betaCommands.includes(targetOrSubcommand)) {
190812
191328
  output_manager_default.print(
190813
- `${import_chalk141.default.grey(
191329
+ `${import_chalk142.default.grey(
190814
191330
  `${getTitleName()} CLI ${pkg_default.version} ${targetOrSubcommand} (beta) \u2014 https://vercel.com/feedback`
190815
191331
  )}
190816
191332
  `
190817
191333
  );
190818
191334
  } else {
190819
- output_manager_default.print(`${import_chalk141.default.grey(`${getTitleName()} CLI ${pkg_default.version}`)}
191335
+ output_manager_default.print(`${import_chalk142.default.grey(`${getTitleName()} CLI ${pkg_default.version}`)}
190820
191336
  `);
190821
191337
  }
190822
191338
  if (!targetOrSubcommand && parsedArgs.flags["--version"]) {
@@ -190954,8 +191470,8 @@ var main18 = async () => {
190954
191470
  let subcommand = void 0;
190955
191471
  let userSuppliedSubCommand = "";
190956
191472
  if (targetOrSubcommand) {
190957
- const targetPath = (0, import_path41.join)(cwd, targetOrSubcommand);
190958
- const targetPathExists = (0, import_fs8.existsSync)(targetPath);
191473
+ const targetPath = (0, import_path42.join)(cwd, targetOrSubcommand);
191474
+ const targetPathExists = (0, import_fs10.existsSync)(targetPath);
190959
191475
  const subcommandExists = GLOBAL_COMMANDS.has(targetOrSubcommand) || commands.has(targetOrSubcommand);
190960
191476
  if (targetPathExists && subcommandExists && !parsedArgs.flags["--cwd"] && !process.env.NOW_BUILDER) {
190961
191477
  output_manager_default.warn(
@@ -191403,20 +191919,20 @@ main18().then(async (exitCode2) => {
191403
191919
  });
191404
191920
  if (latest) {
191405
191921
  const changelog = "https://github.com/vercel/vercel/releases";
191406
- const errorMsg = exitCode2 && exitCode2 !== 2 ? import_chalk141.default.magenta(
191922
+ const errorMsg = exitCode2 && exitCode2 !== 2 ? import_chalk142.default.magenta(
191407
191923
  `
191408
191924
 
191409
- The latest update ${import_chalk141.default.italic(
191925
+ The latest update ${import_chalk142.default.italic(
191410
191926
  "may"
191411
191927
  )} fix any errors that occurred.`
191412
191928
  ) : "";
191413
191929
  output_manager_default.print(
191414
191930
  box(
191415
- `Update available! ${import_chalk141.default.gray(`v${pkg_default.version}`)} \u226B ${import_chalk141.default.green(
191931
+ `Update available! ${import_chalk142.default.gray(`v${pkg_default.version}`)} \u226B ${import_chalk142.default.green(
191416
191932
  `v${latest}`
191417
191933
  )}
191418
191934
  Changelog: ${output_manager_default.link(changelog, changelog, { fallback: false })}
191419
- Run ${import_chalk141.default.cyan(cmd(await getUpdateCommand()))} to update.${errorMsg}`
191935
+ Run ${import_chalk142.default.cyan(cmd(await getUpdateCommand()))} to update.${errorMsg}`
191420
191936
  )
191421
191937
  );
191422
191938
  output_manager_default.print("\n\n");