vercel 59.11.2 → 59.11.7

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 (154) hide show
  1. package/dist/chunks/{add-BKSHWTPX.js → add-KSJQYR5C.js} +23 -18
  2. package/dist/chunks/{add-RBW7QITR.js → add-PERLOALD.js} +37 -23
  3. package/dist/chunks/{add-HPLJZFM2.js → add-WU2QYHYL.js} +23 -18
  4. package/dist/chunks/{build-V4ZLAJWB.js → build-F3J6FLPD.js} +23 -18
  5. package/dist/chunks/{chunk-NGGLYKNU.js → chunk-26CU4Q3C.js} +3 -115
  6. package/dist/chunks/{chunk-QFAS4OVW.js → chunk-2JIX6UMI.js} +3 -84
  7. package/dist/chunks/chunk-2TSBB22D.js +14059 -0
  8. package/dist/chunks/chunk-332LMJLZ.js +16014 -0
  9. package/dist/chunks/{chunk-AYLY3ZVL.js → chunk-3VM7HWF6.js} +2 -2
  10. package/dist/chunks/chunk-4IALDGB7.js +22 -0
  11. package/dist/chunks/chunk-4IVSM24H.js +522 -0
  12. package/dist/chunks/{chunk-5XECIWME.js → chunk-5NF5HOBJ.js} +5 -3
  13. package/dist/chunks/chunk-6E6KPBXY.js +43 -0
  14. package/dist/chunks/chunk-7KROIXQM.js +59 -0
  15. package/dist/chunks/{chunk-ASBP32T6.js → chunk-7MRDIPJY.js} +1 -1
  16. package/dist/chunks/chunk-A5JZS6ZN.js +92 -0
  17. package/dist/chunks/{chunk-7ST552E3.js → chunk-AKLTIZCU.js} +1 -1
  18. package/dist/chunks/{chunk-26XDDLXM.js → chunk-ARU7VBKR.js} +2 -2
  19. package/dist/chunks/chunk-B5XLQKHI.js +849 -0
  20. package/dist/chunks/chunk-C762AAVU.js +137 -0
  21. package/dist/chunks/{chunk-WA2SJE5S.js → chunk-CEDN47PH.js} +4 -4
  22. package/dist/chunks/{chunk-ONRLTUP2.js → chunk-CNDPIHY5.js} +24 -22
  23. package/dist/chunks/{chunk-BMKU5KEL.js → chunk-CV5YC2EN.js} +1 -1
  24. package/dist/chunks/chunk-DBYHS3CK.js +257 -0
  25. package/dist/chunks/{chunk-HDBQPBL6.js → chunk-DSTNNQVV.js} +12 -8
  26. package/dist/chunks/{chunk-QAT3CW4G.js → chunk-EFYMIIER.js} +2 -2
  27. package/dist/chunks/{chunk-NBW3BWOJ.js → chunk-EPOLDWRA.js} +2 -2
  28. package/dist/chunks/{chunk-B4TXCKXE.js → chunk-EZQDYIVB.js} +10 -8
  29. package/dist/chunks/{chunk-2EAIC3SH.js → chunk-FL4JLNT2.js} +8 -8
  30. package/dist/chunks/chunk-FRVG4OW3.js +7438 -0
  31. package/dist/chunks/{chunk-FKDO3CM4.js → chunk-FVNJTRCE.js} +17 -13
  32. package/dist/chunks/chunk-FVT74RZ5.js +1536 -0
  33. package/dist/chunks/chunk-G3PXSXIB.js +18188 -0
  34. package/dist/chunks/chunk-G5FBSUL4.js +822 -0
  35. package/dist/chunks/{chunk-FRAXI2WT.js → chunk-GCVXKRR5.js} +3 -3
  36. package/dist/chunks/chunk-GHKJAK5V.js +1288 -0
  37. package/dist/chunks/{chunk-Q5K5DEOK.js → chunk-GUU4Z2AQ.js} +42 -28
  38. package/dist/chunks/{chunk-OQ3C5VXZ.js → chunk-GVNCVKCI.js} +4 -2
  39. package/dist/chunks/chunk-HB4UKFDO.js +1295 -0
  40. package/dist/chunks/chunk-HRXRELD3.js +338 -0
  41. package/dist/chunks/{chunk-IJ4X426J.js → chunk-IIMSID24.js} +1 -1
  42. package/dist/chunks/{chunk-O75LSD3C.js → chunk-JSD4EZL3.js} +1 -1
  43. package/dist/chunks/{chunk-7AEEQOD4.js → chunk-K3RED3VO.js} +1 -1
  44. package/dist/chunks/{chunk-RSEAADCE.js → chunk-KEKR7OCB.js} +6 -4
  45. package/dist/chunks/{chunk-3T7WSWZH.js → chunk-KFWQ3EFH.js} +1 -1
  46. package/dist/chunks/{chunk-L3UXB2CW.js → chunk-KW7BS25T.js} +1 -1
  47. package/dist/chunks/{chunk-RO44KX6Y.js → chunk-N4QHMXOO.js} +11 -7
  48. package/dist/chunks/{chunk-XRWOTCDO.js → chunk-ND5CF2H3.js} +1 -1
  49. package/dist/chunks/{chunk-RSJBU3ON.js → chunk-NSOYO6JQ.js} +35 -27
  50. package/dist/chunks/{chunk-RKDCNQ4S.js → chunk-NW34PW6V.js} +3 -105
  51. package/dist/chunks/{chunk-C5HKWXRR.js → chunk-OAMU5QO6.js} +1 -1
  52. package/dist/chunks/{chunk-MTWHQEXI.js → chunk-OIH6FP5Y.js} +5 -3
  53. package/dist/chunks/chunk-P7VSBDR4.js +827 -0
  54. package/dist/chunks/chunk-PEC3CQSK.js +90 -0
  55. package/dist/chunks/{chunk-QDV5LZ4Q.js → chunk-PFM75KY3.js} +12 -8
  56. package/dist/chunks/chunk-PJXMXMCO.js +81 -0
  57. package/dist/chunks/chunk-PNGVSHR3.js +40 -0
  58. package/dist/chunks/{chunk-TPATD2MM.js → chunk-QHS645AZ.js} +14 -6
  59. package/dist/chunks/{chunk-OTXE7MHI.js → chunk-QKX7WKIN.js} +8 -6
  60. package/dist/chunks/chunk-QOPTXV4G.js +417 -0
  61. package/dist/chunks/chunk-RN6V5ODW.js +114 -0
  62. package/dist/chunks/chunk-RVBZ64EQ.js +52 -0
  63. package/dist/chunks/chunk-SHFNEZVI.js +49 -0
  64. package/dist/chunks/{chunk-OO3OF6MK.js → chunk-TGNEG57M.js} +44 -15
  65. package/dist/chunks/{chunk-WNAKOXGK.js → chunk-TO7QZGYK.js} +1 -1
  66. package/dist/chunks/chunk-UARGTFCT.js +875 -0
  67. package/dist/chunks/{chunk-FWKSJYDV.js → chunk-UG2WOB5L.js} +1 -1
  68. package/dist/chunks/chunk-V4RMJKQP.js +36 -0
  69. package/dist/chunks/chunk-VT3Z7HF6.js +233 -0
  70. package/dist/chunks/chunk-VUS2JQB2.js +121 -0
  71. package/dist/chunks/{chunk-6CZZ3SH3.js → chunk-VYC45Q4Z.js} +2 -2
  72. package/dist/chunks/{chunk-4KVJ2M4J.js → chunk-WL6QYSGD.js} +78 -17
  73. package/dist/chunks/{chunk-FZRBF25Y.js → chunk-X7DBBZQD.js} +4 -4
  74. package/dist/chunks/{chunk-2NJJ2K5S.js → chunk-XD4DCYMX.js} +6 -6
  75. package/dist/chunks/{chunk-ZSFEACZU.js → chunk-XFF5TGRA.js} +1 -1
  76. package/dist/chunks/{chunk-6TBDHUXK.js → chunk-XIFATBH5.js} +21 -15
  77. package/dist/chunks/chunk-XNIZGCN5.js +58 -0
  78. package/dist/chunks/chunk-XPJLPUKO.js +117 -0
  79. package/dist/chunks/{chunk-FXD67VN5.js → chunk-XUAWTW4W.js} +1 -1
  80. package/dist/chunks/{chunk-I526H4AS.js → chunk-YS76T533.js} +2 -2
  81. package/dist/chunks/chunk-Z7JWYFOY.js +58 -0
  82. package/dist/chunks/{chunk-6JPVTPTU.js → chunk-ZBEECGFD.js} +3 -3
  83. package/dist/chunks/{chunk-52QYYTM5.js → chunk-ZDU2NODC.js} +3 -127
  84. package/dist/chunks/chunk-ZW6HETRE.js +97 -0
  85. package/dist/chunks/{clear-IYGWCNXT.js → clear-XUQO4ZTK.js} +23 -18
  86. package/dist/chunks/{compile-vercel-config-NEEBZRUJ.js → compile-vercel-config-D3ARNHTN.js} +8 -11
  87. package/dist/chunks/{config-6DS6BBR2.js → config-37OAE7QJ.js} +22 -17
  88. package/dist/chunks/{config-NTB5EMV4.js → config-MEDLXUVM.js} +23 -18
  89. package/dist/chunks/{delete-LLC2OGHA.js → delete-3N3YZZOF.js} +16 -12
  90. package/dist/chunks/{delete-LSGID5FV.js → delete-VSWDZ2SW.js} +19 -14
  91. package/dist/chunks/detect-projects-ODNU4PK2.js +18 -0
  92. package/dist/chunks/detect-services-TESZCQWG.js +40 -0
  93. package/dist/chunks/{disable-H4EXEQK7.js → disable-A4FLFMC7.js} +17 -13
  94. package/dist/chunks/{discard-FG6VKHWN.js → discard-CHGFULBZ.js} +17 -13
  95. package/dist/chunks/{edit-YE7D3CPJ.js → edit-JZ63AJYQ.js} +17 -13
  96. package/dist/chunks/{edit-BZJSGUHT.js → edit-MHSYAPDR.js} +19 -15
  97. package/dist/chunks/{enable-6ESD4QTE.js → enable-KD46SEC5.js} +17 -13
  98. package/dist/chunks/{exec-XH4K34JM.js → exec-4IPHZ55G.js} +9 -5
  99. package/dist/chunks/{export-QWSJROLG.js → export-42QZLBSN.js} +16 -13
  100. package/dist/chunks/{image-LTHQMKFG.js → image-GP4H73A2.js} +11 -8
  101. package/dist/chunks/{import-builders-6O7ILGQJ.js → import-builders-6TBLMPL2.js} +18 -13
  102. package/dist/chunks/{inspect-2C4ZSNYC.js → inspect-5FMWMY3C.js} +22 -18
  103. package/dist/chunks/{inspect-N6SMHV3Z.js → inspect-MUVK6MMT.js} +18 -14
  104. package/dist/chunks/{inspect-F7KCTHIL.js → inspect-Q3DWW7MC.js} +22 -18
  105. package/dist/chunks/{inspect-TWDPMXZ5.js → inspect-QFXAOUL4.js} +18 -14
  106. package/dist/chunks/{inspect-ICKNCDMT.js → inspect-RNTSYM6O.js} +18 -14
  107. package/dist/chunks/{list-NWTIJF3L.js → list-IHHIPXEC.js} +20 -16
  108. package/dist/chunks/{list-IPGQVBJO.js → list-JRNWLSO5.js} +16 -14
  109. package/dist/chunks/{list-DS7ZOUXA.js → list-XHD5DLEX.js} +23 -19
  110. package/dist/chunks/{login-F7A7ONKC.js → login-PCT6KFWY.js} +23 -18
  111. package/dist/chunks/{ls-NBDX3MKN.js → ls-GPEHEFCF.js} +24 -18
  112. package/dist/chunks/{ls-RNGO257R.js → ls-PF7F4PP4.js} +27 -23
  113. package/dist/chunks/{ls-XINES6PL.js → ls-PQZ2RIDX.js} +24 -18
  114. package/dist/chunks/{ls-D4TUDBIH.js → ls-SVOHC3XW.js} +24 -18
  115. package/dist/chunks/{ls-2QW3ZSM6.js → ls-TGHCCARZ.js} +24 -18
  116. package/dist/chunks/{ls-LSJEUPFX.js → ls-VRIH5WA3.js} +22 -15
  117. package/dist/chunks/{open-VRQDWZAW.js → open-E7DEKYDU.js} +18 -13
  118. package/dist/chunks/{permissions-6C5C7TEV.js → permissions-JKOONWVL.js} +14 -11
  119. package/dist/chunks/{publish-GVIZPNLN.js → publish-EDDELDE5.js} +17 -13
  120. package/dist/chunks/pull-646WEVDE.js +45 -0
  121. package/dist/chunks/{push-EFZ5P5Z6.js → push-LTNW5OVD.js} +23 -18
  122. package/dist/chunks/{query-GBS2PIT4.js → query-LU4N6KPO.js} +22 -19
  123. package/dist/chunks/{reorder-TN65IFRL.js → reorder-22PKJMZP.js} +17 -13
  124. package/dist/chunks/{reply-DYVEV3PY.js → reply-SF2EZMVZ.js} +17 -13
  125. package/dist/chunks/{resolve-JAWFBPUM.js → resolve-ZCZGXTOT.js} +16 -12
  126. package/dist/chunks/resolve-deployment-framework-preset-NPE6RLV3.js +36 -0
  127. package/dist/chunks/{restore-TJVMHUBQ.js → restore-VJAWZXB4.js} +17 -13
  128. package/dist/chunks/{rm-7XACNZ2U.js → rm-KN2QFCKO.js} +23 -18
  129. package/dist/chunks/{rm-REJVXALW.js → rm-KVEAJPRE.js} +23 -18
  130. package/dist/chunks/{rm-CBPNMSRP.js → rm-OSZ5FZUM.js} +23 -16
  131. package/dist/chunks/{rm-5B5VHWWN.js → rm-W722Q2AO.js} +21 -18
  132. package/dist/chunks/{rm-HQ5CYNJA.js → rm-WNPGTUBH.js} +23 -18
  133. package/dist/chunks/{routes-2OLIBRYX.js → routes-QVMBXOSX.js} +7 -3
  134. package/dist/chunks/{rule-inspect-ZSTDDFID.js → rule-inspect-25Z6SNX3.js} +28 -24
  135. package/dist/chunks/{rules-VGV4M4KY.js → rules-65LKAQ35.js} +15 -12
  136. package/dist/chunks/{schema-45SJNY5L.js → schema-7D6IGJEJ.js} +9 -7
  137. package/dist/chunks/{schema-GMTQOQCV.js → schema-NXCW4M75.js} +19 -17
  138. package/dist/chunks/{set-Z5FO2FCC.js → set-FYJVKMPV.js} +20 -13
  139. package/dist/chunks/setup-and-link-KXPZE32P.js +65 -0
  140. package/dist/chunks/{tags-SDRXWJ63.js → tags-ANIRP5E3.js} +10 -7
  141. package/dist/chunks/{types-JGANJ5EQ.js → types-4GAJ7XQQ.js} +9 -7
  142. package/dist/chunks/{update-JBQBC3IV.js → update-UT6CTKVG.js} +32 -19
  143. package/dist/commands/build/index.js +86 -49
  144. package/dist/commands/deploy/index.js +75 -66
  145. package/dist/commands/dev/index.js +98 -52
  146. package/dist/commands/env/index.js +67 -43
  147. package/dist/commands/link/index.js +48 -27
  148. package/dist/commands/list/index.js +33 -22
  149. package/dist/commands-bulk.js +1659 -1287
  150. package/dist/index.js +62 -40
  151. package/dist/version.mjs +1 -1
  152. package/package.json +46 -46
  153. package/dist/chunks/chunk-WYU64FLP.js +0 -62123
  154. package/dist/chunks/chunk-XNFHNTS2.js +0 -2939
@@ -0,0 +1,137 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __dirname_ } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __dirname_(__filename);
7
+ import {
8
+ printProjectNotFoundError
9
+ } from "./chunk-PJXMXMCO.js";
10
+ import {
11
+ detectExplicitScope
12
+ } from "./chunk-4IVSM24H.js";
13
+ import {
14
+ getLinkedProject,
15
+ param,
16
+ resolveProjectCwd
17
+ } from "./chunk-2TSBB22D.js";
18
+ import {
19
+ buildCommandWithYes,
20
+ outputActionRequired
21
+ } from "./chunk-26CU4Q3C.js";
22
+ import {
23
+ getCommandName,
24
+ getCommandNamePlain
25
+ } from "./chunk-Q2DGFCO7.js";
26
+ import {
27
+ output_manager_default
28
+ } from "./chunk-2JIX6UMI.js";
29
+
30
+ // src/util/parse-env.ts
31
+ var parseEnv = (env) => {
32
+ if (!env) {
33
+ return {};
34
+ }
35
+ if (typeof env === "string") {
36
+ env = [env];
37
+ }
38
+ if (Array.isArray(env)) {
39
+ const startingDict = {};
40
+ return env.reduce((o, e) => {
41
+ let key;
42
+ let value;
43
+ const equalsSign = e.indexOf("=");
44
+ if (equalsSign === -1) {
45
+ key = e;
46
+ } else {
47
+ key = e.slice(0, equalsSign);
48
+ value = e.slice(equalsSign + 1);
49
+ }
50
+ o[key] = value;
51
+ return o;
52
+ }, startingDict);
53
+ }
54
+ return env;
55
+ };
56
+
57
+ // src/util/link/ensure-link.ts
58
+ async function ensureLink(commandName, client, cwd, opts = {}) {
59
+ cwd = await resolveProjectCwd(cwd);
60
+ let link = opts.link;
61
+ const nonInteractive = opts.nonInteractive ?? client.nonInteractive ?? false;
62
+ opts.nonInteractive = nonInteractive;
63
+ if (!link) {
64
+ if (opts.forceDelete) {
65
+ link = { status: "not_linked", org: null, project: null };
66
+ } else {
67
+ link = await getLinkedProject(client, {
68
+ cwd,
69
+ projectName: opts.projectName,
70
+ projectNameIsExplicit: Boolean(opts.projectName && opts.failIfNotFound),
71
+ scopeIsExplicit: detectExplicitScope(client),
72
+ allowOwnerLookupFallback: opts.allowOwnerLookupFallback,
73
+ skipRemoteLookup: opts.skipRemoteLookup
74
+ });
75
+ }
76
+ opts.link = link;
77
+ }
78
+ if (link.status === "linked" && opts.forceDelete || link.status === "not_linked") {
79
+ if (link.status === "not_linked" && opts.failIfNotFound && opts.projectName) {
80
+ await printProjectNotFoundError(
81
+ client,
82
+ opts.projectName,
83
+ commandName,
84
+ link.orgId
85
+ );
86
+ return 1;
87
+ }
88
+ if (link.status === "not_linked" && opts.requireExistingLink) {
89
+ output_manager_default.error(
90
+ `Project is not linked. Run ${getCommandName("link")} first.`
91
+ );
92
+ return 1;
93
+ }
94
+ const { default: setupAndLink } = await import("./setup-and-link-KXPZE32P.js");
95
+ link = await setupAndLink(client, cwd, opts);
96
+ if (link.status === "not_linked") {
97
+ return 0;
98
+ }
99
+ }
100
+ if (link.status === "error") {
101
+ if (link.reason === "HEADLESS") {
102
+ if (nonInteractive) {
103
+ outputActionRequired(
104
+ client,
105
+ {
106
+ status: "action_required",
107
+ reason: "confirmation_required",
108
+ message: `Command ${getCommandNamePlain(commandName)} requires confirmation. Use option --yes to confirm.`,
109
+ next: [
110
+ {
111
+ command: buildCommandWithYes(client.argv),
112
+ when: "Confirm and run"
113
+ }
114
+ ]
115
+ },
116
+ link.exitCode
117
+ );
118
+ } else {
119
+ output_manager_default.error(
120
+ `Command ${getCommandName(
121
+ commandName
122
+ )} requires confirmation. Use option ${param("--yes")} to confirm.`
123
+ );
124
+ }
125
+ }
126
+ if (nonInteractive) {
127
+ process.exit(link.exitCode);
128
+ }
129
+ return link.exitCode;
130
+ }
131
+ return link;
132
+ }
133
+
134
+ export {
135
+ parseEnv,
136
+ ensureLink
137
+ };
@@ -4,12 +4,12 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import {
8
- require_lib
9
- } from "./chunk-WYU64FLP.js";
10
7
  import {
11
8
  isNativeBinaryInstall
12
- } from "./chunk-XNFHNTS2.js";
9
+ } from "./chunk-4IALDGB7.js";
10
+ import {
11
+ require_lib
12
+ } from "./chunk-2TSBB22D.js";
13
13
  import {
14
14
  packageName
15
15
  } from "./chunk-Q2DGFCO7.js";
@@ -7,14 +7,14 @@ const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  getUpdateCommandInfo,
9
9
  isGlobal
10
- } from "./chunk-WA2SJE5S.js";
10
+ } from "./chunk-CEDN47PH.js";
11
11
  import {
12
12
  progress,
13
13
  require_ci_info
14
- } from "./chunk-2EAIC3SH.js";
14
+ } from "./chunk-FL4JLNT2.js";
15
15
  import {
16
16
  writeToConfigFile
17
- } from "./chunk-Q5K5DEOK.js";
17
+ } from "./chunk-GUU4Z2AQ.js";
18
18
  import {
19
19
  getGlobalPathConfig
20
20
  } from "./chunk-AINIBIP4.js";
@@ -24,50 +24,52 @@ import {
24
24
  import {
25
25
  apiCommand,
26
26
  listSubcommand4 as listSubcommand
27
- } from "./chunk-4KVJ2M4J.js";
27
+ } from "./chunk-WL6QYSGD.js";
28
28
  import {
29
29
  require_semver
30
30
  } from "./chunk-IB5L4LKZ.js";
31
- import {
32
- help
33
- } from "./chunk-I526H4AS.js";
34
31
  import {
35
32
  require_chownr,
36
33
  require_mkdirp,
37
34
  require_pump,
38
35
  require_tar_stream
39
- } from "./chunk-WYU64FLP.js";
40
- import {
41
- TelemetryClient,
42
- getInstallRoot,
43
- isNativeBinaryInstall
44
- } from "./chunk-XNFHNTS2.js";
36
+ } from "./chunk-G3PXSXIB.js";
45
37
  import {
46
38
  require_ms
47
39
  } from "./chunk-GGP5R3FU.js";
40
+ import {
41
+ help
42
+ } from "./chunk-YS76T533.js";
43
+ import {
44
+ TelemetryClient
45
+ } from "./chunk-HB4UKFDO.js";
46
+ import {
47
+ fetch as fetch2,
48
+ toNodeReadable
49
+ } from "./chunk-XNIZGCN5.js";
48
50
  import {
49
51
  printError
50
- } from "./chunk-AYLY3ZVL.js";
52
+ } from "./chunk-3VM7HWF6.js";
51
53
  import {
52
54
  parseArguments
53
55
  } from "./chunk-57RHXXXG.js";
56
+ import {
57
+ getInstallRoot,
58
+ isNativeBinaryInstall
59
+ } from "./chunk-4IALDGB7.js";
54
60
  import {
55
61
  require_strip_ansi
56
- } from "./chunk-RKDCNQ4S.js";
62
+ } from "./chunk-XPJLPUKO.js";
57
63
  import {
58
64
  getFlagsSpecification,
59
65
  packageName
60
66
  } from "./chunk-Q2DGFCO7.js";
67
+ import {
68
+ output_manager_default
69
+ } from "./chunk-2JIX6UMI.js";
61
70
  import {
62
71
  pkg_default
63
72
  } from "./chunk-P4QNYOFB.js";
64
- import {
65
- fetch as fetch2,
66
- toNodeReadable
67
- } from "./chunk-52QYYTM5.js";
68
- import {
69
- output_manager_default
70
- } from "./chunk-QFAS4OVW.js";
71
73
  import {
72
74
  require_source
73
75
  } from "./chunk-S7KYDPEM.js";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-Q2DGFCO7.js";
10
10
  import {
11
11
  require_dist
12
- } from "./chunk-QFAS4OVW.js";
12
+ } from "./chunk-ZW6HETRE.js";
13
13
  import {
14
14
  require_source
15
15
  } from "./chunk-S7KYDPEM.js";
@@ -0,0 +1,257 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __dirname_ } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __dirname_(__filename);
7
+ import {
8
+ require_open
9
+ } from "./chunk-HRXRELD3.js";
10
+ import {
11
+ deviceAccessTokenRequest,
12
+ deviceAuthorizationRequest,
13
+ isOAuthError,
14
+ processDeviceAuthorizationResponse,
15
+ processTokenResponse
16
+ } from "./chunk-4IVSM24H.js";
17
+ import {
18
+ printError
19
+ } from "./chunk-3VM7HWF6.js";
20
+ import {
21
+ getTeams,
22
+ getUser,
23
+ humanizePath
24
+ } from "./chunk-2TSBB22D.js";
25
+ import {
26
+ getCommandName
27
+ } from "./chunk-Q2DGFCO7.js";
28
+ import {
29
+ emoji,
30
+ output_manager_default,
31
+ require_ansi_escapes
32
+ } from "./chunk-2JIX6UMI.js";
33
+ import {
34
+ require_source
35
+ } from "./chunk-S7KYDPEM.js";
36
+ import {
37
+ __toESM
38
+ } from "./chunk-TZ2YI2VH.js";
39
+
40
+ // src/commands/login/future.ts
41
+ var import_chalk = __toESM(require_source(), 1);
42
+ var open = __toESM(require_open(), 1);
43
+ var import_ansi_escapes = __toESM(require_ansi_escapes(), 1);
44
+ import readline from "readline";
45
+ import { KNOWN_AGENTS } from "@vercel/detect-agent";
46
+
47
+ // src/util/login/update-current-team-after-login.ts
48
+ async function updateCurrentTeamAfterLogin(client, ssoTeamId) {
49
+ if (ssoTeamId) {
50
+ client.config.currentTeam = ssoTeamId;
51
+ } else {
52
+ let user = null;
53
+ try {
54
+ user = await getUser(client);
55
+ } catch (_err) {
56
+ output_manager_default.error("Failed to fetch the logged in user. Please try again.");
57
+ return 1;
58
+ }
59
+ if (user.version === "northstar" && user.defaultTeamId) {
60
+ client.config.currentTeam = user.defaultTeamId;
61
+ } else {
62
+ delete client.config.currentTeam;
63
+ }
64
+ }
65
+ }
66
+
67
+ // src/commands/login/future.ts
68
+ async function performDeviceCodeFlow(client, options) {
69
+ const deviceAuthorizationResponse = await deviceAuthorizationRequest({
70
+ refresh_token: options?.refreshToken,
71
+ acr_values: options?.acrValues
72
+ });
73
+ output_manager_default.debug(
74
+ `'Device Authorization response:', ${await deviceAuthorizationResponse.clone().text()}`
75
+ );
76
+ const [deviceAuthorizationError, deviceAuthorization] = await processDeviceAuthorizationResponse(deviceAuthorizationResponse);
77
+ if (deviceAuthorizationError) {
78
+ if (options?.fallbackToLoginOnStepUpFailure && options.refreshToken && isOAuthError(deviceAuthorizationError) && (deviceAuthorizationError.code === "invalid_grant" || deviceAuthorizationError.code === "invalid_scope")) {
79
+ output_manager_default.debug(
80
+ `Step-up device authorization failed: ${deviceAuthorizationError.cause.message}`
81
+ );
82
+ output_manager_default.log("Couldn't refresh the saved login. Starting a new login.");
83
+ return performDeviceCodeFlow(
84
+ client,
85
+ options.teamId ? { teamId: options.teamId } : void 0
86
+ );
87
+ }
88
+ printError(
89
+ isOAuthError(deviceAuthorizationError) ? deviceAuthorizationError.cause : deviceAuthorizationError
90
+ );
91
+ return null;
92
+ }
93
+ const { device_code, user_code, verification_uri, expiresAt, interval } = deviceAuthorization;
94
+ let { verification_uri_complete } = deviceAuthorization;
95
+ if (options?.teamId) {
96
+ const url = new URL(verification_uri_complete);
97
+ url.searchParams.set("team_id", options.teamId);
98
+ verification_uri_complete = url.toString();
99
+ }
100
+ const isCursorAgent = client.agentName === KNOWN_AGENTS.CURSOR || client.agentName === KNOWN_AGENTS.CURSOR_CLI;
101
+ const shouldSkipBrowser = process.env.CI && !isCursorAgent;
102
+ output_manager_default.log(
103
+ `
104
+ Visit ${import_chalk.default.bold(
105
+ output_manager_default.link(
106
+ verification_uri.replace("https://", ""),
107
+ verification_uri_complete,
108
+ { color: false, fallback: () => verification_uri_complete }
109
+ )
110
+ )}${output_manager_default.supportsHyperlink ? ` and enter ${import_chalk.default.bold(user_code)}` : ""}
111
+ `
112
+ );
113
+ if (!shouldSkipBrowser) {
114
+ try {
115
+ const browserProcess = await open.default(verification_uri_complete);
116
+ browserProcess.on("error", (error) => {
117
+ output_manager_default.debug(`Failed to open browser: ${error}`);
118
+ });
119
+ } catch (error) {
120
+ output_manager_default.debug(`Failed to open browser: ${error}`);
121
+ if (client.isAgent && client.nonInteractive) {
122
+ output_manager_default.log(
123
+ `
124
+ ${import_chalk.default.yellow("\u26A0")} ${import_chalk.default.bold("Browser could not be opened automatically.")}
125
+ `
126
+ );
127
+ output_manager_default.log(
128
+ `Please ask the user to manually visit the URL above and complete the authentication process.
129
+ `
130
+ );
131
+ }
132
+ }
133
+ }
134
+ const rl = readline.createInterface({
135
+ input: process.stdin,
136
+ output: process.stdout
137
+ }).on("SIGINT", () => {
138
+ process.exit(0);
139
+ });
140
+ output_manager_default.spinner("Waiting for authentication...");
141
+ let intervalMs = interval * 1e3;
142
+ let result = null;
143
+ let flowError = new Error(
144
+ "Timed out waiting for authentication. Please try again."
145
+ );
146
+ async function pollForToken() {
147
+ while (Date.now() < expiresAt) {
148
+ const [tokenResponseError, tokenResponse] = await deviceAccessTokenRequest({ device_code });
149
+ if (tokenResponseError) {
150
+ if (tokenResponseError.message.includes("timeout")) {
151
+ intervalMs *= 2;
152
+ output_manager_default.debug(
153
+ `Connection timeout. Slowing down, polling every ${intervalMs / 1e3}s...`
154
+ );
155
+ await wait(intervalMs);
156
+ continue;
157
+ }
158
+ return tokenResponseError;
159
+ }
160
+ output_manager_default.debug(
161
+ `'Device Access Token response:', ${await tokenResponse.clone().text()}`
162
+ );
163
+ const [tokensError, tokens] = await processTokenResponse(tokenResponse);
164
+ if (isOAuthError(tokensError)) {
165
+ const { code } = tokensError;
166
+ switch (code) {
167
+ case "authorization_pending":
168
+ await wait(intervalMs);
169
+ continue;
170
+ case "slow_down":
171
+ intervalMs += 5 * 1e3;
172
+ output_manager_default.debug(
173
+ `Authorization server requests to slow down. Polling every ${intervalMs / 1e3}s...`
174
+ );
175
+ await wait(intervalMs);
176
+ continue;
177
+ default:
178
+ return tokensError.cause;
179
+ }
180
+ }
181
+ if (tokensError)
182
+ return tokensError;
183
+ output_manager_default.print((0, import_ansi_escapes.eraseLines)(2));
184
+ result = {
185
+ access_token: tokens.access_token,
186
+ expires_in: tokens.expires_in,
187
+ refresh_token: tokens.refresh_token
188
+ };
189
+ return;
190
+ }
191
+ }
192
+ flowError = await pollForToken();
193
+ output_manager_default.stopSpinner();
194
+ rl.close();
195
+ if (flowError) {
196
+ printError(flowError);
197
+ return null;
198
+ }
199
+ return result;
200
+ }
201
+ async function login(client, telemetry, standalone = true) {
202
+ const tokens = await performDeviceCodeFlow(client);
203
+ if (!tokens) {
204
+ telemetry.trackState("error");
205
+ return 1;
206
+ }
207
+ const previousTeamId = client.config.currentTeam;
208
+ client.updateAuthConfig({
209
+ token: tokens.access_token,
210
+ userId: void 0,
211
+ expiresAt: Math.floor(Date.now() / 1e3) + tokens.expires_in,
212
+ refreshToken: tokens.refresh_token
213
+ });
214
+ if (previousTeamId) {
215
+ let isMember = true;
216
+ try {
217
+ const teams = await getTeams(client);
218
+ isMember = teams.some((team) => team.id === previousTeamId);
219
+ } catch {
220
+ }
221
+ if (!isMember) {
222
+ output_manager_default.warn(
223
+ "Your previously selected team is no longer accessible; switching to your default scope."
224
+ );
225
+ client.updateConfig({ currentTeam: void 0 });
226
+ await updateCurrentTeamAfterLogin(client);
227
+ }
228
+ } else {
229
+ client.updateConfig({ currentTeam: void 0 });
230
+ await updateCurrentTeamAfterLogin(client);
231
+ }
232
+ client.persistAuthConfig();
233
+ client.writeToConfigFile();
234
+ output_manager_default.debug(`Saved credentials in "${humanizePath(client.getGlobalPathConfig())}"`);
235
+ if (standalone) {
236
+ output_manager_default.print(`
237
+ ${import_chalk.default.cyan("Congratulations!")} You are now signed in.
238
+
239
+ To deploy something, run ${getCommandName()}.
240
+
241
+ ${emoji("tip")} To deploy every commit automatically,
242
+ connect a Git Repository (${import_chalk.default.bold(output_manager_default.link("vercel.link/git", "https://vercel.link/git", { color: false }))}).
243
+ `);
244
+ } else {
245
+ output_manager_default.success("Logged in.");
246
+ }
247
+ telemetry.trackState("success");
248
+ return 0;
249
+ }
250
+ async function wait(intervalMs) {
251
+ await new Promise((resolve) => setTimeout(resolve, intervalMs));
252
+ }
253
+
254
+ export {
255
+ performDeviceCodeFlow,
256
+ login
257
+ };
@@ -11,23 +11,27 @@ import {
11
11
  RULE_ENVIRONMENTS
12
12
  } from "./chunk-GY5I4AYD.js";
13
13
  import {
14
- detectExplicitScope,
15
14
  resolveProjectContext
16
- } from "./chunk-WYU64FLP.js";
15
+ } from "./chunk-7KROIXQM.js";
17
16
  import {
18
17
  AGENT_REASON,
19
- AGENT_STATUS,
20
- outputAgentError
21
- } from "./chunk-NGGLYKNU.js";
18
+ AGENT_STATUS
19
+ } from "./chunk-VUS2JQB2.js";
20
+ import {
21
+ detectExplicitScope
22
+ } from "./chunk-4IVSM24H.js";
22
23
  import {
23
24
  printError
24
- } from "./chunk-AYLY3ZVL.js";
25
+ } from "./chunk-3VM7HWF6.js";
26
+ import {
27
+ outputAgentError
28
+ } from "./chunk-26CU4Q3C.js";
25
29
  import {
26
30
  isAPIError
27
- } from "./chunk-BMKU5KEL.js";
31
+ } from "./chunk-CV5YC2EN.js";
28
32
  import {
29
33
  output_manager_default
30
- } from "./chunk-QFAS4OVW.js";
34
+ } from "./chunk-2JIX6UMI.js";
31
35
 
32
36
  // src/commands/traces/config/errors.ts
33
37
  function messageFor(err) {
@@ -6,13 +6,13 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  STANDARD_ENVIRONMENTS
9
- } from "./chunk-WYU64FLP.js";
9
+ } from "./chunk-PNGVSHR3.js";
10
10
  import {
11
11
  require_lib
12
12
  } from "./chunk-Q2DGFCO7.js";
13
13
  import {
14
14
  output_manager_default
15
- } from "./chunk-QFAS4OVW.js";
15
+ } from "./chunk-2JIX6UMI.js";
16
16
  import {
17
17
  require_source
18
18
  } from "./chunk-S7KYDPEM.js";
@@ -8,10 +8,10 @@ import {
8
8
  VERCEL_DIR,
9
9
  VERCEL_DIR_PROJECT,
10
10
  require_lib
11
- } from "./chunk-WYU64FLP.js";
11
+ } from "./chunk-2TSBB22D.js";
12
12
  import {
13
13
  require_dist
14
- } from "./chunk-QFAS4OVW.js";
14
+ } from "./chunk-ZW6HETRE.js";
15
15
  import {
16
16
  __toESM
17
17
  } from "./chunk-TZ2YI2VH.js";
@@ -6,20 +6,22 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  resolveProjectContext
9
- } from "./chunk-WYU64FLP.js";
9
+ } from "./chunk-7KROIXQM.js";
10
10
  import {
11
11
  AGENT_REASON,
12
- AGENT_STATUS,
13
- buildCommandWithYes,
14
- outputAgentError,
15
- withGlobalFlags
16
- } from "./chunk-NGGLYKNU.js";
12
+ AGENT_STATUS
13
+ } from "./chunk-VUS2JQB2.js";
17
14
  import {
18
15
  printError
19
- } from "./chunk-AYLY3ZVL.js";
16
+ } from "./chunk-3VM7HWF6.js";
20
17
  import {
21
18
  parseArguments
22
19
  } from "./chunk-57RHXXXG.js";
20
+ import {
21
+ buildCommandWithYes,
22
+ outputAgentError,
23
+ withGlobalFlags
24
+ } from "./chunk-26CU4Q3C.js";
23
25
  import {
24
26
  getCommandName,
25
27
  getCommandNamePlain,
@@ -28,7 +30,7 @@ import {
28
30
  } from "./chunk-Q2DGFCO7.js";
29
31
  import {
30
32
  output_manager_default
31
- } from "./chunk-QFAS4OVW.js";
33
+ } from "./chunk-2JIX6UMI.js";
32
34
  import {
33
35
  require_source
34
36
  } from "./chunk-S7KYDPEM.js";
@@ -6,19 +6,19 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  loginCommand
9
- } from "./chunk-4KVJ2M4J.js";
10
- import {
11
- help
12
- } from "./chunk-I526H4AS.js";
9
+ } from "./chunk-WL6QYSGD.js";
13
10
  import {
14
11
  login
15
- } from "./chunk-WYU64FLP.js";
12
+ } from "./chunk-DBYHS3CK.js";
13
+ import {
14
+ help
15
+ } from "./chunk-YS76T533.js";
16
16
  import {
17
17
  TelemetryClient
18
- } from "./chunk-XNFHNTS2.js";
18
+ } from "./chunk-HB4UKFDO.js";
19
19
  import {
20
20
  printError
21
- } from "./chunk-AYLY3ZVL.js";
21
+ } from "./chunk-3VM7HWF6.js";
22
22
  import {
23
23
  parseArguments
24
24
  } from "./chunk-57RHXXXG.js";
@@ -27,7 +27,7 @@ import {
27
27
  } from "./chunk-Q2DGFCO7.js";
28
28
  import {
29
29
  output_manager_default
30
- } from "./chunk-QFAS4OVW.js";
30
+ } from "./chunk-2JIX6UMI.js";
31
31
  import {
32
32
  require_source
33
33
  } from "./chunk-S7KYDPEM.js";