@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,903 @@
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
+ packageName,
9
+ yesOption
10
+ } from "./chunk-ZLCMHY2G.js";
11
+
12
+ // src/commands/routes/command.ts
13
+ var listSubcommand = {
14
+ name: "list",
15
+ aliases: ["ls"],
16
+ description: "List all routing rules for the current project. These routes apply to all deployments and environments.",
17
+ arguments: [],
18
+ options: [
19
+ {
20
+ name: "search",
21
+ description: "Search by name, description, source, or destination",
22
+ shorthand: "s",
23
+ type: String,
24
+ argument: "QUERY",
25
+ deprecated: false
26
+ },
27
+ {
28
+ name: "filter",
29
+ description: "Filter by type: rewrite, redirect, set_status, transform",
30
+ shorthand: "f",
31
+ type: String,
32
+ argument: "TYPE",
33
+ deprecated: false
34
+ },
35
+ {
36
+ name: "production",
37
+ description: "List routes from the live production version",
38
+ shorthand: null,
39
+ type: Boolean,
40
+ deprecated: false
41
+ },
42
+ {
43
+ name: "version-id",
44
+ description: "List routes from a specific version ID",
45
+ shorthand: null,
46
+ type: String,
47
+ argument: "VERSION_ID",
48
+ deprecated: false
49
+ },
50
+ {
51
+ name: "diff",
52
+ description: "Compare staged changes against production. Use with --version-id to compare a specific version.",
53
+ shorthand: null,
54
+ type: Boolean,
55
+ deprecated: false
56
+ },
57
+ {
58
+ name: "expand",
59
+ description: "Show expanded details for each route",
60
+ shorthand: "e",
61
+ type: Boolean,
62
+ deprecated: false
63
+ }
64
+ ],
65
+ examples: [
66
+ {
67
+ name: "List all routes",
68
+ value: `${packageName} routes list`
69
+ },
70
+ {
71
+ name: "Search for routes",
72
+ value: `${packageName} routes list --search "api"`
73
+ },
74
+ {
75
+ name: "Filter by type",
76
+ value: `${packageName} routes list --filter rewrite`
77
+ },
78
+ {
79
+ name: "Show staged changes",
80
+ value: `${packageName} routes list --diff`
81
+ },
82
+ {
83
+ name: "Show live production routes",
84
+ value: `${packageName} routes list --production`
85
+ },
86
+ {
87
+ name: "Show expanded details",
88
+ value: `${packageName} routes list --expand`
89
+ }
90
+ ]
91
+ };
92
+ var listVersionsSubcommand = {
93
+ name: "list-versions",
94
+ aliases: ["ls-versions"],
95
+ description: "List all versions of routing rules",
96
+ arguments: [],
97
+ options: [
98
+ {
99
+ name: "count",
100
+ description: "Number of versions to fetch (default: 20, max: 100)",
101
+ shorthand: null,
102
+ type: Number,
103
+ argument: "NUMBER",
104
+ deprecated: false
105
+ }
106
+ ],
107
+ examples: [
108
+ {
109
+ name: "List route versions",
110
+ value: `${packageName} routes list-versions`
111
+ },
112
+ {
113
+ name: "List more versions",
114
+ value: `${packageName} routes list-versions --count 50`
115
+ }
116
+ ]
117
+ };
118
+ var inspectSubcommand = {
119
+ name: "inspect",
120
+ aliases: [],
121
+ description: "Show detailed information about a specific route",
122
+ arguments: [
123
+ {
124
+ name: "name-or-id",
125
+ required: true
126
+ }
127
+ ],
128
+ options: [
129
+ {
130
+ name: "diff",
131
+ description: "Compare staged changes against production for this route",
132
+ shorthand: null,
133
+ type: Boolean,
134
+ deprecated: false
135
+ }
136
+ ],
137
+ examples: [
138
+ {
139
+ name: "Inspect a route by name",
140
+ value: `${packageName} routes inspect "API rewrite"`
141
+ },
142
+ {
143
+ name: "Inspect a route by ID",
144
+ value: `${packageName} routes inspect abc123`
145
+ },
146
+ {
147
+ name: "Show staged changes for a route",
148
+ value: `${packageName} routes inspect "My route" --diff`
149
+ }
150
+ ]
151
+ };
152
+ var addSubcommand = {
153
+ name: "add",
154
+ aliases: [],
155
+ description: "Add a new routing rule to the project",
156
+ arguments: [
157
+ {
158
+ name: "name",
159
+ required: false
160
+ }
161
+ ],
162
+ options: [
163
+ // Path & Matching
164
+ {
165
+ name: "src",
166
+ description: "Path pattern (required in non-interactive mode)",
167
+ shorthand: null,
168
+ type: String,
169
+ argument: "PATTERN",
170
+ deprecated: false
171
+ },
172
+ {
173
+ name: "src-syntax",
174
+ description: "Path syntax: regex (default), path-to-regexp, equals",
175
+ shorthand: null,
176
+ type: String,
177
+ argument: "TYPE",
178
+ deprecated: false
179
+ },
180
+ // Primary Actions
181
+ {
182
+ name: "action",
183
+ description: "Action type: rewrite, redirect, or set-status (required with --dest/--status)",
184
+ shorthand: null,
185
+ type: String,
186
+ argument: "TYPE",
187
+ deprecated: false
188
+ },
189
+ {
190
+ name: "dest",
191
+ description: "Destination URL for rewrite or redirect",
192
+ shorthand: null,
193
+ type: String,
194
+ argument: "URL",
195
+ deprecated: false
196
+ },
197
+ {
198
+ name: "status",
199
+ description: "Status code (301/302/307/308 for redirect, or any for set-status)",
200
+ shorthand: null,
201
+ type: Number,
202
+ argument: "CODE",
203
+ deprecated: false
204
+ },
205
+ // Response Headers
206
+ {
207
+ name: "set-response-header",
208
+ description: "Set response header: key=value (repeatable)",
209
+ shorthand: null,
210
+ type: [String],
211
+ argument: "HEADER",
212
+ deprecated: false
213
+ },
214
+ {
215
+ name: "append-response-header",
216
+ description: "Append to response header: key=value (repeatable)",
217
+ shorthand: null,
218
+ type: [String],
219
+ argument: "HEADER",
220
+ deprecated: false
221
+ },
222
+ {
223
+ name: "delete-response-header",
224
+ description: "Delete response header: key (repeatable)",
225
+ shorthand: null,
226
+ type: [String],
227
+ argument: "KEY",
228
+ deprecated: false
229
+ },
230
+ // Request Headers
231
+ {
232
+ name: "set-request-header",
233
+ description: "Set request header: key=value (repeatable)",
234
+ shorthand: null,
235
+ type: [String],
236
+ argument: "HEADER",
237
+ deprecated: false
238
+ },
239
+ {
240
+ name: "append-request-header",
241
+ description: "Append to request header: key=value (repeatable)",
242
+ shorthand: null,
243
+ type: [String],
244
+ argument: "HEADER",
245
+ deprecated: false
246
+ },
247
+ {
248
+ name: "delete-request-header",
249
+ description: "Delete request header: key (repeatable)",
250
+ shorthand: null,
251
+ type: [String],
252
+ argument: "KEY",
253
+ deprecated: false
254
+ },
255
+ // Request Query
256
+ {
257
+ name: "set-request-query",
258
+ description: "Set query parameter: key=value (repeatable)",
259
+ shorthand: null,
260
+ type: [String],
261
+ argument: "PARAM",
262
+ deprecated: false
263
+ },
264
+ {
265
+ name: "append-request-query",
266
+ description: "Append to query parameter: key=value (repeatable)",
267
+ shorthand: null,
268
+ type: [String],
269
+ argument: "PARAM",
270
+ deprecated: false
271
+ },
272
+ {
273
+ name: "delete-request-query",
274
+ description: "Delete query parameter: key (repeatable)",
275
+ shorthand: null,
276
+ type: [String],
277
+ argument: "KEY",
278
+ deprecated: false
279
+ },
280
+ // Conditions
281
+ {
282
+ name: "has",
283
+ description: "Condition that must match: type:key or type:key:value (repeatable)",
284
+ shorthand: null,
285
+ type: [String],
286
+ argument: "CONDITION",
287
+ deprecated: false
288
+ },
289
+ {
290
+ name: "missing",
291
+ description: '"Does not have" condition: type:key or type:key:value (repeatable)',
292
+ shorthand: null,
293
+ type: [String],
294
+ argument: "CONDITION",
295
+ deprecated: false
296
+ },
297
+ // Metadata
298
+ {
299
+ name: "description",
300
+ description: "Route description (max 1024 chars)",
301
+ shorthand: null,
302
+ type: String,
303
+ argument: "TEXT",
304
+ deprecated: false
305
+ },
306
+ {
307
+ name: "disabled",
308
+ description: "Create route in disabled state",
309
+ shorthand: null,
310
+ type: Boolean,
311
+ deprecated: false
312
+ },
313
+ {
314
+ name: "ai",
315
+ description: "Generate route from a natural language description (AI-powered)",
316
+ shorthand: null,
317
+ type: String,
318
+ argument: "PROMPT",
319
+ deprecated: false
320
+ },
321
+ {
322
+ name: "position",
323
+ description: "Position: start, end, after:<id>, before:<id>",
324
+ shorthand: null,
325
+ type: String,
326
+ argument: "POSITION",
327
+ deprecated: false
328
+ },
329
+ {
330
+ name: "yes",
331
+ description: "Skip confirmation prompts",
332
+ shorthand: "y",
333
+ type: Boolean,
334
+ deprecated: false
335
+ }
336
+ ],
337
+ examples: [
338
+ {
339
+ name: "Interactive mode",
340
+ value: `${packageName} routes add`
341
+ },
342
+ {
343
+ name: "Create with AI",
344
+ value: `${packageName} routes add --ai "Rewrite /api/* to https://backend.internal/*"`
345
+ },
346
+ {
347
+ name: "Add a rewrite",
348
+ value: `${packageName} routes add "API Proxy" --src "/api/:path*" --src-syntax path-to-regexp --action rewrite --dest "https://api.example.com/:path*" --yes`
349
+ },
350
+ {
351
+ name: "Add a redirect",
352
+ value: `${packageName} routes add "Old Blog" --src "/blog" --src-syntax equals --action redirect --dest "/articles" --status 301 --yes`
353
+ },
354
+ {
355
+ name: "Add CORS headers",
356
+ value: `${packageName} routes add "CORS" --src "^/api/.*$" --set-response-header "Access-Control-Allow-Origin=*" --yes`
357
+ },
358
+ {
359
+ name: "Block access (set status)",
360
+ value: `${packageName} routes add "Block Admin" --src "^/admin/.*$" --action set-status --status 403 --yes`
361
+ },
362
+ {
363
+ name: "Conditional redirect",
364
+ value: `${packageName} routes add "Auth Required" --src "/protected/:path*" --src-syntax path-to-regexp --action redirect --dest "/login" --status 307 --missing "cookie:session" --yes`
365
+ },
366
+ {
367
+ name: "Rewrite with request headers",
368
+ value: `${packageName} routes add "Backend Proxy" --src "/backend/:path*" --src-syntax path-to-regexp --action rewrite --dest "https://internal.example.com/:path*" --set-request-header "X-Forwarded-Host=myapp.com" --yes`
369
+ },
370
+ {
371
+ name: "Add route at start",
372
+ value: `${packageName} routes add "Priority Route" --src "/priority" --src-syntax equals --action rewrite --dest "/handler" --position start --yes`
373
+ }
374
+ ]
375
+ };
376
+ var publishSubcommand = {
377
+ name: "publish",
378
+ aliases: [],
379
+ description: "Publish staged routing changes to production",
380
+ arguments: [],
381
+ options: [
382
+ {
383
+ ...yesOption,
384
+ description: "Skip the confirmation prompt when publishing"
385
+ }
386
+ ],
387
+ examples: [
388
+ {
389
+ name: "Publish staged changes",
390
+ value: `${packageName} routes publish`
391
+ },
392
+ {
393
+ name: "Publish without confirmation",
394
+ value: `${packageName} routes publish --yes`
395
+ }
396
+ ]
397
+ };
398
+ var restoreSubcommand = {
399
+ name: "restore",
400
+ aliases: [],
401
+ description: "Restore a previous routing version to production",
402
+ arguments: [
403
+ {
404
+ name: "version-id",
405
+ required: true
406
+ }
407
+ ],
408
+ options: [
409
+ {
410
+ ...yesOption,
411
+ description: "Skip the confirmation prompt when restoring"
412
+ }
413
+ ],
414
+ examples: [
415
+ {
416
+ name: "Restore a previous version",
417
+ value: `${packageName} routes restore <version-id>`
418
+ },
419
+ {
420
+ name: "Restore without confirmation",
421
+ value: `${packageName} routes restore <version-id> --yes`
422
+ }
423
+ ]
424
+ };
425
+ var discardSubcommand = {
426
+ name: "discard-staging",
427
+ aliases: [],
428
+ description: "Discard staged routing changes",
429
+ arguments: [],
430
+ options: [
431
+ {
432
+ ...yesOption,
433
+ description: "Skip the confirmation prompt when discarding"
434
+ }
435
+ ],
436
+ examples: [
437
+ {
438
+ name: "Discard staged changes",
439
+ value: `${packageName} routes discard-staging`
440
+ },
441
+ {
442
+ name: "Discard without confirmation",
443
+ value: `${packageName} routes discard-staging --yes`
444
+ }
445
+ ]
446
+ };
447
+ var deleteSubcommand = {
448
+ name: "delete",
449
+ aliases: ["rm"],
450
+ description: "Delete one or more routing rules",
451
+ arguments: [
452
+ {
453
+ name: "name-or-id",
454
+ required: true
455
+ }
456
+ ],
457
+ options: [
458
+ {
459
+ ...yesOption,
460
+ description: "Skip the confirmation prompt when deleting"
461
+ }
462
+ ],
463
+ examples: [
464
+ {
465
+ name: "Delete a route by name",
466
+ value: `${packageName} routes delete "Old Redirect"`
467
+ },
468
+ {
469
+ name: "Delete a route by ID",
470
+ value: `${packageName} routes delete abc123`
471
+ },
472
+ {
473
+ name: "Delete multiple routes",
474
+ value: `${packageName} routes delete "Route A" "Route B"`
475
+ },
476
+ {
477
+ name: "Delete without confirmation",
478
+ value: `${packageName} routes delete "Old Route" --yes`
479
+ }
480
+ ]
481
+ };
482
+ var enableSubcommand = {
483
+ name: "enable",
484
+ aliases: [],
485
+ description: "Enable a disabled routing rule",
486
+ arguments: [
487
+ {
488
+ name: "name-or-id",
489
+ required: true
490
+ }
491
+ ],
492
+ options: [],
493
+ examples: [
494
+ {
495
+ name: "Enable a route by name",
496
+ value: `${packageName} routes enable "API Proxy"`
497
+ },
498
+ {
499
+ name: "Enable a route by ID",
500
+ value: `${packageName} routes enable abc123`
501
+ }
502
+ ]
503
+ };
504
+ var disableSubcommand = {
505
+ name: "disable",
506
+ aliases: [],
507
+ description: "Disable a routing rule without deleting it",
508
+ arguments: [
509
+ {
510
+ name: "name-or-id",
511
+ required: true
512
+ }
513
+ ],
514
+ options: [],
515
+ examples: [
516
+ {
517
+ name: "Disable a route by name",
518
+ value: `${packageName} routes disable "API Proxy"`
519
+ },
520
+ {
521
+ name: "Disable a route by ID",
522
+ value: `${packageName} routes disable abc123`
523
+ }
524
+ ]
525
+ };
526
+ var reorderSubcommand = {
527
+ name: "reorder",
528
+ aliases: ["move"],
529
+ description: "Move a routing rule to a different position",
530
+ arguments: [
531
+ {
532
+ name: "name-or-id",
533
+ required: true
534
+ }
535
+ ],
536
+ options: [
537
+ {
538
+ name: "position",
539
+ description: "Target position: start, end, a number (1-based), before:<id>, after:<id>",
540
+ shorthand: null,
541
+ type: String,
542
+ argument: "POSITION",
543
+ deprecated: false
544
+ },
545
+ {
546
+ name: "first",
547
+ description: "Move to the first position (highest priority)",
548
+ shorthand: null,
549
+ type: Boolean,
550
+ deprecated: false
551
+ },
552
+ {
553
+ name: "last",
554
+ description: "Move to the last position (lowest priority)",
555
+ shorthand: null,
556
+ type: Boolean,
557
+ deprecated: false
558
+ },
559
+ {
560
+ ...yesOption,
561
+ description: "Skip the confirmation prompt when reordering"
562
+ }
563
+ ],
564
+ examples: [
565
+ {
566
+ name: "Move to first position",
567
+ value: `${packageName} routes reorder "Catch All" --first`
568
+ },
569
+ {
570
+ name: "Move to last position",
571
+ value: `${packageName} routes reorder "Catch All" --last`
572
+ },
573
+ {
574
+ name: "Move to a specific position",
575
+ value: `${packageName} routes reorder "API Proxy" --position 3`
576
+ },
577
+ {
578
+ name: "Move after another route",
579
+ value: `${packageName} routes reorder "API Proxy" --position after:route-id-123`
580
+ },
581
+ {
582
+ name: "Interactive reorder (prompts for position)",
583
+ value: `${packageName} routes reorder "API Proxy"`
584
+ }
585
+ ]
586
+ };
587
+ var editSubcommand = {
588
+ name: "edit",
589
+ aliases: [],
590
+ description: "Edit an existing routing rule",
591
+ arguments: [
592
+ {
593
+ name: "name-or-id",
594
+ required: true
595
+ }
596
+ ],
597
+ options: [
598
+ // Metadata
599
+ {
600
+ name: "name",
601
+ description: "Change route name",
602
+ shorthand: null,
603
+ type: String,
604
+ argument: "NAME",
605
+ deprecated: false
606
+ },
607
+ {
608
+ name: "description",
609
+ description: 'Change description (use "" to clear)',
610
+ shorthand: null,
611
+ type: String,
612
+ argument: "TEXT",
613
+ deprecated: false
614
+ },
615
+ // Path & Matching
616
+ {
617
+ name: "src",
618
+ description: "Change source path pattern",
619
+ shorthand: null,
620
+ type: String,
621
+ argument: "PATTERN",
622
+ deprecated: false
623
+ },
624
+ {
625
+ name: "src-syntax",
626
+ description: "Change path syntax: regex, path-to-regexp, equals",
627
+ shorthand: null,
628
+ type: String,
629
+ argument: "TYPE",
630
+ deprecated: false
631
+ },
632
+ // Primary action
633
+ {
634
+ name: "action",
635
+ description: "Set action type: rewrite, redirect, or set-status (required when switching types)",
636
+ shorthand: null,
637
+ type: String,
638
+ argument: "TYPE",
639
+ deprecated: false
640
+ },
641
+ {
642
+ name: "dest",
643
+ description: "Set destination URL",
644
+ shorthand: null,
645
+ type: String,
646
+ argument: "URL",
647
+ deprecated: false
648
+ },
649
+ {
650
+ name: "status",
651
+ description: "Set status code",
652
+ shorthand: null,
653
+ type: Number,
654
+ argument: "CODE",
655
+ deprecated: false
656
+ },
657
+ {
658
+ name: "no-dest",
659
+ description: "Remove destination",
660
+ shorthand: null,
661
+ type: Boolean,
662
+ deprecated: false
663
+ },
664
+ {
665
+ name: "no-status",
666
+ description: "Remove status code",
667
+ shorthand: null,
668
+ type: Boolean,
669
+ deprecated: false
670
+ },
671
+ // Response Headers
672
+ {
673
+ name: "set-response-header",
674
+ description: "Set response header: key=value (repeatable)",
675
+ shorthand: null,
676
+ type: [String],
677
+ argument: "HEADER",
678
+ deprecated: false
679
+ },
680
+ {
681
+ name: "append-response-header",
682
+ description: "Append to response header: key=value (repeatable)",
683
+ shorthand: null,
684
+ type: [String],
685
+ argument: "HEADER",
686
+ deprecated: false
687
+ },
688
+ {
689
+ name: "delete-response-header",
690
+ description: "Delete response header: key (repeatable)",
691
+ shorthand: null,
692
+ type: [String],
693
+ argument: "KEY",
694
+ deprecated: false
695
+ },
696
+ // Request Headers
697
+ {
698
+ name: "set-request-header",
699
+ description: "Set request header: key=value (repeatable)",
700
+ shorthand: null,
701
+ type: [String],
702
+ argument: "HEADER",
703
+ deprecated: false
704
+ },
705
+ {
706
+ name: "append-request-header",
707
+ description: "Append to request header: key=value (repeatable)",
708
+ shorthand: null,
709
+ type: [String],
710
+ argument: "HEADER",
711
+ deprecated: false
712
+ },
713
+ {
714
+ name: "delete-request-header",
715
+ description: "Delete request header: key (repeatable)",
716
+ shorthand: null,
717
+ type: [String],
718
+ argument: "KEY",
719
+ deprecated: false
720
+ },
721
+ // Request Query
722
+ {
723
+ name: "set-request-query",
724
+ description: "Set query parameter: key=value (repeatable)",
725
+ shorthand: null,
726
+ type: [String],
727
+ argument: "PARAM",
728
+ deprecated: false
729
+ },
730
+ {
731
+ name: "append-request-query",
732
+ description: "Append to query parameter: key=value (repeatable)",
733
+ shorthand: null,
734
+ type: [String],
735
+ argument: "PARAM",
736
+ deprecated: false
737
+ },
738
+ {
739
+ name: "delete-request-query",
740
+ description: "Delete query parameter: key (repeatable)",
741
+ shorthand: null,
742
+ type: [String],
743
+ argument: "KEY",
744
+ deprecated: false
745
+ },
746
+ // Conditions
747
+ {
748
+ name: "has",
749
+ description: "Add a has condition: type:key or type:key:value (repeatable)",
750
+ shorthand: null,
751
+ type: [String],
752
+ argument: "CONDITION",
753
+ deprecated: false
754
+ },
755
+ {
756
+ name: "missing",
757
+ description: 'Add a "does not have" condition: type:key or type:key:value (repeatable)',
758
+ shorthand: null,
759
+ type: [String],
760
+ argument: "CONDITION",
761
+ deprecated: false
762
+ },
763
+ // Clearing
764
+ {
765
+ name: "clear-conditions",
766
+ description: "Remove all has/does-not-have conditions",
767
+ shorthand: null,
768
+ type: Boolean,
769
+ deprecated: false
770
+ },
771
+ {
772
+ name: "clear-headers",
773
+ description: "Remove all response headers",
774
+ shorthand: null,
775
+ type: Boolean,
776
+ deprecated: false
777
+ },
778
+ {
779
+ name: "clear-transforms",
780
+ description: "Remove all transforms (request headers, request query)",
781
+ shorthand: null,
782
+ type: Boolean,
783
+ deprecated: false
784
+ },
785
+ {
786
+ name: "ai",
787
+ description: "Describe changes using natural language (AI-powered)",
788
+ shorthand: null,
789
+ type: String,
790
+ argument: "PROMPT",
791
+ deprecated: false
792
+ },
793
+ {
794
+ ...yesOption,
795
+ description: "Skip confirmation prompts"
796
+ }
797
+ ],
798
+ examples: [
799
+ {
800
+ name: "Interactive mode",
801
+ value: `${packageName} routes edit "API Proxy"`
802
+ },
803
+ {
804
+ name: "Edit with AI",
805
+ value: `${packageName} routes edit "API Proxy" --ai "Add CORS headers and change status to 308"`
806
+ },
807
+ {
808
+ name: "Change destination",
809
+ value: `${packageName} routes edit "API Proxy" --dest "https://new-api.example.com/:path*"`
810
+ },
811
+ {
812
+ name: "Switch to redirect",
813
+ value: `${packageName} routes edit "Old Route" --action redirect --dest "/new" --status 301`
814
+ },
815
+ {
816
+ name: "Add a response header",
817
+ value: `${packageName} routes edit "My Route" --set-response-header "Cache-Control=public, max-age=3600"`
818
+ },
819
+ {
820
+ name: "Clear all conditions and add new ones",
821
+ value: `${packageName} routes edit "My Route" --clear-conditions --has "header:Authorization"`
822
+ }
823
+ ]
824
+ };
825
+ var exportSubcommand = {
826
+ name: "export",
827
+ aliases: [],
828
+ description: "Export routes in vercel.json or vercel.ts format",
829
+ arguments: [
830
+ {
831
+ name: "name-or-id",
832
+ required: false
833
+ }
834
+ ],
835
+ options: [
836
+ {
837
+ name: "format",
838
+ description: "Output format: json (default) or ts",
839
+ shorthand: null,
840
+ type: String,
841
+ argument: "FORMAT",
842
+ deprecated: false
843
+ }
844
+ ],
845
+ examples: [
846
+ {
847
+ name: "Export as vercel.json format",
848
+ value: `${packageName} routes export`
849
+ },
850
+ {
851
+ name: "Export as vercel.ts format",
852
+ value: `${packageName} routes export --format ts`
853
+ },
854
+ {
855
+ name: "Export a specific route",
856
+ value: `${packageName} routes export "API Proxy"`
857
+ },
858
+ {
859
+ name: "Export to a file",
860
+ value: `${packageName} routes export > routes.json`
861
+ }
862
+ ]
863
+ };
864
+ var routesCommand = {
865
+ name: "routes",
866
+ aliases: [],
867
+ description: "Manage routing rules for a project. Routes managed at the project level apply to all deployments and environments.",
868
+ arguments: [],
869
+ subcommands: [
870
+ listSubcommand,
871
+ listVersionsSubcommand,
872
+ inspectSubcommand,
873
+ addSubcommand,
874
+ editSubcommand,
875
+ deleteSubcommand,
876
+ enableSubcommand,
877
+ disableSubcommand,
878
+ reorderSubcommand,
879
+ exportSubcommand,
880
+ publishSubcommand,
881
+ restoreSubcommand,
882
+ discardSubcommand
883
+ ],
884
+ options: [],
885
+ examples: []
886
+ };
887
+
888
+ export {
889
+ listSubcommand,
890
+ listVersionsSubcommand,
891
+ inspectSubcommand,
892
+ addSubcommand,
893
+ publishSubcommand,
894
+ restoreSubcommand,
895
+ discardSubcommand,
896
+ deleteSubcommand,
897
+ enableSubcommand,
898
+ disableSubcommand,
899
+ reorderSubcommand,
900
+ editSubcommand,
901
+ exportSubcommand,
902
+ routesCommand
903
+ };