@depup/vercel 50.44.0-depup.0 → 57.0.0-depup.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/README.md +11 -10
  2. package/changes.json +24 -20
  3. package/dist/chunks/add-7M577U56.js +180 -0
  4. package/dist/chunks/add-YRZTDNXX.js +131 -0
  5. package/dist/chunks/{chunk-Y4JJYHUG.js → chunk-2473DUBR.js} +4 -5
  6. package/dist/chunks/chunk-2EDWKVNP.js +3195 -0
  7. package/dist/chunks/{chunk-WXNT7WJO.js → chunk-2MJROFVC.js} +50 -8
  8. package/dist/chunks/{chunk-6DIXPIXB.js → chunk-3242RXCN.js} +2 -2
  9. package/dist/chunks/chunk-3PGXYIKC.js +147 -0
  10. package/dist/chunks/{chunk-2IAZZEVQ.js → chunk-3PKFXNJZ.js} +4 -6
  11. package/dist/chunks/chunk-3VS4DTAU.js +178 -0
  12. package/dist/chunks/{chunk-IS2HEMF4.js → chunk-4G6QZSBL.js} +68 -42
  13. package/dist/chunks/{chunk-K4IC7LFB.js → chunk-4PGF367U.js} +257 -978
  14. package/dist/chunks/chunk-4QVAYRYH.js +71 -0
  15. package/dist/chunks/chunk-52QYYTM5.js +228 -0
  16. package/dist/chunks/{chunk-A5XRYFVO.js → chunk-555WJSO5.js} +109 -75
  17. package/dist/chunks/chunk-5AJPMLDV.js +28 -0
  18. package/dist/chunks/chunk-64IF634X.js +18 -0
  19. package/dist/chunks/chunk-6OMC3HOW.js +73 -0
  20. package/dist/chunks/{chunk-YYWNQQSE.js → chunk-A2TYQBX2.js} +5787 -2019
  21. package/dist/chunks/{chunk-HTOH3MSD.js → chunk-BUZRVER7.js} +5 -4
  22. package/dist/chunks/{chunk-Y5YCSB6X.js → chunk-DMSLNAVH.js} +7 -4
  23. package/dist/chunks/{chunk-C5YP6KFI.js → chunk-DWMH5M4Q.js} +28 -9
  24. package/dist/chunks/chunk-E336ZXPP.js +43 -0
  25. package/dist/chunks/{chunk-U3WLEFHU.js → chunk-ECCWJHC6.js} +60 -14
  26. package/dist/chunks/chunk-F5PQWDOC.js +245 -0
  27. package/dist/chunks/{chunk-WYWXLDX4.js → chunk-F7X55TOY.js} +267 -3351
  28. package/dist/chunks/chunk-FGDKMNEN.js +21 -0
  29. package/dist/chunks/chunk-FHEMFAHB.js +320 -0
  30. package/dist/chunks/chunk-FYQPTH5C.js +126 -0
  31. package/dist/chunks/chunk-G75NFPIT.js +105 -0
  32. package/dist/chunks/{chunk-CO5D46AG.js → chunk-GGP5R3FU.js} +18 -38
  33. package/dist/chunks/chunk-GIL3VAUR.js +109 -0
  34. package/dist/chunks/chunk-GP5VCTEU.js +359 -0
  35. package/dist/chunks/chunk-GZLPFESR.js +48 -0
  36. package/dist/chunks/{chunk-65IHMJX4.js → chunk-HD7B425F.js} +33 -8
  37. package/dist/chunks/{chunk-5CRSHCRD.js → chunk-IOAZNR6Z.js} +207 -32
  38. package/dist/chunks/chunk-KCF6S3XF.js +194 -0
  39. package/dist/chunks/{chunk-A4NVECX5.js → chunk-KSSNLCL4.js} +144 -444
  40. package/dist/chunks/{chunk-VE7MY76H.js → chunk-LHFNIZ2P.js} +3 -1
  41. package/dist/chunks/chunk-LMHT3QR3.js +247 -0
  42. package/dist/chunks/chunk-MAHINYBW.js +138 -0
  43. package/dist/chunks/{chunk-RQTDTSAX.js → chunk-MIFDRYTN.js} +3 -3
  44. package/dist/chunks/{chunk-XMVSCINT.js → chunk-NH43BFJ3.js} +7 -4
  45. package/dist/chunks/chunk-NJUPUGOE.js +593 -0
  46. package/dist/chunks/chunk-NM43FFV6.js +108 -0
  47. package/dist/chunks/{chunk-XHMU7WUB.js → chunk-NRNMT43R.js} +697 -324
  48. package/dist/chunks/{chunk-4YZKA4FN.js → chunk-NZRWTCRM.js} +1 -1
  49. package/dist/chunks/chunk-OF2GNB42.js +53 -0
  50. package/dist/chunks/{chunk-BUBUVE23.js → chunk-OGG6UBXK.js} +4 -2
  51. package/dist/chunks/{chunk-ZQKJVHXY.js → chunk-OX7KI3LF.js} +18 -5
  52. package/dist/chunks/{chunk-JJXA2DQW.js → chunk-P2QZZ6MR.js} +1 -1
  53. package/dist/chunks/chunk-P4QNYOFB.js +96 -0
  54. package/dist/chunks/chunk-PRWJUY5U.js +848 -0
  55. package/dist/chunks/{query-SDKQTWN2.js → chunk-QZD5DKUR.js} +134 -356
  56. package/dist/chunks/{chunk-ELUNQCFN.js → chunk-R5FOIIHT.js} +14 -2
  57. package/dist/chunks/{chunk-UZIEJEMY.js → chunk-R6IGDGX3.js} +5 -5
  58. package/dist/chunks/{chunk-WOFF2NEI.js → chunk-RAFH25WW.js} +333 -62
  59. package/dist/chunks/chunk-RYO6FJFB.js +220 -0
  60. package/dist/chunks/chunk-SZXT3PDQ.js +343 -0
  61. package/dist/chunks/chunk-T4NODP6Y.js +156 -0
  62. package/dist/chunks/{chunk-V23RAVWV.js → chunk-TBR2Q37Y.js} +18792 -16529
  63. package/dist/chunks/chunk-UDWRZXIT.js +657 -0
  64. package/dist/chunks/chunk-V4RMJKQP.js +36 -0
  65. package/dist/chunks/chunk-VGIMO3ZK.js +17 -0
  66. package/dist/chunks/{chunk-V5P25P7F.js → chunk-VXYGCOKL.js} +10 -4
  67. package/dist/chunks/{chunk-BQUQ5F7R.js → chunk-VZSZBD4V.js} +23 -10
  68. package/dist/chunks/chunk-WGGABYO5.js +31 -0
  69. package/dist/chunks/chunk-WR7JTCGL.js +104 -0
  70. package/dist/chunks/{chunk-LOS7HHU3.js → chunk-XBN2O34P.js} +1 -1
  71. package/dist/chunks/{chunk-NELCIT4M.js → chunk-YA3WQFLY.js} +6 -83
  72. package/dist/chunks/{chunk-TBW2XDGN.js → chunk-YOZCJHLZ.js} +27 -15
  73. package/dist/chunks/{chunk-L2BKVTHL.js → chunk-ZVLPUREX.js} +2 -2
  74. package/dist/chunks/cjs-DV4RM7XU.js +20743 -0
  75. package/dist/chunks/{compile-vercel-config-6FEECIZK.js → compile-vercel-config-3OHO3TJA.js} +9 -5
  76. package/dist/chunks/config-validator.mjs +1 -0
  77. package/dist/chunks/constants-3FSSR6E7.js +13 -0
  78. package/dist/chunks/delete-3DZOCWCC.js +150 -0
  79. package/dist/chunks/{delete-J2N2QXMP.js → delete-VOSJLNEA.js} +23 -17
  80. package/dist/chunks/{disable-QGYXQKAM.js → disable-LQDEVRQF.js} +22 -15
  81. package/dist/chunks/{discard-ZDGJB5US.js → discard-RGV4JKXQ.js} +21 -14
  82. package/dist/chunks/{edit-RJWDA5KJ.js → edit-SFIEOQ24.js} +29 -24
  83. package/dist/chunks/edit-UPZPI54L.js +153 -0
  84. package/dist/chunks/{enable-L33HPTXB.js → enable-6UVH35WC.js} +22 -15
  85. package/dist/chunks/exec-CNBOV577.js +1287 -0
  86. package/dist/chunks/{export-Z5C4BJ2U.js → export-6CEG3CK7.js} +23 -17
  87. package/dist/chunks/fetch-proxy-R3JZNXBZ.js +99 -0
  88. package/dist/chunks/image-CQRCD2OE.js +71 -0
  89. package/dist/chunks/inspect-4ZAH3RFT.js +205 -0
  90. package/dist/chunks/inspect-EXQBIAFF.js +587 -0
  91. package/dist/chunks/inspect-K5ZMQG7X.js +165 -0
  92. package/dist/chunks/inspect-UM3LDRPV.js +161 -0
  93. package/dist/chunks/inspect-ZFRY3X3H.js +134 -0
  94. package/dist/chunks/{list-HXN64DKX.js → list-4DRVM7Q4.js} +154 -138
  95. package/dist/chunks/{list-4P2TW77C.js → list-FJCBOCCA.js} +17 -14
  96. package/dist/chunks/list-KCUHD4OA.js +360 -0
  97. package/dist/chunks/login-DFGYNU3K.js +244 -0
  98. package/dist/chunks/ls-34NCZKBE.js +198 -0
  99. package/dist/chunks/ls-4QHHVXXD.js +162 -0
  100. package/dist/chunks/ls-CG6A7UXF.js +211 -0
  101. package/dist/chunks/ls-RHEQ6YQB.js +188 -0
  102. package/dist/chunks/open-E3XADEMX.js +106 -0
  103. package/dist/chunks/{chunk-Q6BEDVOU.js → pkg-56KRLZ5K.js} +3 -9
  104. package/dist/chunks/{publish-TLVHQB2H.js → publish-Z3AQRUCS.js} +21 -14
  105. package/dist/chunks/query-3EV66DO3.js +391 -0
  106. package/dist/chunks/{reorder-UHMUFYIW.js → reorder-VA5E5ZJT.js} +25 -18
  107. package/dist/chunks/reply-SNSCNKAW.js +167 -0
  108. package/dist/chunks/resolve-6ZX4RTXX.js +228 -0
  109. package/dist/chunks/{restore-762GO6HU.js → restore-NEHI5B5P.js} +27 -20
  110. package/dist/chunks/rm-22B22E47.js +134 -0
  111. package/dist/chunks/rm-E5ZVLAKO.js +134 -0
  112. package/dist/chunks/rm-FR6KE744.js +164 -0
  113. package/dist/chunks/{routes-OFD6HJOW.js → routes-JP2CNQ5J.js} +3 -3
  114. package/dist/chunks/rule-inspect-DMP2CKJQ.js +283 -0
  115. package/dist/chunks/rules-EYGXEI2Z.js +82 -0
  116. package/dist/chunks/{schema-WBOIQRP4.js → schema-2IIWOBSQ.js} +67 -32
  117. package/dist/chunks/{stamp-ENIXDCRO.js → stamp-AA7R3MZS.js} +3 -1
  118. package/dist/chunks/tags-ZDVYRHAY.js +65 -0
  119. package/dist/chunks/{types-A4EAQ6F6.js → types-QKLIFDDP.js} +9 -6
  120. package/dist/chunks/update-QH4DQMZV.js +196 -0
  121. package/dist/commands/build/index.js +4509 -657
  122. package/dist/commands/deploy/index.js +380 -162
  123. package/dist/commands/dev/builder-worker.cjs +9 -2
  124. package/dist/commands/dev/index.js +1991 -613
  125. package/dist/commands/dev/next-dev-websocket-shim-preload.cjs +210 -0
  126. package/dist/commands/env/index.js +649 -166
  127. package/dist/commands/link/index.js +90 -54
  128. package/dist/commands/list/index.js +52 -28
  129. package/dist/commands-bulk.js +43440 -19177
  130. package/dist/fetch-dist-tags.cjs +60 -0
  131. package/dist/get-latest-worker.cjs +6 -56
  132. package/dist/help.js +1 -1
  133. package/dist/index.js +728 -22710
  134. package/dist/vc.js +94 -1
  135. package/dist/version.mjs +1 -1
  136. package/package.json +160 -72
  137. package/dist/chunks/chunk-7IDNCLTM.js +0 -152
  138. package/dist/chunks/chunk-D7SZ3DXR.js +0 -58
  139. package/dist/chunks/chunk-K6HUDI7B.js +0 -310
  140. package/dist/chunks/chunk-NYO5XRBQ.js +0 -247
  141. package/dist/chunks/chunk-TWZWQGBN.js +0 -77
  142. package/dist/chunks/chunk-U5J73OA3.js +0 -86
  143. package/dist/chunks/chunk-YKKQGGLZ.js +0 -91
package/README.md CHANGED
@@ -13,25 +13,26 @@ npm install @depup/vercel
13
13
 
14
14
  | Field | Value |
15
15
  |-------|-------|
16
- | Original | [vercel](https://www.npmjs.com/package/vercel) @ 50.44.0 |
17
- | Processed | 2026-04-11 |
16
+ | Original | [vercel](https://www.npmjs.com/package/vercel) @ 57.0.0 |
17
+ | Processed | 2026-07-26 |
18
18
  | Smoke test | failed |
19
- | Deps updated | 10 |
19
+ | Deps updated | 11 |
20
20
 
21
21
  ## Dependency Changes
22
22
 
23
23
  | Dependency | From | To |
24
24
  |------------|------|-----|
25
- | @vercel/blob | 2.3.0 | ^2.3.3 |
25
+ | @vercel/blob | 2.4.0 | ^2.6.1 |
26
26
  | @vercel/fun | 1.3.0 | ^1.3.1 |
27
+ | @vercel/prepare-flags-definitions | 0.3.0 | ^0.4.0 |
27
28
  | chokidar | 4.0.0 | ^5.0.0 |
28
- | esbuild | 0.27.0 | ^0.28.0 |
29
- | form-data | ^4.0.0 | ^4.0.5 |
30
- | jose | 5.9.6 | ^6.2.2 |
29
+ | esbuild | 0.27.0 | ^0.28.1 |
30
+ | jose | 5.9.6 | ^6.2.4 |
31
31
  | luxon | ^3.4.0 | ^3.7.2 |
32
- | proxy-agent | 6.4.0 | ^8.0.1 |
33
- | sandbox | 2.5.6 | ^2.5.9 |
34
- | smol-toml | 1.5.2 | ^1.6.1 |
32
+ | sandbox | 3.4.0 | ^3.5.3 |
33
+ | smol-toml | 1.5.2 | ^1.7.0 |
34
+ | undici | 5.29.0 | ^8.9.0 |
35
+ | zod | 4.1.11 | ^4.4.3 |
35
36
 
36
37
  ---
37
38
 
package/changes.json CHANGED
@@ -1,46 +1,50 @@
1
1
  {
2
2
  "bumped": {
3
3
  "@vercel/blob": {
4
- "from": "2.3.0",
5
- "to": "^2.3.3"
4
+ "from": "2.4.0",
5
+ "to": "^2.6.1"
6
6
  },
7
7
  "@vercel/fun": {
8
8
  "from": "1.3.0",
9
9
  "to": "^1.3.1"
10
10
  },
11
+ "@vercel/prepare-flags-definitions": {
12
+ "from": "0.3.0",
13
+ "to": "^0.4.0"
14
+ },
11
15
  "chokidar": {
12
16
  "from": "4.0.0",
13
17
  "to": "^5.0.0"
14
18
  },
15
- "smol-toml": {
16
- "from": "1.5.2",
17
- "to": "^1.6.1"
18
- },
19
19
  "esbuild": {
20
20
  "from": "0.27.0",
21
- "to": "^0.28.0"
22
- },
23
- "form-data": {
24
- "from": "^4.0.0",
25
- "to": "^4.0.5"
21
+ "to": "^0.28.1"
26
22
  },
27
23
  "jose": {
28
24
  "from": "5.9.6",
29
- "to": "^6.2.2"
25
+ "to": "^6.2.4"
30
26
  },
31
27
  "luxon": {
32
28
  "from": "^3.4.0",
33
29
  "to": "^3.7.2"
34
30
  },
35
- "proxy-agent": {
36
- "from": "6.4.0",
37
- "to": "^8.0.1"
38
- },
39
31
  "sandbox": {
40
- "from": "2.5.6",
41
- "to": "^2.5.9"
32
+ "from": "3.4.0",
33
+ "to": "^3.5.3"
34
+ },
35
+ "smol-toml": {
36
+ "from": "1.5.2",
37
+ "to": "^1.7.0"
38
+ },
39
+ "undici": {
40
+ "from": "5.29.0",
41
+ "to": "^8.9.0"
42
+ },
43
+ "zod": {
44
+ "from": "4.1.11",
45
+ "to": "^4.4.3"
42
46
  }
43
47
  },
44
- "timestamp": "2026-04-11T04:42:51.698Z",
45
- "totalUpdated": 10
48
+ "timestamp": "2026-07-26T01:06:04.242Z",
49
+ "totalUpdated": 11
46
50
  }
@@ -0,0 +1,180 @@
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
+ emitRulesArgParseError,
9
+ handleRulesApiError,
10
+ parseRulesFlagsAndScope,
11
+ rulesCollectionPath
12
+ } from "./chunk-MAHINYBW.js";
13
+ import "./chunk-T4NODP6Y.js";
14
+ import "./chunk-BUZRVER7.js";
15
+ import {
16
+ validateJsonOutput
17
+ } from "./chunk-XPKWKPWA.js";
18
+ import {
19
+ rulesAddSubcommand
20
+ } from "./chunk-KCF6S3XF.js";
21
+ import "./chunk-TBR2Q37Y.js";
22
+ import "./chunk-ECCWJHC6.js";
23
+ import {
24
+ AGENT_REASON,
25
+ buildCommandWithGlobalFlags,
26
+ outputAgentError
27
+ } from "./chunk-UDWRZXIT.js";
28
+ import {
29
+ parseArguments,
30
+ printError
31
+ } from "./chunk-SZXT3PDQ.js";
32
+ import {
33
+ getFlagsSpecification,
34
+ isAPIError,
35
+ packageName
36
+ } from "./chunk-KSSNLCL4.js";
37
+ import "./chunk-P4QNYOFB.js";
38
+ import "./chunk-52QYYTM5.js";
39
+ import {
40
+ output_manager_default
41
+ } from "./chunk-OX7KI3LF.js";
42
+ import "./chunk-GGP5R3FU.js";
43
+ import "./chunk-S7KYDPEM.js";
44
+ import "./chunk-TZ2YI2VH.js";
45
+
46
+ // src/commands/alerts/rules/add.ts
47
+ import { readFileSync } from "fs";
48
+ import { resolve } from "path";
49
+ async function add(client, argv) {
50
+ let parsedArgs;
51
+ try {
52
+ parsedArgs = parseArguments(
53
+ argv,
54
+ getFlagsSpecification(rulesAddSubcommand.options)
55
+ );
56
+ } catch (e) {
57
+ emitRulesArgParseError(
58
+ client,
59
+ e,
60
+ "alerts rules add --project <name-or-id> --body <path>"
61
+ );
62
+ printError(e);
63
+ return 1;
64
+ }
65
+ const fr = validateJsonOutput(parsedArgs.flags);
66
+ if (!fr.valid) {
67
+ outputAgentError(
68
+ client,
69
+ {
70
+ status: "error",
71
+ reason: AGENT_REASON.INVALID_ARGUMENTS,
72
+ message: fr.error
73
+ },
74
+ 1
75
+ );
76
+ output_manager_default.error(fr.error);
77
+ return 1;
78
+ }
79
+ const bodyPath = parsedArgs.flags["--body"];
80
+ if (!bodyPath) {
81
+ outputAgentError(
82
+ client,
83
+ {
84
+ status: "error",
85
+ reason: AGENT_REASON.MISSING_ARGUMENTS,
86
+ message: `Missing required flag --body. Example: ${packageName} alerts rules add --body <file>`,
87
+ hint: "Provide a JSON file describing the new rule (id and teamId are assigned by the API).",
88
+ next: [
89
+ {
90
+ command: buildCommandWithGlobalFlags(
91
+ client.argv,
92
+ "alerts rules add --body <file>"
93
+ ),
94
+ when: "Replace <file> with a path to rule JSON"
95
+ }
96
+ ]
97
+ },
98
+ 1
99
+ );
100
+ output_manager_default.error(
101
+ "Missing required flag: --body <PATH> (JSON file for the new rule)."
102
+ );
103
+ return 1;
104
+ }
105
+ const scope = await parseRulesFlagsAndScope(
106
+ client,
107
+ {
108
+ "--project": parsedArgs.flags["--project"],
109
+ "--all": parsedArgs.flags["--all"]
110
+ },
111
+ fr.jsonOutput,
112
+ "alerts rules add"
113
+ );
114
+ if (typeof scope === "number") {
115
+ return scope;
116
+ }
117
+ let raw;
118
+ try {
119
+ raw = readFileSync(resolve(client.cwd, bodyPath), "utf8");
120
+ } catch {
121
+ outputAgentError(
122
+ client,
123
+ {
124
+ status: "error",
125
+ reason: AGENT_REASON.INVALID_ARGUMENTS,
126
+ message: `Could not read --body file: ${bodyPath}`
127
+ },
128
+ 1
129
+ );
130
+ output_manager_default.error(`Could not read --body file: ${bodyPath}`);
131
+ return 1;
132
+ }
133
+ let body;
134
+ try {
135
+ body = JSON.parse(raw);
136
+ } catch {
137
+ outputAgentError(
138
+ client,
139
+ {
140
+ status: "error",
141
+ reason: AGENT_REASON.INVALID_ARGUMENTS,
142
+ message: "Invalid JSON in --body file."
143
+ },
144
+ 1
145
+ );
146
+ output_manager_default.error("Invalid JSON in --body file.");
147
+ return 1;
148
+ }
149
+ delete body.id;
150
+ delete body.teamId;
151
+ if (scope.projectId !== void 0 && body.projectId === void 0) {
152
+ body.projectId = scope.projectId;
153
+ }
154
+ const path = rulesCollectionPath(scope);
155
+ output_manager_default.spinner("Creating alert rule...");
156
+ try {
157
+ const created = await client.fetch(path, {
158
+ method: "POST",
159
+ body
160
+ });
161
+ if (fr.jsonOutput) {
162
+ client.stdout.write(`${JSON.stringify({ rule: created }, null, 2)}
163
+ `);
164
+ } else {
165
+ const id = created?.id;
166
+ output_manager_default.success(`Created alert rule ${typeof id === "string" ? id : ""}`);
167
+ }
168
+ return 0;
169
+ } catch (err) {
170
+ if (isAPIError(err)) {
171
+ return handleRulesApiError(client, err, fr.jsonOutput);
172
+ }
173
+ throw err;
174
+ } finally {
175
+ output_manager_default.stopSpinner();
176
+ }
177
+ }
178
+ export {
179
+ add as default
180
+ };
@@ -0,0 +1,131 @@
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
+ emitVcrArgParseError,
9
+ handleVcrApiError,
10
+ resolveVcrScope,
11
+ validateVcrJsonOutput
12
+ } from "./chunk-GP5VCTEU.js";
13
+ import {
14
+ outputError
15
+ } from "./chunk-BUZRVER7.js";
16
+ import "./chunk-XPKWKPWA.js";
17
+ import {
18
+ addSubcommand
19
+ } from "./chunk-3VS4DTAU.js";
20
+ import "./chunk-GIL3VAUR.js";
21
+ import "./chunk-FYQPTH5C.js";
22
+ import "./chunk-TBR2Q37Y.js";
23
+ import "./chunk-ECCWJHC6.js";
24
+ import {
25
+ AGENT_REASON,
26
+ buildCommandWithGlobalFlags,
27
+ outputAgentError
28
+ } from "./chunk-UDWRZXIT.js";
29
+ import {
30
+ parseArguments,
31
+ printError
32
+ } from "./chunk-SZXT3PDQ.js";
33
+ import {
34
+ getFlagsSpecification,
35
+ isAPIError,
36
+ packageName
37
+ } from "./chunk-KSSNLCL4.js";
38
+ import "./chunk-P4QNYOFB.js";
39
+ import "./chunk-52QYYTM5.js";
40
+ import {
41
+ output_manager_default
42
+ } from "./chunk-OX7KI3LF.js";
43
+ import "./chunk-GGP5R3FU.js";
44
+ import "./chunk-S7KYDPEM.js";
45
+ import "./chunk-TZ2YI2VH.js";
46
+
47
+ // src/commands/vcr/add.ts
48
+ async function add(client, argv, telemetry) {
49
+ let parsedArgs;
50
+ try {
51
+ parsedArgs = parseArguments(
52
+ argv,
53
+ getFlagsSpecification(addSubcommand.options)
54
+ );
55
+ } catch (err) {
56
+ emitVcrArgParseError(client, err, "vcr add <name> --project <name-or-id>");
57
+ printError(err);
58
+ return 1;
59
+ }
60
+ const fr = validateVcrJsonOutput(client, parsedArgs.flags);
61
+ if (typeof fr === "number") {
62
+ return fr;
63
+ }
64
+ const name = parsedArgs.args[0];
65
+ const project = parsedArgs.flags["--project"];
66
+ telemetry.trackCliOptionProject(project);
67
+ telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]);
68
+ if (!name) {
69
+ outputAgentError(
70
+ client,
71
+ {
72
+ status: "error",
73
+ reason: AGENT_REASON.MISSING_ARGUMENTS,
74
+ message: `Missing repository name. Example: ${packageName} vcr add <name>`,
75
+ next: [
76
+ {
77
+ command: buildCommandWithGlobalFlags(client.argv, "vcr add <name>"),
78
+ when: "Replace <name> with the repository name to create"
79
+ }
80
+ ]
81
+ },
82
+ 1
83
+ );
84
+ return outputError(
85
+ client,
86
+ fr.jsonOutput,
87
+ "MISSING_ARGUMENTS",
88
+ "Usage: `vercel vcr add <name>`"
89
+ );
90
+ }
91
+ const scope = await resolveVcrScope(client, {
92
+ project,
93
+ jsonOutput: fr.jsonOutput
94
+ });
95
+ if (typeof scope === "number") {
96
+ return scope;
97
+ }
98
+ const path = `/v1/vcr/repository?teamId=${encodeURIComponent(scope.teamId)}`;
99
+ output_manager_default.spinner("Creating repository...");
100
+ try {
101
+ const created = await client.fetch(
102
+ path,
103
+ {
104
+ method: "POST",
105
+ body: { projectId: scope.projectId, name }
106
+ }
107
+ );
108
+ if (fr.jsonOutput) {
109
+ client.stdout.write(`${JSON.stringify(created, null, 2)}
110
+ `);
111
+ } else {
112
+ output_manager_default.success(`Created repository ${created.repository?.name ?? name}`);
113
+ }
114
+ return 0;
115
+ } catch (err) {
116
+ if (isAPIError(err)) {
117
+ return handleVcrApiError(client, err, fr.jsonOutput, {
118
+ retry: {
119
+ command: buildCommandWithGlobalFlags(client.argv, "vcr ls"),
120
+ when: "List existing repositories (a name conflict means it already exists)"
121
+ }
122
+ });
123
+ }
124
+ throw err;
125
+ } finally {
126
+ output_manager_default.stopSpinner();
127
+ }
128
+ }
129
+ export {
130
+ add as default
131
+ };
@@ -5,12 +5,11 @@ const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
 
8
- // src/util/is-valid-name.ts
9
- function isValidName(name = "") {
10
- const blacklist = ":/#?&@%+~".split("");
11
- return !name.split("").every((c) => blacklist.includes(c));
8
+ // src/util/can-prompt.ts
9
+ function canPrompt(client) {
10
+ return Boolean(client.stdin.isTTY) && !client.nonInteractive;
12
11
  }
13
12
 
14
13
  export {
15
- isValidName
14
+ canPrompt
16
15
  };