@depup/vercel 50.32.5-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 (96) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +38 -0
  3. package/changes.json +38 -0
  4. package/dist/chunks/chunk-2DLBVZWU.js +197 -0
  5. package/dist/chunks/chunk-2HSQ7YUK.js +93 -0
  6. package/dist/chunks/chunk-2IQTNMUG.js +86 -0
  7. package/dist/chunks/chunk-3FRG2XGZ.js +466 -0
  8. package/dist/chunks/chunk-3KMKI2FP.js +34 -0
  9. package/dist/chunks/chunk-3XFFP2BA.js +110 -0
  10. package/dist/chunks/chunk-4S3Y3ATR.js +5383 -0
  11. package/dist/chunks/chunk-7EHTK7LP.js +359 -0
  12. package/dist/chunks/chunk-7YHZDJ4G.js +116 -0
  13. package/dist/chunks/chunk-A3NYPUKZ.js +17 -0
  14. package/dist/chunks/chunk-AA7QEJFB.js +5204 -0
  15. package/dist/chunks/chunk-AHU7WNL2.js +24 -0
  16. package/dist/chunks/chunk-AKQZ7KG3.js +4172 -0
  17. package/dist/chunks/chunk-AQLVWVEN.js +39155 -0
  18. package/dist/chunks/chunk-BQ3DXZNT.js +968 -0
  19. package/dist/chunks/chunk-E65JE2CC.js +102 -0
  20. package/dist/chunks/chunk-EKPSCRJZ.js +26 -0
  21. package/dist/chunks/chunk-EOZFDJSY.js +18 -0
  22. package/dist/chunks/chunk-FDJURQMQ.js +4676 -0
  23. package/dist/chunks/chunk-FLKHKWZV.js +1854 -0
  24. package/dist/chunks/chunk-G6BUEBF5.js +192 -0
  25. package/dist/chunks/chunk-GBNIO3KP.js +771 -0
  26. package/dist/chunks/chunk-GGP5R3FU.js +129 -0
  27. package/dist/chunks/chunk-H5XJSH37.js +91 -0
  28. package/dist/chunks/chunk-IB5L4LKZ.js +1082 -0
  29. package/dist/chunks/chunk-IE7MNZ56.js +149 -0
  30. package/dist/chunks/chunk-IK7DLK2T.js +16112 -0
  31. package/dist/chunks/chunk-IUGPWINM.js +104 -0
  32. package/dist/chunks/chunk-J7HDA5GH.js +54 -0
  33. package/dist/chunks/chunk-JLYZNGYY.js +293 -0
  34. package/dist/chunks/chunk-JQ4NA5MX.js +250 -0
  35. package/dist/chunks/chunk-LL26LVRR.js +81 -0
  36. package/dist/chunks/chunk-LW5ZNGW7.js +127 -0
  37. package/dist/chunks/chunk-LWBSOTJP.js +1772 -0
  38. package/dist/chunks/chunk-MBGJBHYD.js +388 -0
  39. package/dist/chunks/chunk-NUKAG3YM.js +168 -0
  40. package/dist/chunks/chunk-O7I4ZOCC.js +58 -0
  41. package/dist/chunks/chunk-OWR3XNE3.js +48 -0
  42. package/dist/chunks/chunk-P3SKP5WM.js +27 -0
  43. package/dist/chunks/chunk-P4I4DMEU.js +342 -0
  44. package/dist/chunks/chunk-P5Q6F5IA.js +107 -0
  45. package/dist/chunks/chunk-PMSMUMUO.js +30 -0
  46. package/dist/chunks/chunk-QXRJ52T4.js +2977 -0
  47. package/dist/chunks/chunk-RQXPRFRM.js +90 -0
  48. package/dist/chunks/chunk-S7KYDPEM.js +1564 -0
  49. package/dist/chunks/chunk-SGGLJFUZ.js +68 -0
  50. package/dist/chunks/chunk-SOTR4CXR.js +34 -0
  51. package/dist/chunks/chunk-TEVP63TU.js +1717 -0
  52. package/dist/chunks/chunk-TNBMKNET.js +323 -0
  53. package/dist/chunks/chunk-TZ2YI2VH.js +87 -0
  54. package/dist/chunks/chunk-U6XOC6E4.js +903 -0
  55. package/dist/chunks/chunk-V5P25P7F.js +22 -0
  56. package/dist/chunks/chunk-WQ5CUZWR.js +333 -0
  57. package/dist/chunks/chunk-WU2BPWRP.js +12237 -0
  58. package/dist/chunks/chunk-XPKWKPWA.js +44 -0
  59. package/dist/chunks/chunk-XR53KVJD.js +33 -0
  60. package/dist/chunks/chunk-Y4JJYHUG.js +16 -0
  61. package/dist/chunks/chunk-YPQSDAEW.js +29 -0
  62. package/dist/chunks/chunk-ZB2UO4V2.js +135 -0
  63. package/dist/chunks/chunk-ZLCMHY2G.js +1528 -0
  64. package/dist/chunks/compile-vercel-config-XU3YY2CZ.js +32 -0
  65. package/dist/chunks/delete-EJ2V7KQO.js +144 -0
  66. package/dist/chunks/disable-BKRFMX4U.js +122 -0
  67. package/dist/chunks/discard-4WF34DXK.js +118 -0
  68. package/dist/chunks/edit-FQE7JGU3.js +509 -0
  69. package/dist/chunks/emit-flags-datafiles-QYKPNWPX.js +17 -0
  70. package/dist/chunks/enable-VCNMX63U.js +122 -0
  71. package/dist/chunks/export-3KNVJCQR.js +133 -0
  72. package/dist/chunks/list-43XQCGKH.js +382 -0
  73. package/dist/chunks/list-DUL6PHUR.js +394 -0
  74. package/dist/chunks/publish-CF7GVZK3.js +128 -0
  75. package/dist/chunks/query-KWKO7VWO.js +954 -0
  76. package/dist/chunks/reorder-GU65YMIN.js +259 -0
  77. package/dist/chunks/restore-Q7ENGWVJ.js +158 -0
  78. package/dist/chunks/routes-Q5CWG44T.js +20 -0
  79. package/dist/chunks/schema-PJKLO2K2.js +176 -0
  80. package/dist/chunks/stamp-RTPE2EBB.js +15 -0
  81. package/dist/chunks/types-563KUQRV.js +108 -0
  82. package/dist/chunks/update-route-version-E3V47KNI.js +13 -0
  83. package/dist/commands/build/index.js +1597 -0
  84. package/dist/commands/deploy/index.js +1711 -0
  85. package/dist/commands/dev/builder-worker.cjs +95 -0
  86. package/dist/commands/dev/index.js +20810 -0
  87. package/dist/commands/env/index.js +2154 -0
  88. package/dist/commands/link/index.js +225 -0
  89. package/dist/commands/list/index.js +528 -0
  90. package/dist/commands-bulk.js +29627 -0
  91. package/dist/get-latest-worker.cjs +272 -0
  92. package/dist/help.js +14 -0
  93. package/dist/index.js +24274 -0
  94. package/dist/vc.js +36 -0
  95. package/dist/version.mjs +1 -0
  96. package/package.json +254 -0
@@ -0,0 +1,342 @@
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
+ output_manager_default
9
+ } from "./chunk-FDJURQMQ.js";
10
+ import {
11
+ __commonJS,
12
+ __toESM
13
+ } from "./chunk-TZ2YI2VH.js";
14
+
15
+ // ../../internals/constants/dist/index.js
16
+ var require_dist = __commonJS({
17
+ "../../internals/constants/dist/index.js"(exports) {
18
+ "use strict";
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.TITLE = exports.NAME = exports.LOGO = exports.PROJECT_ENV_TARGET = void 0;
21
+ exports.PROJECT_ENV_TARGET = [
22
+ "production",
23
+ "preview",
24
+ "development"
25
+ ];
26
+ exports.LOGO = "\u25B2";
27
+ exports.NAME = "vercel";
28
+ exports.TITLE = "Vercel";
29
+ }
30
+ });
31
+
32
+ // src/util/telemetry/index.ts
33
+ import { randomUUID } from "crypto";
34
+ import os from "os";
35
+ var import_constants = __toESM(require_dist(), 1);
36
+ import { spawn } from "child_process";
37
+ import { cloneEnv } from "@vercel/build-utils";
38
+ var LogLabel = `['telemetry']:`;
39
+ var TelemetryClient = class {
40
+ constructor({ opts }) {
41
+ this.redactedValue = "[REDACTED]";
42
+ this.noValueToTriggerPrompt = "[TRIGGER_PROMPT]";
43
+ this.redactedArgumentsLength = (args) => {
44
+ if (args && args.length === 1) {
45
+ return "ONE";
46
+ }
47
+ if (args.length > 1) {
48
+ return "MANY";
49
+ }
50
+ return "NONE";
51
+ };
52
+ this.redactedTargetName = (target) => {
53
+ if (import_constants.PROJECT_ENV_TARGET.includes(target)) {
54
+ return target;
55
+ }
56
+ return this.redactedValue;
57
+ };
58
+ this.isDebug = opts.isDebug || false;
59
+ this.store = opts.store;
60
+ }
61
+ track(eventData) {
62
+ if (this.isDebug) {
63
+ output_manager_default.debug(`${LogLabel} ${eventData.key}:${eventData.value}`);
64
+ }
65
+ const event = {
66
+ id: randomUUID(),
67
+ eventTime: Date.now(),
68
+ ...eventData
69
+ };
70
+ this.store.add(event);
71
+ }
72
+ trackCliCommand(eventData) {
73
+ this.track({
74
+ key: `command:${eventData.command}`,
75
+ value: eventData.value
76
+ });
77
+ }
78
+ trackCliSubcommand(eventData) {
79
+ this.track({
80
+ key: `subcommand:${eventData.subcommand}`,
81
+ value: eventData.value
82
+ });
83
+ }
84
+ trackCliArgument(eventData) {
85
+ if (eventData.value) {
86
+ this.track({
87
+ key: `argument:${eventData.arg}`,
88
+ value: eventData.value
89
+ });
90
+ }
91
+ }
92
+ trackCliOption(eventData) {
93
+ this.track({
94
+ key: `option:${eventData.option}`,
95
+ value: eventData.value
96
+ });
97
+ }
98
+ trackCommandOutput(eventData) {
99
+ this.track({
100
+ key: `output:${eventData.key}`,
101
+ value: eventData.value
102
+ });
103
+ }
104
+ trackCliFlag(flag) {
105
+ this.track({
106
+ key: `flag:${flag}`,
107
+ value: "TRUE"
108
+ });
109
+ }
110
+ trackOidcTokenRefresh(count) {
111
+ this.track({
112
+ key: "oidc-token-refresh",
113
+ value: `${count}`
114
+ });
115
+ }
116
+ trackCPUs() {
117
+ this.track({
118
+ key: "cpu_count",
119
+ value: String(os.cpus().length)
120
+ });
121
+ }
122
+ trackAgenticUse(agent) {
123
+ if (agent) {
124
+ this.track({
125
+ key: "agent",
126
+ value: agent
127
+ });
128
+ }
129
+ }
130
+ trackPlatform() {
131
+ this.track({
132
+ key: "platform",
133
+ value: os.platform()
134
+ });
135
+ }
136
+ trackArch() {
137
+ this.track({
138
+ key: "arch",
139
+ value: os.arch()
140
+ });
141
+ }
142
+ trackCI(ciVendorName) {
143
+ if (ciVendorName) {
144
+ this.track({
145
+ key: "ci",
146
+ value: ciVendorName
147
+ });
148
+ }
149
+ }
150
+ trackVersion(version) {
151
+ if (version) {
152
+ this.track({
153
+ key: "version",
154
+ value: version
155
+ });
156
+ }
157
+ }
158
+ trackDefaultDeploy() {
159
+ this.track({
160
+ key: "default-deploy",
161
+ value: "TRUE"
162
+ });
163
+ }
164
+ trackExtension() {
165
+ this.track({
166
+ key: "extension",
167
+ value: this.redactedValue
168
+ });
169
+ }
170
+ trackLoginState(state) {
171
+ if (state === "started")
172
+ this.loginAttempt = randomUUID();
173
+ if (this.loginAttempt) {
174
+ this.track({ key: `login:attempt:${this.loginAttempt}`, value: state });
175
+ }
176
+ if (state !== "started")
177
+ this.loginAttempt = void 0;
178
+ }
179
+ trackCliFlagHelp(command, subcommands) {
180
+ let subcommand;
181
+ if (subcommands) {
182
+ subcommand = Array.isArray(subcommands) ? subcommands[0] : subcommands;
183
+ }
184
+ this.track({
185
+ key: "flag:help",
186
+ value: subcommand ? `${command}:${subcommand}` : command
187
+ });
188
+ }
189
+ /**
190
+ * Tracks the --format option for JSON output.
191
+ * This is a common option across many commands, so it's defined in the base class.
192
+ */
193
+ trackCliOptionFormat(format) {
194
+ if (format) {
195
+ const allowedFormat = ["json"].includes(format) ? format : this.redactedValue;
196
+ this.trackCliOption({
197
+ option: "format",
198
+ value: allowedFormat
199
+ });
200
+ }
201
+ }
202
+ };
203
+ var TelemetryEventStore = class {
204
+ constructor(opts) {
205
+ this.teamId = "NO_TEAM_ID";
206
+ this.userId = "NO_USER_ID";
207
+ this.isDebug = opts?.isDebug || false;
208
+ this.sessionId = randomUUID();
209
+ this.events = [];
210
+ this.config = opts?.config;
211
+ }
212
+ add(event) {
213
+ event.sessionId = this.sessionId;
214
+ event.teamId = this.teamId;
215
+ event.userId = this.userId;
216
+ this.events.push(event);
217
+ }
218
+ updateTeamId(teamId) {
219
+ if (teamId) {
220
+ this.teamId = teamId;
221
+ }
222
+ }
223
+ updateUserId(userId) {
224
+ if (userId) {
225
+ this.userId = userId;
226
+ }
227
+ }
228
+ get hasUserId() {
229
+ return this.userId !== "NO_USER_ID";
230
+ }
231
+ get readonlyEvents() {
232
+ return Array.from(this.events);
233
+ }
234
+ reset() {
235
+ this.events = [];
236
+ }
237
+ get enabled() {
238
+ if (process.env.VERCEL_TELEMETRY_DISABLED) {
239
+ return false;
240
+ }
241
+ return this.config?.enabled ?? true;
242
+ }
243
+ async save() {
244
+ if (this.isDebug) {
245
+ output_manager_default.log(`${LogLabel} Flushing Events`);
246
+ for (const event of this.events) {
247
+ event.teamId = this.teamId;
248
+ event.userId = this.userId;
249
+ output_manager_default.log(JSON.stringify(event));
250
+ }
251
+ return;
252
+ }
253
+ if (this.enabled) {
254
+ const sessionId = this.events[0].sessionId;
255
+ if (!sessionId) {
256
+ output_manager_default.debug("Unable to send metrics: no session ID");
257
+ return;
258
+ }
259
+ const events = this.events.map((event) => {
260
+ delete event.sessionId;
261
+ delete event.teamId;
262
+ delete event.userId;
263
+ const { eventTime, ...rest } = event;
264
+ return {
265
+ event_time: eventTime,
266
+ team_id: this.teamId,
267
+ user_id: this.userId,
268
+ ...rest
269
+ };
270
+ });
271
+ const payload = {
272
+ headers: {
273
+ "Client-id": "vercel-cli",
274
+ "x-vercel-cli-topic-id": "generic",
275
+ "x-vercel-cli-session-id": sessionId
276
+ },
277
+ body: events
278
+ };
279
+ await this.sendToSubprocess(payload, output_manager_default.debugEnabled);
280
+ }
281
+ }
282
+ /**
283
+ * Send the telemetry events to a subprocess, this invokes the `telemetry flush` command
284
+ * and passes a stringified payload to the subprocess, there's a risk that if the event payload
285
+ * increases in size, it may exceed the maximum buffer size for the subprocess, in which case the
286
+ * child process will error and not send anything.
287
+ * FIXME: handle max buffer size
288
+ */
289
+ async sendToSubprocess(payload, outputDebugEnabled) {
290
+ const args = [process.execPath, process.argv[0], process.argv[1]];
291
+ if (args[0] === args[1]) {
292
+ args.shift();
293
+ }
294
+ const nodeBinaryPath = args[0];
295
+ const script = [
296
+ ...args.slice(1),
297
+ "telemetry",
298
+ "flush",
299
+ JSON.stringify(payload)
300
+ ];
301
+ const env = cloneEnv(process.env, {
302
+ VERCEL_TELEMETRY_DISABLED: "1"
303
+ });
304
+ if (outputDebugEnabled) {
305
+ return new Promise((resolve) => {
306
+ const childProcess = spawn(nodeBinaryPath, script, {
307
+ env,
308
+ stdio: ["ignore", "pipe", "pipe"]
309
+ });
310
+ childProcess.stderr.on("data", (data) => output_manager_default.debug(data.toString()));
311
+ childProcess.stdout.on("data", (data) => output_manager_default.debug(data.toString()));
312
+ childProcess.on("error", (d) => {
313
+ output_manager_default.debug(d);
314
+ });
315
+ const timeout = setTimeout(() => {
316
+ output_manager_default.debug("Telemetry subprocess killed due to timeout");
317
+ childProcess.kill();
318
+ }, 2e3);
319
+ childProcess.on("exit", (code) => {
320
+ output_manager_default.debug(`Telemetry subprocess exited with code ${code}`);
321
+ childProcess.unref();
322
+ timeout.unref();
323
+ resolve();
324
+ });
325
+ });
326
+ } else {
327
+ const childProcess = spawn(nodeBinaryPath, script, {
328
+ stdio: "ignore",
329
+ env,
330
+ windowsHide: true,
331
+ detached: true
332
+ });
333
+ childProcess.unref();
334
+ }
335
+ }
336
+ };
337
+
338
+ export {
339
+ require_dist,
340
+ TelemetryClient,
341
+ TelemetryEventStore
342
+ };
@@ -0,0 +1,107 @@
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
+ formatOption,
9
+ limitOption,
10
+ packageName
11
+ } from "./chunk-ZLCMHY2G.js";
12
+
13
+ // src/commands/alerts/command.ts
14
+ var listSubcommand = {
15
+ name: "ls",
16
+ aliases: ["list"],
17
+ description: "",
18
+ default: true,
19
+ hidden: true,
20
+ arguments: [],
21
+ options: [],
22
+ examples: []
23
+ };
24
+ var alertsCommand = {
25
+ name: "alerts",
26
+ aliases: [],
27
+ description: "List alerts for a project or team.",
28
+ arguments: [],
29
+ subcommands: [listSubcommand],
30
+ options: [
31
+ {
32
+ name: "type",
33
+ shorthand: null,
34
+ type: [String],
35
+ argument: "TYPE",
36
+ deprecated: false,
37
+ description: "Filter by alert type. Repeatable and comma-separated (for example --type usage_anomaly,error_anomaly)."
38
+ },
39
+ {
40
+ name: "project",
41
+ shorthand: "p",
42
+ type: String,
43
+ argument: "NAME_OR_ID",
44
+ deprecated: false,
45
+ description: "Filter by project (overrides auto-detected linked project)."
46
+ },
47
+ {
48
+ name: "all",
49
+ shorthand: "a",
50
+ type: Boolean,
51
+ deprecated: false,
52
+ description: "Show team-wide alerts (ignore linked project auto-scoping)."
53
+ },
54
+ {
55
+ name: "ai",
56
+ shorthand: null,
57
+ type: Boolean,
58
+ deprecated: false,
59
+ description: "Print AI-focused sections (title, resolved time, summary, key findings) instead of table output."
60
+ },
61
+ {
62
+ name: "since",
63
+ shorthand: null,
64
+ type: String,
65
+ argument: "ISO_DATE",
66
+ deprecated: false,
67
+ description: "Start of time range (ISO-8601). Defaults to 24 hours ago if not provided."
68
+ },
69
+ {
70
+ name: "until",
71
+ shorthand: null,
72
+ type: String,
73
+ argument: "ISO_DATE",
74
+ deprecated: false,
75
+ description: "End of time range (ISO-8601). Defaults to now."
76
+ },
77
+ limitOption,
78
+ formatOption
79
+ ],
80
+ examples: [
81
+ {
82
+ name: "List alerts for the linked project",
83
+ value: `${packageName} alerts`
84
+ },
85
+ {
86
+ name: "List team-wide alerts",
87
+ value: `${packageName} alerts --all`
88
+ },
89
+ {
90
+ name: "Filter by type",
91
+ value: `${packageName} alerts --type usage_anomaly --type error_anomaly`
92
+ },
93
+ {
94
+ name: "Output JSON",
95
+ value: `${packageName} alerts --format json`
96
+ },
97
+ {
98
+ name: "Custom time range",
99
+ value: `${packageName} alerts --since 2026-03-01T00:00:00.000Z --until 2026-03-02T00:00:00.000Z`
100
+ }
101
+ ]
102
+ };
103
+
104
+ export {
105
+ listSubcommand,
106
+ alertsCommand
107
+ };
@@ -0,0 +1,30 @@
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
+
8
+ // src/util/routes/update-route-version.ts
9
+ async function updateRouteVersion(client, projectId, versionId, action, options = {}) {
10
+ const { teamId } = options;
11
+ const query = new URLSearchParams();
12
+ if (teamId)
13
+ query.set("teamId", teamId);
14
+ const queryString = query.toString();
15
+ const url = `/v1/projects/${projectId}/routes/versions${queryString ? `?${queryString}` : ""}`;
16
+ return await client.fetch(url, {
17
+ method: "POST",
18
+ headers: {
19
+ "Content-Type": "application/json"
20
+ },
21
+ body: JSON.stringify({
22
+ id: versionId,
23
+ action
24
+ })
25
+ });
26
+ }
27
+
28
+ export {
29
+ updateRouteVersion
30
+ };