vercel 47.0.2 → 47.0.4

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 +10 -68
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -94419,13 +94419,6 @@ var init_telemetry = __esm({
94419
94419
  value: this.redactedValue
94420
94420
  });
94421
94421
  }
94422
- trackLoginState(state) {
94423
- if (state === "started")
94424
- this.loginAttempt = (0, import_node_crypto.randomUUID)();
94425
- this.track({ key: `login:attempt:${this.loginAttempt}`, value: state });
94426
- if (state !== "started")
94427
- this.loginAttempt = void 0;
94428
- }
94429
94422
  trackCliFlagHelp(command, subcommands) {
94430
94423
  let subcommand;
94431
94424
  if (subcommands) {
@@ -179463,16 +179456,6 @@ var init_login2 = __esm({
179463
179456
  "use strict";
179464
179457
  init_telemetry();
179465
179458
  LoginTelemetryClient = class extends TelemetryClient {
179466
- /**
179467
- * Tracks the state of the login process.
179468
- * - `started` when the user initiates the login process.
179469
- * - `canceled` when the user cancels the login process.
179470
- * - `error` when the user encounters an error during the login process.
179471
- * - `success` when the user successfully logs in.
179472
- */
179473
- trackState(...args2) {
179474
- this.trackLoginState(...args2);
179475
- }
179476
179459
  };
179477
179460
  }
179478
179461
  });
@@ -179486,7 +179469,7 @@ async function login2(client2) {
179486
179469
  const [deviceAuthorizationError, deviceAuthorization] = await processDeviceAuthorizationResponse(deviceAuthorizationResponse);
179487
179470
  if (deviceAuthorizationError) {
179488
179471
  printError(deviceAuthorizationError);
179489
- return "error";
179472
+ return 1;
179490
179473
  }
179491
179474
  const {
179492
179475
  device_code,
@@ -179496,15 +179479,10 @@ async function login2(client2) {
179496
179479
  expiresAt,
179497
179480
  interval
179498
179481
  } = deviceAuthorization;
179499
- let canceled = false;
179500
- const handleCancel = () => {
179501
- canceled = true;
179502
- rl.close();
179503
- };
179504
179482
  const rl = import_node_readline.default.createInterface({
179505
179483
  input: process.stdin,
179506
179484
  output: process.stdout
179507
- }).on("SIGINT", handleCancel);
179485
+ }).on("SIGINT", () => process.exit(0));
179508
179486
  rl.question(
179509
179487
  `
179510
179488
  Visit ${import_chalk107.default.bold(
@@ -179517,41 +179495,20 @@ async function login2(client2) {
179517
179495
  ${import_chalk107.default.grey("Press [ENTER] to open the browser")}
179518
179496
  `,
179519
179497
  () => {
179520
- if (canceled)
179521
- return;
179522
179498
  open6.default(verification_uri_complete);
179523
179499
  output_manager_default.print((0, import_ansi_escapes6.eraseLines)(2));
179524
179500
  output_manager_default.spinner("Waiting for authentication...");
179525
- if (!canceled) {
179526
- rl.close();
179527
- }
179501
+ rl.close();
179528
179502
  }
179529
179503
  );
179530
- if (canceled) {
179531
- rl.off("SIGINT", handleCancel);
179532
- return "canceled";
179533
- }
179534
179504
  output_manager_default.spinner("Waiting for authentication...");
179535
179505
  let intervalMs = interval * 1e3;
179536
179506
  let error3 = new Error(
179537
179507
  "Timed out waiting for authentication. Please try again."
179538
179508
  );
179539
179509
  async function pollForToken() {
179540
- while (Date.now() < expiresAt && !canceled) {
179541
- await new Promise((resolve13) => {
179542
- const timeoutId = setTimeout(resolve13, intervalMs);
179543
- const checkCancellation = () => {
179544
- if (canceled) {
179545
- clearTimeout(timeoutId);
179546
- resolve13();
179547
- } else {
179548
- setTimeout(checkCancellation, 50);
179549
- }
179550
- };
179551
- checkCancellation();
179552
- });
179553
- if (canceled)
179554
- break;
179510
+ while (Date.now() < expiresAt) {
179511
+ await new Promise((resolve13) => setTimeout(resolve13, intervalMs));
179555
179512
  const [tokenResponseError, tokenResponse] = await deviceAccessTokenRequest({ device_code });
179556
179513
  if (tokenResponseError) {
179557
179514
  if (tokenResponseError.message.includes("timeout")) {
@@ -179613,16 +179570,11 @@ async function login2(client2) {
179613
179570
  }
179614
179571
  error3 = await pollForToken();
179615
179572
  output_manager_default.stopSpinner();
179616
- rl.off("SIGINT", handleCancel);
179617
179573
  rl.close();
179618
- if (canceled) {
179619
- return "canceled";
179620
- }
179621
- if (!error3) {
179622
- return "success";
179623
- }
179574
+ if (!error3)
179575
+ return 0;
179624
179576
  printError(error3);
179625
- return "error";
179577
+ return 1;
179626
179578
  }
179627
179579
  var import_node_readline, import_chalk107, open6, import_ansi_escapes6;
179628
179580
  var init_future = __esm({
@@ -179654,8 +179606,7 @@ async function login3(client2) {
179654
179606
  const flagsSpecification = getFlagsSpecification(loginCommand.options);
179655
179607
  const telemetry2 = new LoginTelemetryClient({
179656
179608
  opts: {
179657
- store: client2.telemetryEventStore,
179658
- isDebug: output_manager_default.isDebugEnabled()
179609
+ store: client2.telemetryEventStore
179659
179610
  }
179660
179611
  });
179661
179612
  try {
@@ -179666,16 +179617,7 @@ async function login3(client2) {
179666
179617
  }
179667
179618
  if (parsedArgs.flags["--future"]) {
179668
179619
  telemetry2.trackCliFlagFuture("login");
179669
- telemetry2.trackState("started");
179670
- const status3 = await login2(client2);
179671
- telemetry2.trackState(status3);
179672
- switch (status3) {
179673
- case "canceled":
179674
- case "success":
179675
- return 0;
179676
- case "error":
179677
- return 1;
179678
- }
179620
+ return await login2(client2);
179679
179621
  }
179680
179622
  if (parsedArgs.flags["--help"]) {
179681
179623
  telemetry2.trackCliFlagHelp("login");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vercel",
3
- "version": "47.0.2",
3
+ "version": "47.0.4",
4
4
  "preferGlobal": true,
5
5
  "license": "Apache-2.0",
6
6
  "description": "The command-line interface for Vercel",
@@ -18,7 +18,7 @@
18
18
  "dist"
19
19
  ],
20
20
  "engines": {
21
- "node": ">= 20"
21
+ "node": ">= 18"
22
22
  },
23
23
  "dependencies": {
24
24
  "@vercel/blob": "1.0.2",
@@ -166,9 +166,9 @@
166
166
  "write-json-file": "2.2.0",
167
167
  "xdg-app-paths": "5.1.0",
168
168
  "yauzl-promise": "2.1.3",
169
+ "@vercel-internals/constants": "1.0.4",
169
170
  "@vercel-internals/get-package-json": "1.0.0",
170
- "@vercel-internals/types": "3.0.6",
171
- "@vercel-internals/constants": "1.0.4"
171
+ "@vercel-internals/types": "3.0.6"
172
172
  },
173
173
  "scripts": {
174
174
  "test": "jest --reporters=default --reporters=jest-junit --env node --verbose --bail",