vercel 50.9.6 → 50.10.1

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 +1679 -428
  2. package/package.json +19 -19
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 });
@@ -51616,7 +51733,7 @@ var require_package = __commonJS2({
51616
51733
  "../client/package.json"(exports2, module2) {
51617
51734
  module2.exports = {
51618
51735
  name: "@vercel/client",
51619
- version: "17.2.31",
51736
+ version: "17.2.32",
51620
51737
  main: "dist/index.js",
51621
51738
  typings: "dist/index.d.ts",
51622
51739
  homepage: "https://vercel.com",
@@ -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);
@@ -86054,7 +86171,9 @@ var require_detect_builders = __commonJS2({
86054
86171
  const f = slugToFramework.get(framework || "");
86055
86172
  if (f && f.useRuntime) {
86056
86173
  const { src, use } = f.useRuntime;
86057
- return { src, use: `${use}${withTag}`, config: config2 };
86174
+ const shouldUseUnifiedBackend = (0, import_build_utils20.isExperimentalBackendsEnabled)() && import_build_utils20.BACKEND_BUILDERS.includes(use);
86175
+ const finalUse = shouldUseUnifiedBackend ? import_build_utils20.UNIFIED_BACKEND_BUILDER : use;
86176
+ return { src, use: `${finalUse}${withTag}`, config: config2 };
86058
86177
  }
86059
86178
  const entrypoints = /* @__PURE__ */ new Set([
86060
86179
  "package.json",
@@ -86500,7 +86619,7 @@ var require_detect_file_system_api = __commonJS2({
86500
86619
  });
86501
86620
  module2.exports = __toCommonJS4(detect_file_system_api_exports);
86502
86621
  var import_semver4 = __toESM4(require_semver2());
86503
- var import__109 = require_dist8();
86622
+ var import__114 = require_dist8();
86504
86623
  async function detectFileSystemAPI2({
86505
86624
  files,
86506
86625
  projectSettings,
@@ -86566,7 +86685,7 @@ var require_detect_file_system_api = __commonJS2({
86566
86685
  };
86567
86686
  }
86568
86687
  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);
86688
+ 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
86689
  return !valid;
86571
86690
  });
86572
86691
  if (invalidBuilder) {
@@ -86579,7 +86698,7 @@ var require_detect_file_system_api = __commonJS2({
86579
86698
  for (const lang of ["go", "python", "ruby"]) {
86580
86699
  for (const { use } of builders) {
86581
86700
  const plugin = "vercel-plugin-" + lang;
86582
- if ((0, import__109.isOfficialRuntime)(lang, use) && !deps[plugin]) {
86701
+ if ((0, import__114.isOfficialRuntime)(lang, use) && !deps[plugin]) {
86583
86702
  return {
86584
86703
  metadata,
86585
86704
  fsApiBuilder: null,
@@ -86636,7 +86755,7 @@ var require_detect_file_system_api = __commonJS2({
86636
86755
  }
86637
86756
  }
86638
86757
  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)
86758
+ ({ use }) => (0, import__114.isOfficialRuntime)("next", use) || (0, import__114.isOfficialRuntime)("static", use) || (0, import__114.isOfficialRuntime)("static-build", use)
86640
86759
  );
86641
86760
  const config2 = frontendBuilder?.config || {};
86642
86761
  const withTag = tag ? `@${tag}` : "";
@@ -86696,11 +86815,11 @@ var require_detect_framework = __commonJS2({
86696
86815
  const isEnabled = (val) => val === "1" || typeof val === "string" && val.toLowerCase() === "true";
86697
86816
  return isEnabled(experimentalEnv);
86698
86817
  }
86699
- function filterFrameworkList(frameworkList9, useExperimentalFrameworks) {
86818
+ function filterFrameworkList(frameworkList10, useExperimentalFrameworks) {
86700
86819
  if (shouldIncludeExperimentalFrameworks(useExperimentalFrameworks)) {
86701
- return frameworkList9;
86820
+ return frameworkList10;
86702
86821
  }
86703
- return frameworkList9.filter((f) => {
86822
+ return frameworkList10.filter((f) => {
86704
86823
  const experimental = f.experimental;
86705
86824
  return !experimental;
86706
86825
  });
@@ -86817,11 +86936,11 @@ var require_detect_framework = __commonJS2({
86817
86936
  }
86818
86937
  async function detectFramework2({
86819
86938
  fs: fs15,
86820
- frameworkList: frameworkList9,
86939
+ frameworkList: frameworkList10,
86821
86940
  useExperimentalFrameworks
86822
86941
  }) {
86823
86942
  const filteredList = filterFrameworkList(
86824
- frameworkList9,
86943
+ frameworkList10,
86825
86944
  useExperimentalFrameworks
86826
86945
  );
86827
86946
  const result = await Promise.all(
@@ -86837,11 +86956,11 @@ var require_detect_framework = __commonJS2({
86837
86956
  }
86838
86957
  async function detectFrameworks3({
86839
86958
  fs: fs15,
86840
- frameworkList: frameworkList9,
86959
+ frameworkList: frameworkList10,
86841
86960
  useExperimentalFrameworks
86842
86961
  }) {
86843
86962
  const filteredList = filterFrameworkList(
86844
- frameworkList9,
86963
+ frameworkList10,
86845
86964
  useExperimentalFrameworks
86846
86965
  );
86847
86966
  const result = await Promise.all(
@@ -86857,11 +86976,11 @@ var require_detect_framework = __commonJS2({
86857
86976
  }
86858
86977
  async function detectFrameworkRecord3({
86859
86978
  fs: fs15,
86860
- frameworkList: frameworkList9,
86979
+ frameworkList: frameworkList10,
86861
86980
  useExperimentalFrameworks
86862
86981
  }) {
86863
86982
  const filteredList = filterFrameworkList(
86864
- frameworkList9,
86983
+ frameworkList10,
86865
86984
  useExperimentalFrameworks
86866
86985
  );
86867
86986
  const result = await Promise.all(
@@ -86946,7 +87065,7 @@ var require_get_project_paths = __commonJS2({
86946
87065
  });
86947
87066
  module2.exports = __toCommonJS4(get_project_paths_exports);
86948
87067
  var import_detect_framework = require_detect_framework();
86949
- var import_frameworks9 = __toESM4(require_frameworks());
87068
+ var import_frameworks10 = __toESM4(require_frameworks());
86950
87069
  var MAX_DEPTH_TRAVERSE = 3;
86951
87070
  var getProjectPaths2 = async ({
86952
87071
  fs: fs15,
@@ -86963,7 +87082,7 @@ var require_get_project_paths = __commonJS2({
86963
87082
  }
86964
87083
  const framework = await (0, import_detect_framework.detectFramework)({
86965
87084
  fs: fs15.chdir(topPath),
86966
- frameworkList: import_frameworks9.default
87085
+ frameworkList: import_frameworks10.default
86967
87086
  });
86968
87087
  if (framework !== null)
86969
87088
  allPaths.push(topPath);
@@ -93330,8 +93449,8 @@ var require_dist8 = __commonJS2({
93330
93449
  detectFrameworks: () => import_detect_framework.detectFrameworks,
93331
93450
  detectInstrumentation: () => import_detect_instrumentation.detectInstrumentation,
93332
93451
  detectOutputDirectory: () => import_detect_builders.detectOutputDirectory,
93333
- detectServices: () => import_detect_services.detectServices,
93334
- generateServicesRoutes: () => import_detect_services.generateServicesRoutes,
93452
+ detectServices: () => import_detect_services2.detectServices,
93453
+ generateServicesRoutes: () => import_detect_services2.generateServicesRoutes,
93335
93454
  getProjectPaths: () => import_get_project_paths.getProjectPaths,
93336
93455
  getServicesBuilders: () => import_get_services_builders.getServicesBuilders,
93337
93456
  getWorkspacePackagePaths: () => import_get_workspace_package_paths.getWorkspacePackagePaths,
@@ -93344,7 +93463,7 @@ var require_dist8 = __commonJS2({
93344
93463
  });
93345
93464
  module2.exports = __toCommonJS4(src_exports2);
93346
93465
  var import_detect_builders = require_detect_builders();
93347
- var import_detect_services = require_detect_services();
93466
+ var import_detect_services2 = require_detect_services();
93348
93467
  var import_get_services_builders = require_get_services_builders();
93349
93468
  var import_detect_file_system_api = require_detect_file_system_api();
93350
93469
  var import_detect_framework = require_detect_framework();
@@ -95428,9 +95547,9 @@ var init_promise = __esm({
95428
95547
  });
95429
95548
 
95430
95549
  // src/util/sleep.ts
95431
- function sleep(ms34) {
95550
+ function sleep(ms35) {
95432
95551
  return new Promise((resolve14) => {
95433
- setTimeout(resolve14, ms34);
95552
+ setTimeout(resolve14, ms35);
95434
95553
  });
95435
95554
  }
95436
95555
  var init_sleep = __esm({
@@ -96009,16 +96128,16 @@ var require_lru_cache = __commonJS2({
96009
96128
  const code2 = `LRU_CACHE_METHOD_${method}`;
96010
96129
  if (shouldWarn(code2)) {
96011
96130
  const { prototype } = LRUCache;
96012
- const { get } = Object.getOwnPropertyDescriptor(prototype, method);
96013
- warn(code2, `${method} method`, `cache.${instead}()`, get);
96131
+ const { get: get2 } = Object.getOwnPropertyDescriptor(prototype, method);
96132
+ warn(code2, `${method} method`, `cache.${instead}()`, get2);
96014
96133
  }
96015
96134
  };
96016
96135
  var deprecatedProperty = (field, instead) => {
96017
96136
  const code2 = `LRU_CACHE_PROPERTY_${field}`;
96018
96137
  if (shouldWarn(code2)) {
96019
96138
  const { prototype } = LRUCache;
96020
- const { get } = Object.getOwnPropertyDescriptor(prototype, field);
96021
- warn(code2, `${field} property`, `cache.${instead}`, get);
96139
+ const { get: get2 } = Object.getOwnPropertyDescriptor(prototype, field);
96140
+ warn(code2, `${field} property`, `cache.${instead}`, get2);
96022
96141
  }
96023
96142
  };
96024
96143
  var emitWarning = (...a) => {
@@ -97284,41 +97403,41 @@ var require_ms2 = __commonJS2({
97284
97403
  return void 0;
97285
97404
  }
97286
97405
  }
97287
- function fmtShort(ms34) {
97288
- var msAbs = Math.abs(ms34);
97406
+ function fmtShort(ms35) {
97407
+ var msAbs = Math.abs(ms35);
97289
97408
  if (msAbs >= d) {
97290
- return Math.round(ms34 / d) + "d";
97409
+ return Math.round(ms35 / d) + "d";
97291
97410
  }
97292
97411
  if (msAbs >= h) {
97293
- return Math.round(ms34 / h) + "h";
97412
+ return Math.round(ms35 / h) + "h";
97294
97413
  }
97295
97414
  if (msAbs >= m) {
97296
- return Math.round(ms34 / m) + "m";
97415
+ return Math.round(ms35 / m) + "m";
97297
97416
  }
97298
97417
  if (msAbs >= s) {
97299
- return Math.round(ms34 / s) + "s";
97418
+ return Math.round(ms35 / s) + "s";
97300
97419
  }
97301
- return ms34 + "ms";
97420
+ return ms35 + "ms";
97302
97421
  }
97303
- function fmtLong(ms34) {
97304
- var msAbs = Math.abs(ms34);
97422
+ function fmtLong(ms35) {
97423
+ var msAbs = Math.abs(ms35);
97305
97424
  if (msAbs >= d) {
97306
- return plural15(ms34, msAbs, d, "day");
97425
+ return plural16(ms35, msAbs, d, "day");
97307
97426
  }
97308
97427
  if (msAbs >= h) {
97309
- return plural15(ms34, msAbs, h, "hour");
97428
+ return plural16(ms35, msAbs, h, "hour");
97310
97429
  }
97311
97430
  if (msAbs >= m) {
97312
- return plural15(ms34, msAbs, m, "minute");
97431
+ return plural16(ms35, msAbs, m, "minute");
97313
97432
  }
97314
97433
  if (msAbs >= s) {
97315
- return plural15(ms34, msAbs, s, "second");
97434
+ return plural16(ms35, msAbs, s, "second");
97316
97435
  }
97317
- return ms34 + " ms";
97436
+ return ms35 + " ms";
97318
97437
  }
97319
- function plural15(ms34, msAbs, n, name) {
97438
+ function plural16(ms35, msAbs, n, name) {
97320
97439
  var isPlural = msAbs >= n * 1.5;
97321
- return Math.round(ms34 / n) + " " + name + (isPlural ? "s" : "");
97440
+ return Math.round(ms35 / n) + " " + name + (isPlural ? "s" : "");
97322
97441
  }
97323
97442
  }
97324
97443
  });
@@ -97361,8 +97480,8 @@ var require_common8 = __commonJS2({
97361
97480
  }
97362
97481
  const self2 = debug2;
97363
97482
  const curr = Number(/* @__PURE__ */ new Date());
97364
- const ms34 = curr - (prevTime || curr);
97365
- self2.diff = ms34;
97483
+ const ms35 = curr - (prevTime || curr);
97484
+ self2.diff = ms35;
97366
97485
  self2.prev = prevTime;
97367
97486
  self2.curr = curr;
97368
97487
  prevTime = curr;
@@ -97963,8 +98082,8 @@ var require_common9 = __commonJS2({
97963
98082
  }
97964
98083
  const self2 = debug2;
97965
98084
  const curr = Number(/* @__PURE__ */ new Date());
97966
- const ms34 = curr - (prevTime || curr);
97967
- self2.diff = ms34;
98085
+ const ms35 = curr - (prevTime || curr);
98086
+ self2.diff = ms35;
97968
98087
  self2.prev = prevTime;
97969
98088
  self2.curr = curr;
97970
98089
  prevTime = curr;
@@ -113271,7 +113390,7 @@ var require_types5 = __commonJS2({
113271
113390
  return d.supertypeList.slice(1);
113272
113391
  }
113273
113392
  function computeSupertypeLookupTable(candidates) {
113274
- var table2 = {};
113393
+ var table3 = {};
113275
113394
  var typeNames = Object.keys(defCache);
113276
113395
  var typeNameCount = typeNames.length;
113277
113396
  for (var i = 0; i < typeNameCount; ++i) {
@@ -113283,12 +113402,12 @@ var require_types5 = __commonJS2({
113283
113402
  for (var j = 0; j < d.supertypeList.length; ++j) {
113284
113403
  var superTypeName = d.supertypeList[j];
113285
113404
  if (hasOwn.call(candidates, superTypeName)) {
113286
- table2[typeName] = superTypeName;
113405
+ table3[typeName] = superTypeName;
113287
113406
  break;
113288
113407
  }
113289
113408
  }
113290
113409
  }
113291
- return table2;
113410
+ return table3;
113292
113411
  }
113293
113412
  var builders = /* @__PURE__ */ Object.create(null);
113294
113413
  var nodePrototype = {};
@@ -113479,7 +113598,7 @@ var require_path4 = __commonJS2({
113479
113598
  Pp.getValueProperty = function getValueProperty(name) {
113480
113599
  return this.value[name];
113481
113600
  };
113482
- Pp.get = function get() {
113601
+ Pp.get = function get2() {
113483
113602
  var names = [];
113484
113603
  for (var _i = 0; _i < arguments.length; _i++) {
113485
113604
  names[_i] = arguments[_i];
@@ -117656,9 +117775,9 @@ var require_context2 = __commonJS2({
117656
117775
  const configurable = Boolean(descriptor2.configurable);
117657
117776
  const enumerable = Boolean(descriptor2.enumerable);
117658
117777
  const hasValue = Boolean(descriptor2.value);
117659
- const get = descriptor2.get ? scope.manage(this.newFunction(descriptor2.get.name, descriptor2.get)) : this.undefined;
117778
+ const get2 = descriptor2.get ? scope.manage(this.newFunction(descriptor2.get.name, descriptor2.get)) : this.undefined;
117660
117779
  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);
117780
+ this.ffi.QTS_DefineProp(this.ctx.value, handle.value, quickJSKey.value, value.value, get2.value, set2.value, configurable, enumerable, hasValue);
117662
117781
  });
117663
117782
  }
117664
117783
  // Evaluation ---------------------------------------------------------------
@@ -121475,7 +121594,7 @@ var require_jsbn = __commonJS2({
121475
121594
  }
121476
121595
  if (r == null)
121477
121596
  r = nbi();
121478
- var y = nbi(), ts = this.s, ms34 = m.s;
121597
+ var y = nbi(), ts = this.s, ms35 = m.s;
121479
121598
  var nsh = this.DB - nbits(pm[pm.t - 1]);
121480
121599
  if (nsh > 0) {
121481
121600
  pm.lShiftTo(nsh, y);
@@ -121511,7 +121630,7 @@ var require_jsbn = __commonJS2({
121511
121630
  }
121512
121631
  if (q != null) {
121513
121632
  r.drShiftTo(ys, q);
121514
- if (ts != ms34)
121633
+ if (ts != ms35)
121515
121634
  BigInteger.ZERO.subTo(q, q);
121516
121635
  }
121517
121636
  r.t = ys;
@@ -129522,7 +129641,7 @@ var require_ci_info = __commonJS2({
129522
129641
  });
129523
129642
 
129524
129643
  // src/util/get-subcommand.ts
129525
- function getSubcommand(cliArgs, config2) {
129644
+ function getSubcommand2(cliArgs, config2) {
129526
129645
  const [subcommand, ...rest] = cliArgs;
129527
129646
  for (const k of Object.keys(config2)) {
129528
129647
  if (k !== "default" && config2[k].indexOf(subcommand) !== -1) {
@@ -131830,7 +131949,7 @@ async function alias(client2) {
131830
131949
  printError(err);
131831
131950
  return 1;
131832
131951
  }
131833
- const { subcommand, args: args2, subcommandOriginal } = getSubcommand(
131952
+ const { subcommand, args: args2, subcommandOriginal } = getSubcommand2(
131834
131953
  parsedArguments.args.slice(1),
131835
131954
  COMMAND_CONFIG
131836
131955
  );
@@ -132116,6 +132235,11 @@ async function parseField(field, typed) {
132116
132235
  value = parseInt(value, 10);
132117
132236
  } else if (/^-?\d*\.\d+$/.test(value)) {
132118
132237
  value = parseFloat(value);
132238
+ } else if (value.startsWith("[") || value.startsWith("{")) {
132239
+ try {
132240
+ value = JSON.parse(value);
132241
+ } catch {
132242
+ }
132119
132243
  }
132120
132244
  }
132121
132245
  return { key, value };
@@ -132163,24 +132287,24 @@ var init_request_builder = __esm({
132163
132287
  }
132164
132288
  });
132165
132289
 
132166
- // src/commands/api/constants.ts
132167
- var API_BASE_URL, OPENAPI_URL, CACHE_FILE, CACHE_TTL_MS;
132290
+ // src/util/openapi/constants.ts
132291
+ var OPENAPI_URL, CACHE_FILE, CACHE_TTL_MS, FETCH_TIMEOUT_MS;
132168
132292
  var init_constants2 = __esm({
132169
- "src/commands/api/constants.ts"() {
132293
+ "src/util/openapi/constants.ts"() {
132170
132294
  "use strict";
132171
- API_BASE_URL = "https://api.vercel.com";
132172
132295
  OPENAPI_URL = "https://openapi.vercel.sh/";
132173
132296
  CACHE_FILE = "openapi-spec.json";
132174
132297
  CACHE_TTL_MS = 24 * 60 * 60 * 1e3;
132298
+ FETCH_TIMEOUT_MS = 10 * 1e3;
132175
132299
  }
132176
132300
  });
132177
132301
 
132178
- // src/commands/api/openapi-cache.ts
132302
+ // src/util/openapi/openapi-cache.ts
132179
132303
  import { join as join9 } from "path";
132180
132304
  import { readFile as readFile6, writeFile as writeFile4, mkdir as mkdir2 } from "fs/promises";
132181
132305
  var OpenApiCache;
132182
132306
  var init_openapi_cache = __esm({
132183
- "src/commands/api/openapi-cache.ts"() {
132307
+ "src/util/openapi/openapi-cache.ts"() {
132184
132308
  "use strict";
132185
132309
  init_global_path();
132186
132310
  init_output_manager();
@@ -132264,12 +132388,20 @@ var init_openapi_cache = __esm({
132264
132388
  const fields = [];
132265
132389
  for (const [name, propSchema] of Object.entries(schema.properties)) {
132266
132390
  const resolvedProp = this.resolveSchemaRef(propSchema);
132391
+ let enumValues = resolvedProp?.enum || propSchema.enum;
132392
+ if (!enumValues && (resolvedProp?.type === "array" || propSchema.type === "array")) {
132393
+ const items = resolvedProp?.items || propSchema.items;
132394
+ if (items) {
132395
+ const resolvedItems = this.resolveSchemaRef(items);
132396
+ enumValues = resolvedItems?.enum || items.enum;
132397
+ }
132398
+ }
132267
132399
  fields.push({
132268
132400
  name,
132269
132401
  required: requiredFields.has(name),
132270
132402
  description: resolvedProp?.description || propSchema.description,
132271
132403
  type: resolvedProp?.type || propSchema.type,
132272
- enumValues: resolvedProp?.enum || propSchema.enum
132404
+ enumValues
132273
132405
  });
132274
132406
  }
132275
132407
  fields.sort((a, b) => {
@@ -132318,14 +132450,20 @@ var init_openapi_cache = __esm({
132318
132450
  output_manager_default.debug("Saved OpenAPI spec to cache");
132319
132451
  }
132320
132452
  /**
132321
- * Fetch OpenAPI spec from remote
132453
+ * Fetch OpenAPI spec from remote with timeout
132322
132454
  */
132323
132455
  async fetchSpec() {
132324
- const response = await fetch(OPENAPI_URL);
132325
- if (!response.ok) {
132326
- throw new Error(`Failed to fetch OpenAPI spec: ${response.status}`);
132456
+ const controller = new AbortController();
132457
+ const timeoutId = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS);
132458
+ try {
132459
+ const response = await fetch(OPENAPI_URL, { signal: controller.signal });
132460
+ if (!response.ok) {
132461
+ throw new Error(`Failed to fetch OpenAPI spec: ${response.status}`);
132462
+ }
132463
+ return await response.json();
132464
+ } finally {
132465
+ clearTimeout(timeoutId);
132327
132466
  }
132328
- return await response.json();
132329
132467
  }
132330
132468
  /**
132331
132469
  * Check if cached spec is expired
@@ -132413,6 +132551,33 @@ var init_openapi_cache = __esm({
132413
132551
  }
132414
132552
  });
132415
132553
 
132554
+ // src/util/openapi/types.ts
132555
+ var init_types = __esm({
132556
+ "src/util/openapi/types.ts"() {
132557
+ "use strict";
132558
+ }
132559
+ });
132560
+
132561
+ // src/util/openapi/index.ts
132562
+ var init_openapi = __esm({
132563
+ "src/util/openapi/index.ts"() {
132564
+ "use strict";
132565
+ init_openapi_cache();
132566
+ init_types();
132567
+ init_constants2();
132568
+ }
132569
+ });
132570
+
132571
+ // src/commands/api/constants.ts
132572
+ var API_BASE_URL;
132573
+ var init_constants3 = __esm({
132574
+ "src/commands/api/constants.ts"() {
132575
+ "use strict";
132576
+ init_openapi();
132577
+ API_BASE_URL = "https://api.vercel.com";
132578
+ }
132579
+ });
132580
+
132416
132581
  // src/commands/api/format-utils.ts
132417
132582
  function colorizeMethod(method) {
132418
132583
  switch (method) {
@@ -132919,6 +133084,18 @@ async function promptForParameters(client2, path11, parameters, bodyFieldsSpec)
132919
133084
  async function promptForBodyField(client2, field, required) {
132920
133085
  const description = formatDescription(field.description);
132921
133086
  const optionalHint = required ? "" : import_chalk43.default.dim(" (optional)");
133087
+ if (field.type === "array" && field.enumValues && field.enumValues.length > 0) {
133088
+ const choices = field.enumValues.map((v) => ({
133089
+ name: String(v),
133090
+ value: String(v)
133091
+ }));
133092
+ const selected = await client2.input.checkbox({
133093
+ message: `Select values for ${import_chalk43.default.cyan(field.name)}${optionalHint}${description}:`,
133094
+ choices,
133095
+ required
133096
+ });
133097
+ return JSON.stringify(selected);
133098
+ }
132922
133099
  if (field.enumValues && field.enumValues.length > 0) {
132923
133100
  const choices = field.enumValues.map((v) => ({
132924
133101
  name: String(v),
@@ -132950,8 +133127,8 @@ var init_api2 = __esm({
132950
133127
  init_command2();
132951
133128
  init_api();
132952
133129
  init_request_builder();
132953
- init_openapi_cache();
132954
- init_constants2();
133130
+ init_openapi();
133131
+ init_constants3();
132955
133132
  init_format_utils();
132956
133133
  init_output_manager();
132957
133134
  }
@@ -137454,7 +137631,7 @@ async function store(client2, rwToken) {
137454
137631
  return 1;
137455
137632
  }
137456
137633
  const subArgs = parsedArgs.args.slice(2);
137457
- const { subcommand, args: args2, subcommandOriginal } = getSubcommand(
137634
+ const { subcommand, args: args2, subcommandOriginal } = getSubcommand2(
137458
137635
  subArgs,
137459
137636
  COMMAND_CONFIG2
137460
137637
  );
@@ -137615,7 +137792,7 @@ async function main(client2) {
137615
137792
  return 1;
137616
137793
  }
137617
137794
  const subArgs = parsedArgs.args.slice(1);
137618
- const { subcommand, args: args2, subcommandOriginal } = getSubcommand(
137795
+ const { subcommand, args: args2, subcommandOriginal } = getSubcommand2(
137619
137796
  subArgs,
137620
137797
  COMMAND_CONFIG3
137621
137798
  );
@@ -153087,6 +153264,141 @@ var init_vercel_auth = __esm({
153087
153264
  }
153088
153265
  });
153089
153266
 
153267
+ // src/util/projects/detect-services.ts
153268
+ function isExperimentalServicesEnabled() {
153269
+ return process.env.VERCEL_USE_EXPERIMENTAL_SERVICES === "1" || process.env.VERCEL_USE_EXPERIMENTAL_SERVICES?.toLowerCase() === "true";
153270
+ }
153271
+ async function tryDetectServices(cwd) {
153272
+ if (!isExperimentalServicesEnabled()) {
153273
+ return null;
153274
+ }
153275
+ const fs15 = new import_fs_detectors4.LocalFileSystemDetector(cwd);
153276
+ const result = await (0, import_fs_detectors4.detectServices)({ fs: fs15 });
153277
+ const hasNoServicesError = result.errors.some(
153278
+ (e2) => e2.code === "NO_SERVICES_CONFIGURED"
153279
+ );
153280
+ if (hasNoServicesError) {
153281
+ return null;
153282
+ }
153283
+ return result;
153284
+ }
153285
+ var import_fs_detectors4;
153286
+ var init_detect_services = __esm({
153287
+ "src/util/projects/detect-services.ts"() {
153288
+ "use strict";
153289
+ import_fs_detectors4 = __toESM3(require_dist8(), 1);
153290
+ }
153291
+ });
153292
+
153293
+ // src/util/input/display-services.ts
153294
+ function getFrameworkName(slug) {
153295
+ if (!slug)
153296
+ return void 0;
153297
+ return frameworksBySlug.get(slug)?.name;
153298
+ }
153299
+ function formatRoutePrefix(routePrefix) {
153300
+ if (routePrefix === "/") {
153301
+ return "/";
153302
+ }
153303
+ const normalized = routePrefix.startsWith("/") ? routePrefix : `/${routePrefix}`;
153304
+ return `${normalized}/*`;
153305
+ }
153306
+ function getServiceDescriptionInfo(service) {
153307
+ const frameworkName = getFrameworkName(service.framework);
153308
+ if (frameworkName && service.framework) {
153309
+ const colorFn = frameworkColors[service.framework] || chalk52.cyan;
153310
+ return { label: frameworkName, colorFn };
153311
+ } else if (service.runtime) {
153312
+ const normalizedRuntime = service.runtime.toLowerCase().replace(/@.*$/, "");
153313
+ const colorFn = runtimeColors[normalizedRuntime] || chalk52.yellow;
153314
+ return { label: service.runtime, colorFn };
153315
+ } else if (service.builder?.use) {
153316
+ return { label: service.builder.use, colorFn: chalk52.magenta };
153317
+ }
153318
+ return { label: "unknown", colorFn: chalk52.dim };
153319
+ }
153320
+ function getServiceTarget(service) {
153321
+ switch (service.type) {
153322
+ case "cron":
153323
+ return `schedule: ${service.schedule ?? "none"}`;
153324
+ case "worker":
153325
+ return `topic: ${service.topic ?? "none"}`;
153326
+ case "web":
153327
+ default:
153328
+ return service.routePrefix ? formatRoutePrefix(service.routePrefix) : "no route";
153329
+ }
153330
+ }
153331
+ function displayDetectedServices(services) {
153332
+ output_manager_default.print(`Multiple services detected. Project Settings:
153333
+ `);
153334
+ const rows = services.map((service) => {
153335
+ const descInfo = getServiceDescriptionInfo(service);
153336
+ const target = getServiceTarget(service);
153337
+ return [
153338
+ `\u2022 ${service.name}`,
153339
+ descInfo.colorFn(`[${descInfo.label}]`),
153340
+ chalk52.dim("\u2192"),
153341
+ target
153342
+ ];
153343
+ });
153344
+ const tableOutput = table(rows, { align: ["l", "l", "l", "l"], hsep: 2 });
153345
+ output_manager_default.print(`${tableOutput}
153346
+ `);
153347
+ }
153348
+ function displayServicesConfigNote() {
153349
+ output_manager_default.print(
153350
+ `
153351
+ ${chalk52.dim("Services (experimental) are configured via vercel.json.")}
153352
+ `
153353
+ );
153354
+ }
153355
+ function displayServiceErrors(errors) {
153356
+ for (const error3 of errors) {
153357
+ output_manager_default.warn(error3.message);
153358
+ }
153359
+ }
153360
+ var import_frameworks4, chalk52, frameworksBySlug, frameworkColors, runtimeColors;
153361
+ var init_display_services = __esm({
153362
+ "src/util/input/display-services.ts"() {
153363
+ "use strict";
153364
+ import_frameworks4 = __toESM3(require_frameworks(), 1);
153365
+ init_output_manager();
153366
+ init_table();
153367
+ chalk52 = require_source();
153368
+ frameworksBySlug = new Map(import_frameworks4.frameworkList.map((f) => [f.slug, f]));
153369
+ frameworkColors = {
153370
+ // JavaScript/TypeScript frameworks
153371
+ nextjs: chalk52.white,
153372
+ vite: chalk52.magenta,
153373
+ nuxtjs: chalk52.green,
153374
+ remix: chalk52.cyan,
153375
+ astro: chalk52.magenta,
153376
+ gatsby: chalk52.magenta,
153377
+ svelte: chalk52.red,
153378
+ sveltekit: chalk52.red,
153379
+ solidstart: chalk52.blue,
153380
+ angular: chalk52.red,
153381
+ vue: chalk52.green,
153382
+ ember: chalk52.red,
153383
+ preact: chalk52.magenta,
153384
+ // Python frameworks
153385
+ fastapi: chalk52.green,
153386
+ flask: chalk52.cyan,
153387
+ // Node frameworks
153388
+ express: chalk52.yellow,
153389
+ nest: chalk52.red,
153390
+ hono: chalk52.yellowBright
153391
+ };
153392
+ runtimeColors = {
153393
+ node: chalk52.green,
153394
+ python: chalk52.blue,
153395
+ go: chalk52.cyan,
153396
+ ruby: chalk52.red,
153397
+ rust: chalk52.yellowBright
153398
+ };
153399
+ }
153400
+ });
153401
+
153090
153402
  // src/util/link/setup-and-link.ts
153091
153403
  import { join as join15, basename as basename7 } from "path";
153092
153404
  async function setupAndLink(client2, path11, {
@@ -153184,9 +153496,17 @@ async function setupAndLink(client2, path11, {
153184
153496
  return { status: "error", exitCode: 1 };
153185
153497
  }
153186
153498
  const isZeroConfig = !localConfig || !localConfig.builds || localConfig.builds.length === 0;
153499
+ const servicesResult = await tryDetectServices(pathWithRootDirectory);
153187
153500
  try {
153188
153501
  let settings = {};
153189
- if (isZeroConfig) {
153502
+ if (servicesResult) {
153503
+ displayDetectedServices(servicesResult.services);
153504
+ if (servicesResult.errors.length > 0) {
153505
+ displayServiceErrors(servicesResult.errors);
153506
+ }
153507
+ displayServicesConfigNote();
153508
+ settings.framework = "services";
153509
+ } else if (isZeroConfig) {
153190
153510
  const localConfigurationOverrides = {
153191
153511
  buildCommand: localConfig?.buildCommand,
153192
153512
  devCommand: localConfig?.devCommand,
@@ -153199,7 +153519,7 @@ async function setupAndLink(client2, path11, {
153199
153519
  pathWithRootDirectory
153200
153520
  );
153201
153521
  const detectedProjects = detectedProjectsForWorkspace.get("") || [];
153202
- const framework = detectedProjects[0] ?? import_frameworks4.frameworkList.find((f) => f.slug === null);
153522
+ const framework = detectedProjects[0] ?? import_frameworks5.frameworkList.find((f) => f.slug === null);
153203
153523
  settings = await editProjectSettings(
153204
153524
  client2,
153205
153525
  {},
@@ -153291,7 +153611,7 @@ async function connectGitRepository(client2, path11, project, autoConfirm, org)
153291
153611
  output_manager_default.debug(`Failed to connect git repository: ${error3}`);
153292
153612
  }
153293
153613
  }
153294
- var import_chalk56, import_fs_extra17, import_frameworks4;
153614
+ var import_chalk56, import_fs_extra17, import_frameworks5;
153295
153615
  var init_setup_and_link = __esm({
153296
153616
  "src/util/link/setup-and-link.ts"() {
153297
153617
  "use strict";
@@ -153313,8 +153633,10 @@ var init_setup_and_link = __esm({
153313
153633
  init_output_manager();
153314
153634
  init_detect_projects();
153315
153635
  init_read_config();
153316
- import_frameworks4 = __toESM3(require_frameworks(), 1);
153636
+ import_frameworks5 = __toESM3(require_frameworks(), 1);
153317
153637
  init_vercel_auth();
153638
+ init_detect_services();
153639
+ init_display_services();
153318
153640
  }
153319
153641
  });
153320
153642
 
@@ -153550,7 +153872,6 @@ import {
153550
153872
  resetCustomInstallCommandSet,
153551
153873
  Span,
153552
153874
  validateNpmrc,
153553
- shouldUseExperimentalBackends,
153554
153875
  isBackendBuilder as isBackendBuilder2
153555
153876
  } from "@vercel/build-utils";
153556
153877
  import { mkdir as mkdir4, writeFile as writeFile5 } from "fs/promises";
@@ -153790,7 +154111,7 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
153790
154111
  readJSONFile(join17(workPath, "package.json")),
153791
154112
  readJSONFile(vercelConfigPath),
153792
154113
  readJSONFile(join17(workPath, "now.json")),
153793
- (0, import_fs_detectors4.detectInstrumentation)(new import_fs_detectors4.LocalFileSystemDetector(workPath))
154114
+ (0, import_fs_detectors5.detectInstrumentation)(new import_fs_detectors5.LocalFileSystemDetector(workPath))
153794
154115
  ]);
153795
154116
  if (pkg instanceof CantParseJSONFile)
153796
154117
  throw pkg;
@@ -153866,7 +154187,7 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
153866
154187
  builds = builds.map((b) => expandBuild(files, b)).flat();
153867
154188
  } else {
153868
154189
  isZeroConfig = true;
153869
- const detectedBuilders = await (0, import_fs_detectors4.detectBuilders)(files, pkg, {
154190
+ const detectedBuilders = await (0, import_fs_detectors5.detectBuilders)(files, pkg, {
153870
154191
  ...localConfig,
153871
154192
  projectSettings,
153872
154193
  ignoreBuildScript: true,
@@ -153997,16 +154318,10 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
153997
154318
  let buildResult;
153998
154319
  try {
153999
154320
  buildResult = await builderSpan.trace(
154000
- async () => {
154001
- if (shouldUseExperimentalBackends(buildConfig.framework) && builderPkg.name !== "@vercel/static" && isBackendBuilder2(build2)) {
154002
- const experimentalBackendBuilder = await import("@vercel/backends");
154003
- return experimentalBackendBuilder.build(buildOptions);
154004
- }
154005
- return builder.build(buildOptions);
154006
- }
154321
+ async () => builder.build(buildOptions)
154007
154322
  );
154008
154323
  if (buildConfig.zeroConfig && isFrontendBuilder && "output" in buildResult && !buildResult.routes) {
154009
- const framework2 = import_frameworks5.frameworkList.find(
154324
+ const framework2 = import_frameworks6.frameworkList.find(
154010
154325
  (f) => f.slug === buildConfig.framework
154011
154326
  );
154012
154327
  if (framework2) {
@@ -154256,9 +154571,9 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, stand
154256
154571
  );
154257
154572
  }
154258
154573
  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
154574
+ const detectedFramework = await (0, import_fs_detectors5.detectFrameworkRecord)({
154575
+ fs: new import_fs_detectors5.LocalFileSystemDetector(cwd),
154576
+ frameworkList: import_frameworks6.frameworkList
154262
154577
  });
154263
154578
  if (!detectedFramework) {
154264
154579
  return;
@@ -154277,7 +154592,7 @@ async function getFramework(cwd, buildResults) {
154277
154592
  };
154278
154593
  }
154279
154594
  }
154280
- const frameworkVersion = (0, import_fs_detectors4.detectFrameworkVersion)(detectedFramework);
154595
+ const frameworkVersion = (0, import_fs_detectors5.detectFrameworkVersion)(detectedFramework);
154281
154596
  if (frameworkVersion) {
154282
154597
  return {
154283
154598
  version: frameworkVersion
@@ -154407,7 +154722,7 @@ async function getFrameworkRoutes(framework, dirPrefix) {
154407
154722
  }
154408
154723
  return routes2;
154409
154724
  }
154410
- var import_chalk58, import_dotenv2, import_fs_extra18, import_minimatch2, import_semver3, import_client6, import_frameworks5, import_fs_detectors4, import_routing_utils2, InMemoryReporter;
154725
+ var import_chalk58, import_dotenv2, import_fs_extra18, import_minimatch2, import_semver3, import_client6, import_frameworks6, import_fs_detectors5, import_routing_utils2, InMemoryReporter;
154411
154726
  var init_build2 = __esm({
154412
154727
  "src/commands/build/index.ts"() {
154413
154728
  "use strict";
@@ -154417,8 +154732,8 @@ var init_build2 = __esm({
154417
154732
  import_minimatch2 = __toESM3(require_minimatch2(), 1);
154418
154733
  import_semver3 = __toESM3(require_semver(), 1);
154419
154734
  import_client6 = __toESM3(require_dist7(), 1);
154420
- import_frameworks5 = __toESM3(require_frameworks(), 1);
154421
- import_fs_detectors4 = __toESM3(require_dist8(), 1);
154735
+ import_frameworks6 = __toESM3(require_frameworks(), 1);
154736
+ import_fs_detectors5 = __toESM3(require_dist8(), 1);
154422
154737
  import_routing_utils2 = __toESM3(require_dist23(), 1);
154423
154738
  init_output_manager();
154424
154739
  init_corepack();
@@ -154924,7 +155239,7 @@ async function main4(client2) {
154924
155239
  return 1;
154925
155240
  }
154926
155241
  const subArgs = parsedArgs.args.slice(1);
154927
- const { subcommand, args: args2, subcommandOriginal } = getSubcommand(
155242
+ const { subcommand, args: args2, subcommandOriginal } = getSubcommand2(
154928
155243
  subArgs,
154929
155244
  COMMAND_CONFIG4
154930
155245
  );
@@ -155899,7 +156214,7 @@ async function main5(client2) {
155899
156214
  printError(err);
155900
156215
  return 1;
155901
156216
  }
155902
- const { subcommand, subcommandOriginal, args: args2 } = getSubcommand(
156217
+ const { subcommand, subcommandOriginal, args: args2 } = getSubcommand2(
155903
156218
  parsedArgs.args.slice(1),
155904
156219
  COMMAND_CONFIG5
155905
156220
  );
@@ -158869,7 +159184,7 @@ var require_compat = __commonJS2({
158869
159184
  return EventEmitter2.listenerCount || require_event_listener_count();
158870
159185
  });
158871
159186
  function lazyProperty(obj, prop, getter) {
158872
- function get() {
159187
+ function get2() {
158873
159188
  var val = getter();
158874
159189
  Object.defineProperty(obj, prop, {
158875
159190
  configurable: true,
@@ -158881,7 +159196,7 @@ var require_compat = __commonJS2({
158881
159196
  Object.defineProperty(obj, prop, {
158882
159197
  configurable: true,
158883
159198
  enumerable: true,
158884
- get
159199
+ get: get2
158885
159200
  });
158886
159201
  }
158887
159202
  function toString2(obj) {
@@ -159130,12 +159445,12 @@ var require_depd = __commonJS2({
159130
159445
  if ("value" in descriptor2) {
159131
159446
  descriptor2 = convertDataDescriptorToAccessor(obj, prop, message2);
159132
159447
  }
159133
- var get = descriptor2.get;
159448
+ var get2 = descriptor2.get;
159134
159449
  var set2 = descriptor2.set;
159135
- if (typeof get === "function") {
159450
+ if (typeof get2 === "function") {
159136
159451
  descriptor2.get = function getter() {
159137
159452
  log.call(deprecate2, message2, site2);
159138
- return get.apply(this, arguments);
159453
+ return get2.apply(this, arguments);
159139
159454
  };
159140
159455
  }
159141
159456
  if (typeof set2 === "function") {
@@ -161121,13 +161436,13 @@ var require_dbcs_codec = __commonJS2({
161121
161436
  this.nodeIdx = 0;
161122
161437
  return ret;
161123
161438
  };
161124
- function findIdx(table2, val) {
161125
- if (table2[0] > val)
161439
+ function findIdx(table3, val) {
161440
+ if (table3[0] > val)
161126
161441
  return -1;
161127
- var l = 0, r = table2.length;
161442
+ var l = 0, r = table3.length;
161128
161443
  while (l < r - 1) {
161129
161444
  var mid = l + Math.floor((r - l + 1) / 2);
161130
- if (table2[mid] <= val)
161445
+ if (table3[mid] <= val)
161131
161446
  l = mid;
161132
161447
  else
161133
161448
  r = mid;
@@ -163686,32 +164001,32 @@ var require_ms3 = __commonJS2({
163686
164001
  return void 0;
163687
164002
  }
163688
164003
  }
163689
- function fmtShort(ms34) {
163690
- if (ms34 >= d) {
163691
- return Math.round(ms34 / d) + "d";
164004
+ function fmtShort(ms35) {
164005
+ if (ms35 >= d) {
164006
+ return Math.round(ms35 / d) + "d";
163692
164007
  }
163693
- if (ms34 >= h) {
163694
- return Math.round(ms34 / h) + "h";
164008
+ if (ms35 >= h) {
164009
+ return Math.round(ms35 / h) + "h";
163695
164010
  }
163696
- if (ms34 >= m) {
163697
- return Math.round(ms34 / m) + "m";
164011
+ if (ms35 >= m) {
164012
+ return Math.round(ms35 / m) + "m";
163698
164013
  }
163699
- if (ms34 >= s) {
163700
- return Math.round(ms34 / s) + "s";
164014
+ if (ms35 >= s) {
164015
+ return Math.round(ms35 / s) + "s";
163701
164016
  }
163702
- return ms34 + "ms";
164017
+ return ms35 + "ms";
163703
164018
  }
163704
- function fmtLong(ms34) {
163705
- return plural15(ms34, d, "day") || plural15(ms34, h, "hour") || plural15(ms34, m, "minute") || plural15(ms34, s, "second") || ms34 + " ms";
164019
+ function fmtLong(ms35) {
164020
+ return plural16(ms35, d, "day") || plural16(ms35, h, "hour") || plural16(ms35, m, "minute") || plural16(ms35, s, "second") || ms35 + " ms";
163706
164021
  }
163707
- function plural15(ms34, n, name) {
163708
- if (ms34 < n) {
164022
+ function plural16(ms35, n, name) {
164023
+ if (ms35 < n) {
163709
164024
  return;
163710
164025
  }
163711
- if (ms34 < n * 1.5) {
163712
- return Math.floor(ms34 / n) + " " + name;
164026
+ if (ms35 < n * 1.5) {
164027
+ return Math.floor(ms35 / n) + " " + name;
163713
164028
  }
163714
- return Math.ceil(ms34 / n) + " " + name + "s";
164029
+ return Math.ceil(ms35 / n) + " " + name + "s";
163715
164030
  }
163716
164031
  }
163717
164032
  });
@@ -163744,8 +164059,8 @@ var require_debug4 = __commonJS2({
163744
164059
  return;
163745
164060
  var self2 = debug2;
163746
164061
  var curr = +/* @__PURE__ */ new Date();
163747
- var ms34 = curr - (prevTime || curr);
163748
- self2.diff = ms34;
164062
+ var ms35 = curr - (prevTime || curr);
164063
+ self2.diff = ms35;
163749
164064
  self2.prev = prevTime;
163750
164065
  self2.curr = curr;
163751
164066
  prevTime = curr;
@@ -164593,14 +164908,14 @@ var require_follow_redirects = __commonJS2({
164593
164908
  debug2("options", options);
164594
164909
  return new RedirectableRequest(options, callback);
164595
164910
  }
164596
- function get(input, options, callback) {
164911
+ function get2(input, options, callback) {
164597
164912
  var wrappedRequest = wrappedProtocol.request(input, options, callback);
164598
164913
  wrappedRequest.end();
164599
164914
  return wrappedRequest;
164600
164915
  }
164601
164916
  Object.defineProperties(wrappedProtocol, {
164602
164917
  request: { value: request, configurable: true, enumerable: true, writable: true },
164603
- get: { value: get, configurable: true, enumerable: true, writable: true }
164918
+ get: { value: get2, configurable: true, enumerable: true, writable: true }
164604
164919
  });
164605
164920
  });
164606
164921
  return exports3;
@@ -175567,7 +175882,7 @@ async function executeBuild(vercelConfig, devServer, files, match, requestPath,
175567
175882
  builderWithPkg: { path: requirePath, builder, pkg }
175568
175883
  } = match;
175569
175884
  const { entrypoint, use } = match;
175570
- const isStatic = (0, import_fs_detectors5.isStaticRuntime)(use);
175885
+ const isStatic = (0, import_fs_detectors6.isStaticRuntime)(use);
175571
175886
  const { envConfigs, cwd: workPath, devCacheDir } = devServer;
175572
175887
  const debug2 = output_manager_default.isDebugEnabled();
175573
175888
  const startTime = Date.now();
@@ -175888,13 +176203,13 @@ async function shutdownBuilder(match) {
175888
176203
  }
175889
176204
  await Promise.all(ops);
175890
176205
  }
175891
- var import_ms12, import_bytes7, import_fs_detectors5, import_pluralize8, import_minimatch3, import_routing_utils4;
176206
+ var import_ms12, import_bytes7, import_fs_detectors6, import_pluralize8, import_minimatch3, import_routing_utils4;
175892
176207
  var init_builder = __esm({
175893
176208
  "src/util/dev/builder.ts"() {
175894
176209
  "use strict";
175895
176210
  import_ms12 = __toESM3(require_ms(), 1);
175896
176211
  import_bytes7 = __toESM3(require_bytes(), 1);
175897
- import_fs_detectors5 = __toESM3(require_dist8(), 1);
176212
+ import_fs_detectors6 = __toESM3(require_dist8(), 1);
175898
176213
  import_pluralize8 = __toESM3(require_pluralize(), 1);
175899
176214
  import_minimatch3 = __toESM3(require_minimatch2(), 1);
175900
176215
  init_highlight();
@@ -176229,13 +176544,13 @@ import {
176229
176544
  getNodeBinPaths,
176230
176545
  FileFsRef as FileFsRef4,
176231
176546
  spawnCommand,
176232
- shouldUseExperimentalBackends as shouldUseExperimentalBackends2
176547
+ shouldUseExperimentalBackends
176233
176548
  } from "@vercel/build-utils";
176234
176549
  function sortBuilders2(buildA, buildB) {
176235
- if (buildA && buildA.use && (0, import_fs_detectors6.isOfficialRuntime)("static-build", buildA.use)) {
176550
+ if (buildA && buildA.use && (0, import_fs_detectors7.isOfficialRuntime)("static-build", buildA.use)) {
176236
176551
  return 1;
176237
176552
  }
176238
- if (buildB && buildB.use && (0, import_fs_detectors6.isOfficialRuntime)("static-build", buildB.use)) {
176553
+ if (buildB && buildB.use && (0, import_fs_detectors7.isOfficialRuntime)("static-build", buildB.use)) {
176239
176554
  return -1;
176240
176555
  }
176241
176556
  return 0;
@@ -176454,7 +176769,7 @@ function buildMatchEquals(a, b) {
176454
176769
  return false;
176455
176770
  return true;
176456
176771
  }
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;
176772
+ 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
176773
  var init_server = __esm({
176459
176774
  "src/util/dev/server.ts"() {
176460
176775
  "use strict";
@@ -176478,8 +176793,8 @@ var init_server = __esm({
176478
176793
  import_json_parse_better_errors3 = __toESM3(require_json_parse_better_errors(), 1);
176479
176794
  import_client12 = __toESM3(require_dist7(), 1);
176480
176795
  import_routing_utils5 = __toESM3(require_dist23(), 1);
176481
- import_fs_detectors6 = __toESM3(require_dist8(), 1);
176482
- import_frameworks6 = __toESM3(require_frameworks(), 1);
176796
+ import_fs_detectors7 = __toESM3(require_dist8(), 1);
176797
+ import_frameworks7 = __toESM3(require_frameworks(), 1);
176483
176798
  init_cmd();
176484
176799
  init_link();
176485
176800
  init_sleep();
@@ -176507,7 +176822,7 @@ var init_server = __esm({
176507
176822
  init_project_settings();
176508
176823
  init_parse_listen();
176509
176824
  frontendRuntimeSet = new Set(
176510
- import_frameworks6.frameworkList.map((f) => f.useRuntime?.use || "@vercel/static-build")
176825
+ import_frameworks7.frameworkList.map((f) => f.useRuntime?.use || "@vercel/static-build")
176511
176826
  );
176512
176827
  DEV_SERVER_PORT_BIND_TIMEOUT = (0, import_ms13.default)("5m");
176513
176828
  DevServer = class {
@@ -177447,14 +177762,14 @@ Please ensure that ${cmd(err.path)} is properly installed`;
177447
177762
  return this.projectSettings.devCommand;
177448
177763
  } else if (this.projectSettings?.framework) {
177449
177764
  const frameworkSlug = this.projectSettings.framework;
177450
- const framework = import_frameworks6.frameworkList.find((f) => f.slug === frameworkSlug);
177765
+ const framework = import_frameworks7.frameworkList.find((f) => f.slug === frameworkSlug);
177451
177766
  if (framework) {
177452
177767
  const defaults = framework.settings.devCommand.value;
177453
177768
  if (defaults) {
177454
177769
  return defaults;
177455
177770
  }
177456
177771
  }
177457
- if (shouldUseExperimentalBackends2(frameworkSlug)) {
177772
+ if (shouldUseExperimentalBackends(frameworkSlug)) {
177458
177773
  return "npx @vercel/cervel dev";
177459
177774
  }
177460
177775
  }
@@ -177514,7 +177829,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
177514
177829
  rewriteRoutes,
177515
177830
  // eslint-disable-next-line prefer-const
177516
177831
  errorRoutes
177517
- } = await (0, import_fs_detectors6.detectBuilders)(files, pkg, {
177832
+ } = await (0, import_fs_detectors7.detectBuilders)(files, pkg, {
177518
177833
  tag: "latest",
177519
177834
  functions: vercelConfig.functions,
177520
177835
  projectSettings: projectSettings || this.projectSettings,
@@ -177577,8 +177892,8 @@ Please ensure that ${cmd(err.path)} is properly installed`;
177577
177892
  return true;
177578
177893
  });
177579
177894
  this.caseSensitive = hasNewRoutingProperties(vercelConfig);
177580
- this.apiDir = (0, import_fs_detectors6.detectApiDirectory)(vercelConfig.builds || []);
177581
- this.apiExtensions = (0, import_fs_detectors6.detectApiExtensions)(vercelConfig.builds || []);
177895
+ this.apiDir = (0, import_fs_detectors7.detectApiDirectory)(vercelConfig.builds || []);
177896
+ this.apiExtensions = (0, import_fs_detectors7.detectApiExtensions)(vercelConfig.builds || []);
177582
177897
  let [runEnv, buildEnv] = await Promise.all([
177583
177898
  this.getLocalEnv(".env", vercelConfig.env),
177584
177899
  this.getLocalEnv(".env.build", vercelConfig.build?.env)
@@ -178189,7 +178504,7 @@ ${error_code}
178189
178504
 
178190
178505
  // src/util/env/constants.ts
178191
178506
  var VERCEL_OIDC_TOKEN;
178192
- var init_constants3 = __esm({
178507
+ var init_constants4 = __esm({
178193
178508
  "src/util/env/constants.ts"() {
178194
178509
  "use strict";
178195
178510
  VERCEL_OIDC_TOKEN = "VERCEL_OIDC_TOKEN";
@@ -178292,7 +178607,7 @@ var init_refresh_oidc_token = __esm({
178292
178607
  import_ms14 = __toESM3(require_ms(), 1);
178293
178608
  init_output_manager();
178294
178609
  init_get_env_records();
178295
- init_constants3();
178610
+ init_constants4();
178296
178611
  REFRESH_BEFORE_EXPIRY_MILLIS = getMs(
178297
178612
  (0, import_ms14.default)("15m"),
178298
178613
  process.env.REFRESH_VERCEL_OIDC_TOKEN_BEFORE_EXPIRY_MILLIS
@@ -178412,7 +178727,7 @@ var init_dev = __esm({
178412
178727
  init_get_env_records();
178413
178728
  init_output_manager();
178414
178729
  init_refresh_oidc_token();
178415
- init_constants3();
178730
+ init_constants4();
178416
178731
  }
178417
178732
  });
178418
178733
 
@@ -178509,7 +178824,7 @@ async function main6(client2) {
178509
178824
  output_manager_default.print(help(devCommand, { columns: client2.stderr.columns }));
178510
178825
  return 2;
178511
178826
  }
178512
- const args2 = getSubcommand(parsedArgs.args.slice(1), COMMAND_CONFIG6).args;
178827
+ const args2 = getSubcommand2(parsedArgs.args.slice(1), COMMAND_CONFIG6).args;
178513
178828
  if ("--confirm" in parsedArgs.flags) {
178514
178829
  output_manager_default.warn("`--confirm` is deprecated, please use `--yes` instead");
178515
178830
  parsedArgs.flags["--yes"] = parsedArgs.flags["--confirm"];
@@ -179640,7 +179955,7 @@ async function dns(client2) {
179640
179955
  store: telemetryEventStore
179641
179956
  }
179642
179957
  });
179643
- const { subcommand, subcommandOriginal, args: args2 } = getSubcommand(
179958
+ const { subcommand, subcommandOriginal, args: args2 } = getSubcommand2(
179644
179959
  parsedArgs.args.slice(1),
179645
179960
  COMMAND_CONFIG7
179646
179961
  );
@@ -180648,7 +180963,7 @@ async function inspect2(client2, argv) {
180648
180963
  output_manager_default.print("\n");
180649
180964
  if (Array.isArray(projects) && projects.length > 0) {
180650
180965
  output_manager_default.print(import_chalk90.default.bold(" Projects\n"));
180651
- const table2 = formatTable(
180966
+ const table3 = formatTable(
180652
180967
  ["Project", "Domains"],
180653
180968
  ["l", "l"],
180654
180969
  [
@@ -180665,7 +180980,7 @@ async function inspect2(client2, argv) {
180665
180980
  ]
180666
180981
  );
180667
180982
  output_manager_default.print(
180668
- table2.split("\n").map((line) => ` ${line}`).join("\n")
180983
+ table3.split("\n").map((line) => ` ${line}`).join("\n")
180669
180984
  );
180670
180985
  output_manager_default.print("\n");
180671
180986
  }
@@ -181599,7 +181914,7 @@ async function main7(client2) {
181599
181914
  store: client2.telemetryEventStore
181600
181915
  }
181601
181916
  });
181602
- const { subcommand, args: args2, subcommandOriginal } = getSubcommand(
181917
+ const { subcommand, args: args2, subcommandOriginal } = getSubcommand2(
181603
181918
  parsedArgs.args.slice(1),
181604
181919
  COMMAND_CONFIG8
181605
181920
  );
@@ -181938,14 +182253,14 @@ function getEnvKeyWarnings(key) {
181938
182253
  }
181939
182254
  return warnings;
181940
182255
  }
181941
- var import_frameworks7, PUBLIC_PREFIXES, SENSITIVE_PATTERN;
182256
+ var import_frameworks8, PUBLIC_PREFIXES, SENSITIVE_PATTERN;
181942
182257
  var init_validate_env = __esm({
181943
182258
  "src/util/env/validate-env.ts"() {
181944
182259
  "use strict";
181945
- import_frameworks7 = __toESM3(require_frameworks(), 1);
182260
+ import_frameworks8 = __toESM3(require_frameworks(), 1);
181946
182261
  PUBLIC_PREFIXES = [
181947
182262
  ...new Set(
181948
- import_frameworks7.frameworkList.map((f) => f.envPrefix).filter((p) => !!p)
182263
+ import_frameworks8.frameworkList.map((f) => f.envPrefix).filter((p) => !!p)
181949
182264
  )
181950
182265
  ];
181951
182266
  SENSITIVE_PATTERN = /(?:^|_)(password|secret|private|token|key|auth|jwt|signature)(?:_|$)/i;
@@ -183209,7 +183524,7 @@ async function main8(client2) {
183209
183524
  return 1;
183210
183525
  }
183211
183526
  const subArgs = parsedArgs.args.slice(1);
183212
- const { subcommand, args: args2, subcommandOriginal } = getSubcommand(
183527
+ const { subcommand, args: args2, subcommandOriginal } = getSubcommand2(
183213
183528
  subArgs,
183214
183529
  COMMAND_CONFIG9
183215
183530
  );
@@ -183728,7 +184043,7 @@ async function main9(client2) {
183728
184043
  store: client2.telemetryEventStore
183729
184044
  }
183730
184045
  });
183731
- const { subcommand, args: args2, subcommandOriginal } = getSubcommand(
184046
+ const { subcommand, args: args2, subcommandOriginal } = getSubcommand2(
183732
184047
  parsedArgs.args.slice(1),
183733
184048
  COMMAND_CONFIG10
183734
184049
  );
@@ -183884,7 +184199,7 @@ async function guidance(client2) {
183884
184199
  printError(err);
183885
184200
  return 1;
183886
184201
  }
183887
- const { subcommand, subcommandOriginal } = getSubcommand(
184202
+ const { subcommand, subcommandOriginal } = getSubcommand2(
183888
184203
  parsedArguments.args.slice(1),
183889
184204
  COMMAND_CONFIG11
183890
184205
  );
@@ -184282,7 +184597,7 @@ async function main10(client2) {
184282
184597
  output_manager_default.print(help(initCommand, { columns: client2.stderr.columns }));
184283
184598
  return 2;
184284
184599
  }
184285
- const args2 = getSubcommand(parsedArgs.args.slice(1), COMMAND_CONFIG12).args;
184600
+ const args2 = getSubcommand2(parsedArgs.args.slice(1), COMMAND_CONFIG12).args;
184286
184601
  if (parsedArgs.args.length > 3) {
184287
184602
  output_manager_default.error("Too many arguments.");
184288
184603
  return 1;
@@ -184403,8 +184718,8 @@ var init_builds = __esm({
184403
184718
  }
184404
184719
  }
184405
184720
  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)}`;
184721
+ const main20 = prefix + path11 + finalSize + finalRegion;
184722
+ return `${import_chalk103.default.grey(corner)} ${color(main20)}`;
184408
184723
  };
184409
184724
  getDirPath = (path11, level = 0, highestLevel = null) => {
184410
184725
  const parts = path11.split("/").slice(0, -1);
@@ -186066,7 +186381,7 @@ async function install(client2) {
186066
186381
  if (flags["--help"]) {
186067
186382
  telemetry2.trackCliFlagHelp("install");
186068
186383
  output_manager_default.print(help(installCommand, { columns: client2.stderr.columns }));
186069
- return 2;
186384
+ return 0;
186070
186385
  }
186071
186386
  await add5(client2, args2.slice(1));
186072
186387
  }
@@ -186836,7 +187151,7 @@ async function main11(client2) {
186836
187151
  subcommand,
186837
187152
  subcommandOriginal,
186838
187153
  args: subArgs
186839
- } = getSubcommand(args2.slice(1), COMMAND_CONFIG13);
187154
+ } = getSubcommand2(args2.slice(1), COMMAND_CONFIG13);
186840
187155
  const needHelp = flags["--help"];
186841
187156
  function printHelp(command) {
186842
187157
  output_manager_default.print(
@@ -186853,14 +187168,14 @@ async function main11(client2) {
186853
187168
  columns: client2.stderr.columns
186854
187169
  })
186855
187170
  );
186856
- return 2;
187171
+ return 0;
186857
187172
  }
186858
187173
  switch (subcommand) {
186859
187174
  case "add": {
186860
187175
  if (needHelp) {
186861
187176
  telemetry2.trackCliFlagHelp("integration", subcommandOriginal);
186862
187177
  printHelp(addSubcommand5);
186863
- return 2;
187178
+ return 0;
186864
187179
  }
186865
187180
  telemetry2.trackCliSubcommandAdd(subcommandOriginal);
186866
187181
  return add5(client2, subArgs);
@@ -186869,7 +187184,7 @@ async function main11(client2) {
186869
187184
  if (needHelp) {
186870
187185
  telemetry2.trackCliFlagHelp("integration", subcommandOriginal);
186871
187186
  printHelp(listSubcommand7);
186872
- return 2;
187187
+ return 0;
186873
187188
  }
186874
187189
  telemetry2.trackCliSubcommandList(subcommandOriginal);
186875
187190
  return list4(client2);
@@ -186878,7 +187193,7 @@ async function main11(client2) {
186878
187193
  if (needHelp) {
186879
187194
  telemetry2.trackCliFlagHelp("integration", subcommandOriginal);
186880
187195
  printHelp(balanceSubcommand);
186881
- return 2;
187196
+ return 0;
186882
187197
  }
186883
187198
  telemetry2.trackCliSubcommandBalance(subcommandOriginal);
186884
187199
  return balance(client2, subArgs);
@@ -186887,7 +187202,7 @@ async function main11(client2) {
186887
187202
  if (needHelp) {
186888
187203
  telemetry2.trackCliFlagHelp("integration", subcommandOriginal);
186889
187204
  printHelp(openSubcommand);
186890
- return 2;
187205
+ return 0;
186891
187206
  }
186892
187207
  telemetry2.trackCliSubcommandOpen(subcommandOriginal);
186893
187208
  return openIntegration(client2, subArgs);
@@ -186896,7 +187211,7 @@ async function main11(client2) {
186896
187211
  if (needHelp) {
186897
187212
  telemetry2.trackCliFlagHelp("integration", subcommandOriginal);
186898
187213
  printHelp(removeSubcommand7);
186899
- return 2;
187214
+ return 0;
186900
187215
  }
186901
187216
  telemetry2.trackCliSubcommandRemove(subcommandOriginal);
186902
187217
  return remove3(client2);
@@ -187401,7 +187716,7 @@ var init_disconnect3 = __esm({
187401
187716
 
187402
187717
  // src/util/integration-resource/types.ts
187403
187718
  var CancelledError, FailedError;
187404
- var init_types = __esm({
187719
+ var init_types2 = __esm({
187405
187720
  "src/util/integration-resource/types.ts"() {
187406
187721
  "use strict";
187407
187722
  CancelledError = class extends Error {
@@ -187592,7 +187907,7 @@ var init_disconnect4 = __esm({
187592
187907
  init_get_resources();
187593
187908
  init_link2();
187594
187909
  init_disconnect3();
187595
- init_types();
187910
+ init_types2();
187596
187911
  init_command19();
187597
187912
  }
187598
187913
  });
@@ -187754,7 +188069,7 @@ var init_remove_resource = __esm({
187754
188069
  init_error2();
187755
188070
  init_delete_resource();
187756
188071
  init_get_resources();
187757
- init_types();
188072
+ init_types2();
187758
188073
  init_remove4();
187759
188074
  init_command19();
187760
188075
  init_disconnect4();
@@ -187777,7 +188092,7 @@ async function main12(client2) {
187777
188092
  getFlagsSpecification(integrationResourceCommand.options),
187778
188093
  { permissive: true }
187779
188094
  );
187780
- const { subcommand, subcommandOriginal } = getSubcommand(
188095
+ const { subcommand, subcommandOriginal } = getSubcommand2(
187781
188096
  args2.slice(1),
187782
188097
  COMMAND_CONFIG14
187783
188098
  );
@@ -187786,7 +188101,7 @@ async function main12(client2) {
187786
188101
  output_manager_default.print(
187787
188102
  help(integrationResourceCommand, { columns: client2.stderr.columns })
187788
188103
  );
187789
- return 2;
188104
+ return 0;
187790
188105
  }
187791
188106
  function printHelp(command) {
187792
188107
  output_manager_default.print(
@@ -187801,7 +188116,7 @@ async function main12(client2) {
187801
188116
  if (needHelp) {
187802
188117
  telemetry2.trackCliFlagHelp("integration-resource", subcommandOriginal);
187803
188118
  printHelp(createThresholdSubcommand);
187804
- return 2;
188119
+ return 0;
187805
188120
  }
187806
188121
  telemetry2.trackCliSubcommandCreateThreshold(subcommandOriginal);
187807
188122
  return createThreshold(client2);
@@ -187810,7 +188125,7 @@ async function main12(client2) {
187810
188125
  if (needHelp) {
187811
188126
  telemetry2.trackCliFlagHelp("integration-resource", subcommandOriginal);
187812
188127
  printHelp(removeSubcommand6);
187813
- return 2;
188128
+ return 0;
187814
188129
  }
187815
188130
  telemetry2.trackCliSubcommandRemove(subcommandOriginal);
187816
188131
  return remove4(client2);
@@ -187819,7 +188134,7 @@ async function main12(client2) {
187819
188134
  if (needHelp) {
187820
188135
  telemetry2.trackCliFlagHelp("integration-resource", subcommandOriginal);
187821
188136
  printHelp(disconnectSubcommand2);
187822
- return 2;
188137
+ return 0;
187823
188138
  }
187824
188139
  telemetry2.trackCliSubcommandDisconnect(subcommandOriginal);
187825
188140
  return disconnect2(client2);
@@ -188720,8 +189035,30 @@ async function fetchRequestLogs(client2, options) {
188720
189035
  const baseUrl = client2.apiUrl === "https://api.vercel.com" ? "https://vercel.com" : client2.apiUrl;
188721
189036
  const url3 = `${baseUrl}/api/logs/request-logs?${query.toString()}`;
188722
189037
  const data = await client2.fetch(url3);
189038
+ const logs2 = (data.rows || []).map((row) => {
189039
+ const firstLog = row.logs?.[0];
189040
+ const firstEvent = row.events?.[0];
189041
+ return {
189042
+ id: row.requestId || "",
189043
+ timestamp: row.timestamp ? new Date(row.timestamp).getTime() : Date.now(),
189044
+ deploymentId: row.deploymentId || "",
189045
+ projectId: options.projectId,
189046
+ level: firstLog?.level || "info",
189047
+ message: firstLog?.message || "",
189048
+ messageTruncated: firstLog?.messageTruncated,
189049
+ source: firstEvent?.source || "static",
189050
+ domain: row.domain || "",
189051
+ requestMethod: row.requestMethod || "",
189052
+ requestPath: row.requestPath || "",
189053
+ responseStatusCode: row.statusCode || 0,
189054
+ environment: row.environment || "production",
189055
+ branch: row.branch,
189056
+ cache: row.cache,
189057
+ traceId: row.traceId
189058
+ };
189059
+ });
188723
189060
  return {
188724
- logs: data.rows || [],
189061
+ logs: logs2,
188725
189062
  pagination: {
188726
189063
  hasMore: data.hasMoreRows ?? false
188727
189064
  }
@@ -188881,6 +189218,11 @@ var init_logsv2 = __esm({
188881
189218
  });
188882
189219
  }
188883
189220
  }
189221
+ trackCliFlagExpand(v) {
189222
+ if (v) {
189223
+ this.trackCliFlag("expand");
189224
+ }
189225
+ }
188884
189226
  };
188885
189227
  }
188886
189228
  });
@@ -188890,6 +189232,78 @@ var logsv2_exports = {};
188890
189232
  __export3(logsv2_exports, {
188891
189233
  default: () => logsv2
188892
189234
  });
189235
+ function table2({
189236
+ columns,
189237
+ rows,
189238
+ tableWidth,
189239
+ formatHeader,
189240
+ formatRow
189241
+ }) {
189242
+ const zeroPad = [0, 0];
189243
+ const maxWidths = columns.map((col) => {
189244
+ const headerWidth = col.label.length;
189245
+ const maxContent = Math.max(
189246
+ headerWidth,
189247
+ ...rows.map((row) => col.getValue(row).length)
189248
+ );
189249
+ return maxContent;
189250
+ });
189251
+ const colPaddings = columns.map(
189252
+ (col) => col.padding ?? zeroPad
189253
+ );
189254
+ const finalWidths = [];
189255
+ let usedWidth = 0;
189256
+ let stretchIndex = -1;
189257
+ for (let i = 0; i < columns.length; i++) {
189258
+ const col = columns[i];
189259
+ const padding2 = colPaddings[i][0] + colPaddings[i][1];
189260
+ if (col.width === "stretch") {
189261
+ stretchIndex = i;
189262
+ finalWidths.push(0);
189263
+ } else if (typeof col.width === "number") {
189264
+ finalWidths.push(col.width);
189265
+ usedWidth += col.width + padding2;
189266
+ } else {
189267
+ finalWidths.push(maxWidths[i]);
189268
+ usedWidth += maxWidths[i] + padding2;
189269
+ }
189270
+ }
189271
+ usedWidth += (columns.length - 1) * 2;
189272
+ if (stretchIndex >= 0) {
189273
+ const stretchPadding = colPaddings[stretchIndex][0] + colPaddings[stretchIndex][1];
189274
+ finalWidths[stretchIndex] = Math.max(
189275
+ 10,
189276
+ tableWidth - usedWidth - stretchPadding
189277
+ );
189278
+ }
189279
+ const pad = (value, width) => {
189280
+ if (value.length > width) {
189281
+ return value.slice(0, width - 1) + "\u2026";
189282
+ }
189283
+ return value.padEnd(width);
189284
+ };
189285
+ const headerStr = columns.map((col, i) => {
189286
+ const padded = pad(col.label, finalWidths[i]);
189287
+ return " ".repeat(colPaddings[i][0]) + padded + " ".repeat(colPaddings[i][1]);
189288
+ }).join(" ");
189289
+ const header = formatHeader ? formatHeader(headerStr) : headerStr;
189290
+ const formattedRows = rows.map((row) => {
189291
+ const rowStr = columns.map((col, i) => {
189292
+ const value = col.getValue(row);
189293
+ const padded = pad(value, finalWidths[i]);
189294
+ const formatted = col.format ? col.format(padded, row) : padded;
189295
+ return " ".repeat(colPaddings[i][0]) + formatted + " ".repeat(colPaddings[i][1]);
189296
+ }).join(" ");
189297
+ return formatRow ? formatRow(rowStr, row) : rowStr;
189298
+ });
189299
+ return { header, rows: formattedRows };
189300
+ }
189301
+ function logsSpanMultipleDays(logs2) {
189302
+ if (logs2.length === 0)
189303
+ return false;
189304
+ const firstDay = new Date(logs2[0].timestamp).toDateString();
189305
+ return logs2.some((log2) => new Date(log2.timestamp).toDateString() !== firstDay);
189306
+ }
188893
189307
  function parseLevels(levels) {
188894
189308
  if (!levels)
188895
189309
  return [];
@@ -188947,6 +189361,7 @@ async function logsv2(client2) {
188947
189361
  const followOption = parsedArguments.flags["--follow"];
188948
189362
  const queryOption = parsedArguments.flags["--query"];
188949
189363
  const requestIdOption = parsedArguments.flags["--request-id"];
189364
+ const expandOption = parsedArguments.flags["--expand"];
188950
189365
  telemetry2.trackCliArgumentUrlOrDeploymentId(deploymentArgument);
188951
189366
  telemetry2.trackCliOptionProject(projectOption);
188952
189367
  telemetry2.trackCliOptionDeployment(deploymentFlag);
@@ -188961,6 +189376,7 @@ async function logsv2(client2) {
188961
189376
  telemetry2.trackCliFlagFollow(followOption);
188962
189377
  telemetry2.trackCliOptionQuery(queryOption);
188963
189378
  telemetry2.trackCliOptionRequestId(requestIdOption);
189379
+ telemetry2.trackCliFlagExpand(expandOption);
188964
189380
  if (followOption) {
188965
189381
  if (!deploymentOption) {
188966
189382
  output_manager_default.error(
@@ -188998,6 +189414,8 @@ async function logsv2(client2) {
188998
189414
  throw err;
188999
189415
  }
189000
189416
  let projectId;
189417
+ let projectSlug;
189418
+ let orgSlug;
189001
189419
  let ownerId;
189002
189420
  if (projectOption) {
189003
189421
  output_manager_default.spinner(`Fetching project "${projectOption}"`, 1e3);
@@ -189012,6 +189430,8 @@ async function logsv2(client2) {
189012
189430
  return 1;
189013
189431
  }
189014
189432
  projectId = project.id;
189433
+ projectSlug = project.name;
189434
+ orgSlug = contextName;
189015
189435
  ownerId = project.accountId;
189016
189436
  } else {
189017
189437
  const link4 = await getLinkedProject(client2);
@@ -189027,6 +189447,8 @@ async function logsv2(client2) {
189027
189447
  }
189028
189448
  client2.config.currentTeam = link4.org.type === "team" ? link4.org.id : void 0;
189029
189449
  projectId = link4.project.id;
189450
+ projectSlug = link4.project.name;
189451
+ orgSlug = link4.org.slug;
189030
189452
  ownerId = link4.org.id;
189031
189453
  }
189032
189454
  let deploymentId;
@@ -189056,7 +189478,7 @@ async function logsv2(client2) {
189056
189478
  if (followOption) {
189057
189479
  if (!jsonOption2) {
189058
189480
  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))}
189481
+ `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
189482
 
189061
189483
  `
189062
189484
  );
@@ -189104,15 +189526,9 @@ async function logsv2(client2) {
189104
189526
  }
189105
189527
  }
189106
189528
  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
189529
  output_manager_default.spinner("Fetching logs...", 1e3);
189115
- let count = 0;
189530
+ const terminalWidth = client2.stderr.isTTY ? client2.stderr.columns || 120 : 120;
189531
+ const logs2 = [];
189116
189532
  try {
189117
189533
  for await (const log2 of fetchAllRequestLogs(client2, {
189118
189534
  projectId,
@@ -189132,9 +189548,8 @@ async function logsv2(client2) {
189132
189548
  if (jsonOption2) {
189133
189549
  client2.stdout.write(JSON.stringify(log2) + "\n");
189134
189550
  } else {
189135
- prettyPrintLogEntry(log2);
189551
+ logs2.push(log2);
189136
189552
  }
189137
- count++;
189138
189553
  }
189139
189554
  } catch (err) {
189140
189555
  output_manager_default.stopSpinner();
@@ -189143,76 +189558,128 @@ async function logsv2(client2) {
189143
189558
  }
189144
189559
  output_manager_default.stopSpinner();
189145
189560
  if (!jsonOption2) {
189146
- if (count === 0) {
189561
+ if (logs2.length === 0) {
189147
189562
  output_manager_default.print(
189148
- import_chalk117.default.gray("No logs found matching the specified filters.\n")
189563
+ import_chalk117.default.dim(`No logs found for ${formatProject(orgSlug, projectSlug)}
189564
+ `)
189149
189565
  );
189150
189566
  } else {
189151
- output_manager_default.print(import_chalk117.default.gray(`
189152
- Displayed ${count} log entries.
189153
- `));
189567
+ const showDate = logsSpanMultipleDays(logs2);
189568
+ const timeFormat = showDate ? DATE_TIME_FORMAT2 : TIME_ONLY_FORMAT;
189569
+ const rowData = logs2.map((log2) => {
189570
+ const statusCode = log2.responseStatusCode;
189571
+ return {
189572
+ time: (0, import_date_fns3.format)(log2.timestamp, timeFormat),
189573
+ level: log2.level,
189574
+ path: `${getSourceIcon2(log2.source)} ${log2.requestMethod} ${log2.requestPath}`,
189575
+ status: !statusCode || statusCode <= 0 ? "---" : String(statusCode),
189576
+ statusCode,
189577
+ message: log2.message?.replace(/\n/g, " ").trim() || "",
189578
+ messageTruncated: log2.messageTruncated
189579
+ };
189580
+ });
189581
+ const baseColumns = [
189582
+ {
189583
+ label: "TIME",
189584
+ getValue: (row) => row.time,
189585
+ format: (padded) => import_chalk117.default.dim(padded)
189586
+ },
189587
+ {
189588
+ label: "LEVEL",
189589
+ getValue: (row) => row.level,
189590
+ format: (padded, row) => colorizeLevel(padded, row.level)
189591
+ },
189592
+ {
189593
+ label: "",
189594
+ padding: [0, 3],
189595
+ getValue: (row) => row.path
189596
+ }
189597
+ ];
189598
+ const columns = expandOption ? baseColumns : [
189599
+ ...baseColumns,
189600
+ {
189601
+ label: "STATUS",
189602
+ getValue: (row) => row.status,
189603
+ format: (padded, row) => row.statusCode <= 0 ? import_chalk117.default.gray(padded) : colorizeStatus(padded, row.statusCode)
189604
+ },
189605
+ {
189606
+ label: "MESSAGE",
189607
+ width: "stretch",
189608
+ getValue: (row) => row.message || "(no message)",
189609
+ format: (padded, row) => row.message ? colorizeMessage(padded, row.level) : import_chalk117.default.dim(padded)
189610
+ }
189611
+ ];
189612
+ const formatted = table2({
189613
+ columns,
189614
+ rows: rowData,
189615
+ tableWidth: terminalWidth,
189616
+ formatHeader: (header) => import_chalk117.default.dim(header),
189617
+ formatRow: expandOption ? (rowStr, row) => {
189618
+ if (row.message) {
189619
+ const coloredMessage = colorizeMessage(row.message, row.level);
189620
+ const truncatedIndicator = row.messageTruncated ? import_chalk117.default.gray("\u2026") : "";
189621
+ return `${rowStr}
189622
+ ${coloredMessage}${truncatedIndicator}
189623
+ `;
189624
+ }
189625
+ return rowStr + "\n";
189626
+ } : void 0
189627
+ });
189628
+ output_manager_default.print(formatted.header + "\n");
189629
+ for (const row of formatted.rows) {
189630
+ output_manager_default.print(row + "\n");
189631
+ }
189632
+ output_manager_default.print(
189633
+ import_chalk117.default.gray(
189634
+ `Fetched ${logs2.length} logs for ${formatProject(orgSlug, projectSlug)}
189635
+ `
189636
+ )
189637
+ );
189154
189638
  }
189155
189639
  }
189156
189640
  return 0;
189157
189641
  }
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) {
189642
+ function colorizeLevel(formatted, level) {
189181
189643
  switch (level) {
189182
189644
  case "fatal":
189645
+ return import_chalk117.default.red.bold(formatted);
189183
189646
  case "error":
189184
- return "\u{1F6AB}";
189647
+ return import_chalk117.default.red(formatted);
189185
189648
  case "warning":
189186
- return "\u26A0\uFE0F";
189649
+ return import_chalk117.default.yellow(formatted);
189187
189650
  default:
189188
- return "\u2139\uFE0F";
189651
+ return import_chalk117.default.dim(formatted);
189652
+ }
189653
+ }
189654
+ function colorizeStatus(formatted, statusCode) {
189655
+ if (statusCode >= 500) {
189656
+ return import_chalk117.default.red(formatted);
189657
+ } else if (statusCode >= 400) {
189658
+ return import_chalk117.default.yellow(formatted);
189659
+ } else if (statusCode >= 300) {
189660
+ return import_chalk117.default.cyan(formatted);
189661
+ } else if (statusCode >= 200) {
189662
+ return import_chalk117.default.green(formatted);
189189
189663
  }
189664
+ return import_chalk117.default.gray(formatted);
189190
189665
  }
189191
189666
  function getSourceIcon2(source) {
189192
189667
  switch (source) {
189668
+ case "serverless":
189669
+ case "lambda":
189670
+ return "\u03BB";
189193
189671
  case "edge-function":
189194
- return "\u0D28";
189195
189672
  case "edge-middleware":
189196
- return "\u025B";
189197
- case "serverless":
189198
- return "\u0192";
189673
+ case "middleware":
189674
+ return "\u03B5";
189675
+ case "static":
189676
+ case "external":
189677
+ case "redirect":
189678
+ return "\u25C7";
189199
189679
  default:
189200
189680
  return " ";
189201
189681
  }
189202
189682
  }
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
189683
  function colorizeMessage(message2, level) {
189217
189684
  switch (level) {
189218
189685
  case "fatal":
@@ -189221,10 +189688,10 @@ function colorizeMessage(message2, level) {
189221
189688
  case "warning":
189222
189689
  return import_chalk117.default.yellow(message2);
189223
189690
  default:
189224
- return message2;
189691
+ return import_chalk117.default.dim(message2);
189225
189692
  }
189226
189693
  }
189227
- var import_error_utils30, import_chalk117, import_date_fns3, DATE_TIME_FORMAT2;
189694
+ var import_error_utils30, import_chalk117, import_date_fns3, TIME_ONLY_FORMAT, DATE_TIME_FORMAT2;
189228
189695
  var init_logsv22 = __esm({
189229
189696
  "src/commands/logsv2/index.ts"() {
189230
189697
  "use strict";
@@ -189235,6 +189702,7 @@ var init_logsv22 = __esm({
189235
189702
  init_get_args();
189236
189703
  init_get_flags_specification();
189237
189704
  init_get_scope();
189705
+ init_format_project();
189238
189706
  init_get_project_by_id_or_name();
189239
189707
  init_link2();
189240
189708
  init_errors_ts();
@@ -189246,7 +189714,8 @@ var init_logsv22 = __esm({
189246
189714
  init_help();
189247
189715
  init_command26();
189248
189716
  init_output_manager();
189249
- DATE_TIME_FORMAT2 = "MMM dd HH:mm:ss.SS";
189717
+ TIME_ONLY_FORMAT = "HH:mm:ss.SS";
189718
+ DATE_TIME_FORMAT2 = "MMM DD HH:mm:ss.SS";
189250
189719
  }
189251
189720
  });
189252
189721
 
@@ -189891,7 +190360,7 @@ async function main14(client2) {
189891
190360
  printError(error3);
189892
190361
  return 1;
189893
190362
  }
189894
- let { subcommand, subcommandOriginal } = getSubcommand(
190363
+ let { subcommand, subcommandOriginal } = getSubcommand2(
189895
190364
  parsedArgs.args.slice(1),
189896
190365
  COMMAND_CONFIG15
189897
190366
  );
@@ -190244,7 +190713,7 @@ async function inspect4(client2, argv) {
190244
190713
  ` ${import_chalk120.default.cyan("Node.js Version")} ${project.nodeVersion}
190245
190714
  `
190246
190715
  );
190247
- const framework = import_frameworks8.frameworkList.find((f) => f.slug === project.framework);
190716
+ const framework = import_frameworks9.frameworkList.find((f) => f.slug === project.framework);
190248
190717
  output_manager_default.print("\n");
190249
190718
  output_manager_default.print(import_chalk120.default.bold(" Framework Settings\n\n"));
190250
190719
  output_manager_default.print(` ${import_chalk120.default.cyan("Framework Preset")} ${framework?.name}
@@ -190264,12 +190733,12 @@ async function inspect4(client2, argv) {
190264
190733
  output_manager_default.print("\n");
190265
190734
  return 0;
190266
190735
  }
190267
- var import_chalk120, import_frameworks8;
190736
+ var import_chalk120, import_frameworks9;
190268
190737
  var init_inspect6 = __esm({
190269
190738
  "src/commands/project/inspect.ts"() {
190270
190739
  "use strict";
190271
190740
  import_chalk120 = __toESM3(require_source(), 1);
190272
- import_frameworks8 = __toESM3(require_frameworks(), 1);
190741
+ import_frameworks9 = __toESM3(require_frameworks(), 1);
190273
190742
  init_pkg_name();
190274
190743
  init_inspect5();
190275
190744
  init_output_manager();
@@ -190661,7 +191130,7 @@ async function main15(client2) {
190661
191130
  printError(error3);
190662
191131
  return 1;
190663
191132
  }
190664
- let { subcommand, args: args2, subcommandOriginal } = getSubcommand(
191133
+ let { subcommand, args: args2, subcommandOriginal } = getSubcommand2(
190665
191134
  parsedArgs.args.slice(1),
190666
191135
  COMMAND_CONFIG16
190667
191136
  );
@@ -193133,7 +193602,7 @@ async function main16(client2) {
193133
193602
  return 1;
193134
193603
  }
193135
193604
  const subArgs = parsedArgs.args.slice(1);
193136
- const { subcommand, args: args2, subcommandOriginal } = getSubcommand(
193605
+ const { subcommand, args: args2, subcommandOriginal } = getSubcommand2(
193137
193606
  subArgs,
193138
193607
  COMMAND_CONFIG17
193139
193608
  );
@@ -194264,7 +194733,7 @@ async function rollingRelease(client2) {
194264
194733
  subcommand,
194265
194734
  args: subcommandArgs,
194266
194735
  subcommandOriginal
194267
- } = getSubcommand(client2.argv.slice(3), COMMAND_CONFIG18);
194736
+ } = getSubcommand2(client2.argv.slice(3), COMMAND_CONFIG18);
194268
194737
  const needHelp = client2.argv.includes("--help") || client2.argv.includes("-h");
194269
194738
  if (!subcommand && needHelp) {
194270
194739
  telemetry2.trackCliFlagHelp("rolling-release");
@@ -195511,7 +195980,7 @@ async function teams(client2) {
195511
195980
  if (parsedArgs.args[0] === "switch") {
195512
195981
  parsedArgs.args.unshift("teams");
195513
195982
  }
195514
- const { subcommand, args: args2, subcommandOriginal } = getSubcommand(
195983
+ const { subcommand, args: args2, subcommandOriginal } = getSubcommand2(
195515
195984
  parsedArgs.args.slice(1),
195516
195985
  COMMAND_CONFIG20
195517
195986
  );
@@ -195755,7 +196224,7 @@ async function telemetry(client2) {
195755
196224
  printError(err);
195756
196225
  return 1;
195757
196226
  }
195758
- const { subcommand, args: args2, subcommandOriginal } = getSubcommand(
196227
+ const { subcommand, args: args2, subcommandOriginal } = getSubcommand2(
195759
196228
  parsedArguments.args.slice(1),
195760
196229
  COMMAND_CONFIG21
195761
196230
  );
@@ -195932,6 +196401,776 @@ var init_upgrade3 = __esm({
195932
196401
  }
195933
196402
  });
195934
196403
 
196404
+ // src/util/webhooks/get-webhooks.ts
196405
+ async function getWebhooks(client2) {
196406
+ const response = await client2.fetch("/v1/webhooks");
196407
+ if (Array.isArray(response)) {
196408
+ return { webhooks: response };
196409
+ }
196410
+ return response;
196411
+ }
196412
+ var init_get_webhooks = __esm({
196413
+ "src/util/webhooks/get-webhooks.ts"() {
196414
+ "use strict";
196415
+ }
196416
+ });
196417
+
196418
+ // src/util/telemetry/commands/webhooks/ls.ts
196419
+ var WebhooksLsTelemetryClient;
196420
+ var init_ls10 = __esm({
196421
+ "src/util/telemetry/commands/webhooks/ls.ts"() {
196422
+ "use strict";
196423
+ init_telemetry();
196424
+ WebhooksLsTelemetryClient = class extends TelemetryClient {
196425
+ trackCliOptionFormat(format8) {
196426
+ if (format8) {
196427
+ this.trackCliOption({
196428
+ option: "format",
196429
+ value: format8
196430
+ });
196431
+ }
196432
+ }
196433
+ };
196434
+ }
196435
+ });
196436
+
196437
+ // src/commands/webhooks/ls.ts
196438
+ async function ls6(client2, argv) {
196439
+ const telemetry2 = new WebhooksLsTelemetryClient({
196440
+ opts: {
196441
+ store: client2.telemetryEventStore
196442
+ }
196443
+ });
196444
+ let parsedArgs;
196445
+ const flagsSpecification = getFlagsSpecification(listSubcommand13.options);
196446
+ try {
196447
+ parsedArgs = parseArguments(argv, flagsSpecification);
196448
+ } catch (error3) {
196449
+ printError(error3);
196450
+ return 1;
196451
+ }
196452
+ const { args: args2, flags: opts } = parsedArgs;
196453
+ const validationResult = validateLsArgs({
196454
+ commandName: "webhooks ls",
196455
+ args: args2,
196456
+ maxArgs: 0,
196457
+ exitCode: 2
196458
+ });
196459
+ if (validationResult !== 0) {
196460
+ return validationResult;
196461
+ }
196462
+ telemetry2.trackCliOptionFormat(opts["--format"]);
196463
+ const formatResult = validateJsonOutput(opts);
196464
+ if (!formatResult.valid) {
196465
+ output_manager_default.error(formatResult.error);
196466
+ return 1;
196467
+ }
196468
+ const asJson = formatResult.jsonOutput;
196469
+ const { contextName } = await getScope(client2);
196470
+ const lsStamp = stamp_default();
196471
+ output_manager_default.spinner(`Fetching Webhooks under ${import_chalk146.default.bold(contextName)}`);
196472
+ const { webhooks } = await getWebhooks(client2);
196473
+ if (asJson) {
196474
+ output_manager_default.stopSpinner();
196475
+ const jsonOutput = {
196476
+ webhooks: webhooks.map((webhook) => ({
196477
+ id: webhook.id,
196478
+ url: webhook.url,
196479
+ events: webhook.events,
196480
+ projectIds: webhook.projectIds,
196481
+ createdAt: webhook.createdAt,
196482
+ updatedAt: webhook.updatedAt
196483
+ }))
196484
+ };
196485
+ client2.stdout.write(`${JSON.stringify(jsonOutput, null, 2)}
196486
+ `);
196487
+ } else {
196488
+ output_manager_default.log(
196489
+ `${(0, import_pluralize16.default)("Webhook", webhooks.length, true)} found under ${import_chalk146.default.bold(
196490
+ contextName
196491
+ )} ${import_chalk146.default.gray(lsStamp())}`
196492
+ );
196493
+ if (webhooks.length > 0) {
196494
+ output_manager_default.print(
196495
+ formatWebhooksTable(webhooks).replace(/^(.*)/gm, `${" ".repeat(1)}$1`)
196496
+ );
196497
+ output_manager_default.print("\n\n");
196498
+ }
196499
+ }
196500
+ return 0;
196501
+ }
196502
+ function formatWebhooksTable(webhooks) {
196503
+ const current = Date.now();
196504
+ const rows = webhooks.map((webhook) => {
196505
+ const age = webhook.createdAt ? (0, import_ms34.default)(current - webhook.createdAt) : "-";
196506
+ const eventsDisplay = webhook.events.length > 2 ? `${webhook.events.slice(0, 2).join(", ")} +${webhook.events.length - 2}` : webhook.events.join(", ");
196507
+ return [webhook.id, webhook.url, eventsDisplay, import_chalk146.default.gray(age)];
196508
+ });
196509
+ return formatTable(
196510
+ ["ID", "URL", "Events", "Age"],
196511
+ ["l", "l", "l", "l"],
196512
+ [{ rows }]
196513
+ );
196514
+ }
196515
+ var import_ms34, import_chalk146, import_pluralize16;
196516
+ var init_ls11 = __esm({
196517
+ "src/commands/webhooks/ls.ts"() {
196518
+ "use strict";
196519
+ import_ms34 = __toESM3(require_ms(), 1);
196520
+ import_chalk146 = __toESM3(require_source(), 1);
196521
+ import_pluralize16 = __toESM3(require_pluralize(), 1);
196522
+ init_get_webhooks();
196523
+ init_get_scope();
196524
+ init_stamp();
196525
+ init_format_table();
196526
+ init_output_format();
196527
+ init_output_manager();
196528
+ init_ls10();
196529
+ init_command44();
196530
+ init_get_args();
196531
+ init_get_flags_specification();
196532
+ init_error2();
196533
+ init_validate_ls_args();
196534
+ }
196535
+ });
196536
+
196537
+ // src/util/webhooks/get-webhook.ts
196538
+ async function getWebhook(client2, webhookId) {
196539
+ return await client2.fetch(
196540
+ `/v1/webhooks/${encodeURIComponent(webhookId)}`
196541
+ );
196542
+ }
196543
+ var init_get_webhook = __esm({
196544
+ "src/util/webhooks/get-webhook.ts"() {
196545
+ "use strict";
196546
+ }
196547
+ });
196548
+
196549
+ // src/util/telemetry/commands/webhooks/get.ts
196550
+ var WebhooksGetTelemetryClient;
196551
+ var init_get = __esm({
196552
+ "src/util/telemetry/commands/webhooks/get.ts"() {
196553
+ "use strict";
196554
+ init_telemetry();
196555
+ WebhooksGetTelemetryClient = class extends TelemetryClient {
196556
+ trackCliArgumentId(id) {
196557
+ if (id) {
196558
+ this.trackCliArgument({
196559
+ arg: "id",
196560
+ value: this.redactedValue
196561
+ });
196562
+ }
196563
+ }
196564
+ trackCliOptionFormat(format8) {
196565
+ if (format8) {
196566
+ this.trackCliOption({
196567
+ option: "format",
196568
+ value: format8
196569
+ });
196570
+ }
196571
+ }
196572
+ };
196573
+ }
196574
+ });
196575
+
196576
+ // src/commands/webhooks/get.ts
196577
+ async function get(client2, argv) {
196578
+ const telemetry2 = new WebhooksGetTelemetryClient({
196579
+ opts: {
196580
+ store: client2.telemetryEventStore
196581
+ }
196582
+ });
196583
+ let parsedArgs;
196584
+ const flagsSpecification = getFlagsSpecification(getSubcommand.options);
196585
+ try {
196586
+ parsedArgs = parseArguments(argv, flagsSpecification);
196587
+ } catch (error3) {
196588
+ printError(error3);
196589
+ return 1;
196590
+ }
196591
+ const { args: args2, flags: opts } = parsedArgs;
196592
+ const [webhookId] = args2;
196593
+ const getStamp = stamp_default();
196594
+ if (!webhookId) {
196595
+ output_manager_default.error(`${getCommandName(`webhooks get <id>`)} expects one argument`);
196596
+ return 1;
196597
+ }
196598
+ telemetry2.trackCliArgumentId(webhookId);
196599
+ telemetry2.trackCliOptionFormat(opts["--format"]);
196600
+ const formatResult = validateJsonOutput(opts);
196601
+ if (!formatResult.valid) {
196602
+ output_manager_default.error(formatResult.error);
196603
+ return 1;
196604
+ }
196605
+ const asJson = formatResult.jsonOutput;
196606
+ if (args2.length !== 1) {
196607
+ output_manager_default.error(
196608
+ `Invalid number of arguments. Usage: ${import_chalk147.default.cyan(
196609
+ `${getCommandName("webhooks get <id>")}`
196610
+ )}`
196611
+ );
196612
+ return 1;
196613
+ }
196614
+ output_manager_default.debug(`Fetching webhook info`);
196615
+ const { contextName } = await getScope(client2);
196616
+ output_manager_default.spinner(
196617
+ `Fetching Webhook ${webhookId} under ${import_chalk147.default.bold(contextName)}`
196618
+ );
196619
+ let webhook;
196620
+ try {
196621
+ webhook = await getWebhook(client2, webhookId);
196622
+ } catch (err) {
196623
+ if (isAPIError(err) && err.status === 404) {
196624
+ output_manager_default.error(`Webhook not found: ${webhookId}`);
196625
+ output_manager_default.log(`Run ${getCommandName(`webhooks ls`)} to see your webhooks.`);
196626
+ return 1;
196627
+ }
196628
+ throw err;
196629
+ }
196630
+ if (asJson) {
196631
+ output_manager_default.stopSpinner();
196632
+ client2.stdout.write(`${JSON.stringify(webhook, null, 2)}
196633
+ `);
196634
+ } else {
196635
+ output_manager_default.log(
196636
+ `Webhook ${webhookId} found under ${import_chalk147.default.bold(contextName)} ${import_chalk147.default.gray(
196637
+ getStamp()
196638
+ )}`
196639
+ );
196640
+ output_manager_default.print("\n");
196641
+ output_manager_default.print(import_chalk147.default.bold(" General\n\n"));
196642
+ output_manager_default.print(` ${import_chalk147.default.cyan("ID")} ${webhook.id}
196643
+ `);
196644
+ output_manager_default.print(` ${import_chalk147.default.cyan("URL")} ${webhook.url}
196645
+ `);
196646
+ output_manager_default.print(
196647
+ ` ${import_chalk147.default.cyan("Created At")} ${formatDate(webhook.createdAt)}
196648
+ `
196649
+ );
196650
+ output_manager_default.print(
196651
+ ` ${import_chalk147.default.cyan("Updated At")} ${formatDate(webhook.updatedAt)}
196652
+ `
196653
+ );
196654
+ output_manager_default.print("\n");
196655
+ output_manager_default.print(import_chalk147.default.bold(" Events\n\n"));
196656
+ for (const event of webhook.events) {
196657
+ output_manager_default.print(` - ${event}
196658
+ `);
196659
+ }
196660
+ if (webhook.projectIds && webhook.projectIds.length > 0) {
196661
+ output_manager_default.print("\n");
196662
+ output_manager_default.print(import_chalk147.default.bold(" Projects\n\n"));
196663
+ if (webhook.projectsMetadata && webhook.projectsMetadata.length > 0) {
196664
+ for (const project of webhook.projectsMetadata) {
196665
+ output_manager_default.print(` - ${project.name} (${project.id})
196666
+ `);
196667
+ }
196668
+ } else {
196669
+ for (const projectId of webhook.projectIds) {
196670
+ output_manager_default.print(` - ${projectId}
196671
+ `);
196672
+ }
196673
+ }
196674
+ }
196675
+ output_manager_default.print("\n");
196676
+ }
196677
+ return 0;
196678
+ }
196679
+ var import_chalk147;
196680
+ var init_get2 = __esm({
196681
+ "src/commands/webhooks/get.ts"() {
196682
+ "use strict";
196683
+ import_chalk147 = __toESM3(require_source(), 1);
196684
+ init_stamp();
196685
+ init_format_date();
196686
+ init_get_webhook();
196687
+ init_get_scope();
196688
+ init_pkg_name();
196689
+ init_output_format();
196690
+ init_get();
196691
+ init_output_manager();
196692
+ init_command44();
196693
+ init_get_args();
196694
+ init_get_flags_specification();
196695
+ init_error2();
196696
+ init_errors_ts();
196697
+ }
196698
+ });
196699
+
196700
+ // src/util/webhooks/create-webhook.ts
196701
+ async function createWebhook(client2, payload) {
196702
+ return await client2.fetch("/v1/webhooks", {
196703
+ method: "POST",
196704
+ body: payload
196705
+ });
196706
+ }
196707
+ var init_create_webhook = __esm({
196708
+ "src/util/webhooks/create-webhook.ts"() {
196709
+ "use strict";
196710
+ }
196711
+ });
196712
+
196713
+ // src/util/telemetry/commands/webhooks/create.ts
196714
+ var WebhooksCreateTelemetryClient;
196715
+ var init_create = __esm({
196716
+ "src/util/telemetry/commands/webhooks/create.ts"() {
196717
+ "use strict";
196718
+ init_telemetry();
196719
+ WebhooksCreateTelemetryClient = class extends TelemetryClient {
196720
+ trackCliArgumentUrl(url3) {
196721
+ if (url3) {
196722
+ this.trackCliArgument({
196723
+ arg: "url",
196724
+ value: this.redactedValue
196725
+ });
196726
+ }
196727
+ }
196728
+ trackCliOptionEvent(events) {
196729
+ if (events && events.length > 0) {
196730
+ this.trackCliOption({
196731
+ option: "event",
196732
+ value: String(events.length)
196733
+ });
196734
+ }
196735
+ }
196736
+ trackCliOptionProject(projects) {
196737
+ if (projects && projects.length > 0) {
196738
+ this.trackCliOption({
196739
+ option: "project",
196740
+ value: String(projects.length)
196741
+ });
196742
+ }
196743
+ }
196744
+ };
196745
+ }
196746
+ });
196747
+
196748
+ // src/util/webhooks/get-webhook-events.ts
196749
+ async function getWebhookEvents() {
196750
+ if (cachedEvents) {
196751
+ return cachedEvents;
196752
+ }
196753
+ const cache = new OpenApiCache();
196754
+ const loaded = await cache.load();
196755
+ if (!loaded) {
196756
+ output_manager_default.debug("Failed to load OpenAPI spec for webhook events");
196757
+ return [];
196758
+ }
196759
+ const endpoints = cache.getEndpoints();
196760
+ const createWebhookEndpoint = endpoints.find(
196761
+ (e2) => e2.path === "/v1/webhooks" && e2.method === "POST"
196762
+ );
196763
+ if (!createWebhookEndpoint) {
196764
+ output_manager_default.debug("Could not find POST /v1/webhooks endpoint in OpenAPI spec");
196765
+ return [];
196766
+ }
196767
+ const bodyFields = cache.getBodyFields(createWebhookEndpoint);
196768
+ const eventsField = bodyFields.find((f) => f.name === "events");
196769
+ if (!eventsField?.enumValues) {
196770
+ output_manager_default.debug("Could not find events enum in webhook endpoint");
196771
+ return [];
196772
+ }
196773
+ cachedEvents = eventsField.enumValues.filter(
196774
+ (v) => typeof v === "string"
196775
+ );
196776
+ return cachedEvents;
196777
+ }
196778
+ async function validateWebhookEvents(events) {
196779
+ const validEvents = await getWebhookEvents();
196780
+ if (validEvents.length === 0) {
196781
+ return [];
196782
+ }
196783
+ const validSet = new Set(validEvents);
196784
+ return events.filter((e2) => !validSet.has(e2));
196785
+ }
196786
+ var cachedEvents;
196787
+ var init_get_webhook_events = __esm({
196788
+ "src/util/webhooks/get-webhook-events.ts"() {
196789
+ "use strict";
196790
+ init_openapi();
196791
+ init_output_manager();
196792
+ cachedEvents = null;
196793
+ }
196794
+ });
196795
+
196796
+ // src/commands/webhooks/create.ts
196797
+ async function create(client2, argv) {
196798
+ const telemetry2 = new WebhooksCreateTelemetryClient({
196799
+ opts: {
196800
+ store: client2.telemetryEventStore
196801
+ }
196802
+ });
196803
+ let parsedArgs;
196804
+ const flagsSpecification = getFlagsSpecification(createSubcommand.options);
196805
+ try {
196806
+ parsedArgs = parseArguments(argv, flagsSpecification);
196807
+ } catch (error3) {
196808
+ printError(error3);
196809
+ return 1;
196810
+ }
196811
+ const { args: args2, flags: opts } = parsedArgs;
196812
+ const [url3] = args2;
196813
+ telemetry2.trackCliArgumentUrl(url3);
196814
+ if (!url3) {
196815
+ output_manager_default.error(
196816
+ `${getCommandName(`webhooks create <url>`)} expects one argument`
196817
+ );
196818
+ return 1;
196819
+ }
196820
+ try {
196821
+ const urlObj = new URL(url3);
196822
+ if (!["http:", "https:"].includes(urlObj.protocol)) {
196823
+ output_manager_default.error("Webhook URL must use http or https protocol");
196824
+ return 1;
196825
+ }
196826
+ } catch {
196827
+ output_manager_default.error(`Invalid URL: ${url3}`);
196828
+ return 1;
196829
+ }
196830
+ const events = opts["--event"];
196831
+ const projectIds = opts["--project"];
196832
+ if (!events || events.length === 0) {
196833
+ output_manager_default.error(
196834
+ `At least one event is required. Use ${import_chalk148.default.cyan("--event <event>")} to specify events.`
196835
+ );
196836
+ output_manager_default.log(
196837
+ `Example: ${getCommandName(
196838
+ "webhooks create https://example.com/webhook --event deployment.created"
196839
+ )}`
196840
+ );
196841
+ return 1;
196842
+ }
196843
+ const invalidEvents = await validateWebhookEvents(events);
196844
+ if (invalidEvents.length > 0) {
196845
+ output_manager_default.error(
196846
+ `Invalid event type${invalidEvents.length > 1 ? "s" : ""}: ${invalidEvents.join(", ")}`
196847
+ );
196848
+ return 1;
196849
+ }
196850
+ telemetry2.trackCliOptionEvent(events);
196851
+ telemetry2.trackCliOptionProject(projectIds);
196852
+ const { contextName } = await getScope(client2);
196853
+ const createStamp = stamp_default();
196854
+ output_manager_default.spinner(`Creating webhook under ${import_chalk148.default.bold(contextName)}`);
196855
+ try {
196856
+ const webhook = await createWebhook(client2, {
196857
+ url: url3,
196858
+ events,
196859
+ projectIds
196860
+ });
196861
+ output_manager_default.success(
196862
+ `Webhook created: ${import_chalk148.default.bold(webhook.id)} ${createStamp()}`
196863
+ );
196864
+ output_manager_default.print("\n");
196865
+ output_manager_default.print(import_chalk148.default.bold(" Webhook Details\n\n"));
196866
+ output_manager_default.print(` ${import_chalk148.default.cyan("ID")} ${webhook.id}
196867
+ `);
196868
+ output_manager_default.print(` ${import_chalk148.default.cyan("URL")} ${webhook.url}
196869
+ `);
196870
+ output_manager_default.print(
196871
+ ` ${import_chalk148.default.cyan("Events")} ${webhook.events.join(", ")}
196872
+ `
196873
+ );
196874
+ if (webhook.projectIds && webhook.projectIds.length > 0) {
196875
+ output_manager_default.print(
196876
+ ` ${import_chalk148.default.cyan("Projects")} ${webhook.projectIds.join(", ")}
196877
+ `
196878
+ );
196879
+ }
196880
+ output_manager_default.print("\n");
196881
+ output_manager_default.warn(
196882
+ `Save this secret - it will not be shown again: ${import_chalk148.default.bold(webhook.secret)}`
196883
+ );
196884
+ output_manager_default.print("\n");
196885
+ return 0;
196886
+ } catch (err) {
196887
+ if (isAPIError(err)) {
196888
+ if (err.code === "invalid_url") {
196889
+ output_manager_default.error(`Invalid webhook URL: ${url3}`);
196890
+ return 1;
196891
+ }
196892
+ if (err.code === "invalid_event") {
196893
+ output_manager_default.error(`Invalid event type. Please check the event names.`);
196894
+ return 1;
196895
+ }
196896
+ output_manager_default.error(err.message);
196897
+ return 1;
196898
+ }
196899
+ throw err;
196900
+ }
196901
+ }
196902
+ var import_chalk148;
196903
+ var init_create2 = __esm({
196904
+ "src/commands/webhooks/create.ts"() {
196905
+ "use strict";
196906
+ import_chalk148 = __toESM3(require_source(), 1);
196907
+ init_create_webhook();
196908
+ init_get_scope();
196909
+ init_stamp();
196910
+ init_pkg_name();
196911
+ init_output_manager();
196912
+ init_create();
196913
+ init_command44();
196914
+ init_get_args();
196915
+ init_get_flags_specification();
196916
+ init_error2();
196917
+ init_errors_ts();
196918
+ init_get_webhook_events();
196919
+ }
196920
+ });
196921
+
196922
+ // src/util/webhooks/delete-webhook.ts
196923
+ async function deleteWebhook(client2, webhookId) {
196924
+ await client2.fetch(`/v1/webhooks/${encodeURIComponent(webhookId)}`, {
196925
+ method: "DELETE"
196926
+ });
196927
+ }
196928
+ var init_delete_webhook = __esm({
196929
+ "src/util/webhooks/delete-webhook.ts"() {
196930
+ "use strict";
196931
+ }
196932
+ });
196933
+
196934
+ // src/util/telemetry/commands/webhooks/rm.ts
196935
+ var WebhooksRmTelemetryClient;
196936
+ var init_rm11 = __esm({
196937
+ "src/util/telemetry/commands/webhooks/rm.ts"() {
196938
+ "use strict";
196939
+ init_telemetry();
196940
+ WebhooksRmTelemetryClient = class extends TelemetryClient {
196941
+ trackCliArgumentId(id) {
196942
+ if (id) {
196943
+ this.trackCliArgument({
196944
+ arg: "id",
196945
+ value: this.redactedValue
196946
+ });
196947
+ }
196948
+ }
196949
+ trackCliFlagYes(yes) {
196950
+ if (yes) {
196951
+ this.trackCliFlag("yes");
196952
+ }
196953
+ }
196954
+ };
196955
+ }
196956
+ });
196957
+
196958
+ // src/commands/webhooks/rm.ts
196959
+ async function rm7(client2, argv) {
196960
+ const telemetry2 = new WebhooksRmTelemetryClient({
196961
+ opts: {
196962
+ store: client2.telemetryEventStore
196963
+ }
196964
+ });
196965
+ let parsedArgs;
196966
+ const flagsSpecification = getFlagsSpecification(removeSubcommand10.options);
196967
+ try {
196968
+ parsedArgs = parseArguments(argv, flagsSpecification);
196969
+ } catch (error3) {
196970
+ printError(error3);
196971
+ return 1;
196972
+ }
196973
+ const { args: args2, flags: opts } = parsedArgs;
196974
+ const [webhookId] = args2;
196975
+ telemetry2.trackCliArgumentId(webhookId);
196976
+ telemetry2.trackCliFlagYes(opts["--yes"]);
196977
+ if (!webhookId) {
196978
+ output_manager_default.error(`${getCommandName(`webhooks rm <id>`)} expects one argument`);
196979
+ return 1;
196980
+ }
196981
+ const { contextName } = await getScope(client2);
196982
+ if (args2.length !== 1) {
196983
+ output_manager_default.error(
196984
+ `Invalid number of arguments. Usage: ${import_chalk149.default.cyan(
196985
+ `${getCommandName("webhooks rm <id>")}`
196986
+ )}`
196987
+ );
196988
+ return 1;
196989
+ }
196990
+ output_manager_default.spinner(`Fetching webhook ${webhookId}`);
196991
+ let webhook;
196992
+ try {
196993
+ webhook = await getWebhook(client2, webhookId);
196994
+ } catch (err) {
196995
+ if (isAPIError(err) && err.status === 404) {
196996
+ output_manager_default.error(`Webhook not found: ${webhookId}`);
196997
+ output_manager_default.log(`Run ${getCommandName(`webhooks ls`)} to see your webhooks.`);
196998
+ return 1;
196999
+ }
197000
+ throw err;
197001
+ }
197002
+ output_manager_default.stopSpinner();
197003
+ const skipConfirmation = opts["--yes"] || false;
197004
+ if (!skipConfirmation && !await client2.input.confirm(
197005
+ `Are you sure you want to remove webhook ${param(webhookId)} (${webhook.url})?`,
197006
+ false
197007
+ )) {
197008
+ output_manager_default.log("Canceled");
197009
+ return 0;
197010
+ }
197011
+ const removeStamp = stamp_default();
197012
+ output_manager_default.spinner(`Removing webhook under ${import_chalk149.default.bold(contextName)}`);
197013
+ try {
197014
+ await deleteWebhook(client2, webhookId);
197015
+ output_manager_default.success(`Webhook ${import_chalk149.default.bold(webhookId)} removed ${removeStamp()}`);
197016
+ return 0;
197017
+ } catch (err) {
197018
+ if (isAPIError(err) && err.status === 404) {
197019
+ output_manager_default.error(`Webhook not found: ${webhookId}`);
197020
+ return 1;
197021
+ }
197022
+ throw err;
197023
+ }
197024
+ }
197025
+ var import_chalk149;
197026
+ var init_rm12 = __esm({
197027
+ "src/commands/webhooks/rm.ts"() {
197028
+ "use strict";
197029
+ import_chalk149 = __toESM3(require_source(), 1);
197030
+ init_delete_webhook();
197031
+ init_get_webhook();
197032
+ init_get_scope();
197033
+ init_stamp();
197034
+ init_param();
197035
+ init_pkg_name();
197036
+ init_output_manager();
197037
+ init_rm11();
197038
+ init_command44();
197039
+ init_get_args();
197040
+ init_get_flags_specification();
197041
+ init_error2();
197042
+ init_errors_ts();
197043
+ }
197044
+ });
197045
+
197046
+ // src/util/telemetry/commands/webhooks/index.ts
197047
+ var WebhooksTelemetryClient;
197048
+ var init_webhooks = __esm({
197049
+ "src/util/telemetry/commands/webhooks/index.ts"() {
197050
+ "use strict";
197051
+ init_telemetry();
197052
+ WebhooksTelemetryClient = class extends TelemetryClient {
197053
+ trackCliSubcommandCreate(actual) {
197054
+ this.trackCliSubcommand({
197055
+ subcommand: "create",
197056
+ value: actual
197057
+ });
197058
+ }
197059
+ trackCliSubcommandGet(actual) {
197060
+ this.trackCliSubcommand({
197061
+ subcommand: "get",
197062
+ value: actual
197063
+ });
197064
+ }
197065
+ trackCliSubcommandRemove(actual) {
197066
+ this.trackCliSubcommand({
197067
+ subcommand: "remove",
197068
+ value: actual
197069
+ });
197070
+ }
197071
+ trackCliSubcommandList(actual) {
197072
+ this.trackCliSubcommand({
197073
+ subcommand: "list",
197074
+ value: actual
197075
+ });
197076
+ }
197077
+ };
197078
+ }
197079
+ });
197080
+
197081
+ // src/commands/webhooks/index.ts
197082
+ var webhooks_exports = {};
197083
+ __export3(webhooks_exports, {
197084
+ default: () => main18
197085
+ });
197086
+ async function main18(client2) {
197087
+ let parsedArgs;
197088
+ const flagsSpecification = getFlagsSpecification(webhooksCommand.options);
197089
+ try {
197090
+ parsedArgs = parseArguments(client2.argv.slice(2), flagsSpecification, {
197091
+ permissive: true
197092
+ });
197093
+ } catch (error3) {
197094
+ printError(error3);
197095
+ return 1;
197096
+ }
197097
+ const telemetry2 = new WebhooksTelemetryClient({
197098
+ opts: {
197099
+ store: client2.telemetryEventStore
197100
+ }
197101
+ });
197102
+ const { subcommand, args: args2, subcommandOriginal } = getSubcommand2(
197103
+ parsedArgs.args.slice(1),
197104
+ COMMAND_CONFIG22
197105
+ );
197106
+ const needHelp = parsedArgs.flags["--help"];
197107
+ if (!subcommand && needHelp) {
197108
+ telemetry2.trackCliFlagHelp("webhooks");
197109
+ output_manager_default.print(help(webhooksCommand, { columns: client2.stderr.columns }));
197110
+ return 2;
197111
+ }
197112
+ function printHelp(command) {
197113
+ output_manager_default.print(
197114
+ help(command, { parent: webhooksCommand, columns: client2.stderr.columns })
197115
+ );
197116
+ return 2;
197117
+ }
197118
+ switch (subcommand) {
197119
+ case "create":
197120
+ if (needHelp) {
197121
+ telemetry2.trackCliFlagHelp("webhooks", subcommandOriginal);
197122
+ return printHelp(createSubcommand);
197123
+ }
197124
+ telemetry2.trackCliSubcommandCreate(subcommandOriginal);
197125
+ return create(client2, args2);
197126
+ case "get":
197127
+ if (needHelp) {
197128
+ telemetry2.trackCliFlagHelp("webhooks", subcommandOriginal);
197129
+ return printHelp(getSubcommand);
197130
+ }
197131
+ telemetry2.trackCliSubcommandGet(subcommandOriginal);
197132
+ return get(client2, args2);
197133
+ case "rm":
197134
+ if (needHelp) {
197135
+ telemetry2.trackCliFlagHelp("webhooks", subcommandOriginal);
197136
+ return printHelp(removeSubcommand10);
197137
+ }
197138
+ telemetry2.trackCliSubcommandRemove(subcommandOriginal);
197139
+ return rm7(client2, args2);
197140
+ default:
197141
+ if (needHelp) {
197142
+ telemetry2.trackCliFlagHelp("webhooks", subcommandOriginal);
197143
+ return printHelp(listSubcommand13);
197144
+ }
197145
+ telemetry2.trackCliSubcommandList(subcommandOriginal);
197146
+ return ls6(client2, args2);
197147
+ }
197148
+ }
197149
+ var COMMAND_CONFIG22;
197150
+ var init_webhooks2 = __esm({
197151
+ "src/commands/webhooks/index.ts"() {
197152
+ "use strict";
197153
+ init_get_args();
197154
+ init_get_subcommand();
197155
+ init_error2();
197156
+ init_ls11();
197157
+ init_get2();
197158
+ init_create2();
197159
+ init_rm12();
197160
+ init_command44();
197161
+ init_help();
197162
+ init_get_flags_specification();
197163
+ init_webhooks();
197164
+ init_output_manager();
197165
+ COMMAND_CONFIG22 = {
197166
+ create: ["create", "add"],
197167
+ get: ["get", "inspect"],
197168
+ ls: ["ls", "list"],
197169
+ rm: ["rm", "remove", "delete"]
197170
+ };
197171
+ }
197172
+ });
197173
+
195935
197174
  // src/util/telemetry/commands/whoami/index.ts
195936
197175
  var WhoamiTelemetryClient;
195937
197176
  var init_whoami = __esm({
@@ -196009,7 +197248,7 @@ var init_whoami2 = __esm({
196009
197248
  // src/index.ts
196010
197249
  var import_error_utils38 = __toESM3(require_dist2(), 1);
196011
197250
  var import_fs_extra24 = __toESM3(require_lib(), 1);
196012
- var import_chalk146 = __toESM3(require_source(), 1);
197251
+ var import_chalk150 = __toESM3(require_source(), 1);
196013
197252
  var import_epipebomb = __toESM3(require_epipebomb(), 1);
196014
197253
  import { join as join25 } from "path";
196015
197254
  import { existsSync as existsSync5 } from "fs";
@@ -196718,6 +197957,12 @@ var RootTelemetryClient = class extends TelemetryClient {
196718
197957
  value: actual
196719
197958
  });
196720
197959
  }
197960
+ trackCliCommandWebhooks(actual) {
197961
+ this.trackCliCommand({
197962
+ command: "webhooks",
197963
+ value: actual
197964
+ });
197965
+ }
196721
197966
  trackCPUs() {
196722
197967
  super.trackCPUs();
196723
197968
  }
@@ -196854,6 +198099,7 @@ var help2 = () => `
196854
198099
  upgrade Upgrade the Vercel CLI to the latest version
196855
198100
  whoami Shows the username of the currently logged in user
196856
198101
  blob [cmd] Manages your Blob stores and files
198102
+ webhooks [cmd] Manages webhooks [beta]
196857
198103
 
196858
198104
  ${import_chalk29.default.dim("Global Options:")}
196859
198105
 
@@ -197012,7 +198258,7 @@ process.on("unhandledRejection", handleRejection);
197012
198258
  process.on("uncaughtException", handleUnexpected);
197013
198259
  var { isTTY: isTTY2 } = process.stdout;
197014
198260
  var apiUrl = "https://api.vercel.com";
197015
- var main18 = async () => {
198261
+ var main19 = async () => {
197016
198262
  if (process.env.FORCE_TTY === "1") {
197017
198263
  isTTY2 = true;
197018
198264
  process.stdout.isTTY = true;
@@ -197060,16 +198306,16 @@ var main18 = async () => {
197060
198306
  }
197061
198307
  const targetOrSubcommand = parsedArgs.args[2];
197062
198308
  const subSubCommand = parsedArgs.args[3];
197063
- const betaCommands = ["api", "curl"];
198309
+ const betaCommands = ["api", "curl", "webhooks"];
197064
198310
  if (betaCommands.includes(targetOrSubcommand)) {
197065
198311
  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`
198312
+ `${import_chalk150.default.grey(
198313
+ `${getTitleName()} CLI ${pkg_default.version} | ${import_chalk150.default.bold(targetOrSubcommand)} is in beta \u2014 https://vercel.com/feedback`
197068
198314
  )}
197069
198315
  `
197070
198316
  );
197071
198317
  } else {
197072
- output_manager_default.print(`${import_chalk146.default.grey(`${getTitleName()} CLI ${pkg_default.version}`)}
198318
+ output_manager_default.print(`${import_chalk150.default.grey(`${getTitleName()} CLI ${pkg_default.version}`)}
197073
198319
  `);
197074
198320
  }
197075
198321
  if (!targetOrSubcommand && parsedArgs.flags["--version"]) {
@@ -197573,6 +198819,10 @@ var main18 = async () => {
197573
198819
  telemetry2.trackCliCommandUpgrade(userSuppliedSubCommand);
197574
198820
  func = (init_upgrade3(), __toCommonJS3(upgrade_exports)).default;
197575
198821
  break;
198822
+ case "webhooks":
198823
+ telemetry2.trackCliCommandWebhooks(userSuppliedSubCommand);
198824
+ func = (init_webhooks2(), __toCommonJS3(webhooks_exports)).default;
198825
+ break;
197576
198826
  case "whoami":
197577
198827
  telemetry2.trackCliCommandWhoami(userSuppliedSubCommand);
197578
198828
  func = (init_whoami2(), __toCommonJS3(whoami_exports)).default;
@@ -197647,24 +198897,25 @@ var main18 = async () => {
197647
198897
  await telemetryEventStore.save();
197648
198898
  return exitCode2;
197649
198899
  };
197650
- main18().then(async (exitCode2) => {
197651
- if (!process.env.NO_UPDATE_NOTIFIER) {
198900
+ main19().then(async (exitCode2) => {
198901
+ const shouldCheckForUpdates = !process.env.NO_UPDATE_NOTIFIER && !process.env.VERCEL;
198902
+ if (shouldCheckForUpdates) {
197652
198903
  const latest = getLatestVersion({
197653
198904
  pkg: pkg_default
197654
198905
  });
197655
198906
  if (latest) {
197656
- const changelog = "https://github.com/vercel/vercel/releases";
198907
+ const changelog = `https://github.com/vercel/vercel/releases/tag/vercel%40${latest}`;
197657
198908
  if (isTTY2) {
197658
- const errorMsg = exitCode2 && exitCode2 !== 2 ? import_chalk146.default.magenta(
197659
- ` The latest update ${import_chalk146.default.italic(
198909
+ const errorMsg = exitCode2 && exitCode2 !== 2 ? import_chalk150.default.magenta(
198910
+ ` The latest update ${import_chalk150.default.italic(
197660
198911
  "may"
197661
198912
  )} fix any errors that occurred.`
197662
198913
  ) : "";
197663
198914
  output_manager_default.print(
197664
198915
  `
197665
- Update available for Vercel CLI (${import_chalk146.default.gray(
198916
+ Update available for Vercel CLI (${import_chalk150.default.gray(
197666
198917
  `v${pkg_default.version}`
197667
- )} \u2192 ${import_chalk146.default.green(`v${latest}`)})${errorMsg}
198918
+ )} \u2192 ${import_chalk150.default.green(`v${latest}`)})${errorMsg}
197668
198919
  `
197669
198920
  );
197670
198921
  const action = await client.input.expand({
@@ -197684,20 +198935,20 @@ Update available for Vercel CLI (${import_chalk146.default.gray(
197684
198935
  await (0, import_open9.default)(changelog);
197685
198936
  }
197686
198937
  } else {
197687
- const errorMsg = exitCode2 && exitCode2 !== 2 ? import_chalk146.default.magenta(
198938
+ const errorMsg = exitCode2 && exitCode2 !== 2 ? import_chalk150.default.magenta(
197688
198939
  `
197689
198940
 
197690
- The latest update ${import_chalk146.default.italic(
198941
+ The latest update ${import_chalk150.default.italic(
197691
198942
  "may"
197692
198943
  )} fix any errors that occurred.`
197693
198944
  ) : "";
197694
198945
  output_manager_default.print(
197695
198946
  box(
197696
- `Update available! ${import_chalk146.default.gray(`v${pkg_default.version}`)} \u226B ${import_chalk146.default.green(
198947
+ `Update available! ${import_chalk150.default.gray(`v${pkg_default.version}`)} \u226B ${import_chalk150.default.green(
197697
198948
  `v${latest}`
197698
198949
  )}
197699
198950
  Changelog: ${output_manager_default.link(changelog, changelog, { fallback: false })}
197700
- Run ${import_chalk146.default.cyan(cmd(await getUpdateCommand()))} to update.${errorMsg}`
198951
+ Run ${import_chalk150.default.cyan(cmd(await getUpdateCommand()))} to update.${errorMsg}`
197701
198952
  )
197702
198953
  );
197703
198954
  output_manager_default.print("\n");