vercel 50.9.5 → 50.10.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 +1672 -416
  2. package/package.json +9 -9
package/dist/index.js CHANGED
@@ -3743,10 +3743,10 @@ var require_ansi_styles = __commonJS2({
3743
3743
  };
3744
3744
  var ansi2ansi = (n) => n;
3745
3745
  var rgb2rgb = (r, g, b) => [r, g, b];
3746
- var setLazyProperty = (object, property, get) => {
3746
+ var setLazyProperty = (object, property, get2) => {
3747
3747
  Object.defineProperty(object, property, {
3748
3748
  get: () => {
3749
- const value = get();
3749
+ const value = get2();
3750
3750
  Object.defineProperty(object, property, {
3751
3751
  value,
3752
3752
  enumerable: true,
@@ -4083,14 +4083,14 @@ var require_templates = __commonJS2({
4083
4083
  }
4084
4084
  return results;
4085
4085
  }
4086
- function buildStyle(chalk142, styles) {
4086
+ function buildStyle(chalk147, styles) {
4087
4087
  const enabled = {};
4088
4088
  for (const layer of styles) {
4089
4089
  for (const style of layer.styles) {
4090
4090
  enabled[style[0]] = layer.inverse ? null : style.slice(1);
4091
4091
  }
4092
4092
  }
4093
- let current = chalk142;
4093
+ let current = chalk147;
4094
4094
  for (const [styleName, styles2] of Object.entries(enabled)) {
4095
4095
  if (!Array.isArray(styles2)) {
4096
4096
  continue;
@@ -4102,7 +4102,7 @@ var require_templates = __commonJS2({
4102
4102
  }
4103
4103
  return current;
4104
4104
  }
4105
- module2.exports = (chalk142, temporary) => {
4105
+ module2.exports = (chalk147, temporary) => {
4106
4106
  const styles = [];
4107
4107
  const chunks = [];
4108
4108
  let chunk = [];
@@ -4112,13 +4112,13 @@ var require_templates = __commonJS2({
4112
4112
  } else if (style) {
4113
4113
  const string = chunk.join("");
4114
4114
  chunk = [];
4115
- chunks.push(styles.length === 0 ? string : buildStyle(chalk142, styles)(string));
4115
+ chunks.push(styles.length === 0 ? string : buildStyle(chalk147, styles)(string));
4116
4116
  styles.push({ inverse, styles: parseStyle(style) });
4117
4117
  } else if (close2) {
4118
4118
  if (styles.length === 0) {
4119
4119
  throw new Error("Found extraneous } in Chalk template literal");
4120
4120
  }
4121
- chunks.push(buildStyle(chalk142, styles)(chunk.join("")));
4121
+ chunks.push(buildStyle(chalk147, styles)(chunk.join("")));
4122
4122
  chunk = [];
4123
4123
  styles.pop();
4124
4124
  } else {
@@ -4166,16 +4166,16 @@ var require_source = __commonJS2({
4166
4166
  }
4167
4167
  };
4168
4168
  var chalkFactory = (options) => {
4169
- const chalk143 = {};
4170
- applyOptions(chalk143, options);
4171
- chalk143.template = (...arguments_) => chalkTag(chalk143.template, ...arguments_);
4172
- Object.setPrototypeOf(chalk143, Chalk.prototype);
4173
- Object.setPrototypeOf(chalk143.template, chalk143);
4174
- chalk143.template.constructor = () => {
4169
+ const chalk148 = {};
4170
+ applyOptions(chalk148, options);
4171
+ chalk148.template = (...arguments_) => chalkTag(chalk148.template, ...arguments_);
4172
+ Object.setPrototypeOf(chalk148, Chalk.prototype);
4173
+ Object.setPrototypeOf(chalk148.template, chalk148);
4174
+ chalk148.template.constructor = () => {
4175
4175
  throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
4176
4176
  };
4177
- chalk143.template.Instance = ChalkClass;
4178
- return chalk143.template;
4177
+ chalk148.template.Instance = ChalkClass;
4178
+ return chalk148.template;
4179
4179
  };
4180
4180
  function Chalk(options) {
4181
4181
  return chalkFactory(options);
@@ -4286,7 +4286,7 @@ var require_source = __commonJS2({
4286
4286
  return openAll + string + closeAll;
4287
4287
  };
4288
4288
  var template;
4289
- var chalkTag = (chalk143, ...strings) => {
4289
+ var chalkTag = (chalk148, ...strings) => {
4290
4290
  const [firstString] = strings;
4291
4291
  if (!isArray(firstString) || !isArray(firstString.raw)) {
4292
4292
  return strings.join(" ");
@@ -4302,14 +4302,14 @@ var require_source = __commonJS2({
4302
4302
  if (template === void 0) {
4303
4303
  template = require_templates();
4304
4304
  }
4305
- return template(chalk143, parts.join(""));
4305
+ return template(chalk148, parts.join(""));
4306
4306
  };
4307
4307
  Object.defineProperties(Chalk.prototype, styles);
4308
- var chalk142 = Chalk();
4309
- chalk142.supportsColor = stdoutColor;
4310
- chalk142.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
4311
- chalk142.stderr.supportsColor = stderrColor;
4312
- module2.exports = chalk142;
4308
+ var chalk147 = Chalk();
4309
+ chalk147.supportsColor = stdoutColor;
4310
+ chalk147.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
4311
+ chalk147.stderr.supportsColor = stderrColor;
4312
+ module2.exports = chalk147;
4313
4313
  }
4314
4314
  });
4315
4315
 
@@ -7220,14 +7220,14 @@ var require_templates2 = __commonJS2({
7220
7220
  }
7221
7221
  return results;
7222
7222
  }
7223
- function buildStyle(chalk142, styles) {
7223
+ function buildStyle(chalk147, styles) {
7224
7224
  const enabled = {};
7225
7225
  for (const layer of styles) {
7226
7226
  for (const style of layer.styles) {
7227
7227
  enabled[style[0]] = layer.inverse ? null : style.slice(1);
7228
7228
  }
7229
7229
  }
7230
- let current = chalk142;
7230
+ let current = chalk147;
7231
7231
  for (const styleName of Object.keys(enabled)) {
7232
7232
  if (Array.isArray(enabled[styleName])) {
7233
7233
  if (!(styleName in current)) {
@@ -7242,7 +7242,7 @@ var require_templates2 = __commonJS2({
7242
7242
  }
7243
7243
  return current;
7244
7244
  }
7245
- module2.exports = (chalk142, tmp) => {
7245
+ module2.exports = (chalk147, tmp) => {
7246
7246
  const styles = [];
7247
7247
  const chunks = [];
7248
7248
  let chunk = [];
@@ -7252,13 +7252,13 @@ var require_templates2 = __commonJS2({
7252
7252
  } else if (style) {
7253
7253
  const str = chunk.join("");
7254
7254
  chunk = [];
7255
- chunks.push(styles.length === 0 ? str : buildStyle(chalk142, styles)(str));
7255
+ chunks.push(styles.length === 0 ? str : buildStyle(chalk147, styles)(str));
7256
7256
  styles.push({ inverse, styles: parseStyle(style) });
7257
7257
  } else if (close2) {
7258
7258
  if (styles.length === 0) {
7259
7259
  throw new Error("Found extraneous } in Chalk template literal");
7260
7260
  }
7261
- chunks.push(buildStyle(chalk142, styles)(chunk.join("")));
7261
+ chunks.push(buildStyle(chalk147, styles)(chunk.join("")));
7262
7262
  chunk = [];
7263
7263
  styles.pop();
7264
7264
  } else {
@@ -7295,16 +7295,16 @@ var require_chalk = __commonJS2({
7295
7295
  }
7296
7296
  function Chalk(options) {
7297
7297
  if (!this || !(this instanceof Chalk) || this.template) {
7298
- const chalk142 = {};
7299
- applyOptions(chalk142, options);
7300
- chalk142.template = function() {
7298
+ const chalk147 = {};
7299
+ applyOptions(chalk147, options);
7300
+ chalk147.template = function() {
7301
7301
  const args2 = [].slice.call(arguments);
7302
- return chalkTag.apply(null, [chalk142.template].concat(args2));
7302
+ return chalkTag.apply(null, [chalk147.template].concat(args2));
7303
7303
  };
7304
- Object.setPrototypeOf(chalk142, Chalk.prototype);
7305
- Object.setPrototypeOf(chalk142.template, chalk142);
7306
- chalk142.template.constructor = Chalk;
7307
- return chalk142.template;
7304
+ Object.setPrototypeOf(chalk147, Chalk.prototype);
7305
+ Object.setPrototypeOf(chalk147.template, chalk147);
7306
+ chalk147.template.constructor = Chalk;
7307
+ return chalk147.template;
7308
7308
  }
7309
7309
  applyOptions(this, options);
7310
7310
  }
@@ -7423,7 +7423,7 @@ var require_chalk = __commonJS2({
7423
7423
  ansiStyles.dim.open = originalDim;
7424
7424
  return str;
7425
7425
  }
7426
- function chalkTag(chalk142, strings) {
7426
+ function chalkTag(chalk147, strings) {
7427
7427
  if (!Array.isArray(strings)) {
7428
7428
  return [].slice.call(arguments, 1).join(" ");
7429
7429
  }
@@ -7433,7 +7433,7 @@ var require_chalk = __commonJS2({
7433
7433
  parts.push(String(args2[i - 1]).replace(/[{}\\]/g, "\\$&"));
7434
7434
  parts.push(String(strings.raw[i]));
7435
7435
  }
7436
- return template(chalk142, parts.join(""));
7436
+ return template(chalk147, parts.join(""));
7437
7437
  }
7438
7438
  Object.defineProperties(Chalk.prototype, styles);
7439
7439
  module2.exports = Chalk();
@@ -9384,21 +9384,21 @@ var require_cli_spinners = __commonJS2({
9384
9384
  var require_log_symbols = __commonJS2({
9385
9385
  "../../node_modules/.pnpm/log-symbols@2.2.0/node_modules/log-symbols/index.js"(exports2, module2) {
9386
9386
  "use strict";
9387
- var chalk142 = require_chalk();
9387
+ var chalk147 = require_chalk();
9388
9388
  var isSupported = process.platform !== "win32" || process.env.CI || process.env.TERM === "xterm-256color";
9389
- var main19 = {
9390
- info: chalk142.blue("\u2139"),
9391
- success: chalk142.green("\u2714"),
9392
- warning: chalk142.yellow("\u26A0"),
9393
- error: chalk142.red("\u2716")
9389
+ var main20 = {
9390
+ info: chalk147.blue("\u2139"),
9391
+ success: chalk147.green("\u2714"),
9392
+ warning: chalk147.yellow("\u26A0"),
9393
+ error: chalk147.red("\u2716")
9394
9394
  };
9395
9395
  var fallbacks = {
9396
- info: chalk142.blue("i"),
9397
- success: chalk142.green("\u221A"),
9398
- warning: chalk142.yellow("\u203C"),
9399
- error: chalk142.red("\xD7")
9396
+ info: chalk147.blue("i"),
9397
+ success: chalk147.green("\u221A"),
9398
+ warning: chalk147.yellow("\u203C"),
9399
+ error: chalk147.red("\xD7")
9400
9400
  };
9401
- module2.exports = isSupported ? main19 : fallbacks;
9401
+ module2.exports = isSupported ? main20 : fallbacks;
9402
9402
  }
9403
9403
  });
9404
9404
 
@@ -9792,7 +9792,7 @@ var require_wcwidth = __commonJS2({
9792
9792
  var require_ora = __commonJS2({
9793
9793
  "../../node_modules/.pnpm/ora@3.4.0/node_modules/ora/index.js"(exports2, module2) {
9794
9794
  "use strict";
9795
- var chalk142 = require_chalk();
9795
+ var chalk147 = require_chalk();
9796
9796
  var cliCursor = require_cli_cursor();
9797
9797
  var cliSpinners = require_cli_spinners();
9798
9798
  var logSymbols = require_log_symbols();
@@ -9881,7 +9881,7 @@ var require_ora = __commonJS2({
9881
9881
  const { frames } = this.spinner;
9882
9882
  let frame = frames[this.frameIndex];
9883
9883
  if (this.color) {
9884
- frame = chalk142[this.color](frame);
9884
+ frame = chalk147[this.color](frame);
9885
9885
  }
9886
9886
  this.frameIndex = ++this.frameIndex % frames.length;
9887
9887
  const fullPrefixText = typeof this.prefixText === "string" ? this.prefixText + " " : "";
@@ -34010,7 +34010,7 @@ var init_command26 = __esm({
34010
34010
  logsv2Command = {
34011
34011
  name: "logsv2",
34012
34012
  aliases: [],
34013
- description: "Display request logs for a project using the new logs API.",
34013
+ description: "Display request logs for a project using the new logs API.\n\nSource types: \u03BB = serverless, \u03B5 = edge/middleware, \u25C7 = static/external",
34014
34014
  hidden: true,
34015
34015
  arguments: [
34016
34016
  {
@@ -34109,6 +34109,13 @@ var init_command26 = __esm({
34109
34109
  type: String,
34110
34110
  deprecated: false,
34111
34111
  description: "Filter by request ID"
34112
+ },
34113
+ {
34114
+ name: "expand",
34115
+ shorthand: "x",
34116
+ type: Boolean,
34117
+ deprecated: false,
34118
+ description: "Show full log message below each request line"
34112
34119
  }
34113
34120
  ],
34114
34121
  examples: [
@@ -34147,6 +34154,10 @@ var init_command26 = __esm({
34147
34154
  {
34148
34155
  name: "Display logs for a specific request",
34149
34156
  value: `${packageName} logsv2 --request-id req_xxxxx`
34157
+ },
34158
+ {
34159
+ name: "Display logs with full message details",
34160
+ value: `${packageName} logsv2 --expand`
34150
34161
  }
34151
34162
  ]
34152
34163
  };
@@ -35643,6 +35654,110 @@ var init_command43 = __esm({
35643
35654
  }
35644
35655
  });
35645
35656
 
35657
+ // src/commands/webhooks/command.ts
35658
+ var listSubcommand13, getSubcommand, createSubcommand, removeSubcommand10, webhooksCommand;
35659
+ var init_command44 = __esm({
35660
+ "src/commands/webhooks/command.ts"() {
35661
+ "use strict";
35662
+ init_pkg_name();
35663
+ init_arg_common();
35664
+ listSubcommand13 = {
35665
+ name: "list",
35666
+ aliases: ["ls"],
35667
+ description: "Show all webhooks",
35668
+ default: true,
35669
+ arguments: [],
35670
+ options: [formatOption],
35671
+ examples: [
35672
+ {
35673
+ name: "List all webhooks as JSON",
35674
+ value: `${packageName} webhooks ls --format json`
35675
+ }
35676
+ ]
35677
+ };
35678
+ getSubcommand = {
35679
+ name: "get",
35680
+ aliases: ["inspect"],
35681
+ description: "Displays information related to a webhook",
35682
+ arguments: [
35683
+ {
35684
+ name: "id",
35685
+ required: true
35686
+ }
35687
+ ],
35688
+ options: [formatOption],
35689
+ examples: []
35690
+ };
35691
+ createSubcommand = {
35692
+ name: "create",
35693
+ aliases: ["add"],
35694
+ description: "Create a new webhook",
35695
+ arguments: [
35696
+ {
35697
+ name: "url",
35698
+ required: true
35699
+ }
35700
+ ],
35701
+ options: [
35702
+ {
35703
+ name: "event",
35704
+ shorthand: "e",
35705
+ type: [String],
35706
+ argument: "EVENT",
35707
+ deprecated: false,
35708
+ description: "Webhook event to subscribe to (can be used multiple times)"
35709
+ },
35710
+ {
35711
+ name: "project",
35712
+ shorthand: "p",
35713
+ type: [String],
35714
+ argument: "PROJECT_ID",
35715
+ deprecated: false,
35716
+ description: "Project ID to associate with the webhook (can be used multiple times)"
35717
+ }
35718
+ ],
35719
+ examples: [
35720
+ {
35721
+ name: "Create a webhook for deployment events",
35722
+ value: `${packageName} webhooks create https://example.com/webhook --event deployment.created --event deployment.ready`
35723
+ }
35724
+ ]
35725
+ };
35726
+ removeSubcommand10 = {
35727
+ name: "remove",
35728
+ aliases: ["rm", "delete"],
35729
+ description: "Remove a webhook",
35730
+ arguments: [
35731
+ {
35732
+ name: "id",
35733
+ required: true
35734
+ }
35735
+ ],
35736
+ options: [
35737
+ {
35738
+ ...yesOption,
35739
+ description: "Skip the confirmation prompt when removing a webhook"
35740
+ }
35741
+ ],
35742
+ examples: []
35743
+ };
35744
+ webhooksCommand = {
35745
+ name: "webhooks",
35746
+ aliases: ["webhook"],
35747
+ description: "Manage webhooks",
35748
+ arguments: [],
35749
+ subcommands: [
35750
+ listSubcommand13,
35751
+ getSubcommand,
35752
+ createSubcommand,
35753
+ removeSubcommand10
35754
+ ],
35755
+ options: [],
35756
+ examples: []
35757
+ };
35758
+ }
35759
+ });
35760
+
35646
35761
  // src/commands/index.ts
35647
35762
  function getCommandAliases(command) {
35648
35763
  return [command.name].concat(command.aliases);
@@ -35694,6 +35809,7 @@ var init_commands = __esm({
35694
35809
  init_command41();
35695
35810
  init_command42();
35696
35811
  init_command43();
35812
+ init_command44();
35697
35813
  init_output_manager();
35698
35814
  commandsStructs = [
35699
35815
  aliasCommand,
@@ -35737,6 +35853,7 @@ var init_commands = __esm({
35737
35853
  teamsCommand,
35738
35854
  telemetryCommand,
35739
35855
  upgradeCommand,
35856
+ webhooksCommand,
35740
35857
  whoamiCommand,
35741
35858
  // added because we don't have a full help command
35742
35859
  { name: "help", aliases: [] }
@@ -37141,14 +37258,14 @@ var require_templates3 = __commonJS2({
37141
37258
  }
37142
37259
  return results;
37143
37260
  }
37144
- function buildStyle(chalk142, styles) {
37261
+ function buildStyle(chalk147, styles) {
37145
37262
  const enabled = {};
37146
37263
  for (const layer of styles) {
37147
37264
  for (const style of layer.styles) {
37148
37265
  enabled[style[0]] = layer.inverse ? null : style.slice(1);
37149
37266
  }
37150
37267
  }
37151
- let current = chalk142;
37268
+ let current = chalk147;
37152
37269
  for (const [styleName, styles2] of Object.entries(enabled)) {
37153
37270
  if (!Array.isArray(styles2)) {
37154
37271
  continue;
@@ -37160,7 +37277,7 @@ var require_templates3 = __commonJS2({
37160
37277
  }
37161
37278
  return current;
37162
37279
  }
37163
- module2.exports = (chalk142, temporary) => {
37280
+ module2.exports = (chalk147, temporary) => {
37164
37281
  const styles = [];
37165
37282
  const chunks = [];
37166
37283
  let chunk = [];
@@ -37170,13 +37287,13 @@ var require_templates3 = __commonJS2({
37170
37287
  } else if (style) {
37171
37288
  const string = chunk.join("");
37172
37289
  chunk = [];
37173
- chunks.push(styles.length === 0 ? string : buildStyle(chalk142, styles)(string));
37290
+ chunks.push(styles.length === 0 ? string : buildStyle(chalk147, styles)(string));
37174
37291
  styles.push({ inverse, styles: parseStyle(style) });
37175
37292
  } else if (close2) {
37176
37293
  if (styles.length === 0) {
37177
37294
  throw new Error("Found extraneous } in Chalk template literal");
37178
37295
  }
37179
- chunks.push(buildStyle(chalk142, styles)(chunk.join("")));
37296
+ chunks.push(buildStyle(chalk147, styles)(chunk.join("")));
37180
37297
  chunk = [];
37181
37298
  styles.pop();
37182
37299
  } else {
@@ -37224,16 +37341,16 @@ var require_source2 = __commonJS2({
37224
37341
  }
37225
37342
  };
37226
37343
  var chalkFactory = (options) => {
37227
- const chalk143 = {};
37228
- applyOptions(chalk143, options);
37229
- chalk143.template = (...arguments_) => chalkTag(chalk143.template, ...arguments_);
37230
- Object.setPrototypeOf(chalk143, Chalk.prototype);
37231
- Object.setPrototypeOf(chalk143.template, chalk143);
37232
- chalk143.template.constructor = () => {
37344
+ const chalk148 = {};
37345
+ applyOptions(chalk148, options);
37346
+ chalk148.template = (...arguments_) => chalkTag(chalk148.template, ...arguments_);
37347
+ Object.setPrototypeOf(chalk148, Chalk.prototype);
37348
+ Object.setPrototypeOf(chalk148.template, chalk148);
37349
+ chalk148.template.constructor = () => {
37233
37350
  throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
37234
37351
  };
37235
- chalk143.template.Instance = ChalkClass;
37236
- return chalk143.template;
37352
+ chalk148.template.Instance = ChalkClass;
37353
+ return chalk148.template;
37237
37354
  };
37238
37355
  function Chalk(options) {
37239
37356
  return chalkFactory(options);
@@ -37344,7 +37461,7 @@ var require_source2 = __commonJS2({
37344
37461
  return openAll + string + closeAll;
37345
37462
  };
37346
37463
  var template;
37347
- var chalkTag = (chalk143, ...strings) => {
37464
+ var chalkTag = (chalk148, ...strings) => {
37348
37465
  const [firstString] = strings;
37349
37466
  if (!isArray(firstString) || !isArray(firstString.raw)) {
37350
37467
  return strings.join(" ");
@@ -37360,14 +37477,14 @@ var require_source2 = __commonJS2({
37360
37477
  if (template === void 0) {
37361
37478
  template = require_templates3();
37362
37479
  }
37363
- return template(chalk143, parts.join(""));
37480
+ return template(chalk148, parts.join(""));
37364
37481
  };
37365
37482
  Object.defineProperties(Chalk.prototype, styles);
37366
- var chalk142 = Chalk();
37367
- chalk142.supportsColor = stdoutColor;
37368
- chalk142.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
37369
- chalk142.stderr.supportsColor = stderrColor;
37370
- module2.exports = chalk142;
37483
+ var chalk147 = Chalk();
37484
+ chalk147.supportsColor = stdoutColor;
37485
+ chalk147.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
37486
+ chalk147.stderr.supportsColor = stderrColor;
37487
+ module2.exports = chalk147;
37371
37488
  }
37372
37489
  });
37373
37490
 
@@ -38845,7 +38962,7 @@ var require_figures = __commonJS2({
38845
38962
  "use strict";
38846
38963
  var escapeStringRegexp = require_escape_string_regexp();
38847
38964
  var { platform } = process;
38848
- var main19 = {
38965
+ var main20 = {
38849
38966
  tick: "\u2714",
38850
38967
  cross: "\u2716",
38851
38968
  star: "\u2605",
@@ -38931,12 +39048,12 @@ var require_figures = __commonJS2({
38931
39048
  hamburger: "\u2261",
38932
39049
  smiley: "\u263A",
38933
39050
  mustache: "\u250C\u2500\u2510",
38934
- heart: main19.heart,
39051
+ heart: main20.heart,
38935
39052
  nodejs: "\u2666",
38936
- arrowUp: main19.arrowUp,
38937
- arrowDown: main19.arrowDown,
38938
- arrowLeft: main19.arrowLeft,
38939
- arrowRight: main19.arrowRight,
39053
+ arrowUp: main20.arrowUp,
39054
+ arrowDown: main20.arrowDown,
39055
+ arrowLeft: main20.arrowLeft,
39056
+ arrowRight: main20.arrowRight,
38940
39057
  radioOn: "(*)",
38941
39058
  radioOff: "( )",
38942
39059
  checkboxOn: "[\xD7]",
@@ -38964,14 +39081,14 @@ var require_figures = __commonJS2({
38964
39081
  sevenEighths: "7/8"
38965
39082
  };
38966
39083
  if (platform === "linux") {
38967
- main19.questionMarkPrefix = "?";
39084
+ main20.questionMarkPrefix = "?";
38968
39085
  }
38969
- var figures4 = platform === "win32" ? windows : main19;
39086
+ var figures4 = platform === "win32" ? windows : main20;
38970
39087
  var fn2 = (string) => {
38971
- if (figures4 === main19) {
39088
+ if (figures4 === main20) {
38972
39089
  return string;
38973
39090
  }
38974
- for (const [key, value] of Object.entries(main19)) {
39091
+ for (const [key, value] of Object.entries(main20)) {
38975
39092
  if (value === figures4[key]) {
38976
39093
  continue;
38977
39094
  }
@@ -38980,7 +39097,7 @@ var require_figures = __commonJS2({
38980
39097
  return string;
38981
39098
  };
38982
39099
  module2.exports = Object.assign(fn2, figures4);
38983
- module2.exports.main = main19;
39100
+ module2.exports.main = main20;
38984
39101
  module2.exports.windows = windows;
38985
39102
  }
38986
39103
  });
@@ -45074,9 +45191,9 @@ var require_layout_manager = __commonJS2({
45074
45191
  }
45075
45192
  return col;
45076
45193
  }
45077
- function layoutTable(table2) {
45194
+ function layoutTable(table3) {
45078
45195
  let alloc = {};
45079
- table2.forEach(function(row, rowIndex) {
45196
+ table3.forEach(function(row, rowIndex) {
45080
45197
  let col = 0;
45081
45198
  row.forEach(function(cell) {
45082
45199
  cell.y = rowIndex;
@@ -45097,17 +45214,17 @@ var require_layout_manager = __commonJS2({
45097
45214
  });
45098
45215
  });
45099
45216
  }
45100
- function maxWidth(table2) {
45217
+ function maxWidth(table3) {
45101
45218
  let mw = 0;
45102
- table2.forEach(function(row) {
45219
+ table3.forEach(function(row) {
45103
45220
  row.forEach(function(cell) {
45104
45221
  mw = Math.max(mw, cell.x + (cell.colSpan || 1));
45105
45222
  });
45106
45223
  });
45107
45224
  return mw;
45108
45225
  }
45109
- function maxHeight(table2) {
45110
- return table2.length;
45226
+ function maxHeight(table3) {
45227
+ return table3.length;
45111
45228
  }
45112
45229
  function cellsConflict(cell1, cell2) {
45113
45230
  let yMin1 = cell1.y;
@@ -45143,15 +45260,15 @@ var require_layout_manager = __commonJS2({
45143
45260
  }
45144
45261
  return true;
45145
45262
  }
45146
- function addRowSpanCells(table2) {
45147
- table2.forEach(function(row, rowIndex) {
45263
+ function addRowSpanCells(table3) {
45264
+ table3.forEach(function(row, rowIndex) {
45148
45265
  row.forEach(function(cell) {
45149
45266
  for (let i = 1; i < cell.rowSpan; i++) {
45150
45267
  let rowSpanCell = new RowSpanCell(cell);
45151
45268
  rowSpanCell.x = cell.x;
45152
45269
  rowSpanCell.y = cell.y + i;
45153
45270
  rowSpanCell.colSpan = cell.colSpan;
45154
- insertCell(rowSpanCell, table2[rowIndex + i]);
45271
+ insertCell(rowSpanCell, table3[rowIndex + i]);
45155
45272
  }
45156
45273
  });
45157
45274
  });
@@ -45177,21 +45294,21 @@ var require_layout_manager = __commonJS2({
45177
45294
  }
45178
45295
  row.splice(x, 0, cell);
45179
45296
  }
45180
- function fillInTable(table2) {
45181
- let h_max = maxHeight(table2);
45182
- let w_max = maxWidth(table2);
45297
+ function fillInTable(table3) {
45298
+ let h_max = maxHeight(table3);
45299
+ let w_max = maxWidth(table3);
45183
45300
  debug2(`Max rows: ${h_max}; Max cols: ${w_max}`);
45184
45301
  for (let y = 0; y < h_max; y++) {
45185
45302
  for (let x = 0; x < w_max; x++) {
45186
- if (!conflictExists(table2, x, y)) {
45303
+ if (!conflictExists(table3, x, y)) {
45187
45304
  let opts = { x, y, colSpan: 1, rowSpan: 1 };
45188
45305
  x++;
45189
- while (x < w_max && !conflictExists(table2, x, y)) {
45306
+ while (x < w_max && !conflictExists(table3, x, y)) {
45190
45307
  opts.colSpan++;
45191
45308
  x++;
45192
45309
  }
45193
45310
  let y2 = y + 1;
45194
- while (y2 < h_max && allBlank(table2, y2, opts.x, opts.x + opts.colSpan)) {
45311
+ while (y2 < h_max && allBlank(table3, y2, opts.x, opts.x + opts.colSpan)) {
45195
45312
  opts.rowSpan++;
45196
45313
  y2++;
45197
45314
  }
@@ -45199,7 +45316,7 @@ var require_layout_manager = __commonJS2({
45199
45316
  cell.x = opts.x;
45200
45317
  cell.y = opts.y;
45201
45318
  warn(`Missing cell at ${cell.y}-${cell.x}.`);
45202
- insertCell(cell, table2[y]);
45319
+ insertCell(cell, table3[y]);
45203
45320
  }
45204
45321
  }
45205
45322
  }
@@ -45240,11 +45357,11 @@ var require_layout_manager = __commonJS2({
45240
45357
  };
45241
45358
  })();
45242
45359
  function makeComputeWidths(colSpan, desiredWidth, x, forcedMin) {
45243
- return function(vals, table2) {
45360
+ return function(vals, table3) {
45244
45361
  let result = [];
45245
45362
  let spanners = [];
45246
45363
  let auto = {};
45247
- table2.forEach(function(row) {
45364
+ table3.forEach(function(row) {
45248
45365
  row.forEach(function(cell) {
45249
45366
  if ((cell[colSpan] || 1) > 1) {
45250
45367
  spanners.push(cell);
@@ -45403,14 +45520,14 @@ var require_cli_table3 = __commonJS2({
45403
45520
 
45404
45521
  // src/util/output/table.ts
45405
45522
  function table(rows, opts) {
45406
- const table2 = new import_cli_table3.default({
45523
+ const table3 = new import_cli_table3.default({
45407
45524
  style: {
45408
45525
  ...defaultStyle,
45409
45526
  "padding-right": opts?.hsep ?? defaultStyle["padding-right"]
45410
45527
  },
45411
45528
  chars: noBorderChars
45412
45529
  });
45413
- table2.push(
45530
+ table3.push(
45414
45531
  ...rows.map(
45415
45532
  (row) => row.map((cell, i) => ({
45416
45533
  content: cell,
@@ -45418,7 +45535,7 @@ function table(rows, opts) {
45418
45535
  }))
45419
45536
  )
45420
45537
  );
45421
- return table2.toString();
45538
+ return table3.toString();
45422
45539
  }
45423
45540
  var import_cli_table3, defaultStyle, noBorderChars, alignMap;
45424
45541
  var init_table = __esm({
@@ -45462,14 +45579,14 @@ function wordWrap(text, maxWidth) {
45462
45579
  "padding-left": INDENT.length
45463
45580
  }
45464
45581
  });
45465
- const table2 = new import_cli_table32.default(_tableOptions);
45466
- table2.push([
45582
+ const table3 = new import_cli_table32.default(_tableOptions);
45583
+ table3.push([
45467
45584
  {
45468
45585
  content: text,
45469
45586
  wordWrap: true
45470
45587
  }
45471
45588
  ]);
45472
- return table2.toString();
45589
+ return table3.toString();
45473
45590
  }
45474
45591
  function lineToString(line) {
45475
45592
  let string = "";
@@ -45552,17 +45669,17 @@ function buildCommandOptionLines(commandOptions, options, sectionTitle) {
45552
45669
  ]);
45553
45670
  }
45554
45671
  const finalColumnWidth = options.columns - maxWidthOfUnwrappedColumns;
45555
- const table2 = new import_cli_table32.default(
45672
+ const table3 = new import_cli_table32.default(
45556
45673
  Object.assign({}, tableOptions, {
45557
45674
  colWidths: [null, null, finalColumnWidth]
45558
45675
  })
45559
45676
  );
45560
- table2.push(...rows);
45677
+ table3.push(...rows);
45561
45678
  return [
45562
45679
  `${INDENT}${import_chalk15.default.dim(sectionTitle)}:`,
45563
45680
  NEWLINE,
45564
45681
  NEWLINE,
45565
- table2.toString(),
45682
+ table3.toString(),
45566
45683
  NEWLINE,
45567
45684
  NEWLINE
45568
45685
  ].join("");
@@ -45599,17 +45716,17 @@ function buildSubcommandLines(subcommands, options) {
45599
45716
  }
45600
45717
  const rightMargin = INDENT.repeat(4).length;
45601
45718
  const finalColumnWidth = options.columns - maxWidthOfUnwrappedColumns - rightMargin;
45602
- const table2 = new import_cli_table32.default(
45719
+ const table3 = new import_cli_table32.default(
45603
45720
  Object.assign({}, tableOptions, {
45604
45721
  colWidths: [null, null, finalColumnWidth]
45605
45722
  })
45606
45723
  );
45607
- table2.push(...rows);
45724
+ table3.push(...rows);
45608
45725
  return [
45609
45726
  `${INDENT}${import_chalk15.default.dim("Commands")}:`,
45610
45727
  NEWLINE,
45611
45728
  NEWLINE,
45612
- table2.toString(),
45729
+ table3.toString(),
45613
45730
  NEWLINE,
45614
45731
  NEWLINE
45615
45732
  ].join("");
@@ -48773,7 +48890,7 @@ var require_write_json_file = __commonJS2({
48773
48890
  };
48774
48891
  var readFile8 = (fp) => pify(fs15.readFile)(fp, "utf8").catch(() => {
48775
48892
  });
48776
- var main19 = (fp, data, opts) => {
48893
+ var main20 = (fp, data, opts) => {
48777
48894
  return (opts.detectIndent ? readFile8(fp) : Promise.resolve()).then((str) => {
48778
48895
  const indent = str ? detectIndent(str).indent : opts.indent;
48779
48896
  const json = JSON.stringify(data, opts.replacer, indent);
@@ -48798,7 +48915,7 @@ var require_write_json_file = __commonJS2({
48798
48915
  `, { mode: opts.mode });
48799
48916
  };
48800
48917
  module2.exports = (fp, data, opts) => {
48801
- return makeDir(path11.dirname(fp), { fs: fs15 }).then(() => init2(main19, fp, data, opts));
48918
+ return makeDir(path11.dirname(fp), { fs: fs15 }).then(() => init2(main20, fp, data, opts));
48802
48919
  };
48803
48920
  module2.exports.sync = (fp, data, opts) => {
48804
48921
  makeDir.sync(path11.dirname(fp), { fs: fs15 });
@@ -56970,7 +57087,7 @@ var require_parse3 = __commonJS2({
56970
57087
  return star;
56971
57088
  return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
56972
57089
  };
56973
- const create = (str) => {
57090
+ const create2 = (str) => {
56974
57091
  switch (str) {
56975
57092
  case "*":
56976
57093
  return `${nodot}${ONE_CHAR}${star}`;
@@ -56992,7 +57109,7 @@ var require_parse3 = __commonJS2({
56992
57109
  const match = /^(.*?)\.(\w+)$/.exec(str);
56993
57110
  if (!match)
56994
57111
  return;
56995
- const source2 = create(match[1]);
57112
+ const source2 = create2(match[1]);
56996
57113
  if (!source2)
56997
57114
  return;
56998
57115
  return source2 + DOT_LITERAL + match[2];
@@ -57000,7 +57117,7 @@ var require_parse3 = __commonJS2({
57000
57117
  }
57001
57118
  };
57002
57119
  const output2 = utils.removePrefix(input, state);
57003
- let source = create(output2);
57120
+ let source = create2(output2);
57004
57121
  if (source && opts.strictSlashes !== true) {
57005
57122
  source += `${SLASH_LITERAL}?`;
57006
57123
  }
@@ -58317,7 +58434,7 @@ var require_reusify = __commonJS2({
58317
58434
  function reusify(Constructor) {
58318
58435
  var head = new Constructor();
58319
58436
  var tail = head;
58320
- function get() {
58437
+ function get2() {
58321
58438
  var current = head;
58322
58439
  if (current.next) {
58323
58440
  head = current.next;
@@ -58333,7 +58450,7 @@ var require_reusify = __commonJS2({
58333
58450
  tail = obj;
58334
58451
  }
58335
58452
  return {
58336
- get,
58453
+ get: get2,
58337
58454
  release
58338
58455
  };
58339
58456
  }
@@ -60597,41 +60714,41 @@ var require_ms = __commonJS2({
60597
60714
  return void 0;
60598
60715
  }
60599
60716
  }
60600
- function fmtShort(ms34) {
60601
- var msAbs = Math.abs(ms34);
60717
+ function fmtShort(ms35) {
60718
+ var msAbs = Math.abs(ms35);
60602
60719
  if (msAbs >= d) {
60603
- return Math.round(ms34 / d) + "d";
60720
+ return Math.round(ms35 / d) + "d";
60604
60721
  }
60605
60722
  if (msAbs >= h) {
60606
- return Math.round(ms34 / h) + "h";
60723
+ return Math.round(ms35 / h) + "h";
60607
60724
  }
60608
60725
  if (msAbs >= m) {
60609
- return Math.round(ms34 / m) + "m";
60726
+ return Math.round(ms35 / m) + "m";
60610
60727
  }
60611
60728
  if (msAbs >= s) {
60612
- return Math.round(ms34 / s) + "s";
60729
+ return Math.round(ms35 / s) + "s";
60613
60730
  }
60614
- return ms34 + "ms";
60731
+ return ms35 + "ms";
60615
60732
  }
60616
- function fmtLong(ms34) {
60617
- var msAbs = Math.abs(ms34);
60733
+ function fmtLong(ms35) {
60734
+ var msAbs = Math.abs(ms35);
60618
60735
  if (msAbs >= d) {
60619
- return plural15(ms34, msAbs, d, "day");
60736
+ return plural16(ms35, msAbs, d, "day");
60620
60737
  }
60621
60738
  if (msAbs >= h) {
60622
- return plural15(ms34, msAbs, h, "hour");
60739
+ return plural16(ms35, msAbs, h, "hour");
60623
60740
  }
60624
60741
  if (msAbs >= m) {
60625
- return plural15(ms34, msAbs, m, "minute");
60742
+ return plural16(ms35, msAbs, m, "minute");
60626
60743
  }
60627
60744
  if (msAbs >= s) {
60628
- return plural15(ms34, msAbs, s, "second");
60745
+ return plural16(ms35, msAbs, s, "second");
60629
60746
  }
60630
- return ms34 + " ms";
60747
+ return ms35 + " ms";
60631
60748
  }
60632
- function plural15(ms34, msAbs, n, name) {
60749
+ function plural16(ms35, msAbs, n, name) {
60633
60750
  var isPlural = msAbs >= n * 1.5;
60634
- return Math.round(ms34 / n) + " " + name + (isPlural ? "s" : "");
60751
+ return Math.round(ms35 / n) + " " + name + (isPlural ? "s" : "");
60635
60752
  }
60636
60753
  }
60637
60754
  });
@@ -60672,18 +60789,18 @@ var require_get_polling_delay = __commonJS2({
60672
60789
  getPollingDelay: () => getPollingDelay
60673
60790
  });
60674
60791
  module2.exports = __toCommonJS4(get_polling_delay_exports);
60675
- var import_ms34 = __toESM4(require_ms());
60792
+ var import_ms35 = __toESM4(require_ms());
60676
60793
  function getPollingDelay(elapsed2) {
60677
- if (elapsed2 <= (0, import_ms34.default)("15s")) {
60678
- return (0, import_ms34.default)("1s");
60794
+ if (elapsed2 <= (0, import_ms35.default)("15s")) {
60795
+ return (0, import_ms35.default)("1s");
60679
60796
  }
60680
- if (elapsed2 <= (0, import_ms34.default)("1m")) {
60681
- return (0, import_ms34.default)("5s");
60797
+ if (elapsed2 <= (0, import_ms35.default)("1m")) {
60798
+ return (0, import_ms35.default)("5s");
60682
60799
  }
60683
- if (elapsed2 <= (0, import_ms34.default)("5m")) {
60684
- return (0, import_ms34.default)("15s");
60800
+ if (elapsed2 <= (0, import_ms35.default)("5m")) {
60801
+ return (0, import_ms35.default)("15s");
60685
60802
  }
60686
- return (0, import_ms34.default)("30s");
60803
+ return (0, import_ms35.default)("30s");
60687
60804
  }
60688
60805
  }
60689
60806
  });
@@ -63679,7 +63796,7 @@ var require_bl = __commonJS2({
63679
63796
  this._callback = null;
63680
63797
  }
63681
63798
  };
63682
- BufferList.prototype.get = function get(index) {
63799
+ BufferList.prototype.get = function get2(index) {
63683
63800
  return this.slice(index, index + 1)[0];
63684
63801
  };
63685
63802
  BufferList.prototype.slice = function slice(start, end) {
@@ -72198,11 +72315,11 @@ var require_pluralize = __commonJS2({
72198
72315
  pluralize2.addPluralRule(word, "$0");
72199
72316
  pluralize2.addSingularRule(word, "$0");
72200
72317
  };
72201
- pluralize2.addIrregularRule = function(single, plural15) {
72202
- plural15 = plural15.toLowerCase();
72318
+ pluralize2.addIrregularRule = function(single, plural16) {
72319
+ plural16 = plural16.toLowerCase();
72203
72320
  single = single.toLowerCase();
72204
- irregularSingles[single] = plural15;
72205
- irregularPlurals[plural15] = single;
72321
+ irregularSingles[single] = plural16;
72322
+ irregularPlurals[plural16] = single;
72206
72323
  };
72207
72324
  [
72208
72325
  // Pronouns.
@@ -78900,11 +79017,11 @@ var require_stringify2 = __commonJS2({
78900
79017
  throw typeError(firstValueType);
78901
79018
  var fullKey = prefix + stringifyKey(key);
78902
79019
  var result = "";
78903
- values.forEach((table2) => {
79020
+ values.forEach((table3) => {
78904
79021
  if (result.length > 0)
78905
79022
  result += "\n";
78906
79023
  result += indent + "[[" + fullKey + "]]\n";
78907
- result += stringifyObject(fullKey + ".", indent, table2);
79024
+ result += stringifyObject(fullKey + ".", indent, table3);
78908
79025
  });
78909
79026
  return result;
78910
79027
  }
@@ -79050,7 +79167,7 @@ var require_frameworks = __commonJS2({
79050
79167
  var frameworks_exports = {};
79051
79168
  __export4(frameworks_exports, {
79052
79169
  default: () => frameworks_default,
79053
- frameworkList: () => frameworkList9,
79170
+ frameworkList: () => frameworkList10,
79054
79171
  frameworks: () => frameworks
79055
79172
  });
79056
79173
  module2.exports = __toCommonJS4(frameworks_exports);
@@ -82958,8 +83075,8 @@ var require_frameworks = __commonJS2({
82958
83075
  getOutputDirName: async () => "public"
82959
83076
  }
82960
83077
  ];
82961
- var frameworkList9 = frameworks;
82962
- var frameworks_default = frameworkList9;
83078
+ var frameworkList10 = frameworks;
83079
+ var frameworks_default = frameworkList10;
82963
83080
  }
82964
83081
  });
82965
83082
 
@@ -85087,8 +85204,8 @@ var require_resolve2 = __commonJS2({
85087
85204
  var import_path45 = __require("path");
85088
85205
  var import_types3 = require_types4();
85089
85206
  var import_utils9 = require_utils15();
85090
- var import_frameworks9 = __toESM4(require_frameworks());
85091
- var frameworksBySlug = new Map(import_frameworks9.default.map((f) => [f.slug, f]));
85207
+ var import_frameworks10 = __toESM4(require_frameworks());
85208
+ var frameworksBySlug2 = new Map(import_frameworks10.default.map((f) => [f.slug, f]));
85092
85209
  function validateServiceConfig(name, config2) {
85093
85210
  if (!config2 || typeof config2 !== "object") {
85094
85211
  return {
@@ -85126,7 +85243,7 @@ var require_resolve2 = __commonJS2({
85126
85243
  serviceName: name
85127
85244
  };
85128
85245
  }
85129
- if (config2.framework && !frameworksBySlug.has(config2.framework)) {
85246
+ if (config2.framework && !frameworksBySlug2.has(config2.framework)) {
85130
85247
  return {
85131
85248
  code: "INVALID_FRAMEWORK",
85132
85249
  message: `Service "${name}" has invalid framework "${config2.framework}".`,
@@ -85172,7 +85289,7 @@ var require_resolve2 = __commonJS2({
85172
85289
  let builderUse;
85173
85290
  let builderSrc;
85174
85291
  if (config2.framework) {
85175
- const framework = frameworksBySlug.get(config2.framework);
85292
+ const framework = frameworksBySlug2.get(config2.framework);
85176
85293
  builderUse = framework?.useRuntime?.use || "@vercel/static-build";
85177
85294
  builderSrc = config2.entrypoint || framework?.useRuntime?.src || "package.json";
85178
85295
  } else if (config2.builder) {
@@ -85260,13 +85377,13 @@ var require_detect_services = __commonJS2({
85260
85377
  var __toCommonJS4 = (mod) => __copyProps4(__defProp4({}, "__esModule", { value: true }), mod);
85261
85378
  var detect_services_exports = {};
85262
85379
  __export4(detect_services_exports, {
85263
- detectServices: () => detectServices2,
85380
+ detectServices: () => detectServices3,
85264
85381
  generateServicesRoutes: () => generateServicesRoutes2
85265
85382
  });
85266
85383
  module2.exports = __toCommonJS4(detect_services_exports);
85267
85384
  var import_utils9 = require_utils15();
85268
85385
  var import_resolve = require_resolve2();
85269
- async function detectServices2(options) {
85386
+ async function detectServices3(options) {
85270
85387
  const { fs: fs15, workPath } = options;
85271
85388
  const scopedFs = workPath ? fs15.chdir(workPath) : fs15;
85272
85389
  const { config: vercelConfig, error: configError } = await (0, import_utils9.readVercelConfig)(scopedFs);
@@ -85474,14 +85591,14 @@ var require_local_file_system_detector = __commonJS2({
85474
85591
  var __toCommonJS4 = (mod) => __copyProps4(__defProp4({}, "__esModule", { value: true }), mod);
85475
85592
  var local_file_system_detector_exports = {};
85476
85593
  __export4(local_file_system_detector_exports, {
85477
- LocalFileSystemDetector: () => LocalFileSystemDetector5
85594
+ LocalFileSystemDetector: () => LocalFileSystemDetector6
85478
85595
  });
85479
85596
  module2.exports = __toCommonJS4(local_file_system_detector_exports);
85480
85597
  var import_promises7 = __toESM4(__require("fs/promises"));
85481
85598
  var import_path45 = __require("path");
85482
85599
  var import_filesystem = require_filesystem();
85483
85600
  var import_error_utils39 = require_dist2();
85484
- var LocalFileSystemDetector5 = class _LocalFileSystemDetector extends import_filesystem.DetectorFilesystem {
85601
+ var LocalFileSystemDetector6 = class _LocalFileSystemDetector extends import_filesystem.DetectorFilesystem {
85485
85602
  constructor(rootPath) {
85486
85603
  super();
85487
85604
  this.rootPath = rootPath;
@@ -85564,7 +85681,7 @@ var require_get_services_builders = __commonJS2({
85564
85681
  getServicesBuilders: () => getServicesBuilders2
85565
85682
  });
85566
85683
  module2.exports = __toCommonJS4(get_services_builders_exports);
85567
- var import_detect_services = require_detect_services();
85684
+ var import_detect_services2 = require_detect_services();
85568
85685
  var import_local_file_system_detector = require_local_file_system_detector();
85569
85686
  async function getServicesBuilders2(options) {
85570
85687
  const { workPath } = options;
@@ -85585,7 +85702,7 @@ var require_get_services_builders = __commonJS2({
85585
85702
  };
85586
85703
  }
85587
85704
  const fs15 = new import_local_file_system_detector.LocalFileSystemDetector(workPath);
85588
- const result = await (0, import_detect_services.detectServices)({ fs: fs15 });
85705
+ const result = await (0, import_detect_services2.detectServices)({ fs: fs15 });
85589
85706
  const warningResponses = result.warnings.map((w) => ({
85590
85707
  code: w.code,
85591
85708
  message: w.message
@@ -85681,7 +85798,7 @@ var require_detect_builders = __commonJS2({
85681
85798
  var import_minimatch5 = __toESM4(require_minimatch2());
85682
85799
  var import_semver4 = require_semver2();
85683
85800
  var import_path45 = __require("path");
85684
- var import_frameworks9 = __toESM4(require_frameworks());
85801
+ var import_frameworks10 = __toESM4(require_frameworks());
85685
85802
  var import_is_official_runtime = require_is_official_runtime();
85686
85803
  var import_build_utils20 = __require("@vercel/build-utils");
85687
85804
  var import_get_services_builders = require_get_services_builders();
@@ -85689,7 +85806,7 @@ var require_detect_builders = __commonJS2({
85689
85806
  var REGEX_VERCEL_PLATFORM_FILES = `api/**,package.json,${REGEX_MIDDLEWARE_FILES}`;
85690
85807
  var REGEX_NON_VERCEL_PLATFORM_FILES2 = `!{${REGEX_VERCEL_PLATFORM_FILES}}`;
85691
85808
  var slugToFramework = new Map(
85692
- import_frameworks9.default.map((f) => [f.slug, f])
85809
+ import_frameworks10.default.map((f) => [f.slug, f])
85693
85810
  );
85694
85811
  function sortFiles(fileA, fileB) {
85695
85812
  return fileA.localeCompare(fileB);
@@ -86500,7 +86617,7 @@ var require_detect_file_system_api = __commonJS2({
86500
86617
  });
86501
86618
  module2.exports = __toCommonJS4(detect_file_system_api_exports);
86502
86619
  var import_semver4 = __toESM4(require_semver2());
86503
- var import__109 = require_dist8();
86620
+ var import__114 = require_dist8();
86504
86621
  async function detectFileSystemAPI2({
86505
86622
  files,
86506
86623
  projectSettings,
@@ -86566,7 +86683,7 @@ var require_detect_file_system_api = __commonJS2({
86566
86683
  };
86567
86684
  }
86568
86685
  const invalidBuilder = builders.find(({ use }) => {
86569
- const valid = (0, import__109.isOfficialRuntime)("go", use) || (0, import__109.isOfficialRuntime)("python", use) || (0, import__109.isOfficialRuntime)("ruby", use) || (0, import__109.isOfficialRuntime)("node", use) || (0, import__109.isOfficialRuntime)("next", use) || (0, import__109.isOfficialRuntime)("static", use) || (0, import__109.isOfficialRuntime)("static-build", use);
86686
+ const valid = (0, import__114.isOfficialRuntime)("go", use) || (0, import__114.isOfficialRuntime)("python", use) || (0, import__114.isOfficialRuntime)("ruby", use) || (0, import__114.isOfficialRuntime)("node", use) || (0, import__114.isOfficialRuntime)("next", use) || (0, import__114.isOfficialRuntime)("static", use) || (0, import__114.isOfficialRuntime)("static-build", use);
86570
86687
  return !valid;
86571
86688
  });
86572
86689
  if (invalidBuilder) {
@@ -86579,7 +86696,7 @@ var require_detect_file_system_api = __commonJS2({
86579
86696
  for (const lang of ["go", "python", "ruby"]) {
86580
86697
  for (const { use } of builders) {
86581
86698
  const plugin = "vercel-plugin-" + lang;
86582
- if ((0, import__109.isOfficialRuntime)(lang, use) && !deps[plugin]) {
86699
+ if ((0, import__114.isOfficialRuntime)(lang, use) && !deps[plugin]) {
86583
86700
  return {
86584
86701
  metadata,
86585
86702
  fsApiBuilder: null,
@@ -86636,7 +86753,7 @@ var require_detect_file_system_api = __commonJS2({
86636
86753
  }
86637
86754
  }
86638
86755
  const frontendBuilder = builders.find(
86639
- ({ use }) => (0, import__109.isOfficialRuntime)("next", use) || (0, import__109.isOfficialRuntime)("static", use) || (0, import__109.isOfficialRuntime)("static-build", use)
86756
+ ({ use }) => (0, import__114.isOfficialRuntime)("next", use) || (0, import__114.isOfficialRuntime)("static", use) || (0, import__114.isOfficialRuntime)("static-build", use)
86640
86757
  );
86641
86758
  const config2 = frontendBuilder?.config || {};
86642
86759
  const withTag = tag ? `@${tag}` : "";
@@ -86696,11 +86813,11 @@ var require_detect_framework = __commonJS2({
86696
86813
  const isEnabled = (val) => val === "1" || typeof val === "string" && val.toLowerCase() === "true";
86697
86814
  return isEnabled(experimentalEnv);
86698
86815
  }
86699
- function filterFrameworkList(frameworkList9, useExperimentalFrameworks) {
86816
+ function filterFrameworkList(frameworkList10, useExperimentalFrameworks) {
86700
86817
  if (shouldIncludeExperimentalFrameworks(useExperimentalFrameworks)) {
86701
- return frameworkList9;
86818
+ return frameworkList10;
86702
86819
  }
86703
- return frameworkList9.filter((f) => {
86820
+ return frameworkList10.filter((f) => {
86704
86821
  const experimental = f.experimental;
86705
86822
  return !experimental;
86706
86823
  });
@@ -86817,11 +86934,11 @@ var require_detect_framework = __commonJS2({
86817
86934
  }
86818
86935
  async function detectFramework2({
86819
86936
  fs: fs15,
86820
- frameworkList: frameworkList9,
86937
+ frameworkList: frameworkList10,
86821
86938
  useExperimentalFrameworks
86822
86939
  }) {
86823
86940
  const filteredList = filterFrameworkList(
86824
- frameworkList9,
86941
+ frameworkList10,
86825
86942
  useExperimentalFrameworks
86826
86943
  );
86827
86944
  const result = await Promise.all(
@@ -86837,11 +86954,11 @@ var require_detect_framework = __commonJS2({
86837
86954
  }
86838
86955
  async function detectFrameworks3({
86839
86956
  fs: fs15,
86840
- frameworkList: frameworkList9,
86957
+ frameworkList: frameworkList10,
86841
86958
  useExperimentalFrameworks
86842
86959
  }) {
86843
86960
  const filteredList = filterFrameworkList(
86844
- frameworkList9,
86961
+ frameworkList10,
86845
86962
  useExperimentalFrameworks
86846
86963
  );
86847
86964
  const result = await Promise.all(
@@ -86857,11 +86974,11 @@ var require_detect_framework = __commonJS2({
86857
86974
  }
86858
86975
  async function detectFrameworkRecord3({
86859
86976
  fs: fs15,
86860
- frameworkList: frameworkList9,
86977
+ frameworkList: frameworkList10,
86861
86978
  useExperimentalFrameworks
86862
86979
  }) {
86863
86980
  const filteredList = filterFrameworkList(
86864
- frameworkList9,
86981
+ frameworkList10,
86865
86982
  useExperimentalFrameworks
86866
86983
  );
86867
86984
  const result = await Promise.all(
@@ -86946,7 +87063,7 @@ var require_get_project_paths = __commonJS2({
86946
87063
  });
86947
87064
  module2.exports = __toCommonJS4(get_project_paths_exports);
86948
87065
  var import_detect_framework = require_detect_framework();
86949
- var import_frameworks9 = __toESM4(require_frameworks());
87066
+ var import_frameworks10 = __toESM4(require_frameworks());
86950
87067
  var MAX_DEPTH_TRAVERSE = 3;
86951
87068
  var getProjectPaths2 = async ({
86952
87069
  fs: fs15,
@@ -86963,7 +87080,7 @@ var require_get_project_paths = __commonJS2({
86963
87080
  }
86964
87081
  const framework = await (0, import_detect_framework.detectFramework)({
86965
87082
  fs: fs15.chdir(topPath),
86966
- frameworkList: import_frameworks9.default
87083
+ frameworkList: import_frameworks10.default
86967
87084
  });
86968
87085
  if (framework !== null)
86969
87086
  allPaths.push(topPath);
@@ -93330,8 +93447,8 @@ var require_dist8 = __commonJS2({
93330
93447
  detectFrameworks: () => import_detect_framework.detectFrameworks,
93331
93448
  detectInstrumentation: () => import_detect_instrumentation.detectInstrumentation,
93332
93449
  detectOutputDirectory: () => import_detect_builders.detectOutputDirectory,
93333
- detectServices: () => import_detect_services.detectServices,
93334
- generateServicesRoutes: () => import_detect_services.generateServicesRoutes,
93450
+ detectServices: () => import_detect_services2.detectServices,
93451
+ generateServicesRoutes: () => import_detect_services2.generateServicesRoutes,
93335
93452
  getProjectPaths: () => import_get_project_paths.getProjectPaths,
93336
93453
  getServicesBuilders: () => import_get_services_builders.getServicesBuilders,
93337
93454
  getWorkspacePackagePaths: () => import_get_workspace_package_paths.getWorkspacePackagePaths,
@@ -93344,7 +93461,7 @@ var require_dist8 = __commonJS2({
93344
93461
  });
93345
93462
  module2.exports = __toCommonJS4(src_exports2);
93346
93463
  var import_detect_builders = require_detect_builders();
93347
- var import_detect_services = require_detect_services();
93464
+ var import_detect_services2 = require_detect_services();
93348
93465
  var import_get_services_builders = require_get_services_builders();
93349
93466
  var import_detect_file_system_api = require_detect_file_system_api();
93350
93467
  var import_detect_framework = require_detect_framework();
@@ -95428,9 +95545,9 @@ var init_promise = __esm({
95428
95545
  });
95429
95546
 
95430
95547
  // src/util/sleep.ts
95431
- function sleep(ms34) {
95548
+ function sleep(ms35) {
95432
95549
  return new Promise((resolve14) => {
95433
- setTimeout(resolve14, ms34);
95550
+ setTimeout(resolve14, ms35);
95434
95551
  });
95435
95552
  }
95436
95553
  var init_sleep = __esm({
@@ -96009,16 +96126,16 @@ var require_lru_cache = __commonJS2({
96009
96126
  const code2 = `LRU_CACHE_METHOD_${method}`;
96010
96127
  if (shouldWarn(code2)) {
96011
96128
  const { prototype } = LRUCache;
96012
- const { get } = Object.getOwnPropertyDescriptor(prototype, method);
96013
- warn(code2, `${method} method`, `cache.${instead}()`, get);
96129
+ const { get: get2 } = Object.getOwnPropertyDescriptor(prototype, method);
96130
+ warn(code2, `${method} method`, `cache.${instead}()`, get2);
96014
96131
  }
96015
96132
  };
96016
96133
  var deprecatedProperty = (field, instead) => {
96017
96134
  const code2 = `LRU_CACHE_PROPERTY_${field}`;
96018
96135
  if (shouldWarn(code2)) {
96019
96136
  const { prototype } = LRUCache;
96020
- const { get } = Object.getOwnPropertyDescriptor(prototype, field);
96021
- warn(code2, `${field} property`, `cache.${instead}`, get);
96137
+ const { get: get2 } = Object.getOwnPropertyDescriptor(prototype, field);
96138
+ warn(code2, `${field} property`, `cache.${instead}`, get2);
96022
96139
  }
96023
96140
  };
96024
96141
  var emitWarning = (...a) => {
@@ -97284,41 +97401,41 @@ var require_ms2 = __commonJS2({
97284
97401
  return void 0;
97285
97402
  }
97286
97403
  }
97287
- function fmtShort(ms34) {
97288
- var msAbs = Math.abs(ms34);
97404
+ function fmtShort(ms35) {
97405
+ var msAbs = Math.abs(ms35);
97289
97406
  if (msAbs >= d) {
97290
- return Math.round(ms34 / d) + "d";
97407
+ return Math.round(ms35 / d) + "d";
97291
97408
  }
97292
97409
  if (msAbs >= h) {
97293
- return Math.round(ms34 / h) + "h";
97410
+ return Math.round(ms35 / h) + "h";
97294
97411
  }
97295
97412
  if (msAbs >= m) {
97296
- return Math.round(ms34 / m) + "m";
97413
+ return Math.round(ms35 / m) + "m";
97297
97414
  }
97298
97415
  if (msAbs >= s) {
97299
- return Math.round(ms34 / s) + "s";
97416
+ return Math.round(ms35 / s) + "s";
97300
97417
  }
97301
- return ms34 + "ms";
97418
+ return ms35 + "ms";
97302
97419
  }
97303
- function fmtLong(ms34) {
97304
- var msAbs = Math.abs(ms34);
97420
+ function fmtLong(ms35) {
97421
+ var msAbs = Math.abs(ms35);
97305
97422
  if (msAbs >= d) {
97306
- return plural15(ms34, msAbs, d, "day");
97423
+ return plural16(ms35, msAbs, d, "day");
97307
97424
  }
97308
97425
  if (msAbs >= h) {
97309
- return plural15(ms34, msAbs, h, "hour");
97426
+ return plural16(ms35, msAbs, h, "hour");
97310
97427
  }
97311
97428
  if (msAbs >= m) {
97312
- return plural15(ms34, msAbs, m, "minute");
97429
+ return plural16(ms35, msAbs, m, "minute");
97313
97430
  }
97314
97431
  if (msAbs >= s) {
97315
- return plural15(ms34, msAbs, s, "second");
97432
+ return plural16(ms35, msAbs, s, "second");
97316
97433
  }
97317
- return ms34 + " ms";
97434
+ return ms35 + " ms";
97318
97435
  }
97319
- function plural15(ms34, msAbs, n, name) {
97436
+ function plural16(ms35, msAbs, n, name) {
97320
97437
  var isPlural = msAbs >= n * 1.5;
97321
- return Math.round(ms34 / n) + " " + name + (isPlural ? "s" : "");
97438
+ return Math.round(ms35 / n) + " " + name + (isPlural ? "s" : "");
97322
97439
  }
97323
97440
  }
97324
97441
  });
@@ -97361,8 +97478,8 @@ var require_common8 = __commonJS2({
97361
97478
  }
97362
97479
  const self2 = debug2;
97363
97480
  const curr = Number(/* @__PURE__ */ new Date());
97364
- const ms34 = curr - (prevTime || curr);
97365
- self2.diff = ms34;
97481
+ const ms35 = curr - (prevTime || curr);
97482
+ self2.diff = ms35;
97366
97483
  self2.prev = prevTime;
97367
97484
  self2.curr = curr;
97368
97485
  prevTime = curr;
@@ -97963,8 +98080,8 @@ var require_common9 = __commonJS2({
97963
98080
  }
97964
98081
  const self2 = debug2;
97965
98082
  const curr = Number(/* @__PURE__ */ new Date());
97966
- const ms34 = curr - (prevTime || curr);
97967
- self2.diff = ms34;
98083
+ const ms35 = curr - (prevTime || curr);
98084
+ self2.diff = ms35;
97968
98085
  self2.prev = prevTime;
97969
98086
  self2.curr = curr;
97970
98087
  prevTime = curr;
@@ -113271,7 +113388,7 @@ var require_types5 = __commonJS2({
113271
113388
  return d.supertypeList.slice(1);
113272
113389
  }
113273
113390
  function computeSupertypeLookupTable(candidates) {
113274
- var table2 = {};
113391
+ var table3 = {};
113275
113392
  var typeNames = Object.keys(defCache);
113276
113393
  var typeNameCount = typeNames.length;
113277
113394
  for (var i = 0; i < typeNameCount; ++i) {
@@ -113283,12 +113400,12 @@ var require_types5 = __commonJS2({
113283
113400
  for (var j = 0; j < d.supertypeList.length; ++j) {
113284
113401
  var superTypeName = d.supertypeList[j];
113285
113402
  if (hasOwn.call(candidates, superTypeName)) {
113286
- table2[typeName] = superTypeName;
113403
+ table3[typeName] = superTypeName;
113287
113404
  break;
113288
113405
  }
113289
113406
  }
113290
113407
  }
113291
- return table2;
113408
+ return table3;
113292
113409
  }
113293
113410
  var builders = /* @__PURE__ */ Object.create(null);
113294
113411
  var nodePrototype = {};
@@ -113479,7 +113596,7 @@ var require_path4 = __commonJS2({
113479
113596
  Pp.getValueProperty = function getValueProperty(name) {
113480
113597
  return this.value[name];
113481
113598
  };
113482
- Pp.get = function get() {
113599
+ Pp.get = function get2() {
113483
113600
  var names = [];
113484
113601
  for (var _i = 0; _i < arguments.length; _i++) {
113485
113602
  names[_i] = arguments[_i];
@@ -117656,9 +117773,9 @@ var require_context2 = __commonJS2({
117656
117773
  const configurable = Boolean(descriptor2.configurable);
117657
117774
  const enumerable = Boolean(descriptor2.enumerable);
117658
117775
  const hasValue = Boolean(descriptor2.value);
117659
- const get = descriptor2.get ? scope.manage(this.newFunction(descriptor2.get.name, descriptor2.get)) : this.undefined;
117776
+ const get2 = descriptor2.get ? scope.manage(this.newFunction(descriptor2.get.name, descriptor2.get)) : this.undefined;
117660
117777
  const set2 = descriptor2.set ? scope.manage(this.newFunction(descriptor2.set.name, descriptor2.set)) : this.undefined;
117661
- this.ffi.QTS_DefineProp(this.ctx.value, handle.value, quickJSKey.value, value.value, get.value, set2.value, configurable, enumerable, hasValue);
117778
+ this.ffi.QTS_DefineProp(this.ctx.value, handle.value, quickJSKey.value, value.value, get2.value, set2.value, configurable, enumerable, hasValue);
117662
117779
  });
117663
117780
  }
117664
117781
  // Evaluation ---------------------------------------------------------------
@@ -121475,7 +121592,7 @@ var require_jsbn = __commonJS2({
121475
121592
  }
121476
121593
  if (r == null)
121477
121594
  r = nbi();
121478
- var y = nbi(), ts = this.s, ms34 = m.s;
121595
+ var y = nbi(), ts = this.s, ms35 = m.s;
121479
121596
  var nsh = this.DB - nbits(pm[pm.t - 1]);
121480
121597
  if (nsh > 0) {
121481
121598
  pm.lShiftTo(nsh, y);
@@ -121511,7 +121628,7 @@ var require_jsbn = __commonJS2({
121511
121628
  }
121512
121629
  if (q != null) {
121513
121630
  r.drShiftTo(ys, q);
121514
- if (ts != ms34)
121631
+ if (ts != ms35)
121515
121632
  BigInteger.ZERO.subTo(q, q);
121516
121633
  }
121517
121634
  r.t = ys;
@@ -129522,7 +129639,7 @@ var require_ci_info = __commonJS2({
129522
129639
  });
129523
129640
 
129524
129641
  // src/util/get-subcommand.ts
129525
- function getSubcommand(cliArgs, config2) {
129642
+ function getSubcommand2(cliArgs, config2) {
129526
129643
  const [subcommand, ...rest] = cliArgs;
129527
129644
  for (const k of Object.keys(config2)) {
129528
129645
  if (k !== "default" && config2[k].indexOf(subcommand) !== -1) {
@@ -131830,7 +131947,7 @@ async function alias(client2) {
131830
131947
  printError(err);
131831
131948
  return 1;
131832
131949
  }
131833
- const { subcommand, args: args2, subcommandOriginal } = getSubcommand(
131950
+ const { subcommand, args: args2, subcommandOriginal } = getSubcommand2(
131834
131951
  parsedArguments.args.slice(1),
131835
131952
  COMMAND_CONFIG
131836
131953
  );
@@ -132116,6 +132233,11 @@ async function parseField(field, typed) {
132116
132233
  value = parseInt(value, 10);
132117
132234
  } else if (/^-?\d*\.\d+$/.test(value)) {
132118
132235
  value = parseFloat(value);
132236
+ } else if (value.startsWith("[") || value.startsWith("{")) {
132237
+ try {
132238
+ value = JSON.parse(value);
132239
+ } catch {
132240
+ }
132119
132241
  }
132120
132242
  }
132121
132243
  return { key, value };
@@ -132163,24 +132285,24 @@ var init_request_builder = __esm({
132163
132285
  }
132164
132286
  });
132165
132287
 
132166
- // src/commands/api/constants.ts
132167
- var API_BASE_URL, OPENAPI_URL, CACHE_FILE, CACHE_TTL_MS;
132288
+ // src/util/openapi/constants.ts
132289
+ var OPENAPI_URL, CACHE_FILE, CACHE_TTL_MS, FETCH_TIMEOUT_MS;
132168
132290
  var init_constants2 = __esm({
132169
- "src/commands/api/constants.ts"() {
132291
+ "src/util/openapi/constants.ts"() {
132170
132292
  "use strict";
132171
- API_BASE_URL = "https://api.vercel.com";
132172
132293
  OPENAPI_URL = "https://openapi.vercel.sh/";
132173
132294
  CACHE_FILE = "openapi-spec.json";
132174
132295
  CACHE_TTL_MS = 24 * 60 * 60 * 1e3;
132296
+ FETCH_TIMEOUT_MS = 10 * 1e3;
132175
132297
  }
132176
132298
  });
132177
132299
 
132178
- // src/commands/api/openapi-cache.ts
132300
+ // src/util/openapi/openapi-cache.ts
132179
132301
  import { join as join9 } from "path";
132180
132302
  import { readFile as readFile6, writeFile as writeFile4, mkdir as mkdir2 } from "fs/promises";
132181
132303
  var OpenApiCache;
132182
132304
  var init_openapi_cache = __esm({
132183
- "src/commands/api/openapi-cache.ts"() {
132305
+ "src/util/openapi/openapi-cache.ts"() {
132184
132306
  "use strict";
132185
132307
  init_global_path();
132186
132308
  init_output_manager();
@@ -132264,12 +132386,20 @@ var init_openapi_cache = __esm({
132264
132386
  const fields = [];
132265
132387
  for (const [name, propSchema] of Object.entries(schema.properties)) {
132266
132388
  const resolvedProp = this.resolveSchemaRef(propSchema);
132389
+ let enumValues = resolvedProp?.enum || propSchema.enum;
132390
+ if (!enumValues && (resolvedProp?.type === "array" || propSchema.type === "array")) {
132391
+ const items = resolvedProp?.items || propSchema.items;
132392
+ if (items) {
132393
+ const resolvedItems = this.resolveSchemaRef(items);
132394
+ enumValues = resolvedItems?.enum || items.enum;
132395
+ }
132396
+ }
132267
132397
  fields.push({
132268
132398
  name,
132269
132399
  required: requiredFields.has(name),
132270
132400
  description: resolvedProp?.description || propSchema.description,
132271
132401
  type: resolvedProp?.type || propSchema.type,
132272
- enumValues: resolvedProp?.enum || propSchema.enum
132402
+ enumValues
132273
132403
  });
132274
132404
  }
132275
132405
  fields.sort((a, b) => {
@@ -132318,14 +132448,20 @@ var init_openapi_cache = __esm({
132318
132448
  output_manager_default.debug("Saved OpenAPI spec to cache");
132319
132449
  }
132320
132450
  /**
132321
- * Fetch OpenAPI spec from remote
132451
+ * Fetch OpenAPI spec from remote with timeout
132322
132452
  */
132323
132453
  async fetchSpec() {
132324
- const response = await fetch(OPENAPI_URL);
132325
- if (!response.ok) {
132326
- throw new Error(`Failed to fetch OpenAPI spec: ${response.status}`);
132454
+ const controller = new AbortController();
132455
+ const timeoutId = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS);
132456
+ try {
132457
+ const response = await fetch(OPENAPI_URL, { signal: controller.signal });
132458
+ if (!response.ok) {
132459
+ throw new Error(`Failed to fetch OpenAPI spec: ${response.status}`);
132460
+ }
132461
+ return await response.json();
132462
+ } finally {
132463
+ clearTimeout(timeoutId);
132327
132464
  }
132328
- return await response.json();
132329
132465
  }
132330
132466
  /**
132331
132467
  * Check if cached spec is expired
@@ -132413,6 +132549,33 @@ var init_openapi_cache = __esm({
132413
132549
  }
132414
132550
  });
132415
132551
 
132552
+ // src/util/openapi/types.ts
132553
+ var init_types = __esm({
132554
+ "src/util/openapi/types.ts"() {
132555
+ "use strict";
132556
+ }
132557
+ });
132558
+
132559
+ // src/util/openapi/index.ts
132560
+ var init_openapi = __esm({
132561
+ "src/util/openapi/index.ts"() {
132562
+ "use strict";
132563
+ init_openapi_cache();
132564
+ init_types();
132565
+ init_constants2();
132566
+ }
132567
+ });
132568
+
132569
+ // src/commands/api/constants.ts
132570
+ var API_BASE_URL;
132571
+ var init_constants3 = __esm({
132572
+ "src/commands/api/constants.ts"() {
132573
+ "use strict";
132574
+ init_openapi();
132575
+ API_BASE_URL = "https://api.vercel.com";
132576
+ }
132577
+ });
132578
+
132416
132579
  // src/commands/api/format-utils.ts
132417
132580
  function colorizeMethod(method) {
132418
132581
  switch (method) {
@@ -132919,6 +133082,18 @@ async function promptForParameters(client2, path11, parameters, bodyFieldsSpec)
132919
133082
  async function promptForBodyField(client2, field, required) {
132920
133083
  const description = formatDescription(field.description);
132921
133084
  const optionalHint = required ? "" : import_chalk43.default.dim(" (optional)");
133085
+ if (field.type === "array" && field.enumValues && field.enumValues.length > 0) {
133086
+ const choices = field.enumValues.map((v) => ({
133087
+ name: String(v),
133088
+ value: String(v)
133089
+ }));
133090
+ const selected = await client2.input.checkbox({
133091
+ message: `Select values for ${import_chalk43.default.cyan(field.name)}${optionalHint}${description}:`,
133092
+ choices,
133093
+ required
133094
+ });
133095
+ return JSON.stringify(selected);
133096
+ }
132922
133097
  if (field.enumValues && field.enumValues.length > 0) {
132923
133098
  const choices = field.enumValues.map((v) => ({
132924
133099
  name: String(v),
@@ -132950,8 +133125,8 @@ var init_api2 = __esm({
132950
133125
  init_command2();
132951
133126
  init_api();
132952
133127
  init_request_builder();
132953
- init_openapi_cache();
132954
- init_constants2();
133128
+ init_openapi();
133129
+ init_constants3();
132955
133130
  init_format_utils();
132956
133131
  init_output_manager();
132957
133132
  }
@@ -137454,7 +137629,7 @@ async function store(client2, rwToken) {
137454
137629
  return 1;
137455
137630
  }
137456
137631
  const subArgs = parsedArgs.args.slice(2);
137457
- const { subcommand, args: args2, subcommandOriginal } = getSubcommand(
137632
+ const { subcommand, args: args2, subcommandOriginal } = getSubcommand2(
137458
137633
  subArgs,
137459
137634
  COMMAND_CONFIG2
137460
137635
  );
@@ -137615,7 +137790,7 @@ async function main(client2) {
137615
137790
  return 1;
137616
137791
  }
137617
137792
  const subArgs = parsedArgs.args.slice(1);
137618
- const { subcommand, args: args2, subcommandOriginal } = getSubcommand(
137793
+ const { subcommand, args: args2, subcommandOriginal } = getSubcommand2(
137619
137794
  subArgs,
137620
137795
  COMMAND_CONFIG3
137621
137796
  );
@@ -153087,6 +153262,141 @@ var init_vercel_auth = __esm({
153087
153262
  }
153088
153263
  });
153089
153264
 
153265
+ // src/util/projects/detect-services.ts
153266
+ function isExperimentalServicesEnabled() {
153267
+ return process.env.VERCEL_USE_EXPERIMENTAL_SERVICES === "1" || process.env.VERCEL_USE_EXPERIMENTAL_SERVICES?.toLowerCase() === "true";
153268
+ }
153269
+ async function tryDetectServices(cwd) {
153270
+ if (!isExperimentalServicesEnabled()) {
153271
+ return null;
153272
+ }
153273
+ const fs15 = new import_fs_detectors4.LocalFileSystemDetector(cwd);
153274
+ const result = await (0, import_fs_detectors4.detectServices)({ fs: fs15 });
153275
+ const hasNoServicesError = result.errors.some(
153276
+ (e2) => e2.code === "NO_SERVICES_CONFIGURED"
153277
+ );
153278
+ if (hasNoServicesError) {
153279
+ return null;
153280
+ }
153281
+ return result;
153282
+ }
153283
+ var import_fs_detectors4;
153284
+ var init_detect_services = __esm({
153285
+ "src/util/projects/detect-services.ts"() {
153286
+ "use strict";
153287
+ import_fs_detectors4 = __toESM3(require_dist8(), 1);
153288
+ }
153289
+ });
153290
+
153291
+ // src/util/input/display-services.ts
153292
+ function getFrameworkName(slug) {
153293
+ if (!slug)
153294
+ return void 0;
153295
+ return frameworksBySlug.get(slug)?.name;
153296
+ }
153297
+ function formatRoutePrefix(routePrefix) {
153298
+ if (routePrefix === "/") {
153299
+ return "/";
153300
+ }
153301
+ const normalized = routePrefix.startsWith("/") ? routePrefix : `/${routePrefix}`;
153302
+ return `${normalized}/*`;
153303
+ }
153304
+ function getServiceDescriptionInfo(service) {
153305
+ const frameworkName = getFrameworkName(service.framework);
153306
+ if (frameworkName && service.framework) {
153307
+ const colorFn = frameworkColors[service.framework] || chalk52.cyan;
153308
+ return { label: frameworkName, colorFn };
153309
+ } else if (service.runtime) {
153310
+ const normalizedRuntime = service.runtime.toLowerCase().replace(/@.*$/, "");
153311
+ const colorFn = runtimeColors[normalizedRuntime] || chalk52.yellow;
153312
+ return { label: service.runtime, colorFn };
153313
+ } else if (service.builder?.use) {
153314
+ return { label: service.builder.use, colorFn: chalk52.magenta };
153315
+ }
153316
+ return { label: "unknown", colorFn: chalk52.dim };
153317
+ }
153318
+ function getServiceTarget(service) {
153319
+ switch (service.type) {
153320
+ case "cron":
153321
+ return `schedule: ${service.schedule ?? "none"}`;
153322
+ case "worker":
153323
+ return `topic: ${service.topic ?? "none"}`;
153324
+ case "web":
153325
+ default:
153326
+ return service.routePrefix ? formatRoutePrefix(service.routePrefix) : "no route";
153327
+ }
153328
+ }
153329
+ function displayDetectedServices(services) {
153330
+ output_manager_default.print(`Multiple services detected. Project Settings:
153331
+ `);
153332
+ const rows = services.map((service) => {
153333
+ const descInfo = getServiceDescriptionInfo(service);
153334
+ const target = getServiceTarget(service);
153335
+ return [
153336
+ `\u2022 ${service.name}`,
153337
+ descInfo.colorFn(`[${descInfo.label}]`),
153338
+ chalk52.dim("\u2192"),
153339
+ target
153340
+ ];
153341
+ });
153342
+ const tableOutput = table(rows, { align: ["l", "l", "l", "l"], hsep: 2 });
153343
+ output_manager_default.print(`${tableOutput}
153344
+ `);
153345
+ }
153346
+ function displayServicesConfigNote() {
153347
+ output_manager_default.print(
153348
+ `
153349
+ ${chalk52.dim("Services (experimental) are configured via vercel.json.")}
153350
+ `
153351
+ );
153352
+ }
153353
+ function displayServiceErrors(errors) {
153354
+ for (const error3 of errors) {
153355
+ output_manager_default.warn(error3.message);
153356
+ }
153357
+ }
153358
+ var import_frameworks4, chalk52, frameworksBySlug, frameworkColors, runtimeColors;
153359
+ var init_display_services = __esm({
153360
+ "src/util/input/display-services.ts"() {
153361
+ "use strict";
153362
+ import_frameworks4 = __toESM3(require_frameworks(), 1);
153363
+ init_output_manager();
153364
+ init_table();
153365
+ chalk52 = require_source();
153366
+ frameworksBySlug = new Map(import_frameworks4.frameworkList.map((f) => [f.slug, f]));
153367
+ frameworkColors = {
153368
+ // JavaScript/TypeScript frameworks
153369
+ nextjs: chalk52.white,
153370
+ vite: chalk52.magenta,
153371
+ nuxtjs: chalk52.green,
153372
+ remix: chalk52.cyan,
153373
+ astro: chalk52.magenta,
153374
+ gatsby: chalk52.magenta,
153375
+ svelte: chalk52.red,
153376
+ sveltekit: chalk52.red,
153377
+ solidstart: chalk52.blue,
153378
+ angular: chalk52.red,
153379
+ vue: chalk52.green,
153380
+ ember: chalk52.red,
153381
+ preact: chalk52.magenta,
153382
+ // Python frameworks
153383
+ fastapi: chalk52.green,
153384
+ flask: chalk52.cyan,
153385
+ // Node frameworks
153386
+ express: chalk52.yellow,
153387
+ nest: chalk52.red,
153388
+ hono: chalk52.yellowBright
153389
+ };
153390
+ runtimeColors = {
153391
+ node: chalk52.green,
153392
+ python: chalk52.blue,
153393
+ go: chalk52.cyan,
153394
+ ruby: chalk52.red,
153395
+ rust: chalk52.yellowBright
153396
+ };
153397
+ }
153398
+ });
153399
+
153090
153400
  // src/util/link/setup-and-link.ts
153091
153401
  import { join as join15, basename as basename7 } from "path";
153092
153402
  async function setupAndLink(client2, path11, {
@@ -153184,9 +153494,17 @@ async function setupAndLink(client2, path11, {
153184
153494
  return { status: "error", exitCode: 1 };
153185
153495
  }
153186
153496
  const isZeroConfig = !localConfig || !localConfig.builds || localConfig.builds.length === 0;
153497
+ const servicesResult = await tryDetectServices(pathWithRootDirectory);
153187
153498
  try {
153188
153499
  let settings = {};
153189
- if (isZeroConfig) {
153500
+ if (servicesResult) {
153501
+ displayDetectedServices(servicesResult.services);
153502
+ if (servicesResult.errors.length > 0) {
153503
+ displayServiceErrors(servicesResult.errors);
153504
+ }
153505
+ displayServicesConfigNote();
153506
+ settings.framework = "services";
153507
+ } else if (isZeroConfig) {
153190
153508
  const localConfigurationOverrides = {
153191
153509
  buildCommand: localConfig?.buildCommand,
153192
153510
  devCommand: localConfig?.devCommand,
@@ -153199,7 +153517,7 @@ async function setupAndLink(client2, path11, {
153199
153517
  pathWithRootDirectory
153200
153518
  );
153201
153519
  const detectedProjects = detectedProjectsForWorkspace.get("") || [];
153202
- const framework = detectedProjects[0] ?? import_frameworks4.frameworkList.find((f) => f.slug === null);
153520
+ const framework = detectedProjects[0] ?? import_frameworks5.frameworkList.find((f) => f.slug === null);
153203
153521
  settings = await editProjectSettings(
153204
153522
  client2,
153205
153523
  {},
@@ -153291,7 +153609,7 @@ async function connectGitRepository(client2, path11, project, autoConfirm, org)
153291
153609
  output_manager_default.debug(`Failed to connect git repository: ${error3}`);
153292
153610
  }
153293
153611
  }
153294
- var import_chalk56, import_fs_extra17, import_frameworks4;
153612
+ var import_chalk56, import_fs_extra17, import_frameworks5;
153295
153613
  var init_setup_and_link = __esm({
153296
153614
  "src/util/link/setup-and-link.ts"() {
153297
153615
  "use strict";
@@ -153313,8 +153631,10 @@ var init_setup_and_link = __esm({
153313
153631
  init_output_manager();
153314
153632
  init_detect_projects();
153315
153633
  init_read_config();
153316
- import_frameworks4 = __toESM3(require_frameworks(), 1);
153634
+ import_frameworks5 = __toESM3(require_frameworks(), 1);
153317
153635
  init_vercel_auth();
153636
+ init_detect_services();
153637
+ init_display_services();
153318
153638
  }
153319
153639
  });
153320
153640
 
@@ -153790,7 +154110,7 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
153790
154110
  readJSONFile(join17(workPath, "package.json")),
153791
154111
  readJSONFile(vercelConfigPath),
153792
154112
  readJSONFile(join17(workPath, "now.json")),
153793
- (0, import_fs_detectors4.detectInstrumentation)(new import_fs_detectors4.LocalFileSystemDetector(workPath))
154113
+ (0, import_fs_detectors5.detectInstrumentation)(new import_fs_detectors5.LocalFileSystemDetector(workPath))
153794
154114
  ]);
153795
154115
  if (pkg instanceof CantParseJSONFile)
153796
154116
  throw pkg;
@@ -153866,7 +154186,7 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
153866
154186
  builds = builds.map((b) => expandBuild(files, b)).flat();
153867
154187
  } else {
153868
154188
  isZeroConfig = true;
153869
- const detectedBuilders = await (0, import_fs_detectors4.detectBuilders)(files, pkg, {
154189
+ const detectedBuilders = await (0, import_fs_detectors5.detectBuilders)(files, pkg, {
153870
154190
  ...localConfig,
153871
154191
  projectSettings,
153872
154192
  ignoreBuildScript: true,
@@ -154006,7 +154326,7 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
154006
154326
  }
154007
154327
  );
154008
154328
  if (buildConfig.zeroConfig && isFrontendBuilder && "output" in buildResult && !buildResult.routes) {
154009
- const framework2 = import_frameworks5.frameworkList.find(
154329
+ const framework2 = import_frameworks6.frameworkList.find(
154010
154330
  (f) => f.slug === buildConfig.framework
154011
154331
  );
154012
154332
  if (framework2) {
@@ -154256,9 +154576,9 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
154256
154576
  );
154257
154577
  }
154258
154578
  async function getFramework(cwd, buildResults) {
154259
- const detectedFramework = await (0, import_fs_detectors4.detectFrameworkRecord)({
154260
- fs: new import_fs_detectors4.LocalFileSystemDetector(cwd),
154261
- frameworkList: import_frameworks5.frameworkList
154579
+ const detectedFramework = await (0, import_fs_detectors5.detectFrameworkRecord)({
154580
+ fs: new import_fs_detectors5.LocalFileSystemDetector(cwd),
154581
+ frameworkList: import_frameworks6.frameworkList
154262
154582
  });
154263
154583
  if (!detectedFramework) {
154264
154584
  return;
@@ -154277,7 +154597,7 @@ async function getFramework(cwd, buildResults) {
154277
154597
  };
154278
154598
  }
154279
154599
  }
154280
- const frameworkVersion = (0, import_fs_detectors4.detectFrameworkVersion)(detectedFramework);
154600
+ const frameworkVersion = (0, import_fs_detectors5.detectFrameworkVersion)(detectedFramework);
154281
154601
  if (frameworkVersion) {
154282
154602
  return {
154283
154603
  version: frameworkVersion
@@ -154407,7 +154727,7 @@ async function getFrameworkRoutes(framework, dirPrefix) {
154407
154727
  }
154408
154728
  return routes2;
154409
154729
  }
154410
- var import_chalk58, import_dotenv2, import_fs_extra18, import_minimatch2, import_semver3, import_client6, import_frameworks5, import_fs_detectors4, import_routing_utils2, InMemoryReporter;
154730
+ var import_chalk58, import_dotenv2, import_fs_extra18, import_minimatch2, import_semver3, import_client6, import_frameworks6, import_fs_detectors5, import_routing_utils2, InMemoryReporter;
154411
154731
  var init_build2 = __esm({
154412
154732
  "src/commands/build/index.ts"() {
154413
154733
  "use strict";
@@ -154417,8 +154737,8 @@ var init_build2 = __esm({
154417
154737
  import_minimatch2 = __toESM3(require_minimatch2(), 1);
154418
154738
  import_semver3 = __toESM3(require_semver(), 1);
154419
154739
  import_client6 = __toESM3(require_dist7(), 1);
154420
- import_frameworks5 = __toESM3(require_frameworks(), 1);
154421
- import_fs_detectors4 = __toESM3(require_dist8(), 1);
154740
+ import_frameworks6 = __toESM3(require_frameworks(), 1);
154741
+ import_fs_detectors5 = __toESM3(require_dist8(), 1);
154422
154742
  import_routing_utils2 = __toESM3(require_dist23(), 1);
154423
154743
  init_output_manager();
154424
154744
  init_corepack();
@@ -154924,7 +155244,7 @@ async function main4(client2) {
154924
155244
  return 1;
154925
155245
  }
154926
155246
  const subArgs = parsedArgs.args.slice(1);
154927
- const { subcommand, args: args2, subcommandOriginal } = getSubcommand(
155247
+ const { subcommand, args: args2, subcommandOriginal } = getSubcommand2(
154928
155248
  subArgs,
154929
155249
  COMMAND_CONFIG4
154930
155250
  );
@@ -155899,7 +156219,7 @@ async function main5(client2) {
155899
156219
  printError(err);
155900
156220
  return 1;
155901
156221
  }
155902
- const { subcommand, subcommandOriginal, args: args2 } = getSubcommand(
156222
+ const { subcommand, subcommandOriginal, args: args2 } = getSubcommand2(
155903
156223
  parsedArgs.args.slice(1),
155904
156224
  COMMAND_CONFIG5
155905
156225
  );
@@ -158869,7 +159189,7 @@ var require_compat = __commonJS2({
158869
159189
  return EventEmitter2.listenerCount || require_event_listener_count();
158870
159190
  });
158871
159191
  function lazyProperty(obj, prop, getter) {
158872
- function get() {
159192
+ function get2() {
158873
159193
  var val = getter();
158874
159194
  Object.defineProperty(obj, prop, {
158875
159195
  configurable: true,
@@ -158881,7 +159201,7 @@ var require_compat = __commonJS2({
158881
159201
  Object.defineProperty(obj, prop, {
158882
159202
  configurable: true,
158883
159203
  enumerable: true,
158884
- get
159204
+ get: get2
158885
159205
  });
158886
159206
  }
158887
159207
  function toString2(obj) {
@@ -159130,12 +159450,12 @@ var require_depd = __commonJS2({
159130
159450
  if ("value" in descriptor2) {
159131
159451
  descriptor2 = convertDataDescriptorToAccessor(obj, prop, message2);
159132
159452
  }
159133
- var get = descriptor2.get;
159453
+ var get2 = descriptor2.get;
159134
159454
  var set2 = descriptor2.set;
159135
- if (typeof get === "function") {
159455
+ if (typeof get2 === "function") {
159136
159456
  descriptor2.get = function getter() {
159137
159457
  log.call(deprecate2, message2, site2);
159138
- return get.apply(this, arguments);
159458
+ return get2.apply(this, arguments);
159139
159459
  };
159140
159460
  }
159141
159461
  if (typeof set2 === "function") {
@@ -161121,13 +161441,13 @@ var require_dbcs_codec = __commonJS2({
161121
161441
  this.nodeIdx = 0;
161122
161442
  return ret;
161123
161443
  };
161124
- function findIdx(table2, val) {
161125
- if (table2[0] > val)
161444
+ function findIdx(table3, val) {
161445
+ if (table3[0] > val)
161126
161446
  return -1;
161127
- var l = 0, r = table2.length;
161447
+ var l = 0, r = table3.length;
161128
161448
  while (l < r - 1) {
161129
161449
  var mid = l + Math.floor((r - l + 1) / 2);
161130
- if (table2[mid] <= val)
161450
+ if (table3[mid] <= val)
161131
161451
  l = mid;
161132
161452
  else
161133
161453
  r = mid;
@@ -163686,32 +164006,32 @@ var require_ms3 = __commonJS2({
163686
164006
  return void 0;
163687
164007
  }
163688
164008
  }
163689
- function fmtShort(ms34) {
163690
- if (ms34 >= d) {
163691
- return Math.round(ms34 / d) + "d";
164009
+ function fmtShort(ms35) {
164010
+ if (ms35 >= d) {
164011
+ return Math.round(ms35 / d) + "d";
163692
164012
  }
163693
- if (ms34 >= h) {
163694
- return Math.round(ms34 / h) + "h";
164013
+ if (ms35 >= h) {
164014
+ return Math.round(ms35 / h) + "h";
163695
164015
  }
163696
- if (ms34 >= m) {
163697
- return Math.round(ms34 / m) + "m";
164016
+ if (ms35 >= m) {
164017
+ return Math.round(ms35 / m) + "m";
163698
164018
  }
163699
- if (ms34 >= s) {
163700
- return Math.round(ms34 / s) + "s";
164019
+ if (ms35 >= s) {
164020
+ return Math.round(ms35 / s) + "s";
163701
164021
  }
163702
- return ms34 + "ms";
164022
+ return ms35 + "ms";
163703
164023
  }
163704
- function fmtLong(ms34) {
163705
- return plural15(ms34, d, "day") || plural15(ms34, h, "hour") || plural15(ms34, m, "minute") || plural15(ms34, s, "second") || ms34 + " ms";
164024
+ function fmtLong(ms35) {
164025
+ return plural16(ms35, d, "day") || plural16(ms35, h, "hour") || plural16(ms35, m, "minute") || plural16(ms35, s, "second") || ms35 + " ms";
163706
164026
  }
163707
- function plural15(ms34, n, name) {
163708
- if (ms34 < n) {
164027
+ function plural16(ms35, n, name) {
164028
+ if (ms35 < n) {
163709
164029
  return;
163710
164030
  }
163711
- if (ms34 < n * 1.5) {
163712
- return Math.floor(ms34 / n) + " " + name;
164031
+ if (ms35 < n * 1.5) {
164032
+ return Math.floor(ms35 / n) + " " + name;
163713
164033
  }
163714
- return Math.ceil(ms34 / n) + " " + name + "s";
164034
+ return Math.ceil(ms35 / n) + " " + name + "s";
163715
164035
  }
163716
164036
  }
163717
164037
  });
@@ -163744,8 +164064,8 @@ var require_debug4 = __commonJS2({
163744
164064
  return;
163745
164065
  var self2 = debug2;
163746
164066
  var curr = +/* @__PURE__ */ new Date();
163747
- var ms34 = curr - (prevTime || curr);
163748
- self2.diff = ms34;
164067
+ var ms35 = curr - (prevTime || curr);
164068
+ self2.diff = ms35;
163749
164069
  self2.prev = prevTime;
163750
164070
  self2.curr = curr;
163751
164071
  prevTime = curr;
@@ -164593,14 +164913,14 @@ var require_follow_redirects = __commonJS2({
164593
164913
  debug2("options", options);
164594
164914
  return new RedirectableRequest(options, callback);
164595
164915
  }
164596
- function get(input, options, callback) {
164916
+ function get2(input, options, callback) {
164597
164917
  var wrappedRequest = wrappedProtocol.request(input, options, callback);
164598
164918
  wrappedRequest.end();
164599
164919
  return wrappedRequest;
164600
164920
  }
164601
164921
  Object.defineProperties(wrappedProtocol, {
164602
164922
  request: { value: request, configurable: true, enumerable: true, writable: true },
164603
- get: { value: get, configurable: true, enumerable: true, writable: true }
164923
+ get: { value: get2, configurable: true, enumerable: true, writable: true }
164604
164924
  });
164605
164925
  });
164606
164926
  return exports3;
@@ -175567,7 +175887,7 @@ async function executeBuild(vercelConfig, devServer, files, match, requestPath,
175567
175887
  builderWithPkg: { path: requirePath, builder, pkg }
175568
175888
  } = match;
175569
175889
  const { entrypoint, use } = match;
175570
- const isStatic = (0, import_fs_detectors5.isStaticRuntime)(use);
175890
+ const isStatic = (0, import_fs_detectors6.isStaticRuntime)(use);
175571
175891
  const { envConfigs, cwd: workPath, devCacheDir } = devServer;
175572
175892
  const debug2 = output_manager_default.isDebugEnabled();
175573
175893
  const startTime = Date.now();
@@ -175888,13 +176208,13 @@ async function shutdownBuilder(match) {
175888
176208
  }
175889
176209
  await Promise.all(ops);
175890
176210
  }
175891
- var import_ms12, import_bytes7, import_fs_detectors5, import_pluralize8, import_minimatch3, import_routing_utils4;
176211
+ var import_ms12, import_bytes7, import_fs_detectors6, import_pluralize8, import_minimatch3, import_routing_utils4;
175892
176212
  var init_builder = __esm({
175893
176213
  "src/util/dev/builder.ts"() {
175894
176214
  "use strict";
175895
176215
  import_ms12 = __toESM3(require_ms(), 1);
175896
176216
  import_bytes7 = __toESM3(require_bytes(), 1);
175897
- import_fs_detectors5 = __toESM3(require_dist8(), 1);
176217
+ import_fs_detectors6 = __toESM3(require_dist8(), 1);
175898
176218
  import_pluralize8 = __toESM3(require_pluralize(), 1);
175899
176219
  import_minimatch3 = __toESM3(require_minimatch2(), 1);
175900
176220
  init_highlight();
@@ -176232,10 +176552,10 @@ import {
176232
176552
  shouldUseExperimentalBackends as shouldUseExperimentalBackends2
176233
176553
  } from "@vercel/build-utils";
176234
176554
  function sortBuilders2(buildA, buildB) {
176235
- if (buildA && buildA.use && (0, import_fs_detectors6.isOfficialRuntime)("static-build", buildA.use)) {
176555
+ if (buildA && buildA.use && (0, import_fs_detectors7.isOfficialRuntime)("static-build", buildA.use)) {
176236
176556
  return 1;
176237
176557
  }
176238
- if (buildB && buildB.use && (0, import_fs_detectors6.isOfficialRuntime)("static-build", buildB.use)) {
176558
+ if (buildB && buildB.use && (0, import_fs_detectors7.isOfficialRuntime)("static-build", buildB.use)) {
176239
176559
  return -1;
176240
176560
  }
176241
176561
  return 0;
@@ -176454,7 +176774,7 @@ function buildMatchEquals(a, b) {
176454
176774
  return false;
176455
176775
  return true;
176456
176776
  }
176457
- var import_fs_extra21, import_ms13, import_chalk73, import_node_fetch6, import_pluralize9, import_raw_body, import_async_listen3, import_minimatch4, import_http_proxy_node16, import_serve_handler, import_dotenv3, import_once, import_directory, import_get_port, import_is_port_reachable, import_fast_deep_equal, import_npm_package_arg2, import_json_parse_better_errors3, import_client12, import_routing_utils5, import_fs_detectors6, import_frameworks6, import_error_utils21, frontendRuntimeSet, DEV_SERVER_PORT_BIND_TIMEOUT, DevServer;
176777
+ var import_fs_extra21, import_ms13, import_chalk73, import_node_fetch6, import_pluralize9, import_raw_body, import_async_listen3, import_minimatch4, import_http_proxy_node16, import_serve_handler, import_dotenv3, import_once, import_directory, import_get_port, import_is_port_reachable, import_fast_deep_equal, import_npm_package_arg2, import_json_parse_better_errors3, import_client12, import_routing_utils5, import_fs_detectors7, import_frameworks7, import_error_utils21, frontendRuntimeSet, DEV_SERVER_PORT_BIND_TIMEOUT, DevServer;
176458
176778
  var init_server = __esm({
176459
176779
  "src/util/dev/server.ts"() {
176460
176780
  "use strict";
@@ -176478,8 +176798,8 @@ var init_server = __esm({
176478
176798
  import_json_parse_better_errors3 = __toESM3(require_json_parse_better_errors(), 1);
176479
176799
  import_client12 = __toESM3(require_dist7(), 1);
176480
176800
  import_routing_utils5 = __toESM3(require_dist23(), 1);
176481
- import_fs_detectors6 = __toESM3(require_dist8(), 1);
176482
- import_frameworks6 = __toESM3(require_frameworks(), 1);
176801
+ import_fs_detectors7 = __toESM3(require_dist8(), 1);
176802
+ import_frameworks7 = __toESM3(require_frameworks(), 1);
176483
176803
  init_cmd();
176484
176804
  init_link();
176485
176805
  init_sleep();
@@ -176507,7 +176827,7 @@ var init_server = __esm({
176507
176827
  init_project_settings();
176508
176828
  init_parse_listen();
176509
176829
  frontendRuntimeSet = new Set(
176510
- import_frameworks6.frameworkList.map((f) => f.useRuntime?.use || "@vercel/static-build")
176830
+ import_frameworks7.frameworkList.map((f) => f.useRuntime?.use || "@vercel/static-build")
176511
176831
  );
176512
176832
  DEV_SERVER_PORT_BIND_TIMEOUT = (0, import_ms13.default)("5m");
176513
176833
  DevServer = class {
@@ -177447,7 +177767,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
177447
177767
  return this.projectSettings.devCommand;
177448
177768
  } else if (this.projectSettings?.framework) {
177449
177769
  const frameworkSlug = this.projectSettings.framework;
177450
- const framework = import_frameworks6.frameworkList.find((f) => f.slug === frameworkSlug);
177770
+ const framework = import_frameworks7.frameworkList.find((f) => f.slug === frameworkSlug);
177451
177771
  if (framework) {
177452
177772
  const defaults = framework.settings.devCommand.value;
177453
177773
  if (defaults) {
@@ -177514,7 +177834,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
177514
177834
  rewriteRoutes,
177515
177835
  // eslint-disable-next-line prefer-const
177516
177836
  errorRoutes
177517
- } = await (0, import_fs_detectors6.detectBuilders)(files, pkg, {
177837
+ } = await (0, import_fs_detectors7.detectBuilders)(files, pkg, {
177518
177838
  tag: "latest",
177519
177839
  functions: vercelConfig.functions,
177520
177840
  projectSettings: projectSettings || this.projectSettings,
@@ -177577,8 +177897,8 @@ Please ensure that ${cmd(err.path)} is properly installed`;
177577
177897
  return true;
177578
177898
  });
177579
177899
  this.caseSensitive = hasNewRoutingProperties(vercelConfig);
177580
- this.apiDir = (0, import_fs_detectors6.detectApiDirectory)(vercelConfig.builds || []);
177581
- this.apiExtensions = (0, import_fs_detectors6.detectApiExtensions)(vercelConfig.builds || []);
177900
+ this.apiDir = (0, import_fs_detectors7.detectApiDirectory)(vercelConfig.builds || []);
177901
+ this.apiExtensions = (0, import_fs_detectors7.detectApiExtensions)(vercelConfig.builds || []);
177582
177902
  let [runEnv, buildEnv] = await Promise.all([
177583
177903
  this.getLocalEnv(".env", vercelConfig.env),
177584
177904
  this.getLocalEnv(".env.build", vercelConfig.build?.env)
@@ -178189,7 +178509,7 @@ ${error_code}
178189
178509
 
178190
178510
  // src/util/env/constants.ts
178191
178511
  var VERCEL_OIDC_TOKEN;
178192
- var init_constants3 = __esm({
178512
+ var init_constants4 = __esm({
178193
178513
  "src/util/env/constants.ts"() {
178194
178514
  "use strict";
178195
178515
  VERCEL_OIDC_TOKEN = "VERCEL_OIDC_TOKEN";
@@ -178292,7 +178612,7 @@ var init_refresh_oidc_token = __esm({
178292
178612
  import_ms14 = __toESM3(require_ms(), 1);
178293
178613
  init_output_manager();
178294
178614
  init_get_env_records();
178295
- init_constants3();
178615
+ init_constants4();
178296
178616
  REFRESH_BEFORE_EXPIRY_MILLIS = getMs(
178297
178617
  (0, import_ms14.default)("15m"),
178298
178618
  process.env.REFRESH_VERCEL_OIDC_TOKEN_BEFORE_EXPIRY_MILLIS
@@ -178412,7 +178732,7 @@ var init_dev = __esm({
178412
178732
  init_get_env_records();
178413
178733
  init_output_manager();
178414
178734
  init_refresh_oidc_token();
178415
- init_constants3();
178735
+ init_constants4();
178416
178736
  }
178417
178737
  });
178418
178738
 
@@ -178509,7 +178829,7 @@ async function main6(client2) {
178509
178829
  output_manager_default.print(help(devCommand, { columns: client2.stderr.columns }));
178510
178830
  return 2;
178511
178831
  }
178512
- const args2 = getSubcommand(parsedArgs.args.slice(1), COMMAND_CONFIG6).args;
178832
+ const args2 = getSubcommand2(parsedArgs.args.slice(1), COMMAND_CONFIG6).args;
178513
178833
  if ("--confirm" in parsedArgs.flags) {
178514
178834
  output_manager_default.warn("`--confirm` is deprecated, please use `--yes` instead");
178515
178835
  parsedArgs.flags["--yes"] = parsedArgs.flags["--confirm"];
@@ -179640,7 +179960,7 @@ async function dns(client2) {
179640
179960
  store: telemetryEventStore
179641
179961
  }
179642
179962
  });
179643
- const { subcommand, subcommandOriginal, args: args2 } = getSubcommand(
179963
+ const { subcommand, subcommandOriginal, args: args2 } = getSubcommand2(
179644
179964
  parsedArgs.args.slice(1),
179645
179965
  COMMAND_CONFIG7
179646
179966
  );
@@ -180648,7 +180968,7 @@ async function inspect2(client2, argv) {
180648
180968
  output_manager_default.print("\n");
180649
180969
  if (Array.isArray(projects) && projects.length > 0) {
180650
180970
  output_manager_default.print(import_chalk90.default.bold(" Projects\n"));
180651
- const table2 = formatTable(
180971
+ const table3 = formatTable(
180652
180972
  ["Project", "Domains"],
180653
180973
  ["l", "l"],
180654
180974
  [
@@ -180665,7 +180985,7 @@ async function inspect2(client2, argv) {
180665
180985
  ]
180666
180986
  );
180667
180987
  output_manager_default.print(
180668
- table2.split("\n").map((line) => ` ${line}`).join("\n")
180988
+ table3.split("\n").map((line) => ` ${line}`).join("\n")
180669
180989
  );
180670
180990
  output_manager_default.print("\n");
180671
180991
  }
@@ -181599,7 +181919,7 @@ async function main7(client2) {
181599
181919
  store: client2.telemetryEventStore
181600
181920
  }
181601
181921
  });
181602
- const { subcommand, args: args2, subcommandOriginal } = getSubcommand(
181922
+ const { subcommand, args: args2, subcommandOriginal } = getSubcommand2(
181603
181923
  parsedArgs.args.slice(1),
181604
181924
  COMMAND_CONFIG8
181605
181925
  );
@@ -181938,14 +182258,14 @@ function getEnvKeyWarnings(key) {
181938
182258
  }
181939
182259
  return warnings;
181940
182260
  }
181941
- var import_frameworks7, PUBLIC_PREFIXES, SENSITIVE_PATTERN;
182261
+ var import_frameworks8, PUBLIC_PREFIXES, SENSITIVE_PATTERN;
181942
182262
  var init_validate_env = __esm({
181943
182263
  "src/util/env/validate-env.ts"() {
181944
182264
  "use strict";
181945
- import_frameworks7 = __toESM3(require_frameworks(), 1);
182265
+ import_frameworks8 = __toESM3(require_frameworks(), 1);
181946
182266
  PUBLIC_PREFIXES = [
181947
182267
  ...new Set(
181948
- import_frameworks7.frameworkList.map((f) => f.envPrefix).filter((p) => !!p)
182268
+ import_frameworks8.frameworkList.map((f) => f.envPrefix).filter((p) => !!p)
181949
182269
  )
181950
182270
  ];
181951
182271
  SENSITIVE_PATTERN = /(?:^|_)(password|secret|private|token|key|auth|jwt|signature)(?:_|$)/i;
@@ -183209,7 +183529,7 @@ async function main8(client2) {
183209
183529
  return 1;
183210
183530
  }
183211
183531
  const subArgs = parsedArgs.args.slice(1);
183212
- const { subcommand, args: args2, subcommandOriginal } = getSubcommand(
183532
+ const { subcommand, args: args2, subcommandOriginal } = getSubcommand2(
183213
183533
  subArgs,
183214
183534
  COMMAND_CONFIG9
183215
183535
  );
@@ -183728,7 +184048,7 @@ async function main9(client2) {
183728
184048
  store: client2.telemetryEventStore
183729
184049
  }
183730
184050
  });
183731
- const { subcommand, args: args2, subcommandOriginal } = getSubcommand(
184051
+ const { subcommand, args: args2, subcommandOriginal } = getSubcommand2(
183732
184052
  parsedArgs.args.slice(1),
183733
184053
  COMMAND_CONFIG10
183734
184054
  );
@@ -183884,7 +184204,7 @@ async function guidance(client2) {
183884
184204
  printError(err);
183885
184205
  return 1;
183886
184206
  }
183887
- const { subcommand, subcommandOriginal } = getSubcommand(
184207
+ const { subcommand, subcommandOriginal } = getSubcommand2(
183888
184208
  parsedArguments.args.slice(1),
183889
184209
  COMMAND_CONFIG11
183890
184210
  );
@@ -184282,7 +184602,7 @@ async function main10(client2) {
184282
184602
  output_manager_default.print(help(initCommand, { columns: client2.stderr.columns }));
184283
184603
  return 2;
184284
184604
  }
184285
- const args2 = getSubcommand(parsedArgs.args.slice(1), COMMAND_CONFIG12).args;
184605
+ const args2 = getSubcommand2(parsedArgs.args.slice(1), COMMAND_CONFIG12).args;
184286
184606
  if (parsedArgs.args.length > 3) {
184287
184607
  output_manager_default.error("Too many arguments.");
184288
184608
  return 1;
@@ -184403,8 +184723,8 @@ var init_builds = __esm({
184403
184723
  }
184404
184724
  }
184405
184725
  const corner = isLast ? "\u2514\u2500\u2500" : "\u251C\u2500\u2500";
184406
- const main19 = prefix + path11 + finalSize + finalRegion;
184407
- return `${import_chalk103.default.grey(corner)} ${color(main19)}`;
184726
+ const main20 = prefix + path11 + finalSize + finalRegion;
184727
+ return `${import_chalk103.default.grey(corner)} ${color(main20)}`;
184408
184728
  };
184409
184729
  getDirPath = (path11, level = 0, highestLevel = null) => {
184410
184730
  const parts = path11.split("/").slice(0, -1);
@@ -186066,7 +186386,7 @@ async function install(client2) {
186066
186386
  if (flags["--help"]) {
186067
186387
  telemetry2.trackCliFlagHelp("install");
186068
186388
  output_manager_default.print(help(installCommand, { columns: client2.stderr.columns }));
186069
- return 2;
186389
+ return 0;
186070
186390
  }
186071
186391
  await add5(client2, args2.slice(1));
186072
186392
  }
@@ -186836,7 +187156,7 @@ async function main11(client2) {
186836
187156
  subcommand,
186837
187157
  subcommandOriginal,
186838
187158
  args: subArgs
186839
- } = getSubcommand(args2.slice(1), COMMAND_CONFIG13);
187159
+ } = getSubcommand2(args2.slice(1), COMMAND_CONFIG13);
186840
187160
  const needHelp = flags["--help"];
186841
187161
  function printHelp(command) {
186842
187162
  output_manager_default.print(
@@ -186853,14 +187173,14 @@ async function main11(client2) {
186853
187173
  columns: client2.stderr.columns
186854
187174
  })
186855
187175
  );
186856
- return 2;
187176
+ return 0;
186857
187177
  }
186858
187178
  switch (subcommand) {
186859
187179
  case "add": {
186860
187180
  if (needHelp) {
186861
187181
  telemetry2.trackCliFlagHelp("integration", subcommandOriginal);
186862
187182
  printHelp(addSubcommand5);
186863
- return 2;
187183
+ return 0;
186864
187184
  }
186865
187185
  telemetry2.trackCliSubcommandAdd(subcommandOriginal);
186866
187186
  return add5(client2, subArgs);
@@ -186869,7 +187189,7 @@ async function main11(client2) {
186869
187189
  if (needHelp) {
186870
187190
  telemetry2.trackCliFlagHelp("integration", subcommandOriginal);
186871
187191
  printHelp(listSubcommand7);
186872
- return 2;
187192
+ return 0;
186873
187193
  }
186874
187194
  telemetry2.trackCliSubcommandList(subcommandOriginal);
186875
187195
  return list4(client2);
@@ -186878,7 +187198,7 @@ async function main11(client2) {
186878
187198
  if (needHelp) {
186879
187199
  telemetry2.trackCliFlagHelp("integration", subcommandOriginal);
186880
187200
  printHelp(balanceSubcommand);
186881
- return 2;
187201
+ return 0;
186882
187202
  }
186883
187203
  telemetry2.trackCliSubcommandBalance(subcommandOriginal);
186884
187204
  return balance(client2, subArgs);
@@ -186887,7 +187207,7 @@ async function main11(client2) {
186887
187207
  if (needHelp) {
186888
187208
  telemetry2.trackCliFlagHelp("integration", subcommandOriginal);
186889
187209
  printHelp(openSubcommand);
186890
- return 2;
187210
+ return 0;
186891
187211
  }
186892
187212
  telemetry2.trackCliSubcommandOpen(subcommandOriginal);
186893
187213
  return openIntegration(client2, subArgs);
@@ -186896,7 +187216,7 @@ async function main11(client2) {
186896
187216
  if (needHelp) {
186897
187217
  telemetry2.trackCliFlagHelp("integration", subcommandOriginal);
186898
187218
  printHelp(removeSubcommand7);
186899
- return 2;
187219
+ return 0;
186900
187220
  }
186901
187221
  telemetry2.trackCliSubcommandRemove(subcommandOriginal);
186902
187222
  return remove3(client2);
@@ -187401,7 +187721,7 @@ var init_disconnect3 = __esm({
187401
187721
 
187402
187722
  // src/util/integration-resource/types.ts
187403
187723
  var CancelledError, FailedError;
187404
- var init_types = __esm({
187724
+ var init_types2 = __esm({
187405
187725
  "src/util/integration-resource/types.ts"() {
187406
187726
  "use strict";
187407
187727
  CancelledError = class extends Error {
@@ -187592,7 +187912,7 @@ var init_disconnect4 = __esm({
187592
187912
  init_get_resources();
187593
187913
  init_link2();
187594
187914
  init_disconnect3();
187595
- init_types();
187915
+ init_types2();
187596
187916
  init_command19();
187597
187917
  }
187598
187918
  });
@@ -187754,7 +188074,7 @@ var init_remove_resource = __esm({
187754
188074
  init_error2();
187755
188075
  init_delete_resource();
187756
188076
  init_get_resources();
187757
- init_types();
188077
+ init_types2();
187758
188078
  init_remove4();
187759
188079
  init_command19();
187760
188080
  init_disconnect4();
@@ -187777,7 +188097,7 @@ async function main12(client2) {
187777
188097
  getFlagsSpecification(integrationResourceCommand.options),
187778
188098
  { permissive: true }
187779
188099
  );
187780
- const { subcommand, subcommandOriginal } = getSubcommand(
188100
+ const { subcommand, subcommandOriginal } = getSubcommand2(
187781
188101
  args2.slice(1),
187782
188102
  COMMAND_CONFIG14
187783
188103
  );
@@ -187786,7 +188106,7 @@ async function main12(client2) {
187786
188106
  output_manager_default.print(
187787
188107
  help(integrationResourceCommand, { columns: client2.stderr.columns })
187788
188108
  );
187789
- return 2;
188109
+ return 0;
187790
188110
  }
187791
188111
  function printHelp(command) {
187792
188112
  output_manager_default.print(
@@ -187801,7 +188121,7 @@ async function main12(client2) {
187801
188121
  if (needHelp) {
187802
188122
  telemetry2.trackCliFlagHelp("integration-resource", subcommandOriginal);
187803
188123
  printHelp(createThresholdSubcommand);
187804
- return 2;
188124
+ return 0;
187805
188125
  }
187806
188126
  telemetry2.trackCliSubcommandCreateThreshold(subcommandOriginal);
187807
188127
  return createThreshold(client2);
@@ -187810,7 +188130,7 @@ async function main12(client2) {
187810
188130
  if (needHelp) {
187811
188131
  telemetry2.trackCliFlagHelp("integration-resource", subcommandOriginal);
187812
188132
  printHelp(removeSubcommand6);
187813
- return 2;
188133
+ return 0;
187814
188134
  }
187815
188135
  telemetry2.trackCliSubcommandRemove(subcommandOriginal);
187816
188136
  return remove4(client2);
@@ -187819,7 +188139,7 @@ async function main12(client2) {
187819
188139
  if (needHelp) {
187820
188140
  telemetry2.trackCliFlagHelp("integration-resource", subcommandOriginal);
187821
188141
  printHelp(disconnectSubcommand2);
187822
- return 2;
188142
+ return 0;
187823
188143
  }
187824
188144
  telemetry2.trackCliSubcommandDisconnect(subcommandOriginal);
187825
188145
  return disconnect2(client2);
@@ -188720,8 +189040,30 @@ async function fetchRequestLogs(client2, options) {
188720
189040
  const baseUrl = client2.apiUrl === "https://api.vercel.com" ? "https://vercel.com" : client2.apiUrl;
188721
189041
  const url3 = `${baseUrl}/api/logs/request-logs?${query.toString()}`;
188722
189042
  const data = await client2.fetch(url3);
189043
+ const logs2 = (data.rows || []).map((row) => {
189044
+ const firstLog = row.logs?.[0];
189045
+ const firstEvent = row.events?.[0];
189046
+ return {
189047
+ id: row.requestId || "",
189048
+ timestamp: row.timestamp ? new Date(row.timestamp).getTime() : Date.now(),
189049
+ deploymentId: row.deploymentId || "",
189050
+ projectId: options.projectId,
189051
+ level: firstLog?.level || "info",
189052
+ message: firstLog?.message || "",
189053
+ messageTruncated: firstLog?.messageTruncated,
189054
+ source: firstEvent?.source || "static",
189055
+ domain: row.domain || "",
189056
+ requestMethod: row.requestMethod || "",
189057
+ requestPath: row.requestPath || "",
189058
+ responseStatusCode: row.statusCode || 0,
189059
+ environment: row.environment || "production",
189060
+ branch: row.branch,
189061
+ cache: row.cache,
189062
+ traceId: row.traceId
189063
+ };
189064
+ });
188723
189065
  return {
188724
- logs: data.rows || [],
189066
+ logs: logs2,
188725
189067
  pagination: {
188726
189068
  hasMore: data.hasMoreRows ?? false
188727
189069
  }
@@ -188881,6 +189223,11 @@ var init_logsv2 = __esm({
188881
189223
  });
188882
189224
  }
188883
189225
  }
189226
+ trackCliFlagExpand(v) {
189227
+ if (v) {
189228
+ this.trackCliFlag("expand");
189229
+ }
189230
+ }
188884
189231
  };
188885
189232
  }
188886
189233
  });
@@ -188890,6 +189237,78 @@ var logsv2_exports = {};
188890
189237
  __export3(logsv2_exports, {
188891
189238
  default: () => logsv2
188892
189239
  });
189240
+ function table2({
189241
+ columns,
189242
+ rows,
189243
+ tableWidth,
189244
+ formatHeader,
189245
+ formatRow
189246
+ }) {
189247
+ const zeroPad = [0, 0];
189248
+ const maxWidths = columns.map((col) => {
189249
+ const headerWidth = col.label.length;
189250
+ const maxContent = Math.max(
189251
+ headerWidth,
189252
+ ...rows.map((row) => col.getValue(row).length)
189253
+ );
189254
+ return maxContent;
189255
+ });
189256
+ const colPaddings = columns.map(
189257
+ (col) => col.padding ?? zeroPad
189258
+ );
189259
+ const finalWidths = [];
189260
+ let usedWidth = 0;
189261
+ let stretchIndex = -1;
189262
+ for (let i = 0; i < columns.length; i++) {
189263
+ const col = columns[i];
189264
+ const padding2 = colPaddings[i][0] + colPaddings[i][1];
189265
+ if (col.width === "stretch") {
189266
+ stretchIndex = i;
189267
+ finalWidths.push(0);
189268
+ } else if (typeof col.width === "number") {
189269
+ finalWidths.push(col.width);
189270
+ usedWidth += col.width + padding2;
189271
+ } else {
189272
+ finalWidths.push(maxWidths[i]);
189273
+ usedWidth += maxWidths[i] + padding2;
189274
+ }
189275
+ }
189276
+ usedWidth += (columns.length - 1) * 2;
189277
+ if (stretchIndex >= 0) {
189278
+ const stretchPadding = colPaddings[stretchIndex][0] + colPaddings[stretchIndex][1];
189279
+ finalWidths[stretchIndex] = Math.max(
189280
+ 10,
189281
+ tableWidth - usedWidth - stretchPadding
189282
+ );
189283
+ }
189284
+ const pad = (value, width) => {
189285
+ if (value.length > width) {
189286
+ return value.slice(0, width - 1) + "\u2026";
189287
+ }
189288
+ return value.padEnd(width);
189289
+ };
189290
+ const headerStr = columns.map((col, i) => {
189291
+ const padded = pad(col.label, finalWidths[i]);
189292
+ return " ".repeat(colPaddings[i][0]) + padded + " ".repeat(colPaddings[i][1]);
189293
+ }).join(" ");
189294
+ const header = formatHeader ? formatHeader(headerStr) : headerStr;
189295
+ const formattedRows = rows.map((row) => {
189296
+ const rowStr = columns.map((col, i) => {
189297
+ const value = col.getValue(row);
189298
+ const padded = pad(value, finalWidths[i]);
189299
+ const formatted = col.format ? col.format(padded, row) : padded;
189300
+ return " ".repeat(colPaddings[i][0]) + formatted + " ".repeat(colPaddings[i][1]);
189301
+ }).join(" ");
189302
+ return formatRow ? formatRow(rowStr, row) : rowStr;
189303
+ });
189304
+ return { header, rows: formattedRows };
189305
+ }
189306
+ function logsSpanMultipleDays(logs2) {
189307
+ if (logs2.length === 0)
189308
+ return false;
189309
+ const firstDay = new Date(logs2[0].timestamp).toDateString();
189310
+ return logs2.some((log2) => new Date(log2.timestamp).toDateString() !== firstDay);
189311
+ }
188893
189312
  function parseLevels(levels) {
188894
189313
  if (!levels)
188895
189314
  return [];
@@ -188947,6 +189366,7 @@ async function logsv2(client2) {
188947
189366
  const followOption = parsedArguments.flags["--follow"];
188948
189367
  const queryOption = parsedArguments.flags["--query"];
188949
189368
  const requestIdOption = parsedArguments.flags["--request-id"];
189369
+ const expandOption = parsedArguments.flags["--expand"];
188950
189370
  telemetry2.trackCliArgumentUrlOrDeploymentId(deploymentArgument);
188951
189371
  telemetry2.trackCliOptionProject(projectOption);
188952
189372
  telemetry2.trackCliOptionDeployment(deploymentFlag);
@@ -188961,6 +189381,7 @@ async function logsv2(client2) {
188961
189381
  telemetry2.trackCliFlagFollow(followOption);
188962
189382
  telemetry2.trackCliOptionQuery(queryOption);
188963
189383
  telemetry2.trackCliOptionRequestId(requestIdOption);
189384
+ telemetry2.trackCliFlagExpand(expandOption);
188964
189385
  if (followOption) {
188965
189386
  if (!deploymentOption) {
188966
189387
  output_manager_default.error(
@@ -188998,6 +189419,8 @@ async function logsv2(client2) {
188998
189419
  throw err;
188999
189420
  }
189000
189421
  let projectId;
189422
+ let projectSlug;
189423
+ let orgSlug;
189001
189424
  let ownerId;
189002
189425
  if (projectOption) {
189003
189426
  output_manager_default.spinner(`Fetching project "${projectOption}"`, 1e3);
@@ -189012,6 +189435,8 @@ async function logsv2(client2) {
189012
189435
  return 1;
189013
189436
  }
189014
189437
  projectId = project.id;
189438
+ projectSlug = project.name;
189439
+ orgSlug = contextName;
189015
189440
  ownerId = project.accountId;
189016
189441
  } else {
189017
189442
  const link4 = await getLinkedProject(client2);
@@ -189027,6 +189452,8 @@ async function logsv2(client2) {
189027
189452
  }
189028
189453
  client2.config.currentTeam = link4.org.type === "team" ? link4.org.id : void 0;
189029
189454
  projectId = link4.project.id;
189455
+ projectSlug = link4.project.name;
189456
+ orgSlug = link4.org.slug;
189030
189457
  ownerId = link4.org.id;
189031
189458
  }
189032
189459
  let deploymentId;
@@ -189056,7 +189483,7 @@ async function logsv2(client2) {
189056
189483
  if (followOption) {
189057
189484
  if (!jsonOption2) {
189058
189485
  output_manager_default.print(
189059
- `Streaming logs for deployment ${import_chalk117.default.bold(deploymentId)} starting from ${import_chalk117.default.bold((0, import_date_fns3.format)(Date.now(), DATE_TIME_FORMAT2))}
189486
+ `Streaming logs for deployment ${import_chalk117.default.bold(deploymentId)} starting from ${import_chalk117.default.bold((0, import_date_fns3.format)(Date.now(), TIME_ONLY_FORMAT))}
189060
189487
 
189061
189488
  `
189062
189489
  );
@@ -189104,15 +189531,9 @@ async function logsv2(client2) {
189104
189531
  }
189105
189532
  }
189106
189533
  const limit = limitOption2 ?? 100;
189107
- if (!jsonOption2) {
189108
- output_manager_default.print(
189109
- `Fetching logs for project ${import_chalk117.default.bold(projectId)} in ${import_chalk117.default.bold(contextName)}...
189110
-
189111
- `
189112
- );
189113
- }
189114
189534
  output_manager_default.spinner("Fetching logs...", 1e3);
189115
- let count = 0;
189535
+ const terminalWidth = client2.stderr.isTTY ? client2.stderr.columns || 120 : 120;
189536
+ const logs2 = [];
189116
189537
  try {
189117
189538
  for await (const log2 of fetchAllRequestLogs(client2, {
189118
189539
  projectId,
@@ -189132,9 +189553,8 @@ async function logsv2(client2) {
189132
189553
  if (jsonOption2) {
189133
189554
  client2.stdout.write(JSON.stringify(log2) + "\n");
189134
189555
  } else {
189135
- prettyPrintLogEntry(log2);
189556
+ logs2.push(log2);
189136
189557
  }
189137
- count++;
189138
189558
  }
189139
189559
  } catch (err) {
189140
189560
  output_manager_default.stopSpinner();
@@ -189143,76 +189563,128 @@ async function logsv2(client2) {
189143
189563
  }
189144
189564
  output_manager_default.stopSpinner();
189145
189565
  if (!jsonOption2) {
189146
- if (count === 0) {
189566
+ if (logs2.length === 0) {
189147
189567
  output_manager_default.print(
189148
- import_chalk117.default.gray("No logs found matching the specified filters.\n")
189568
+ import_chalk117.default.dim(`No logs found for ${formatProject(orgSlug, projectSlug)}
189569
+ `)
189149
189570
  );
189150
189571
  } else {
189151
- output_manager_default.print(import_chalk117.default.gray(`
189152
- Displayed ${count} log entries.
189153
- `));
189572
+ const showDate = logsSpanMultipleDays(logs2);
189573
+ const timeFormat = showDate ? DATE_TIME_FORMAT2 : TIME_ONLY_FORMAT;
189574
+ const rowData = logs2.map((log2) => {
189575
+ const statusCode = log2.responseStatusCode;
189576
+ return {
189577
+ time: (0, import_date_fns3.format)(log2.timestamp, timeFormat),
189578
+ level: log2.level,
189579
+ path: `${getSourceIcon2(log2.source)} ${log2.requestMethod} ${log2.requestPath}`,
189580
+ status: !statusCode || statusCode <= 0 ? "---" : String(statusCode),
189581
+ statusCode,
189582
+ message: log2.message?.replace(/\n/g, " ").trim() || "",
189583
+ messageTruncated: log2.messageTruncated
189584
+ };
189585
+ });
189586
+ const baseColumns = [
189587
+ {
189588
+ label: "TIME",
189589
+ getValue: (row) => row.time,
189590
+ format: (padded) => import_chalk117.default.dim(padded)
189591
+ },
189592
+ {
189593
+ label: "LEVEL",
189594
+ getValue: (row) => row.level,
189595
+ format: (padded, row) => colorizeLevel(padded, row.level)
189596
+ },
189597
+ {
189598
+ label: "",
189599
+ padding: [0, 3],
189600
+ getValue: (row) => row.path
189601
+ }
189602
+ ];
189603
+ const columns = expandOption ? baseColumns : [
189604
+ ...baseColumns,
189605
+ {
189606
+ label: "STATUS",
189607
+ getValue: (row) => row.status,
189608
+ format: (padded, row) => row.statusCode <= 0 ? import_chalk117.default.gray(padded) : colorizeStatus(padded, row.statusCode)
189609
+ },
189610
+ {
189611
+ label: "MESSAGE",
189612
+ width: "stretch",
189613
+ getValue: (row) => row.message || "(no message)",
189614
+ format: (padded, row) => row.message ? colorizeMessage(padded, row.level) : import_chalk117.default.dim(padded)
189615
+ }
189616
+ ];
189617
+ const formatted = table2({
189618
+ columns,
189619
+ rows: rowData,
189620
+ tableWidth: terminalWidth,
189621
+ formatHeader: (header) => import_chalk117.default.dim(header),
189622
+ formatRow: expandOption ? (rowStr, row) => {
189623
+ if (row.message) {
189624
+ const coloredMessage = colorizeMessage(row.message, row.level);
189625
+ const truncatedIndicator = row.messageTruncated ? import_chalk117.default.gray("\u2026") : "";
189626
+ return `${rowStr}
189627
+ ${coloredMessage}${truncatedIndicator}
189628
+ `;
189629
+ }
189630
+ return rowStr + "\n";
189631
+ } : void 0
189632
+ });
189633
+ output_manager_default.print(formatted.header + "\n");
189634
+ for (const row of formatted.rows) {
189635
+ output_manager_default.print(row + "\n");
189636
+ }
189637
+ output_manager_default.print(
189638
+ import_chalk117.default.gray(
189639
+ `Fetched ${logs2.length} logs for ${formatProject(orgSlug, projectSlug)}
189640
+ `
189641
+ )
189642
+ );
189154
189643
  }
189155
189644
  }
189156
189645
  return 0;
189157
189646
  }
189158
- function prettyPrintLogEntry(log2) {
189159
- const date = (0, import_date_fns3.format)(log2.timestamp, DATE_TIME_FORMAT2);
189160
- const levelIcon = getLevelIcon2(log2.level);
189161
- const sourceIcon = getSourceIcon2(log2.source);
189162
- const status3 = log2.responseStatusCode <= 0 ? import_chalk117.default.gray("---") : getStatusColor(log2.responseStatusCode);
189163
- const headerLine = `${import_chalk117.default.dim(date)} ${levelIcon} ${import_chalk117.default.bold(
189164
- log2.requestMethod.padEnd(6)
189165
- )} ${status3} ${import_chalk117.default.dim(log2.domain)} ${sourceIcon} ${log2.requestPath}`;
189166
- output_manager_default.print(`${headerLine}
189167
- `);
189168
- if (log2.message) {
189169
- const message2 = log2.message.replace(/\n$/, "");
189170
- const truncatedIndicator = log2.messageTruncated ? import_chalk117.default.gray("\u2026") : "";
189171
- output_manager_default.print(
189172
- `${colorizeMessage(message2, log2.level)}${truncatedIndicator}
189173
-
189174
- `
189175
- );
189176
- } else {
189177
- output_manager_default.print("\n");
189178
- }
189179
- }
189180
- function getLevelIcon2(level) {
189647
+ function colorizeLevel(formatted, level) {
189181
189648
  switch (level) {
189182
189649
  case "fatal":
189650
+ return import_chalk117.default.red.bold(formatted);
189183
189651
  case "error":
189184
- return "\u{1F6AB}";
189652
+ return import_chalk117.default.red(formatted);
189185
189653
  case "warning":
189186
- return "\u26A0\uFE0F";
189654
+ return import_chalk117.default.yellow(formatted);
189187
189655
  default:
189188
- return "\u2139\uFE0F";
189656
+ return import_chalk117.default.dim(formatted);
189657
+ }
189658
+ }
189659
+ function colorizeStatus(formatted, statusCode) {
189660
+ if (statusCode >= 500) {
189661
+ return import_chalk117.default.red(formatted);
189662
+ } else if (statusCode >= 400) {
189663
+ return import_chalk117.default.yellow(formatted);
189664
+ } else if (statusCode >= 300) {
189665
+ return import_chalk117.default.cyan(formatted);
189666
+ } else if (statusCode >= 200) {
189667
+ return import_chalk117.default.green(formatted);
189189
189668
  }
189669
+ return import_chalk117.default.gray(formatted);
189190
189670
  }
189191
189671
  function getSourceIcon2(source) {
189192
189672
  switch (source) {
189673
+ case "serverless":
189674
+ case "lambda":
189675
+ return "\u03BB";
189193
189676
  case "edge-function":
189194
- return "\u0D28";
189195
189677
  case "edge-middleware":
189196
- return "\u025B";
189197
- case "serverless":
189198
- return "\u0192";
189678
+ case "middleware":
189679
+ return "\u03B5";
189680
+ case "static":
189681
+ case "external":
189682
+ case "redirect":
189683
+ return "\u25C7";
189199
189684
  default:
189200
189685
  return " ";
189201
189686
  }
189202
189687
  }
189203
- function getStatusColor(status3) {
189204
- const statusStr = String(status3);
189205
- if (status3 >= 500) {
189206
- return import_chalk117.default.red(statusStr);
189207
- } else if (status3 >= 400) {
189208
- return import_chalk117.default.yellow(statusStr);
189209
- } else if (status3 >= 300) {
189210
- return import_chalk117.default.cyan(statusStr);
189211
- } else if (status3 >= 200) {
189212
- return import_chalk117.default.green(statusStr);
189213
- }
189214
- return import_chalk117.default.gray(statusStr);
189215
- }
189216
189688
  function colorizeMessage(message2, level) {
189217
189689
  switch (level) {
189218
189690
  case "fatal":
@@ -189221,10 +189693,10 @@ function colorizeMessage(message2, level) {
189221
189693
  case "warning":
189222
189694
  return import_chalk117.default.yellow(message2);
189223
189695
  default:
189224
- return message2;
189696
+ return import_chalk117.default.dim(message2);
189225
189697
  }
189226
189698
  }
189227
- var import_error_utils30, import_chalk117, import_date_fns3, DATE_TIME_FORMAT2;
189699
+ var import_error_utils30, import_chalk117, import_date_fns3, TIME_ONLY_FORMAT, DATE_TIME_FORMAT2;
189228
189700
  var init_logsv22 = __esm({
189229
189701
  "src/commands/logsv2/index.ts"() {
189230
189702
  "use strict";
@@ -189235,6 +189707,7 @@ var init_logsv22 = __esm({
189235
189707
  init_get_args();
189236
189708
  init_get_flags_specification();
189237
189709
  init_get_scope();
189710
+ init_format_project();
189238
189711
  init_get_project_by_id_or_name();
189239
189712
  init_link2();
189240
189713
  init_errors_ts();
@@ -189246,7 +189719,8 @@ var init_logsv22 = __esm({
189246
189719
  init_help();
189247
189720
  init_command26();
189248
189721
  init_output_manager();
189249
- DATE_TIME_FORMAT2 = "MMM dd HH:mm:ss.SS";
189722
+ TIME_ONLY_FORMAT = "HH:mm:ss.SS";
189723
+ DATE_TIME_FORMAT2 = "MMM DD HH:mm:ss.SS";
189250
189724
  }
189251
189725
  });
189252
189726
 
@@ -189891,7 +190365,7 @@ async function main14(client2) {
189891
190365
  printError(error3);
189892
190366
  return 1;
189893
190367
  }
189894
- let { subcommand, subcommandOriginal } = getSubcommand(
190368
+ let { subcommand, subcommandOriginal } = getSubcommand2(
189895
190369
  parsedArgs.args.slice(1),
189896
190370
  COMMAND_CONFIG15
189897
190371
  );
@@ -190244,7 +190718,7 @@ async function inspect4(client2, argv) {
190244
190718
  ` ${import_chalk120.default.cyan("Node.js Version")} ${project.nodeVersion}
190245
190719
  `
190246
190720
  );
190247
- const framework = import_frameworks8.frameworkList.find((f) => f.slug === project.framework);
190721
+ const framework = import_frameworks9.frameworkList.find((f) => f.slug === project.framework);
190248
190722
  output_manager_default.print("\n");
190249
190723
  output_manager_default.print(import_chalk120.default.bold(" Framework Settings\n\n"));
190250
190724
  output_manager_default.print(` ${import_chalk120.default.cyan("Framework Preset")} ${framework?.name}
@@ -190264,12 +190738,12 @@ async function inspect4(client2, argv) {
190264
190738
  output_manager_default.print("\n");
190265
190739
  return 0;
190266
190740
  }
190267
- var import_chalk120, import_frameworks8;
190741
+ var import_chalk120, import_frameworks9;
190268
190742
  var init_inspect6 = __esm({
190269
190743
  "src/commands/project/inspect.ts"() {
190270
190744
  "use strict";
190271
190745
  import_chalk120 = __toESM3(require_source(), 1);
190272
- import_frameworks8 = __toESM3(require_frameworks(), 1);
190746
+ import_frameworks9 = __toESM3(require_frameworks(), 1);
190273
190747
  init_pkg_name();
190274
190748
  init_inspect5();
190275
190749
  init_output_manager();
@@ -190661,7 +191135,7 @@ async function main15(client2) {
190661
191135
  printError(error3);
190662
191136
  return 1;
190663
191137
  }
190664
- let { subcommand, args: args2, subcommandOriginal } = getSubcommand(
191138
+ let { subcommand, args: args2, subcommandOriginal } = getSubcommand2(
190665
191139
  parsedArgs.args.slice(1),
190666
191140
  COMMAND_CONFIG16
190667
191141
  );
@@ -193133,7 +193607,7 @@ async function main16(client2) {
193133
193607
  return 1;
193134
193608
  }
193135
193609
  const subArgs = parsedArgs.args.slice(1);
193136
- const { subcommand, args: args2, subcommandOriginal } = getSubcommand(
193610
+ const { subcommand, args: args2, subcommandOriginal } = getSubcommand2(
193137
193611
  subArgs,
193138
193612
  COMMAND_CONFIG17
193139
193613
  );
@@ -194264,7 +194738,7 @@ async function rollingRelease(client2) {
194264
194738
  subcommand,
194265
194739
  args: subcommandArgs,
194266
194740
  subcommandOriginal
194267
- } = getSubcommand(client2.argv.slice(3), COMMAND_CONFIG18);
194741
+ } = getSubcommand2(client2.argv.slice(3), COMMAND_CONFIG18);
194268
194742
  const needHelp = client2.argv.includes("--help") || client2.argv.includes("-h");
194269
194743
  if (!subcommand && needHelp) {
194270
194744
  telemetry2.trackCliFlagHelp("rolling-release");
@@ -195511,7 +195985,7 @@ async function teams(client2) {
195511
195985
  if (parsedArgs.args[0] === "switch") {
195512
195986
  parsedArgs.args.unshift("teams");
195513
195987
  }
195514
- const { subcommand, args: args2, subcommandOriginal } = getSubcommand(
195988
+ const { subcommand, args: args2, subcommandOriginal } = getSubcommand2(
195515
195989
  parsedArgs.args.slice(1),
195516
195990
  COMMAND_CONFIG20
195517
195991
  );
@@ -195755,7 +196229,7 @@ async function telemetry(client2) {
195755
196229
  printError(err);
195756
196230
  return 1;
195757
196231
  }
195758
- const { subcommand, args: args2, subcommandOriginal } = getSubcommand(
196232
+ const { subcommand, args: args2, subcommandOriginal } = getSubcommand2(
195759
196233
  parsedArguments.args.slice(1),
195760
196234
  COMMAND_CONFIG21
195761
196235
  );
@@ -195932,6 +196406,776 @@ var init_upgrade3 = __esm({
195932
196406
  }
195933
196407
  });
195934
196408
 
196409
+ // src/util/webhooks/get-webhooks.ts
196410
+ async function getWebhooks(client2) {
196411
+ const response = await client2.fetch("/v1/webhooks");
196412
+ if (Array.isArray(response)) {
196413
+ return { webhooks: response };
196414
+ }
196415
+ return response;
196416
+ }
196417
+ var init_get_webhooks = __esm({
196418
+ "src/util/webhooks/get-webhooks.ts"() {
196419
+ "use strict";
196420
+ }
196421
+ });
196422
+
196423
+ // src/util/telemetry/commands/webhooks/ls.ts
196424
+ var WebhooksLsTelemetryClient;
196425
+ var init_ls10 = __esm({
196426
+ "src/util/telemetry/commands/webhooks/ls.ts"() {
196427
+ "use strict";
196428
+ init_telemetry();
196429
+ WebhooksLsTelemetryClient = class extends TelemetryClient {
196430
+ trackCliOptionFormat(format8) {
196431
+ if (format8) {
196432
+ this.trackCliOption({
196433
+ option: "format",
196434
+ value: format8
196435
+ });
196436
+ }
196437
+ }
196438
+ };
196439
+ }
196440
+ });
196441
+
196442
+ // src/commands/webhooks/ls.ts
196443
+ async function ls6(client2, argv) {
196444
+ const telemetry2 = new WebhooksLsTelemetryClient({
196445
+ opts: {
196446
+ store: client2.telemetryEventStore
196447
+ }
196448
+ });
196449
+ let parsedArgs;
196450
+ const flagsSpecification = getFlagsSpecification(listSubcommand13.options);
196451
+ try {
196452
+ parsedArgs = parseArguments(argv, flagsSpecification);
196453
+ } catch (error3) {
196454
+ printError(error3);
196455
+ return 1;
196456
+ }
196457
+ const { args: args2, flags: opts } = parsedArgs;
196458
+ const validationResult = validateLsArgs({
196459
+ commandName: "webhooks ls",
196460
+ args: args2,
196461
+ maxArgs: 0,
196462
+ exitCode: 2
196463
+ });
196464
+ if (validationResult !== 0) {
196465
+ return validationResult;
196466
+ }
196467
+ telemetry2.trackCliOptionFormat(opts["--format"]);
196468
+ const formatResult = validateJsonOutput(opts);
196469
+ if (!formatResult.valid) {
196470
+ output_manager_default.error(formatResult.error);
196471
+ return 1;
196472
+ }
196473
+ const asJson = formatResult.jsonOutput;
196474
+ const { contextName } = await getScope(client2);
196475
+ const lsStamp = stamp_default();
196476
+ output_manager_default.spinner(`Fetching Webhooks under ${import_chalk146.default.bold(contextName)}`);
196477
+ const { webhooks } = await getWebhooks(client2);
196478
+ if (asJson) {
196479
+ output_manager_default.stopSpinner();
196480
+ const jsonOutput = {
196481
+ webhooks: webhooks.map((webhook) => ({
196482
+ id: webhook.id,
196483
+ url: webhook.url,
196484
+ events: webhook.events,
196485
+ projectIds: webhook.projectIds,
196486
+ createdAt: webhook.createdAt,
196487
+ updatedAt: webhook.updatedAt
196488
+ }))
196489
+ };
196490
+ client2.stdout.write(`${JSON.stringify(jsonOutput, null, 2)}
196491
+ `);
196492
+ } else {
196493
+ output_manager_default.log(
196494
+ `${(0, import_pluralize16.default)("Webhook", webhooks.length, true)} found under ${import_chalk146.default.bold(
196495
+ contextName
196496
+ )} ${import_chalk146.default.gray(lsStamp())}`
196497
+ );
196498
+ if (webhooks.length > 0) {
196499
+ output_manager_default.print(
196500
+ formatWebhooksTable(webhooks).replace(/^(.*)/gm, `${" ".repeat(1)}$1`)
196501
+ );
196502
+ output_manager_default.print("\n\n");
196503
+ }
196504
+ }
196505
+ return 0;
196506
+ }
196507
+ function formatWebhooksTable(webhooks) {
196508
+ const current = Date.now();
196509
+ const rows = webhooks.map((webhook) => {
196510
+ const age = webhook.createdAt ? (0, import_ms34.default)(current - webhook.createdAt) : "-";
196511
+ const eventsDisplay = webhook.events.length > 2 ? `${webhook.events.slice(0, 2).join(", ")} +${webhook.events.length - 2}` : webhook.events.join(", ");
196512
+ return [webhook.id, webhook.url, eventsDisplay, import_chalk146.default.gray(age)];
196513
+ });
196514
+ return formatTable(
196515
+ ["ID", "URL", "Events", "Age"],
196516
+ ["l", "l", "l", "l"],
196517
+ [{ rows }]
196518
+ );
196519
+ }
196520
+ var import_ms34, import_chalk146, import_pluralize16;
196521
+ var init_ls11 = __esm({
196522
+ "src/commands/webhooks/ls.ts"() {
196523
+ "use strict";
196524
+ import_ms34 = __toESM3(require_ms(), 1);
196525
+ import_chalk146 = __toESM3(require_source(), 1);
196526
+ import_pluralize16 = __toESM3(require_pluralize(), 1);
196527
+ init_get_webhooks();
196528
+ init_get_scope();
196529
+ init_stamp();
196530
+ init_format_table();
196531
+ init_output_format();
196532
+ init_output_manager();
196533
+ init_ls10();
196534
+ init_command44();
196535
+ init_get_args();
196536
+ init_get_flags_specification();
196537
+ init_error2();
196538
+ init_validate_ls_args();
196539
+ }
196540
+ });
196541
+
196542
+ // src/util/webhooks/get-webhook.ts
196543
+ async function getWebhook(client2, webhookId) {
196544
+ return await client2.fetch(
196545
+ `/v1/webhooks/${encodeURIComponent(webhookId)}`
196546
+ );
196547
+ }
196548
+ var init_get_webhook = __esm({
196549
+ "src/util/webhooks/get-webhook.ts"() {
196550
+ "use strict";
196551
+ }
196552
+ });
196553
+
196554
+ // src/util/telemetry/commands/webhooks/get.ts
196555
+ var WebhooksGetTelemetryClient;
196556
+ var init_get = __esm({
196557
+ "src/util/telemetry/commands/webhooks/get.ts"() {
196558
+ "use strict";
196559
+ init_telemetry();
196560
+ WebhooksGetTelemetryClient = class extends TelemetryClient {
196561
+ trackCliArgumentId(id) {
196562
+ if (id) {
196563
+ this.trackCliArgument({
196564
+ arg: "id",
196565
+ value: this.redactedValue
196566
+ });
196567
+ }
196568
+ }
196569
+ trackCliOptionFormat(format8) {
196570
+ if (format8) {
196571
+ this.trackCliOption({
196572
+ option: "format",
196573
+ value: format8
196574
+ });
196575
+ }
196576
+ }
196577
+ };
196578
+ }
196579
+ });
196580
+
196581
+ // src/commands/webhooks/get.ts
196582
+ async function get(client2, argv) {
196583
+ const telemetry2 = new WebhooksGetTelemetryClient({
196584
+ opts: {
196585
+ store: client2.telemetryEventStore
196586
+ }
196587
+ });
196588
+ let parsedArgs;
196589
+ const flagsSpecification = getFlagsSpecification(getSubcommand.options);
196590
+ try {
196591
+ parsedArgs = parseArguments(argv, flagsSpecification);
196592
+ } catch (error3) {
196593
+ printError(error3);
196594
+ return 1;
196595
+ }
196596
+ const { args: args2, flags: opts } = parsedArgs;
196597
+ const [webhookId] = args2;
196598
+ const getStamp = stamp_default();
196599
+ if (!webhookId) {
196600
+ output_manager_default.error(`${getCommandName(`webhooks get <id>`)} expects one argument`);
196601
+ return 1;
196602
+ }
196603
+ telemetry2.trackCliArgumentId(webhookId);
196604
+ telemetry2.trackCliOptionFormat(opts["--format"]);
196605
+ const formatResult = validateJsonOutput(opts);
196606
+ if (!formatResult.valid) {
196607
+ output_manager_default.error(formatResult.error);
196608
+ return 1;
196609
+ }
196610
+ const asJson = formatResult.jsonOutput;
196611
+ if (args2.length !== 1) {
196612
+ output_manager_default.error(
196613
+ `Invalid number of arguments. Usage: ${import_chalk147.default.cyan(
196614
+ `${getCommandName("webhooks get <id>")}`
196615
+ )}`
196616
+ );
196617
+ return 1;
196618
+ }
196619
+ output_manager_default.debug(`Fetching webhook info`);
196620
+ const { contextName } = await getScope(client2);
196621
+ output_manager_default.spinner(
196622
+ `Fetching Webhook ${webhookId} under ${import_chalk147.default.bold(contextName)}`
196623
+ );
196624
+ let webhook;
196625
+ try {
196626
+ webhook = await getWebhook(client2, webhookId);
196627
+ } catch (err) {
196628
+ if (isAPIError(err) && err.status === 404) {
196629
+ output_manager_default.error(`Webhook not found: ${webhookId}`);
196630
+ output_manager_default.log(`Run ${getCommandName(`webhooks ls`)} to see your webhooks.`);
196631
+ return 1;
196632
+ }
196633
+ throw err;
196634
+ }
196635
+ if (asJson) {
196636
+ output_manager_default.stopSpinner();
196637
+ client2.stdout.write(`${JSON.stringify(webhook, null, 2)}
196638
+ `);
196639
+ } else {
196640
+ output_manager_default.log(
196641
+ `Webhook ${webhookId} found under ${import_chalk147.default.bold(contextName)} ${import_chalk147.default.gray(
196642
+ getStamp()
196643
+ )}`
196644
+ );
196645
+ output_manager_default.print("\n");
196646
+ output_manager_default.print(import_chalk147.default.bold(" General\n\n"));
196647
+ output_manager_default.print(` ${import_chalk147.default.cyan("ID")} ${webhook.id}
196648
+ `);
196649
+ output_manager_default.print(` ${import_chalk147.default.cyan("URL")} ${webhook.url}
196650
+ `);
196651
+ output_manager_default.print(
196652
+ ` ${import_chalk147.default.cyan("Created At")} ${formatDate(webhook.createdAt)}
196653
+ `
196654
+ );
196655
+ output_manager_default.print(
196656
+ ` ${import_chalk147.default.cyan("Updated At")} ${formatDate(webhook.updatedAt)}
196657
+ `
196658
+ );
196659
+ output_manager_default.print("\n");
196660
+ output_manager_default.print(import_chalk147.default.bold(" Events\n\n"));
196661
+ for (const event of webhook.events) {
196662
+ output_manager_default.print(` - ${event}
196663
+ `);
196664
+ }
196665
+ if (webhook.projectIds && webhook.projectIds.length > 0) {
196666
+ output_manager_default.print("\n");
196667
+ output_manager_default.print(import_chalk147.default.bold(" Projects\n\n"));
196668
+ if (webhook.projectsMetadata && webhook.projectsMetadata.length > 0) {
196669
+ for (const project of webhook.projectsMetadata) {
196670
+ output_manager_default.print(` - ${project.name} (${project.id})
196671
+ `);
196672
+ }
196673
+ } else {
196674
+ for (const projectId of webhook.projectIds) {
196675
+ output_manager_default.print(` - ${projectId}
196676
+ `);
196677
+ }
196678
+ }
196679
+ }
196680
+ output_manager_default.print("\n");
196681
+ }
196682
+ return 0;
196683
+ }
196684
+ var import_chalk147;
196685
+ var init_get2 = __esm({
196686
+ "src/commands/webhooks/get.ts"() {
196687
+ "use strict";
196688
+ import_chalk147 = __toESM3(require_source(), 1);
196689
+ init_stamp();
196690
+ init_format_date();
196691
+ init_get_webhook();
196692
+ init_get_scope();
196693
+ init_pkg_name();
196694
+ init_output_format();
196695
+ init_get();
196696
+ init_output_manager();
196697
+ init_command44();
196698
+ init_get_args();
196699
+ init_get_flags_specification();
196700
+ init_error2();
196701
+ init_errors_ts();
196702
+ }
196703
+ });
196704
+
196705
+ // src/util/webhooks/create-webhook.ts
196706
+ async function createWebhook(client2, payload) {
196707
+ return await client2.fetch("/v1/webhooks", {
196708
+ method: "POST",
196709
+ body: payload
196710
+ });
196711
+ }
196712
+ var init_create_webhook = __esm({
196713
+ "src/util/webhooks/create-webhook.ts"() {
196714
+ "use strict";
196715
+ }
196716
+ });
196717
+
196718
+ // src/util/telemetry/commands/webhooks/create.ts
196719
+ var WebhooksCreateTelemetryClient;
196720
+ var init_create = __esm({
196721
+ "src/util/telemetry/commands/webhooks/create.ts"() {
196722
+ "use strict";
196723
+ init_telemetry();
196724
+ WebhooksCreateTelemetryClient = class extends TelemetryClient {
196725
+ trackCliArgumentUrl(url3) {
196726
+ if (url3) {
196727
+ this.trackCliArgument({
196728
+ arg: "url",
196729
+ value: this.redactedValue
196730
+ });
196731
+ }
196732
+ }
196733
+ trackCliOptionEvent(events) {
196734
+ if (events && events.length > 0) {
196735
+ this.trackCliOption({
196736
+ option: "event",
196737
+ value: String(events.length)
196738
+ });
196739
+ }
196740
+ }
196741
+ trackCliOptionProject(projects) {
196742
+ if (projects && projects.length > 0) {
196743
+ this.trackCliOption({
196744
+ option: "project",
196745
+ value: String(projects.length)
196746
+ });
196747
+ }
196748
+ }
196749
+ };
196750
+ }
196751
+ });
196752
+
196753
+ // src/util/webhooks/get-webhook-events.ts
196754
+ async function getWebhookEvents() {
196755
+ if (cachedEvents) {
196756
+ return cachedEvents;
196757
+ }
196758
+ const cache = new OpenApiCache();
196759
+ const loaded = await cache.load();
196760
+ if (!loaded) {
196761
+ output_manager_default.debug("Failed to load OpenAPI spec for webhook events");
196762
+ return [];
196763
+ }
196764
+ const endpoints = cache.getEndpoints();
196765
+ const createWebhookEndpoint = endpoints.find(
196766
+ (e2) => e2.path === "/v1/webhooks" && e2.method === "POST"
196767
+ );
196768
+ if (!createWebhookEndpoint) {
196769
+ output_manager_default.debug("Could not find POST /v1/webhooks endpoint in OpenAPI spec");
196770
+ return [];
196771
+ }
196772
+ const bodyFields = cache.getBodyFields(createWebhookEndpoint);
196773
+ const eventsField = bodyFields.find((f) => f.name === "events");
196774
+ if (!eventsField?.enumValues) {
196775
+ output_manager_default.debug("Could not find events enum in webhook endpoint");
196776
+ return [];
196777
+ }
196778
+ cachedEvents = eventsField.enumValues.filter(
196779
+ (v) => typeof v === "string"
196780
+ );
196781
+ return cachedEvents;
196782
+ }
196783
+ async function validateWebhookEvents(events) {
196784
+ const validEvents = await getWebhookEvents();
196785
+ if (validEvents.length === 0) {
196786
+ return [];
196787
+ }
196788
+ const validSet = new Set(validEvents);
196789
+ return events.filter((e2) => !validSet.has(e2));
196790
+ }
196791
+ var cachedEvents;
196792
+ var init_get_webhook_events = __esm({
196793
+ "src/util/webhooks/get-webhook-events.ts"() {
196794
+ "use strict";
196795
+ init_openapi();
196796
+ init_output_manager();
196797
+ cachedEvents = null;
196798
+ }
196799
+ });
196800
+
196801
+ // src/commands/webhooks/create.ts
196802
+ async function create(client2, argv) {
196803
+ const telemetry2 = new WebhooksCreateTelemetryClient({
196804
+ opts: {
196805
+ store: client2.telemetryEventStore
196806
+ }
196807
+ });
196808
+ let parsedArgs;
196809
+ const flagsSpecification = getFlagsSpecification(createSubcommand.options);
196810
+ try {
196811
+ parsedArgs = parseArguments(argv, flagsSpecification);
196812
+ } catch (error3) {
196813
+ printError(error3);
196814
+ return 1;
196815
+ }
196816
+ const { args: args2, flags: opts } = parsedArgs;
196817
+ const [url3] = args2;
196818
+ telemetry2.trackCliArgumentUrl(url3);
196819
+ if (!url3) {
196820
+ output_manager_default.error(
196821
+ `${getCommandName(`webhooks create <url>`)} expects one argument`
196822
+ );
196823
+ return 1;
196824
+ }
196825
+ try {
196826
+ const urlObj = new URL(url3);
196827
+ if (!["http:", "https:"].includes(urlObj.protocol)) {
196828
+ output_manager_default.error("Webhook URL must use http or https protocol");
196829
+ return 1;
196830
+ }
196831
+ } catch {
196832
+ output_manager_default.error(`Invalid URL: ${url3}`);
196833
+ return 1;
196834
+ }
196835
+ const events = opts["--event"];
196836
+ const projectIds = opts["--project"];
196837
+ if (!events || events.length === 0) {
196838
+ output_manager_default.error(
196839
+ `At least one event is required. Use ${import_chalk148.default.cyan("--event <event>")} to specify events.`
196840
+ );
196841
+ output_manager_default.log(
196842
+ `Example: ${getCommandName(
196843
+ "webhooks create https://example.com/webhook --event deployment.created"
196844
+ )}`
196845
+ );
196846
+ return 1;
196847
+ }
196848
+ const invalidEvents = await validateWebhookEvents(events);
196849
+ if (invalidEvents.length > 0) {
196850
+ output_manager_default.error(
196851
+ `Invalid event type${invalidEvents.length > 1 ? "s" : ""}: ${invalidEvents.join(", ")}`
196852
+ );
196853
+ return 1;
196854
+ }
196855
+ telemetry2.trackCliOptionEvent(events);
196856
+ telemetry2.trackCliOptionProject(projectIds);
196857
+ const { contextName } = await getScope(client2);
196858
+ const createStamp = stamp_default();
196859
+ output_manager_default.spinner(`Creating webhook under ${import_chalk148.default.bold(contextName)}`);
196860
+ try {
196861
+ const webhook = await createWebhook(client2, {
196862
+ url: url3,
196863
+ events,
196864
+ projectIds
196865
+ });
196866
+ output_manager_default.success(
196867
+ `Webhook created: ${import_chalk148.default.bold(webhook.id)} ${createStamp()}`
196868
+ );
196869
+ output_manager_default.print("\n");
196870
+ output_manager_default.print(import_chalk148.default.bold(" Webhook Details\n\n"));
196871
+ output_manager_default.print(` ${import_chalk148.default.cyan("ID")} ${webhook.id}
196872
+ `);
196873
+ output_manager_default.print(` ${import_chalk148.default.cyan("URL")} ${webhook.url}
196874
+ `);
196875
+ output_manager_default.print(
196876
+ ` ${import_chalk148.default.cyan("Events")} ${webhook.events.join(", ")}
196877
+ `
196878
+ );
196879
+ if (webhook.projectIds && webhook.projectIds.length > 0) {
196880
+ output_manager_default.print(
196881
+ ` ${import_chalk148.default.cyan("Projects")} ${webhook.projectIds.join(", ")}
196882
+ `
196883
+ );
196884
+ }
196885
+ output_manager_default.print("\n");
196886
+ output_manager_default.warn(
196887
+ `Save this secret - it will not be shown again: ${import_chalk148.default.bold(webhook.secret)}`
196888
+ );
196889
+ output_manager_default.print("\n");
196890
+ return 0;
196891
+ } catch (err) {
196892
+ if (isAPIError(err)) {
196893
+ if (err.code === "invalid_url") {
196894
+ output_manager_default.error(`Invalid webhook URL: ${url3}`);
196895
+ return 1;
196896
+ }
196897
+ if (err.code === "invalid_event") {
196898
+ output_manager_default.error(`Invalid event type. Please check the event names.`);
196899
+ return 1;
196900
+ }
196901
+ output_manager_default.error(err.message);
196902
+ return 1;
196903
+ }
196904
+ throw err;
196905
+ }
196906
+ }
196907
+ var import_chalk148;
196908
+ var init_create2 = __esm({
196909
+ "src/commands/webhooks/create.ts"() {
196910
+ "use strict";
196911
+ import_chalk148 = __toESM3(require_source(), 1);
196912
+ init_create_webhook();
196913
+ init_get_scope();
196914
+ init_stamp();
196915
+ init_pkg_name();
196916
+ init_output_manager();
196917
+ init_create();
196918
+ init_command44();
196919
+ init_get_args();
196920
+ init_get_flags_specification();
196921
+ init_error2();
196922
+ init_errors_ts();
196923
+ init_get_webhook_events();
196924
+ }
196925
+ });
196926
+
196927
+ // src/util/webhooks/delete-webhook.ts
196928
+ async function deleteWebhook(client2, webhookId) {
196929
+ await client2.fetch(`/v1/webhooks/${encodeURIComponent(webhookId)}`, {
196930
+ method: "DELETE"
196931
+ });
196932
+ }
196933
+ var init_delete_webhook = __esm({
196934
+ "src/util/webhooks/delete-webhook.ts"() {
196935
+ "use strict";
196936
+ }
196937
+ });
196938
+
196939
+ // src/util/telemetry/commands/webhooks/rm.ts
196940
+ var WebhooksRmTelemetryClient;
196941
+ var init_rm11 = __esm({
196942
+ "src/util/telemetry/commands/webhooks/rm.ts"() {
196943
+ "use strict";
196944
+ init_telemetry();
196945
+ WebhooksRmTelemetryClient = class extends TelemetryClient {
196946
+ trackCliArgumentId(id) {
196947
+ if (id) {
196948
+ this.trackCliArgument({
196949
+ arg: "id",
196950
+ value: this.redactedValue
196951
+ });
196952
+ }
196953
+ }
196954
+ trackCliFlagYes(yes) {
196955
+ if (yes) {
196956
+ this.trackCliFlag("yes");
196957
+ }
196958
+ }
196959
+ };
196960
+ }
196961
+ });
196962
+
196963
+ // src/commands/webhooks/rm.ts
196964
+ async function rm7(client2, argv) {
196965
+ const telemetry2 = new WebhooksRmTelemetryClient({
196966
+ opts: {
196967
+ store: client2.telemetryEventStore
196968
+ }
196969
+ });
196970
+ let parsedArgs;
196971
+ const flagsSpecification = getFlagsSpecification(removeSubcommand10.options);
196972
+ try {
196973
+ parsedArgs = parseArguments(argv, flagsSpecification);
196974
+ } catch (error3) {
196975
+ printError(error3);
196976
+ return 1;
196977
+ }
196978
+ const { args: args2, flags: opts } = parsedArgs;
196979
+ const [webhookId] = args2;
196980
+ telemetry2.trackCliArgumentId(webhookId);
196981
+ telemetry2.trackCliFlagYes(opts["--yes"]);
196982
+ if (!webhookId) {
196983
+ output_manager_default.error(`${getCommandName(`webhooks rm <id>`)} expects one argument`);
196984
+ return 1;
196985
+ }
196986
+ const { contextName } = await getScope(client2);
196987
+ if (args2.length !== 1) {
196988
+ output_manager_default.error(
196989
+ `Invalid number of arguments. Usage: ${import_chalk149.default.cyan(
196990
+ `${getCommandName("webhooks rm <id>")}`
196991
+ )}`
196992
+ );
196993
+ return 1;
196994
+ }
196995
+ output_manager_default.spinner(`Fetching webhook ${webhookId}`);
196996
+ let webhook;
196997
+ try {
196998
+ webhook = await getWebhook(client2, webhookId);
196999
+ } catch (err) {
197000
+ if (isAPIError(err) && err.status === 404) {
197001
+ output_manager_default.error(`Webhook not found: ${webhookId}`);
197002
+ output_manager_default.log(`Run ${getCommandName(`webhooks ls`)} to see your webhooks.`);
197003
+ return 1;
197004
+ }
197005
+ throw err;
197006
+ }
197007
+ output_manager_default.stopSpinner();
197008
+ const skipConfirmation = opts["--yes"] || false;
197009
+ if (!skipConfirmation && !await client2.input.confirm(
197010
+ `Are you sure you want to remove webhook ${param(webhookId)} (${webhook.url})?`,
197011
+ false
197012
+ )) {
197013
+ output_manager_default.log("Canceled");
197014
+ return 0;
197015
+ }
197016
+ const removeStamp = stamp_default();
197017
+ output_manager_default.spinner(`Removing webhook under ${import_chalk149.default.bold(contextName)}`);
197018
+ try {
197019
+ await deleteWebhook(client2, webhookId);
197020
+ output_manager_default.success(`Webhook ${import_chalk149.default.bold(webhookId)} removed ${removeStamp()}`);
197021
+ return 0;
197022
+ } catch (err) {
197023
+ if (isAPIError(err) && err.status === 404) {
197024
+ output_manager_default.error(`Webhook not found: ${webhookId}`);
197025
+ return 1;
197026
+ }
197027
+ throw err;
197028
+ }
197029
+ }
197030
+ var import_chalk149;
197031
+ var init_rm12 = __esm({
197032
+ "src/commands/webhooks/rm.ts"() {
197033
+ "use strict";
197034
+ import_chalk149 = __toESM3(require_source(), 1);
197035
+ init_delete_webhook();
197036
+ init_get_webhook();
197037
+ init_get_scope();
197038
+ init_stamp();
197039
+ init_param();
197040
+ init_pkg_name();
197041
+ init_output_manager();
197042
+ init_rm11();
197043
+ init_command44();
197044
+ init_get_args();
197045
+ init_get_flags_specification();
197046
+ init_error2();
197047
+ init_errors_ts();
197048
+ }
197049
+ });
197050
+
197051
+ // src/util/telemetry/commands/webhooks/index.ts
197052
+ var WebhooksTelemetryClient;
197053
+ var init_webhooks = __esm({
197054
+ "src/util/telemetry/commands/webhooks/index.ts"() {
197055
+ "use strict";
197056
+ init_telemetry();
197057
+ WebhooksTelemetryClient = class extends TelemetryClient {
197058
+ trackCliSubcommandCreate(actual) {
197059
+ this.trackCliSubcommand({
197060
+ subcommand: "create",
197061
+ value: actual
197062
+ });
197063
+ }
197064
+ trackCliSubcommandGet(actual) {
197065
+ this.trackCliSubcommand({
197066
+ subcommand: "get",
197067
+ value: actual
197068
+ });
197069
+ }
197070
+ trackCliSubcommandRemove(actual) {
197071
+ this.trackCliSubcommand({
197072
+ subcommand: "remove",
197073
+ value: actual
197074
+ });
197075
+ }
197076
+ trackCliSubcommandList(actual) {
197077
+ this.trackCliSubcommand({
197078
+ subcommand: "list",
197079
+ value: actual
197080
+ });
197081
+ }
197082
+ };
197083
+ }
197084
+ });
197085
+
197086
+ // src/commands/webhooks/index.ts
197087
+ var webhooks_exports = {};
197088
+ __export3(webhooks_exports, {
197089
+ default: () => main18
197090
+ });
197091
+ async function main18(client2) {
197092
+ let parsedArgs;
197093
+ const flagsSpecification = getFlagsSpecification(webhooksCommand.options);
197094
+ try {
197095
+ parsedArgs = parseArguments(client2.argv.slice(2), flagsSpecification, {
197096
+ permissive: true
197097
+ });
197098
+ } catch (error3) {
197099
+ printError(error3);
197100
+ return 1;
197101
+ }
197102
+ const telemetry2 = new WebhooksTelemetryClient({
197103
+ opts: {
197104
+ store: client2.telemetryEventStore
197105
+ }
197106
+ });
197107
+ const { subcommand, args: args2, subcommandOriginal } = getSubcommand2(
197108
+ parsedArgs.args.slice(1),
197109
+ COMMAND_CONFIG22
197110
+ );
197111
+ const needHelp = parsedArgs.flags["--help"];
197112
+ if (!subcommand && needHelp) {
197113
+ telemetry2.trackCliFlagHelp("webhooks");
197114
+ output_manager_default.print(help(webhooksCommand, { columns: client2.stderr.columns }));
197115
+ return 2;
197116
+ }
197117
+ function printHelp(command) {
197118
+ output_manager_default.print(
197119
+ help(command, { parent: webhooksCommand, columns: client2.stderr.columns })
197120
+ );
197121
+ return 2;
197122
+ }
197123
+ switch (subcommand) {
197124
+ case "create":
197125
+ if (needHelp) {
197126
+ telemetry2.trackCliFlagHelp("webhooks", subcommandOriginal);
197127
+ return printHelp(createSubcommand);
197128
+ }
197129
+ telemetry2.trackCliSubcommandCreate(subcommandOriginal);
197130
+ return create(client2, args2);
197131
+ case "get":
197132
+ if (needHelp) {
197133
+ telemetry2.trackCliFlagHelp("webhooks", subcommandOriginal);
197134
+ return printHelp(getSubcommand);
197135
+ }
197136
+ telemetry2.trackCliSubcommandGet(subcommandOriginal);
197137
+ return get(client2, args2);
197138
+ case "rm":
197139
+ if (needHelp) {
197140
+ telemetry2.trackCliFlagHelp("webhooks", subcommandOriginal);
197141
+ return printHelp(removeSubcommand10);
197142
+ }
197143
+ telemetry2.trackCliSubcommandRemove(subcommandOriginal);
197144
+ return rm7(client2, args2);
197145
+ default:
197146
+ if (needHelp) {
197147
+ telemetry2.trackCliFlagHelp("webhooks", subcommandOriginal);
197148
+ return printHelp(listSubcommand13);
197149
+ }
197150
+ telemetry2.trackCliSubcommandList(subcommandOriginal);
197151
+ return ls6(client2, args2);
197152
+ }
197153
+ }
197154
+ var COMMAND_CONFIG22;
197155
+ var init_webhooks2 = __esm({
197156
+ "src/commands/webhooks/index.ts"() {
197157
+ "use strict";
197158
+ init_get_args();
197159
+ init_get_subcommand();
197160
+ init_error2();
197161
+ init_ls11();
197162
+ init_get2();
197163
+ init_create2();
197164
+ init_rm12();
197165
+ init_command44();
197166
+ init_help();
197167
+ init_get_flags_specification();
197168
+ init_webhooks();
197169
+ init_output_manager();
197170
+ COMMAND_CONFIG22 = {
197171
+ create: ["create", "add"],
197172
+ get: ["get", "inspect"],
197173
+ ls: ["ls", "list"],
197174
+ rm: ["rm", "remove", "delete"]
197175
+ };
197176
+ }
197177
+ });
197178
+
195935
197179
  // src/util/telemetry/commands/whoami/index.ts
195936
197180
  var WhoamiTelemetryClient;
195937
197181
  var init_whoami = __esm({
@@ -196009,7 +197253,7 @@ var init_whoami2 = __esm({
196009
197253
  // src/index.ts
196010
197254
  var import_error_utils38 = __toESM3(require_dist2(), 1);
196011
197255
  var import_fs_extra24 = __toESM3(require_lib(), 1);
196012
- var import_chalk146 = __toESM3(require_source(), 1);
197256
+ var import_chalk150 = __toESM3(require_source(), 1);
196013
197257
  var import_epipebomb = __toESM3(require_epipebomb(), 1);
196014
197258
  import { join as join25 } from "path";
196015
197259
  import { existsSync as existsSync5 } from "fs";
@@ -196718,6 +197962,12 @@ var RootTelemetryClient = class extends TelemetryClient {
196718
197962
  value: actual
196719
197963
  });
196720
197964
  }
197965
+ trackCliCommandWebhooks(actual) {
197966
+ this.trackCliCommand({
197967
+ command: "webhooks",
197968
+ value: actual
197969
+ });
197970
+ }
196721
197971
  trackCPUs() {
196722
197972
  super.trackCPUs();
196723
197973
  }
@@ -196854,6 +198104,7 @@ var help2 = () => `
196854
198104
  upgrade Upgrade the Vercel CLI to the latest version
196855
198105
  whoami Shows the username of the currently logged in user
196856
198106
  blob [cmd] Manages your Blob stores and files
198107
+ webhooks [cmd] Manages webhooks [beta]
196857
198108
 
196858
198109
  ${import_chalk29.default.dim("Global Options:")}
196859
198110
 
@@ -197012,7 +198263,7 @@ process.on("unhandledRejection", handleRejection);
197012
198263
  process.on("uncaughtException", handleUnexpected);
197013
198264
  var { isTTY: isTTY2 } = process.stdout;
197014
198265
  var apiUrl = "https://api.vercel.com";
197015
- var main18 = async () => {
198266
+ var main19 = async () => {
197016
198267
  if (process.env.FORCE_TTY === "1") {
197017
198268
  isTTY2 = true;
197018
198269
  process.stdout.isTTY = true;
@@ -197060,16 +198311,16 @@ var main18 = async () => {
197060
198311
  }
197061
198312
  const targetOrSubcommand = parsedArgs.args[2];
197062
198313
  const subSubCommand = parsedArgs.args[3];
197063
- const betaCommands = ["api", "curl"];
198314
+ const betaCommands = ["api", "curl", "webhooks"];
197064
198315
  if (betaCommands.includes(targetOrSubcommand)) {
197065
198316
  output_manager_default.print(
197066
- `${import_chalk146.default.grey(
197067
- `${getTitleName()} CLI ${pkg_default.version} | ${import_chalk146.default.bold(targetOrSubcommand)} is in beta \u2014 https://vercel.com/feedback`
198317
+ `${import_chalk150.default.grey(
198318
+ `${getTitleName()} CLI ${pkg_default.version} | ${import_chalk150.default.bold(targetOrSubcommand)} is in beta \u2014 https://vercel.com/feedback`
197068
198319
  )}
197069
198320
  `
197070
198321
  );
197071
198322
  } else {
197072
- output_manager_default.print(`${import_chalk146.default.grey(`${getTitleName()} CLI ${pkg_default.version}`)}
198323
+ output_manager_default.print(`${import_chalk150.default.grey(`${getTitleName()} CLI ${pkg_default.version}`)}
197073
198324
  `);
197074
198325
  }
197075
198326
  if (!targetOrSubcommand && parsedArgs.flags["--version"]) {
@@ -197573,6 +198824,10 @@ var main18 = async () => {
197573
198824
  telemetry2.trackCliCommandUpgrade(userSuppliedSubCommand);
197574
198825
  func = (init_upgrade3(), __toCommonJS3(upgrade_exports)).default;
197575
198826
  break;
198827
+ case "webhooks":
198828
+ telemetry2.trackCliCommandWebhooks(userSuppliedSubCommand);
198829
+ func = (init_webhooks2(), __toCommonJS3(webhooks_exports)).default;
198830
+ break;
197576
198831
  case "whoami":
197577
198832
  telemetry2.trackCliCommandWhoami(userSuppliedSubCommand);
197578
198833
  func = (init_whoami2(), __toCommonJS3(whoami_exports)).default;
@@ -197647,24 +198902,25 @@ var main18 = async () => {
197647
198902
  await telemetryEventStore.save();
197648
198903
  return exitCode2;
197649
198904
  };
197650
- main18().then(async (exitCode2) => {
197651
- if (!process.env.NO_UPDATE_NOTIFIER) {
198905
+ main19().then(async (exitCode2) => {
198906
+ const shouldCheckForUpdates = !process.env.NO_UPDATE_NOTIFIER && !process.env.VERCEL;
198907
+ if (shouldCheckForUpdates) {
197652
198908
  const latest = getLatestVersion({
197653
198909
  pkg: pkg_default
197654
198910
  });
197655
198911
  if (latest) {
197656
- const changelog = "https://github.com/vercel/vercel/releases";
198912
+ const changelog = `https://github.com/vercel/vercel/releases/tag/vercel%40${latest}`;
197657
198913
  if (isTTY2) {
197658
- const errorMsg = exitCode2 && exitCode2 !== 2 ? import_chalk146.default.magenta(
197659
- ` The latest update ${import_chalk146.default.italic(
198914
+ const errorMsg = exitCode2 && exitCode2 !== 2 ? import_chalk150.default.magenta(
198915
+ ` The latest update ${import_chalk150.default.italic(
197660
198916
  "may"
197661
198917
  )} fix any errors that occurred.`
197662
198918
  ) : "";
197663
198919
  output_manager_default.print(
197664
198920
  `
197665
- Update available for Vercel CLI (${import_chalk146.default.gray(
198921
+ Update available for Vercel CLI (${import_chalk150.default.gray(
197666
198922
  `v${pkg_default.version}`
197667
- )} \u2192 ${import_chalk146.default.green(`v${latest}`)})${errorMsg}
198923
+ )} \u2192 ${import_chalk150.default.green(`v${latest}`)})${errorMsg}
197668
198924
  `
197669
198925
  );
197670
198926
  const action = await client.input.expand({
@@ -197684,20 +198940,20 @@ Update available for Vercel CLI (${import_chalk146.default.gray(
197684
198940
  await (0, import_open9.default)(changelog);
197685
198941
  }
197686
198942
  } else {
197687
- const errorMsg = exitCode2 && exitCode2 !== 2 ? import_chalk146.default.magenta(
198943
+ const errorMsg = exitCode2 && exitCode2 !== 2 ? import_chalk150.default.magenta(
197688
198944
  `
197689
198945
 
197690
- The latest update ${import_chalk146.default.italic(
198946
+ The latest update ${import_chalk150.default.italic(
197691
198947
  "may"
197692
198948
  )} fix any errors that occurred.`
197693
198949
  ) : "";
197694
198950
  output_manager_default.print(
197695
198951
  box(
197696
- `Update available! ${import_chalk146.default.gray(`v${pkg_default.version}`)} \u226B ${import_chalk146.default.green(
198952
+ `Update available! ${import_chalk150.default.gray(`v${pkg_default.version}`)} \u226B ${import_chalk150.default.green(
197697
198953
  `v${latest}`
197698
198954
  )}
197699
198955
  Changelog: ${output_manager_default.link(changelog, changelog, { fallback: false })}
197700
- Run ${import_chalk146.default.cyan(cmd(await getUpdateCommand()))} to update.${errorMsg}`
198956
+ Run ${import_chalk150.default.cyan(cmd(await getUpdateCommand()))} to update.${errorMsg}`
197701
198957
  )
197702
198958
  );
197703
198959
  output_manager_default.print("\n");