vercel 59.11.7 → 59.12.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 (125) hide show
  1. package/dist/chunks/{add-KSJQYR5C.js → add-OO3JGLZW.js} +3 -3
  2. package/dist/chunks/{add-WU2QYHYL.js → add-RTXDASSS.js} +3 -3
  3. package/dist/chunks/add-XGO6LHMD.js +221 -0
  4. package/dist/chunks/{build-F3J6FLPD.js → build-JINV2UD4.js} +3 -3
  5. package/dist/chunks/chunk-2NIDTSQJ.js +305 -0
  6. package/dist/chunks/{chunk-SHFNEZVI.js → chunk-32XSMM3W.js} +1 -1
  7. package/dist/chunks/{chunk-N4QHMXOO.js → chunk-3BB2HOO2.js} +3 -2
  8. package/dist/chunks/{chunk-DSTNNQVV.js → chunk-3F25W3GA.js} +3 -3
  9. package/dist/chunks/{chunk-OIH6FP5Y.js → chunk-4TUMNBEE.js} +2 -2
  10. package/dist/chunks/{chunk-4IVSM24H.js → chunk-ABSZNJQO.js} +1 -1
  11. package/dist/chunks/{chunk-CNDPIHY5.js → chunk-AV747POV.js} +24 -19
  12. package/dist/chunks/{chunk-QHS645AZ.js → chunk-CZ5QQRXD.js} +3 -3
  13. package/dist/chunks/{chunk-FL4JLNT2.js → chunk-E47NARDE.js} +2 -2
  14. package/dist/chunks/{chunk-XM3LOQIX.js → chunk-EDMW7SBH.js} +76 -92
  15. package/dist/chunks/{chunk-PJXMXMCO.js → chunk-ELZ6WQQA.js} +2 -2
  16. package/dist/chunks/{chunk-FVNJTRCE.js → chunk-EOLGLGXJ.js} +2 -2
  17. package/dist/chunks/chunk-GDOUDU6O.js +74 -0
  18. package/dist/chunks/{chunk-GCVXKRR5.js → chunk-HD4DR3DA.js} +1 -0
  19. package/dist/chunks/{chunk-DWIC7MRV.js → chunk-HKHXKSXQ.js} +1 -1
  20. package/dist/chunks/{chunk-ZBEECGFD.js → chunk-HM24ZWQL.js} +1 -1
  21. package/dist/chunks/chunk-HR2MP4XF.js +324 -0
  22. package/dist/chunks/{chunk-EZQDYIVB.js → chunk-JOXNBQ7W.js} +1 -1
  23. package/dist/chunks/{chunk-DBYHS3CK.js → chunk-KAF4WFF3.js} +2 -2
  24. package/dist/chunks/{chunk-VYC45Q4Z.js → chunk-KNO327AW.js} +1 -1
  25. package/dist/chunks/{chunk-XD4DCYMX.js → chunk-L6B6BRHH.js} +2 -2
  26. package/dist/chunks/{chunk-X7DBBZQD.js → chunk-LDV2R4P4.js} +1 -1
  27. package/dist/chunks/{chunk-2TSBB22D.js → chunk-MADFAH3O.js} +2 -2
  28. package/dist/chunks/{chunk-TGNEG57M.js → chunk-MDGPZHSM.js} +110 -14
  29. package/dist/chunks/{chunk-XIFATBH5.js → chunk-NDY3JDOU.js} +4 -4
  30. package/dist/chunks/{chunk-NSOYO6JQ.js → chunk-OJHDGHOB.js} +6 -6
  31. package/dist/chunks/{chunk-KJBZ5ZST.js → chunk-PIMIVJYK.js} +1 -0
  32. package/dist/chunks/{chunk-C762AAVU.js → chunk-PP5GKSIX.js} +4 -4
  33. package/dist/chunks/{chunk-Z7JWYFOY.js → chunk-QB2UHSUB.js} +1 -1
  34. package/dist/chunks/chunk-QIUK4Z7Q.js +79 -0
  35. package/dist/chunks/{chunk-GHKJAK5V.js → chunk-RNK3LXLR.js} +4 -4
  36. package/dist/chunks/{chunk-CEDN47PH.js → chunk-SWO66HE2.js} +1 -1
  37. package/dist/chunks/{chunk-EPOLDWRA.js → chunk-TDGK45FB.js} +1 -1
  38. package/dist/chunks/{chunk-PFM75KY3.js → chunk-UA55I7M6.js} +3 -3
  39. package/dist/chunks/{chunk-VT3Z7HF6.js → chunk-UJPVHLL5.js} +4 -4
  40. package/dist/chunks/{chunk-UARGTFCT.js → chunk-VJSREJVM.js} +1 -1
  41. package/dist/chunks/{chunk-WL6QYSGD.js → chunk-WPBCUXMZ.js} +506 -22
  42. package/dist/chunks/{chunk-A5JZS6ZN.js → chunk-WSZ5E4WH.js} +1 -1
  43. package/dist/chunks/{chunk-GUU4Z2AQ.js → chunk-WT2Y7FRD.js} +6 -6
  44. package/dist/chunks/{chunk-G3PXSXIB.js → chunk-WT6C2ALC.js} +3 -3
  45. package/dist/chunks/{chunk-7KROIXQM.js → chunk-X6TGUHFD.js} +3 -3
  46. package/dist/chunks/{chunk-QOPTXV4G.js → chunk-YPMFZRTN.js} +1 -1
  47. package/dist/chunks/{chunk-FVT74RZ5.js → chunk-YRESLJCW.js} +11 -11
  48. package/dist/chunks/{clear-XUQO4ZTK.js → clear-GQTDYSKJ.js} +3 -3
  49. package/dist/chunks/{compile-vercel-config-D3ARNHTN.js → compile-vercel-config-URVMKDVW.js} +2 -2
  50. package/dist/chunks/{config-37OAE7QJ.js → config-MSVQR5T6.js} +7 -7
  51. package/dist/chunks/{config-MEDLXUVM.js → config-OAXY4J6P.js} +3 -3
  52. package/dist/chunks/config-validator.mjs +1 -1
  53. package/dist/chunks/{delete-VSWDZ2SW.js → delete-57QO64HD.js} +5 -5
  54. package/dist/chunks/{delete-3N3YZZOF.js → delete-XN6ESD7C.js} +5 -5
  55. package/dist/chunks/{detect-services-TESZCQWG.js → detect-services-UPY4LTBZ.js} +6 -6
  56. package/dist/chunks/{disable-A4FLFMC7.js → disable-BYI46V7B.js} +5 -5
  57. package/dist/chunks/{discard-CHGFULBZ.js → discard-IIQL44ZZ.js} +5 -5
  58. package/dist/chunks/{edit-MHSYAPDR.js → edit-BRNS3OR4.js} +6 -6
  59. package/dist/chunks/{edit-JZ63AJYQ.js → edit-JTW7XZH7.js} +5 -5
  60. package/dist/chunks/{enable-KD46SEC5.js → enable-CH5FSQMR.js} +5 -5
  61. package/dist/chunks/{export-42QZLBSN.js → export-6WHQOWKM.js} +5 -5
  62. package/dist/chunks/{image-GP4H73A2.js → image-ZSLYATWG.js} +3 -3
  63. package/dist/chunks/{import-builders-6TBLMPL2.js → import-builders-FNMYJZGG.js} +4 -4
  64. package/dist/chunks/{inspect-5FMWMY3C.js → inspect-4RDZSYWU.js} +10 -10
  65. package/dist/chunks/{inspect-MUVK6MMT.js → inspect-7WQXZWET.js} +3 -3
  66. package/dist/chunks/{inspect-Q3DWW7MC.js → inspect-CGXTNMMO.js} +9 -9
  67. package/dist/chunks/{inspect-RNTSYM6O.js → inspect-XJ7BYLZ5.js} +3 -3
  68. package/dist/chunks/{inspect-QFXAOUL4.js → inspect-Z2MBTTB7.js} +3 -3
  69. package/dist/chunks/{list-IHHIPXEC.js → list-65LW6OTM.js} +6 -6
  70. package/dist/chunks/{list-XHD5DLEX.js → list-7W3PHRB6.js} +7 -7
  71. package/dist/chunks/{list-JRNWLSO5.js → list-KS22Y57L.js} +2 -2
  72. package/dist/chunks/{login-PCT6KFWY.js → login-NXULVQZ2.js} +3 -3
  73. package/dist/chunks/{ls-TGHCCARZ.js → ls-35EOVEIQ.js} +4 -4
  74. package/dist/chunks/{ls-PQZ2RIDX.js → ls-5GKS5QRW.js} +4 -4
  75. package/dist/chunks/ls-ADYFYYIW.js +204 -0
  76. package/dist/chunks/{ls-SVOHC3XW.js → ls-DZYN3SNS.js} +4 -4
  77. package/dist/chunks/{ls-VRIH5WA3.js → ls-HVQOGBGV.js} +7 -7
  78. package/dist/chunks/{ls-GPEHEFCF.js → ls-I2PWG7YN.js} +4 -4
  79. package/dist/chunks/{open-E7DEKYDU.js → open-H34HXJHP.js} +5 -5
  80. package/dist/chunks/{permissions-JKOONWVL.js → permissions-ZPPEPKVE.js} +4 -4
  81. package/dist/chunks/{publish-EDDELDE5.js → publish-NRMKXHAU.js} +5 -5
  82. package/dist/chunks/{pull-646WEVDE.js → pull-WUT3XTZX.js} +7 -7
  83. package/dist/chunks/{push-LTNW5OVD.js → push-WFNCEA5J.js} +3 -3
  84. package/dist/chunks/{query-LU4N6KPO.js → query-2FQM3F7N.js} +7 -7
  85. package/dist/chunks/{reorder-22PKJMZP.js → reorder-GYCT7L3C.js} +5 -5
  86. package/dist/chunks/{reply-SF2EZMVZ.js → reply-RFEXNYZ7.js} +5 -5
  87. package/dist/chunks/{resolve-ZCZGXTOT.js → resolve-ZFGT7W6Z.js} +5 -5
  88. package/dist/chunks/{restore-VJAWZXB4.js → restore-JAXPMYL5.js} +5 -5
  89. package/dist/chunks/rm-CLKQN5E4.js +162 -0
  90. package/dist/chunks/{rm-WNPGTUBH.js → rm-JPV5V2SH.js} +3 -3
  91. package/dist/chunks/{rm-KN2QFCKO.js → rm-N7SGFQOA.js} +3 -3
  92. package/dist/chunks/{rm-KVEAJPRE.js → rm-UQJ4CZJH.js} +3 -3
  93. package/dist/chunks/{rm-OSZ5FZUM.js → rm-ZUQ4U454.js} +7 -7
  94. package/dist/chunks/rule-inspect-HI3YY7OY.js +123 -0
  95. package/dist/chunks/{rules-65LKAQ35.js → rules-DA3Q64M4.js} +7 -7
  96. package/dist/chunks/{schema-NXCW4M75.js → schema-R3C4CXJ6.js} +6 -6
  97. package/dist/chunks/schema-UYYFV3JB.js +381 -0
  98. package/dist/chunks/{set-FYJVKMPV.js → set-TOJPGW4J.js} +7 -7
  99. package/dist/chunks/{setup-and-link-KXPZE32P.js → setup-and-link-DRYXQOH4.js} +16 -16
  100. package/dist/chunks/{tags-ANIRP5E3.js → tags-TNLVFNVI.js} +2 -2
  101. package/dist/chunks/update-X6JB3NPI.js +224 -0
  102. package/dist/chunks/vlt-builder-importer-USCFHWPL.js +322 -0
  103. package/dist/commands/build/index.js +19 -19
  104. package/dist/commands/deploy/index.js +19 -19
  105. package/dist/commands/dev/index.js +25 -25
  106. package/dist/commands/env/index.js +12 -12
  107. package/dist/commands/link/index.js +12 -12
  108. package/dist/commands/list/index.js +5 -5
  109. package/dist/commands-bulk.js +8273 -3511
  110. package/dist/help.js +1 -1
  111. package/dist/index.js +28 -18
  112. package/dist/runtime-assets/node-preloads/next-dev-websocket.cjs +6 -0
  113. package/dist/version.mjs +1 -1
  114. package/package.json +52 -48
  115. package/dist/chunks/add-PERLOALD.js +0 -233
  116. package/dist/chunks/chunk-5GGUB4EO.js +0 -31
  117. package/dist/chunks/chunk-ARU7VBKR.js +0 -144
  118. package/dist/chunks/chunk-KEKR7OCB.js +0 -140
  119. package/dist/chunks/chunk-MXLA3VQS.js +0 -20
  120. package/dist/chunks/chunk-QKX7WKIN.js +0 -98
  121. package/dist/chunks/ls-PF7F4PP4.js +0 -197
  122. package/dist/chunks/rm-W722Q2AO.js +0 -173
  123. package/dist/chunks/rule-inspect-25Z6SNX3.js +0 -285
  124. package/dist/chunks/schema-7D6IGJEJ.js +0 -429
  125. package/dist/chunks/update-UT6CTKVG.js +0 -246
@@ -17,7 +17,7 @@ import {
17
17
  emitVcrArgParseError,
18
18
  resolveVcrScope,
19
19
  validateVcrJsonOutput
20
- } from "./chunk-FVNJTRCE.js";
20
+ } from "./chunk-EOLGLGXJ.js";
21
21
  import "./chunk-TO7QZGYK.js";
22
22
  import {
23
23
  outputError
@@ -33,7 +33,7 @@ import "./chunk-GGP5R3FU.js";
33
33
  import {
34
34
  AGENT_REASON
35
35
  } from "./chunk-VUS2JQB2.js";
36
- import "./chunk-4IVSM24H.js";
36
+ import "./chunk-ABSZNJQO.js";
37
37
  import "./chunk-XNIZGCN5.js";
38
38
  import {
39
39
  printError
@@ -41,7 +41,7 @@ import {
41
41
  import {
42
42
  parseArguments
43
43
  } from "./chunk-57RHXXXG.js";
44
- import "./chunk-2TSBB22D.js";
44
+ import "./chunk-MADFAH3O.js";
45
45
  import "./chunk-G5FBSUL4.js";
46
46
  import {
47
47
  buildCommandWithGlobalFlags,
@@ -9,7 +9,7 @@ import {
9
9
  handleVcrApiError,
10
10
  resolveVcrScope,
11
11
  validateVcrJsonOutput
12
- } from "./chunk-FVNJTRCE.js";
12
+ } from "./chunk-EOLGLGXJ.js";
13
13
  import "./chunk-TO7QZGYK.js";
14
14
  import {
15
15
  outputError
@@ -28,7 +28,7 @@ import "./chunk-GGP5R3FU.js";
28
28
  import {
29
29
  AGENT_REASON
30
30
  } from "./chunk-VUS2JQB2.js";
31
- import "./chunk-4IVSM24H.js";
31
+ import "./chunk-ABSZNJQO.js";
32
32
  import "./chunk-XNIZGCN5.js";
33
33
  import {
34
34
  printError
@@ -36,7 +36,7 @@ import {
36
36
  import {
37
37
  parseArguments
38
38
  } from "./chunk-57RHXXXG.js";
39
- import "./chunk-2TSBB22D.js";
39
+ import "./chunk-MADFAH3O.js";
40
40
  import "./chunk-G5FBSUL4.js";
41
41
  import {
42
42
  buildCommandWithGlobalFlags,
@@ -0,0 +1,221 @@
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
+ printRuleMutationReceipt
9
+ } from "./chunk-2NIDTSQJ.js";
10
+ import "./chunk-GDOUDU6O.js";
11
+ import {
12
+ emitRulesArgParseError,
13
+ getBodyType,
14
+ handleRulesApiError,
15
+ outputRulesError,
16
+ readRuleBody,
17
+ resolveRulesProject,
18
+ resolveRulesTeam,
19
+ rulesCollectionPath
20
+ } from "./chunk-HR2MP4XF.js";
21
+ import "./chunk-3BB2HOO2.js";
22
+ import "./chunk-GZLPFESR.js";
23
+ import "./chunk-A3NYPUKZ.js";
24
+ import "./chunk-KFWQ3EFH.js";
25
+ import "./chunk-FGDKMNEN.js";
26
+ import "./chunk-PRWJUY5U.js";
27
+ import "./chunk-WT2Y7FRD.js";
28
+ import "./chunk-AINIBIP4.js";
29
+ import "./chunk-QB2UHSUB.js";
30
+ import "./chunk-ND5CF2H3.js";
31
+ import {
32
+ validateJsonOutput
33
+ } from "./chunk-KXDWXXJH.js";
34
+ import "./chunk-V4RMJKQP.js";
35
+ import {
36
+ rulesAddSubcommand
37
+ } from "./chunk-EDMW7SBH.js";
38
+ import "./chunk-WT6C2ALC.js";
39
+ import "./chunk-P7VSBDR4.js";
40
+ import "./chunk-YPMFZRTN.js";
41
+ import "./chunk-ZDU2NODC.js";
42
+ import "./chunk-PEC3CQSK.js";
43
+ import "./chunk-GGP5R3FU.js";
44
+ import "./chunk-VUS2JQB2.js";
45
+ import "./chunk-KAF4WFF3.js";
46
+ import "./chunk-HRXRELD3.js";
47
+ import "./chunk-B5XLQKHI.js";
48
+ import "./chunk-ABSZNJQO.js";
49
+ import "./chunk-XNIZGCN5.js";
50
+ import "./chunk-NW34PW6V.js";
51
+ import {
52
+ printError
53
+ } from "./chunk-3VM7HWF6.js";
54
+ import {
55
+ parseArguments
56
+ } from "./chunk-57RHXXXG.js";
57
+ import "./chunk-MADFAH3O.js";
58
+ import "./chunk-G5FBSUL4.js";
59
+ import "./chunk-26CU4Q3C.js";
60
+ import "./chunk-XPJLPUKO.js";
61
+ import {
62
+ isAPIError
63
+ } from "./chunk-CV5YC2EN.js";
64
+ import {
65
+ getFlagsSpecification
66
+ } from "./chunk-Q2DGFCO7.js";
67
+ import {
68
+ output_manager_default
69
+ } from "./chunk-2JIX6UMI.js";
70
+ import "./chunk-P4QNYOFB.js";
71
+ import "./chunk-ZW6HETRE.js";
72
+ import "./chunk-S7KYDPEM.js";
73
+ import "./chunk-TZ2YI2VH.js";
74
+
75
+ // src/commands/alerts/rules/add.ts
76
+ function applyScopeFlag(client, body, type, scope, flags, jsonOutput) {
77
+ if (Object.hasOwn(body, "ruleScope")) {
78
+ if (flags["--project"] || flags["--all"]) {
79
+ return outputRulesError(
80
+ client,
81
+ jsonOutput,
82
+ "SCOPE_CONFLICT",
83
+ "Specify rule scope either in the body or with --project/--all, not both."
84
+ );
85
+ }
86
+ return void 0;
87
+ }
88
+ if (flags["--project"]) {
89
+ body.ruleScope = type === "custom" ? { type: "project", projectId: scope.projectId } : { type: "include", projectIds: [scope.projectId] };
90
+ return void 0;
91
+ }
92
+ if (flags["--all"]) {
93
+ if (type === "custom") {
94
+ return outputRulesError(
95
+ client,
96
+ jsonOutput,
97
+ "INVALID_SCOPE",
98
+ "Custom alert rules must target one project. Use --project <name-or-id>."
99
+ );
100
+ }
101
+ body.ruleScope = { type: "all" };
102
+ return void 0;
103
+ }
104
+ return outputRulesError(
105
+ client,
106
+ jsonOutput,
107
+ "MISSING_SCOPE",
108
+ "Missing rule scope. Add ruleScope to the body, or pass --project or --all."
109
+ );
110
+ }
111
+ async function resolveCreateScope(client, flags, jsonOutput) {
112
+ if (flags["--project"] && flags["--all"]) {
113
+ return outputRulesError(
114
+ client,
115
+ jsonOutput,
116
+ "MUTUAL_EXCLUSIVITY",
117
+ "Cannot specify both --all and --project. Use one or the other."
118
+ );
119
+ }
120
+ return flags["--project"] ? resolveRulesProject(
121
+ client,
122
+ flags["--project"],
123
+ jsonOutput,
124
+ "alerts rules add"
125
+ ) : resolveRulesTeam(client, jsonOutput);
126
+ }
127
+ async function add(client, argv) {
128
+ let parsedArgs;
129
+ try {
130
+ parsedArgs = parseArguments(
131
+ argv,
132
+ getFlagsSpecification(rulesAddSubcommand.options)
133
+ );
134
+ } catch (error) {
135
+ emitRulesArgParseError(
136
+ client,
137
+ error,
138
+ "alerts rules add --project <name-or-id> --body <path>"
139
+ );
140
+ printError(error);
141
+ return 1;
142
+ }
143
+ const flags = parsedArgs.flags;
144
+ const format = validateJsonOutput(flags);
145
+ if (!format.valid) {
146
+ return outputRulesError(client, false, "INVALID_ARGUMENTS", format.error);
147
+ }
148
+ if (!flags["--body"]) {
149
+ return outputRulesError(
150
+ client,
151
+ format.jsonOutput,
152
+ "MISSING_ARGUMENTS",
153
+ "Missing required flag: --body <PATH>."
154
+ );
155
+ }
156
+ const body = readRuleBody(client, flags["--body"], format.jsonOutput);
157
+ if (typeof body === "number")
158
+ return body;
159
+ const type = getBodyType(body);
160
+ if (!type) {
161
+ return outputRulesError(
162
+ client,
163
+ format.jsonOutput,
164
+ "INVALID_RULE_TYPE",
165
+ "Create body must set type to built-in or custom."
166
+ );
167
+ }
168
+ if (Object.hasOwn(body, "ruleScope") && (flags["--project"] || flags["--all"])) {
169
+ return outputRulesError(
170
+ client,
171
+ format.jsonOutput,
172
+ "SCOPE_CONFLICT",
173
+ "Specify rule scope either in the body or with --project/--all, not both."
174
+ );
175
+ }
176
+ if (type === "custom" && flags["--all"]) {
177
+ return outputRulesError(
178
+ client,
179
+ format.jsonOutput,
180
+ "INVALID_SCOPE",
181
+ "Custom alert rules must target one project. Use --project <name-or-id>."
182
+ );
183
+ }
184
+ const scope = await resolveCreateScope(client, flags, format.jsonOutput);
185
+ if (typeof scope === "number")
186
+ return scope;
187
+ const scopeError = applyScopeFlag(
188
+ client,
189
+ body,
190
+ type,
191
+ scope,
192
+ flags,
193
+ format.jsonOutput
194
+ );
195
+ if (scopeError !== void 0)
196
+ return scopeError;
197
+ output_manager_default.spinner("Creating alert rule\u2026");
198
+ try {
199
+ const response = await client.fetch(
200
+ rulesCollectionPath(scope.teamId),
201
+ { method: "POST", body }
202
+ );
203
+ if (format.jsonOutput) {
204
+ client.stdout.write(`${JSON.stringify(response, null, 2)}
205
+ `);
206
+ } else {
207
+ printRuleMutationReceipt("Created", response.rule, client.argv);
208
+ }
209
+ return 0;
210
+ } catch (error) {
211
+ if (isAPIError(error)) {
212
+ return handleRulesApiError(client, error, format.jsonOutput);
213
+ }
214
+ throw error;
215
+ } finally {
216
+ output_manager_default.stopSpinner();
217
+ }
218
+ }
219
+ export {
220
+ add as default
221
+ };
@@ -23,7 +23,7 @@ import {
23
23
  runEngine,
24
24
  splitPassthrough,
25
25
  validateVcrChoice
26
- } from "./chunk-FVNJTRCE.js";
26
+ } from "./chunk-EOLGLGXJ.js";
27
27
  import "./chunk-TO7QZGYK.js";
28
28
  import {
29
29
  outputError
@@ -42,7 +42,7 @@ import "./chunk-GGP5R3FU.js";
42
42
  import {
43
43
  AGENT_REASON
44
44
  } from "./chunk-VUS2JQB2.js";
45
- import "./chunk-4IVSM24H.js";
45
+ import "./chunk-ABSZNJQO.js";
46
46
  import "./chunk-XNIZGCN5.js";
47
47
  import {
48
48
  printError
@@ -50,7 +50,7 @@ import {
50
50
  import {
51
51
  parseArguments
52
52
  } from "./chunk-57RHXXXG.js";
53
- import "./chunk-2TSBB22D.js";
53
+ import "./chunk-MADFAH3O.js";
54
54
  import "./chunk-G5FBSUL4.js";
55
55
  import {
56
56
  buildCommandWithGlobalFlags,
@@ -0,0 +1,305 @@
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
+ humanizeReference,
9
+ renderAlertTable
10
+ } from "./chunk-GDOUDU6O.js";
11
+ import {
12
+ formatDate
13
+ } from "./chunk-GZLPFESR.js";
14
+ import {
15
+ truncateEnd,
16
+ truncateMiddle
17
+ } from "./chunk-ND5CF2H3.js";
18
+ import {
19
+ printAlignedLabel
20
+ } from "./chunk-MADFAH3O.js";
21
+ import {
22
+ buildCommandWithGlobalFlags,
23
+ quoteArg
24
+ } from "./chunk-26CU4Q3C.js";
25
+ import {
26
+ output_manager_default
27
+ } from "./chunk-2JIX6UMI.js";
28
+ import {
29
+ require_source
30
+ } from "./chunk-S7KYDPEM.js";
31
+ import {
32
+ __toESM
33
+ } from "./chunk-TZ2YI2VH.js";
34
+
35
+ // src/commands/alerts/rules/format.ts
36
+ var import_chalk = __toESM(require_source(), 1);
37
+ function formatBoolean(value) {
38
+ return value ? "yes" : "no";
39
+ }
40
+ function formatOperator(operator) {
41
+ return {
42
+ gt: ">",
43
+ gte: ">=",
44
+ lt: "<",
45
+ lte: "<="
46
+ }[operator] ?? operator;
47
+ }
48
+ function formatPublicRuleScope(rule) {
49
+ const scope = rule.ruleScope;
50
+ if (scope.type === "all")
51
+ return "all projects";
52
+ if (scope.type === "project")
53
+ return `project: ${scope.projectId}`;
54
+ return `${scope.type}: ${scope.projectIds.join(", ")}`;
55
+ }
56
+ function formatMetricSelection(metric) {
57
+ const modifiers = [
58
+ metric.per ? `per ${metric.per}` : void 0,
59
+ metric.normalize ? `normalize ${metric.normalize}` : void 0,
60
+ metric.dimensions?.length ? `dimensions ${metric.dimensions.join(", ")}` : void 0
61
+ ].filter(Boolean);
62
+ return `${metric.aggregation} ${metric.metric}${modifiers.length ? ` (${modifiers.join("; ")})` : ""}`;
63
+ }
64
+ function formatCustomTrigger(trigger) {
65
+ const minimum = trigger.minimum ? `; minimum ${trigger.minimum.output} >= ${trigger.minimum.threshold}` : "";
66
+ if (trigger.type === "anomaly") {
67
+ return `${trigger.output} anomaly at ${trigger.standardDeviations} standard deviations${minimum}`;
68
+ }
69
+ return `${trigger.output} ${formatOperator(trigger.operator)} ${trigger.threshold}${minimum}`;
70
+ }
71
+ function formatCustomCondition(rule) {
72
+ if (!rule.querySupported)
73
+ return "Query unavailable via API";
74
+ const query = rule.evaluation.query;
75
+ const output = query.outputs[0];
76
+ const selection = query.formulas?.[output] ? `${output} = ${query.formulas[output]}` : query.metrics[output] ? formatMetricSelection(query.metrics[output]) : output;
77
+ return `${selection}; ${formatCustomTrigger(rule.trigger)}; ${rule.evaluation.window}`;
78
+ }
79
+ function formatBuiltInCondition(rule) {
80
+ const triggers = rule.triggers.mode === "all" ? "all triggers" : rule.triggers.items.map((trigger) => humanizeReference(trigger.type)).join(", ");
81
+ return `${triggers}; minimum ${rule.matchMinimumSeverityLevel}`;
82
+ }
83
+ function formatRuleCondition(rule) {
84
+ return rule.type === "built-in" ? formatBuiltInCondition(rule) : formatCustomCondition(rule);
85
+ }
86
+ function printRules(rules) {
87
+ const rows = [
88
+ ["Name", "Rule ID", "Type", "Scope", "Condition"].map(
89
+ (header) => import_chalk.default.cyan(header)
90
+ ),
91
+ ...rules.map((rule) => [
92
+ import_chalk.default.bold(truncateEnd(rule.name, 36)),
93
+ import_chalk.default.dim(rule.id),
94
+ rule.isDefault ? `${rule.type} (default)` : rule.type,
95
+ truncateMiddle(formatPublicRuleScope(rule), 38),
96
+ truncateEnd(formatRuleCondition(rule), 72)
97
+ ])
98
+ ];
99
+ output_manager_default.print(`
100
+ ${renderAlertTable(rows, 2)}
101
+ `);
102
+ }
103
+ function commonRows(rule) {
104
+ return [
105
+ ["Name", rule.name],
106
+ ["Rule ID", rule.id],
107
+ ["Type", rule.type],
108
+ ["Scope", formatPublicRuleScope(rule)],
109
+ ["Default", formatBoolean(rule.isDefault)],
110
+ ...rule.createdAt ? [["Created", formatDate(rule.createdAt)]] : [],
111
+ ...rule.updatedAt ? [["Updated", formatDate(rule.updatedAt)]] : []
112
+ ];
113
+ }
114
+ function notificationRows(rule) {
115
+ return [
116
+ [
117
+ "Team owner notifications",
118
+ formatBoolean(rule.notificationSettings.enableTeamOwnerNotifications)
119
+ ],
120
+ ...rule.notificationSettings.incidentIoRoutingKey ? [
121
+ [
122
+ "Incident.io routing key",
123
+ rule.notificationSettings.incidentIoRoutingKey
124
+ ]
125
+ ] : []
126
+ ];
127
+ }
128
+ function printBuiltInRule(rule) {
129
+ output_manager_default.print(`${import_chalk.default.cyan("Built-in conditions")}
130
+
131
+ `);
132
+ if (rule.triggers.mode === "all") {
133
+ output_manager_default.print(
134
+ `${renderAlertTable(
135
+ [
136
+ ["Minimum severity", rule.matchMinimumSeverityLevel],
137
+ ["Triggers", "all built-in triggers"]
138
+ ],
139
+ 3
140
+ )}
141
+ `
142
+ );
143
+ } else {
144
+ output_manager_default.print(
145
+ `${renderAlertTable(
146
+ [["Minimum severity", rule.matchMinimumSeverityLevel]],
147
+ 3
148
+ )}
149
+
150
+ ${renderAlertTable(
151
+ [
152
+ ["Trigger", "Filter"].map((header) => import_chalk.default.cyan(header)),
153
+ ...rule.triggers.items.map((trigger) => [
154
+ trigger.type,
155
+ trigger.filter || "-"
156
+ ])
157
+ ],
158
+ 3
159
+ )}
160
+ `
161
+ );
162
+ }
163
+ }
164
+ function metricRows(rule) {
165
+ return Object.entries(rule.evaluation.query.metrics).map(
166
+ ([alias, metric]) => [
167
+ alias,
168
+ metric.metric,
169
+ metric.aggregation,
170
+ [
171
+ metric.per ? `per ${metric.per}` : void 0,
172
+ metric.normalize ? `normalize ${metric.normalize}` : void 0,
173
+ metric.dimensions?.join(", ")
174
+ ].filter(Boolean).join("; ") || "-",
175
+ metric.filter || "-"
176
+ ]
177
+ );
178
+ }
179
+ function printCustomRule(rule) {
180
+ output_manager_default.print(`${import_chalk.default.cyan("Custom alert")}
181
+
182
+ `);
183
+ if (!rule.querySupported) {
184
+ output_manager_default.print(
185
+ " Query unavailable via API. You can update metadata, delete the rule, or recreate it with a supported query.\n"
186
+ );
187
+ output_manager_default.print(`
188
+ ${renderAlertTable([["Severity", rule.severity]], 3)}
189
+ `);
190
+ return;
191
+ }
192
+ const query = rule.evaluation.query;
193
+ output_manager_default.print(
194
+ `${renderAlertTable(
195
+ [
196
+ ["Severity", rule.severity],
197
+ ["Window", rule.evaluation.window],
198
+ ["Output", query.outputs[0]],
199
+ ...query.formulas ? Object.entries(query.formulas).map(([alias, formula]) => [
200
+ `Formula ${alias}`,
201
+ formula
202
+ ]) : [],
203
+ ...query.groupBy?.length ? [["Group By", query.groupBy.join(", ")]] : [],
204
+ ...query.filter ? [["Query Filter", query.filter]] : []
205
+ ],
206
+ 3
207
+ )}
208
+ `
209
+ );
210
+ output_manager_default.print(`
211
+ ${import_chalk.default.cyan("Metrics")}
212
+
213
+ `);
214
+ output_manager_default.print(
215
+ `${renderAlertTable(
216
+ [
217
+ ["Alias", "Metric", "Aggregation", "Modifiers", "Filter"].map(
218
+ (header) => import_chalk.default.cyan(header)
219
+ ),
220
+ ...metricRows(rule)
221
+ ],
222
+ 3
223
+ )}
224
+ `
225
+ );
226
+ output_manager_default.print(`
227
+ ${import_chalk.default.cyan("Trigger")}
228
+
229
+ `);
230
+ output_manager_default.print(
231
+ `${renderAlertTable(
232
+ [
233
+ ["Type", rule.trigger.type],
234
+ ["Output", rule.trigger.output],
235
+ ...rule.trigger.type === "threshold" ? [
236
+ ["Operator", rule.trigger.operator],
237
+ ["Threshold", String(rule.trigger.threshold)]
238
+ ] : [["Standard Deviations", String(rule.trigger.standardDeviations)]],
239
+ ...rule.trigger.minimum ? [
240
+ ["Minimum Output", rule.trigger.minimum.output],
241
+ ["Minimum Threshold", String(rule.trigger.minimum.threshold)]
242
+ ] : []
243
+ ],
244
+ 3
245
+ )}
246
+ `
247
+ );
248
+ }
249
+ function printRule(rule) {
250
+ output_manager_default.print(
251
+ `
252
+ ${import_chalk.default.bold("Alert rule")} ${import_chalk.default.cyan(rule.id)}
253
+ ${renderAlertTable(
254
+ commonRows(rule),
255
+ 3
256
+ )}
257
+
258
+ ${import_chalk.default.cyan("Notifications")}
259
+
260
+ ${renderAlertTable(
261
+ notificationRows(rule),
262
+ 3
263
+ )}
264
+
265
+ `
266
+ );
267
+ if (rule.type === "built-in")
268
+ printBuiltInRule(rule);
269
+ else
270
+ printCustomRule(rule);
271
+ }
272
+ function printRulePreview(rule) {
273
+ printAlignedLabel("Name", rule.name);
274
+ printAlignedLabel("Rule ID", rule.id);
275
+ printAlignedLabel("Type", rule.type);
276
+ printAlignedLabel("Scope", formatPublicRuleScope(rule));
277
+ }
278
+ function printRuleDeletionReceipt(ruleId) {
279
+ output_manager_default.print("\n");
280
+ printAlignedLabel("Deleted", ruleId, { gutter: "\u2713" });
281
+ }
282
+ function printRuleMutationReceipt(action, rule, argv) {
283
+ output_manager_default.print("\n");
284
+ printAlignedLabel(action, rule.name, { gutter: "\u2713" });
285
+ printAlignedLabel("Rule ID", rule.id);
286
+ printAlignedLabel("Type", rule.type);
287
+ printAlignedLabel("Scope", formatPublicRuleScope(rule));
288
+ if (action !== "Deleted") {
289
+ printAlignedLabel(
290
+ "Inspect",
291
+ buildCommandWithGlobalFlags(
292
+ argv,
293
+ `alerts rules inspect ${quoteArg(rule.id)}`
294
+ )
295
+ );
296
+ }
297
+ }
298
+
299
+ export {
300
+ printRules,
301
+ printRule,
302
+ printRulePreview,
303
+ printRuleDeletionReceipt,
304
+ printRuleMutationReceipt
305
+ };
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-6E6KPBXY.js";
10
10
  import {
11
11
  require_lib
12
- } from "./chunk-2TSBB22D.js";
12
+ } from "./chunk-MADFAH3O.js";
13
13
  import {
14
14
  CantParseJSONFile
15
15
  } from "./chunk-CV5YC2EN.js";
@@ -12,11 +12,11 @@ import {
12
12
  } from "./chunk-VUS2JQB2.js";
13
13
  import {
14
14
  getScope
15
- } from "./chunk-4IVSM24H.js";
15
+ } from "./chunk-ABSZNJQO.js";
16
16
  import {
17
17
  getLinkedProject,
18
18
  getProjectByNameOrId
19
- } from "./chunk-2TSBB22D.js";
19
+ } from "./chunk-MADFAH3O.js";
20
20
  import {
21
21
  buildCommandWithGlobalFlags,
22
22
  outputAgentError
@@ -158,5 +158,6 @@ async function resolveAlertsScope(client, opts) {
158
158
  }
159
159
 
160
160
  export {
161
+ emitAlertsScopeError,
161
162
  resolveAlertsScope
162
163
  };
@@ -6,20 +6,20 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  MISSING_BOTH_MESSAGE
9
- } from "./chunk-5GGUB4EO.js";
9
+ } from "./chunk-QIUK4Z7Q.js";
10
10
  import {
11
11
  RULE_ENVIRONMENTS
12
12
  } from "./chunk-GY5I4AYD.js";
13
13
  import {
14
14
  resolveProjectContext
15
- } from "./chunk-7KROIXQM.js";
15
+ } from "./chunk-X6TGUHFD.js";
16
16
  import {
17
17
  AGENT_REASON,
18
18
  AGENT_STATUS
19
19
  } from "./chunk-VUS2JQB2.js";
20
20
  import {
21
21
  detectExplicitScope
22
- } from "./chunk-4IVSM24H.js";
22
+ } from "./chunk-ABSZNJQO.js";
23
23
  import {
24
24
  printError
25
25
  } from "./chunk-3VM7HWF6.js";
@@ -100,7 +100,7 @@ var metricsCommand = {
100
100
  type: [String],
101
101
  deprecated: false,
102
102
  get description() {
103
- return process.env.FF_METRICS ? "KQL filter expression (repeatable, ANDed together)" : "OData filter expression (repeatable, ANDed together)";
103
+ return process.env.FF_LEGACY_METRICS ? "OData filter expression (repeatable, ANDed together)" : "KQL filter expression (repeatable, ANDed together)";
104
104
  },
105
105
  argument: "EXPR"
106
106
  },
@@ -158,7 +158,7 @@ var metricsCommand = {
158
158
  jsonOption
159
159
  ],
160
160
  get examples() {
161
- const canonical = Boolean(process.env.FF_METRICS);
161
+ const canonical = !process.env.FF_LEGACY_METRICS;
162
162
  const httpStatus = canonical ? "httpStatus" : "http_status";
163
163
  const errorCode = canonical ? "errorCode" : "error_code";
164
164
  const aiProvider = canonical ? "aiProvider" : "ai_provider";
@@ -14,7 +14,7 @@ import {
14
14
  getTeamByIdOrSlug,
15
15
  getUser,
16
16
  getVercelDirectory
17
- } from "./chunk-2TSBB22D.js";
17
+ } from "./chunk-MADFAH3O.js";
18
18
  import {
19
19
  InvalidToken,
20
20
  TeamDeleted