vercel 59.4.0 → 59.6.2

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 (137) hide show
  1. package/dist/chunks/{add-FQMB3XPM.js → add-4GQZ22ZN.js} +20 -16
  2. package/dist/chunks/{add-73X2SKBH.js → add-HJSEM4YJ.js} +17 -13
  3. package/dist/chunks/{add-QJ3WT4FW.js → add-SIGUSM3Y.js} +21 -17
  4. package/dist/chunks/{build-YUYCLCXD.js → build-XOMJDX4M.js} +18 -15
  5. package/dist/chunks/{chunk-F7OXZLY2.js → chunk-26XDDLXM.js} +2 -2
  6. package/dist/chunks/{chunk-VCE6QKFE.js → chunk-2O5J3KMT.js} +4 -4
  7. package/dist/chunks/{chunk-XI6NJLI4.js → chunk-2YRAWYGE.js} +3 -3
  8. package/dist/chunks/{chunk-X6O6XJEA.js → chunk-37V5P4VO.js} +16 -14
  9. package/dist/chunks/{chunk-EB7NJKPL.js → chunk-3F5EGINT.js} +3 -3
  10. package/dist/chunks/{chunk-RIB4S2IB.js → chunk-3HZLXCVL.js} +1 -1
  11. package/dist/chunks/{chunk-KQRVZWJU.js → chunk-3T7WSWZH.js} +1 -1
  12. package/dist/chunks/{chunk-3KNPVXJ3.js → chunk-4KD5BYHB.js} +1 -1
  13. package/dist/chunks/{chunk-XLKFJPMT.js → chunk-57RHXXXG.js} +1 -1
  14. package/dist/chunks/chunk-5GGUB4EO.js +31 -0
  15. package/dist/chunks/{chunk-R6IGDGX3.js → chunk-5XECIWME.js} +1 -1
  16. package/dist/chunks/{chunk-KAYSW4CJ.js → chunk-6JPVTPTU.js} +3 -3
  17. package/dist/chunks/{chunk-ZFWNMVNR.js → chunk-6M2KZUED.js} +19 -8
  18. package/dist/chunks/{chunk-HT2XWSAJ.js → chunk-7AEEQOD4.js} +2 -29
  19. package/dist/chunks/{chunk-HURL5EBN.js → chunk-7HE63HCR.js} +124 -161
  20. package/dist/chunks/chunk-7Q45OKWR.js +149 -0
  21. package/dist/chunks/{chunk-RI7KKKII.js → chunk-7R6M3BHM.js} +4 -18
  22. package/dist/chunks/{chunk-XBN2O34P.js → chunk-7ST552E3.js} +17 -4
  23. package/dist/chunks/{chunk-JKQWQA2T.js → chunk-AINIBIP4.js} +1 -1
  24. package/dist/chunks/{chunk-CV4S27SS.js → chunk-ASBP32T6.js} +1 -1
  25. package/dist/chunks/chunk-AYLY3ZVL.js +104 -0
  26. package/dist/chunks/{chunk-SOFC4MLS.js → chunk-BMKU5KEL.js} +9 -569
  27. package/dist/chunks/{chunk-KDYRLN6H.js → chunk-C5HKWXRR.js} +1 -1
  28. package/dist/chunks/{chunk-2MF3ZAVW.js → chunk-CJV7J7B5.js} +6 -6
  29. package/dist/chunks/{chunk-HJVTLJHO.js → chunk-DE7MBNHQ.js} +6 -6
  30. package/dist/chunks/{chunk-3L2YLLHC.js → chunk-DWIC7MRV.js} +2 -2
  31. package/dist/chunks/{chunk-GFCTRJI5.js → chunk-EZKW5YJ2.js} +1 -1
  32. package/dist/chunks/{chunk-MWYQ24FO.js → chunk-FRAXI2WT.js} +3 -3
  33. package/dist/chunks/{chunk-DDIZGOCK.js → chunk-FRZULOVH.js} +8 -6
  34. package/dist/chunks/{chunk-Y3J4VU2H.js → chunk-FWKSJYDV.js} +2 -2
  35. package/dist/chunks/chunk-FXD67VN5.js +467 -0
  36. package/dist/chunks/{chunk-EB5NBVTV.js → chunk-GISTGGBO.js} +8 -8
  37. package/dist/chunks/chunk-GY5I4AYD.js +122 -0
  38. package/dist/chunks/{chunk-PD4DYNSB.js → chunk-GZQQNLF5.js} +5 -5
  39. package/dist/chunks/{chunk-PIMIKY4X.js → chunk-IJ4X426J.js} +1 -1
  40. package/dist/chunks/{chunk-KSZ4MNHO.js → chunk-JH4WQRIU.js} +2 -2
  41. package/dist/chunks/{chunk-TVXCXIRO.js → chunk-L3UXB2CW.js} +1 -1
  42. package/dist/chunks/{chunk-O5DLWLT7.js → chunk-LXZVOR6F.js} +9 -9
  43. package/dist/chunks/{chunk-EG5BSAXD.js → chunk-MTWHQEXI.js} +1 -1
  44. package/dist/chunks/{chunk-WC7IINFV.js → chunk-NFU4XJIR.js} +1 -1
  45. package/dist/chunks/{chunk-TH2XUVDP.js → chunk-NGGLYKNU.js} +30 -6
  46. package/dist/chunks/{chunk-2PX6N4FE.js → chunk-NGNN6WF2.js} +10 -10
  47. package/dist/chunks/{chunk-GGPE5377.js → chunk-O26N2UPI.js} +1 -1
  48. package/dist/chunks/chunk-O75LSD3C.js +34 -0
  49. package/dist/chunks/{chunk-BBSS3XIW.js → chunk-OQ3C5VXZ.js} +1 -1
  50. package/dist/chunks/{chunk-M22O6CYY.js → chunk-POOO7W47.js} +1 -1
  51. package/dist/chunks/{chunk-LKTQR5JE.js → chunk-PRH6KRUT.js} +2 -2
  52. package/dist/chunks/chunk-Q2DGFCO7.js +579 -0
  53. package/dist/chunks/{chunk-OX7KI3LF.js → chunk-QFAS4OVW.js} +18 -0
  54. package/dist/chunks/{chunk-CHEZBD7H.js → chunk-R5PULMHT.js} +3 -3
  55. package/dist/chunks/{chunk-VAFU7DXZ.js → chunk-RKDCNQ4S.js} +1 -91
  56. package/dist/chunks/{chunk-BLYBHFIE.js → chunk-SF3AYAIF.js} +61 -24
  57. package/dist/chunks/{chunk-GMWRTZVZ.js → chunk-SLPSPYVR.js} +1 -1
  58. package/dist/chunks/{chunk-J5Y2QGGU.js → chunk-SWI6F4X3.js} +2 -2
  59. package/dist/chunks/chunk-V3MDDR2X.js +249 -0
  60. package/dist/chunks/{chunk-HMJVUXE6.js → chunk-VJ5NAOWB.js} +867 -625
  61. package/dist/chunks/{chunk-O5GNPPTU.js → chunk-VP5Y3SZG.js} +1 -1
  62. package/dist/chunks/{chunk-G75NFPIT.js → chunk-WNAKOXGK.js} +1 -1
  63. package/dist/chunks/{chunk-NP6BQPCN.js → chunk-WZ2S3A2A.js} +8 -6
  64. package/dist/chunks/{chunk-7QVJTI5H.js → chunk-XDGOOW3K.js} +1 -1
  65. package/dist/chunks/{chunk-UMA66MKW.js → chunk-XM3LOQIX.js} +1 -1
  66. package/dist/chunks/{chunk-CYNB6LL4.js → chunk-XNFHNTS2.js} +1 -1
  67. package/dist/chunks/{chunk-VDJN4WKH.js → chunk-XRWOTCDO.js} +1 -1
  68. package/dist/chunks/{chunk-UV2ZMFVG.js → chunk-YJKZQEHS.js} +2 -2
  69. package/dist/chunks/{chunk-STPH4Y62.js → chunk-YJUO3EKH.js} +1 -1
  70. package/dist/chunks/{chunk-Y42SPI2H.js → chunk-ZNMTDLYH.js} +6 -6
  71. package/dist/chunks/{chunk-VLPLCJZC.js → chunk-ZSFEACZU.js} +1 -1
  72. package/dist/chunks/{clear-USQM5VW5.js → clear-BWT2FJY4.js} +17 -13
  73. package/dist/chunks/{compile-vercel-config-2JNYMI6W.js → compile-vercel-config-DGM4NISW.js} +10 -7
  74. package/dist/chunks/{config-VTRIDLY4.js → config-NJAN3RMU.js} +20 -16
  75. package/dist/chunks/config-RSE6Z4LB.js +122 -0
  76. package/dist/chunks/{constants-YMCRE6IG.js → constants-WEQVJSYS.js} +1 -1
  77. package/dist/chunks/{delete-ILLSBCVQ.js → delete-LROBRBAH.js} +15 -11
  78. package/dist/chunks/{delete-VTPHK3EB.js → delete-SSL2PK2F.js} +12 -9
  79. package/dist/chunks/{disable-VTOMO64V.js → disable-ASG5JDZR.js} +12 -9
  80. package/dist/chunks/{discard-ZIOZ34ZI.js → discard-PV47B6IL.js} +12 -9
  81. package/dist/chunks/{edit-E3AMR4KM.js → edit-5ATYIOLX.js} +14 -11
  82. package/dist/chunks/{edit-JMZ5XWVW.js → edit-REI7HXGG.js} +16 -12
  83. package/dist/chunks/{enable-A4PMZ7QZ.js → enable-LZXL7XAG.js} +12 -9
  84. package/dist/chunks/{exec-CNBOV577.js → exec-XH4K34JM.js} +3 -3
  85. package/dist/chunks/{export-Y6AJ3WRZ.js → export-ZAZFQU2E.js} +12 -9
  86. package/dist/chunks/{image-26BKPAUB.js → image-QPHN5V7L.js} +7 -6
  87. package/dist/chunks/{import-builders-3H7J2SEK.js → import-builders-W3YE2V6A.js} +12 -9
  88. package/dist/chunks/{inspect-7DGKYHKW.js → inspect-BFGK72WY.js} +18 -14
  89. package/dist/chunks/{inspect-OEY4DJRI.js → inspect-FRXJRM6T.js} +18 -14
  90. package/dist/chunks/{inspect-ZW5N6O5P.js → inspect-RDMC2Z3Q.js} +17 -13
  91. package/dist/chunks/{inspect-GJFVAZIJ.js → inspect-SJEZVGPK.js} +20 -16
  92. package/dist/chunks/{inspect-N3E2PO6K.js → inspect-SSOM3FXS.js} +17 -13
  93. package/dist/chunks/{list-MIQ5D6PM.js → list-2HTR7Q3J.js} +18 -14
  94. package/dist/chunks/{list-2VTCNQEB.js → list-PHDUZVMR.js} +15 -11
  95. package/dist/chunks/{list-DTJBW7OQ.js → list-W33GXKDA.js} +18 -14
  96. package/dist/chunks/{login-L34UHAU5.js → login-JWAFHVDG.js} +30 -17
  97. package/dist/chunks/{ls-OBUDC4SB.js → ls-3AN2DZHN.js} +20 -15
  98. package/dist/chunks/{ls-SXJFBLUT.js → ls-3MH2OCP3.js} +20 -15
  99. package/dist/chunks/ls-D2POUHI7.js +176 -0
  100. package/dist/chunks/{ls-VDYUFSSC.js → ls-KDFU224B.js} +20 -15
  101. package/dist/chunks/{ls-OKO4IHWB.js → ls-KX2VBOGV.js} +18 -14
  102. package/dist/chunks/{ls-NCPQY4FV.js → ls-RWKNJQNT.js} +23 -18
  103. package/dist/chunks/{open-V5JDGXUP.js → open-IEYRB6RL.js} +15 -11
  104. package/dist/chunks/{permissions-6CPRPPBY.js → permissions-ZWZUMEHR.js} +10 -9
  105. package/dist/chunks/{publish-R27DPHFO.js → publish-UWZYBDHK.js} +12 -9
  106. package/dist/chunks/{push-VLVTBS42.js → push-IAEQ3FBF.js} +18 -15
  107. package/dist/chunks/{query-IVVRYMJN.js → query-NNOZYSED.js} +18 -14
  108. package/dist/chunks/{reorder-LJ2RBZM2.js → reorder-TKBM244W.js} +12 -9
  109. package/dist/chunks/{reply-USAISZYC.js → reply-FLBSBMTW.js} +16 -12
  110. package/dist/chunks/{resolve-CRCJYVS5.js → resolve-GJYPMWUE.js} +15 -11
  111. package/dist/chunks/{restore-6PBPEAMU.js → restore-PNI3TM3U.js} +12 -9
  112. package/dist/chunks/{rm-HHELZB7R.js → rm-76CSSSSV.js} +17 -13
  113. package/dist/chunks/{rm-TWU3JR6Z.js → rm-FN7LTIIL.js} +17 -13
  114. package/dist/chunks/{rm-KGOEOWVK.js → rm-FTE33UHE.js} +16 -12
  115. package/dist/chunks/rm-FXA5DLXQ.js +315 -0
  116. package/dist/chunks/{rm-EOD7RDSO.js → rm-PGJ4KR6U.js} +20 -16
  117. package/dist/chunks/{routes-SZI2G4SE.js → routes-2OLIBRYX.js} +3 -3
  118. package/dist/chunks/{rule-inspect-WFTVRK6B.js → rule-inspect-LJIGPTWS.js} +18 -14
  119. package/dist/chunks/{rules-AQYTFJI6.js → rules-6BMNO6M5.js} +11 -10
  120. package/dist/chunks/{schema-LUVFYPWN.js → schema-45SJNY5L.js} +9 -7
  121. package/dist/chunks/{schema-ZCDCJC7E.js → schema-HATXEQDP.js} +14 -11
  122. package/dist/chunks/set-C3UQUQ42.js +243 -0
  123. package/dist/chunks/{tags-RCNRFX7U.js → tags-BTVDROFG.js} +6 -5
  124. package/dist/chunks/{types-AJHILHO5.js → types-JGANJ5EQ.js} +12 -8
  125. package/dist/chunks/{update-I7QGAOYF.js → update-B6PSOHUW.js} +19 -15
  126. package/dist/commands/build/builder-worker.cjs +281 -0
  127. package/dist/commands/build/index.js +695 -236
  128. package/dist/commands/deploy/index.js +131 -50
  129. package/dist/commands/dev/index.js +677 -144
  130. package/dist/commands/env/index.js +1199 -565
  131. package/dist/commands/link/index.js +27 -22
  132. package/dist/commands/list/index.js +21 -14
  133. package/dist/commands-bulk.js +2051 -1019
  134. package/dist/help.js +1 -1
  135. package/dist/index.js +39 -33
  136. package/dist/version.mjs +1 -1
  137. package/package.json +48 -48
@@ -9,40 +9,44 @@ import {
9
9
  handleRulesApiError,
10
10
  parseRulesFlagsAndScope,
11
11
  rulesItemPath
12
- } from "./chunk-CHEZBD7H.js";
13
- import "./chunk-VCE6QKFE.js";
14
- import "./chunk-KQRVZWJU.js";
12
+ } from "./chunk-R5PULMHT.js";
13
+ import "./chunk-2O5J3KMT.js";
14
+ import "./chunk-3T7WSWZH.js";
15
15
  import {
16
16
  validateJsonOutput
17
17
  } from "./chunk-KXDWXXJH.js";
18
18
  import {
19
19
  rulesRmSubcommand
20
- } from "./chunk-UMA66MKW.js";
21
- import "./chunk-HMJVUXE6.js";
22
- import "./chunk-CYNB6LL4.js";
20
+ } from "./chunk-XM3LOQIX.js";
21
+ import "./chunk-VJ5NAOWB.js";
22
+ import "./chunk-FXD67VN5.js";
23
+ import "./chunk-XNFHNTS2.js";
23
24
  import {
24
25
  AGENT_REASON,
25
26
  buildCommandWithGlobalFlags,
26
27
  buildCommandWithYes,
27
28
  outputAgentError
28
- } from "./chunk-TH2XUVDP.js";
29
+ } from "./chunk-NGGLYKNU.js";
29
30
  import "./chunk-GGP5R3FU.js";
30
31
  import {
31
32
  printError
32
- } from "./chunk-VAFU7DXZ.js";
33
+ } from "./chunk-AYLY3ZVL.js";
33
34
  import {
34
35
  parseArguments
35
- } from "./chunk-XLKFJPMT.js";
36
+ } from "./chunk-57RHXXXG.js";
37
+ import "./chunk-RKDCNQ4S.js";
38
+ import {
39
+ isAPIError
40
+ } from "./chunk-BMKU5KEL.js";
36
41
  import {
37
42
  getFlagsSpecification,
38
- isAPIError,
39
43
  packageName
40
- } from "./chunk-SOFC4MLS.js";
44
+ } from "./chunk-Q2DGFCO7.js";
41
45
  import "./chunk-P4QNYOFB.js";
42
46
  import "./chunk-52QYYTM5.js";
43
47
  import {
44
48
  output_manager_default
45
- } from "./chunk-OX7KI3LF.js";
49
+ } from "./chunk-QFAS4OVW.js";
46
50
  import "./chunk-S7KYDPEM.js";
47
51
  import "./chunk-TZ2YI2VH.js";
48
52
 
@@ -0,0 +1,315 @@
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
+ EMPTY_PATH_ERROR,
9
+ ENVIRONMENT_ERROR,
10
+ RULE_LIMIT,
11
+ confirmationRequired,
12
+ formatRuleLine,
13
+ formatRuleTarget,
14
+ handleTracingApiError,
15
+ invalidArguments,
16
+ isRuleEnvironment,
17
+ readProjectTracing,
18
+ resolveConfigScope,
19
+ ruleNotFound,
20
+ subcommandArguments,
21
+ writeConfigJson,
22
+ writeSamplingRules
23
+ } from "./chunk-V3MDDR2X.js";
24
+ import "./chunk-5GGUB4EO.js";
25
+ import {
26
+ validateJsonOutput
27
+ } from "./chunk-KXDWXXJH.js";
28
+ import {
29
+ tracesCommand
30
+ } from "./chunk-7Q45OKWR.js";
31
+ import {
32
+ rmSubcommand
33
+ } from "./chunk-GY5I4AYD.js";
34
+ import {
35
+ help
36
+ } from "./chunk-2YRAWYGE.js";
37
+ import "./chunk-VJ5NAOWB.js";
38
+ import "./chunk-FXD67VN5.js";
39
+ import {
40
+ TelemetryClient
41
+ } from "./chunk-XNFHNTS2.js";
42
+ import {
43
+ buildCommandWithGlobalFlags,
44
+ quoteArg
45
+ } from "./chunk-NGGLYKNU.js";
46
+ import "./chunk-GGP5R3FU.js";
47
+ import {
48
+ printError
49
+ } from "./chunk-AYLY3ZVL.js";
50
+ import {
51
+ parseArguments
52
+ } from "./chunk-57RHXXXG.js";
53
+ import "./chunk-RKDCNQ4S.js";
54
+ import "./chunk-BMKU5KEL.js";
55
+ import {
56
+ getCommandName,
57
+ getCommandNamePlain,
58
+ getFlagsSpecification
59
+ } from "./chunk-Q2DGFCO7.js";
60
+ import "./chunk-P4QNYOFB.js";
61
+ import "./chunk-52QYYTM5.js";
62
+ import {
63
+ output_manager_default
64
+ } from "./chunk-QFAS4OVW.js";
65
+ import {
66
+ require_source
67
+ } from "./chunk-S7KYDPEM.js";
68
+ import {
69
+ __toESM
70
+ } from "./chunk-TZ2YI2VH.js";
71
+
72
+ // src/commands/traces/config/rm.ts
73
+ var import_chalk = __toESM(require_source(), 1);
74
+
75
+ // src/util/telemetry/commands/traces/config/rm.ts
76
+ var TracesConfigRmTelemetryClient = class extends TelemetryClient {
77
+ /**
78
+ * The environment word is a closed set, so a valid value is tracked raw.
79
+ * Anything else is a typo the CLI rejected and is redacted.
80
+ */
81
+ trackCliArgumentEnvironment(environment) {
82
+ if (environment) {
83
+ this.trackCliArgument({
84
+ arg: "environment",
85
+ value: isRuleEnvironment(environment) ? environment : this.redactedValue
86
+ });
87
+ }
88
+ }
89
+ /** The path prefix is customer data. */
90
+ trackCliArgumentRequestPath(requestPath) {
91
+ if (requestPath) {
92
+ this.trackCliArgument({
93
+ arg: "requestPath",
94
+ value: this.redactedValue
95
+ });
96
+ }
97
+ }
98
+ trackCliFlagDefault(defaultOnly) {
99
+ if (defaultOnly) {
100
+ this.trackCliFlag("default");
101
+ }
102
+ }
103
+ trackCliFlagJson(json) {
104
+ if (json) {
105
+ this.trackCliFlag("json");
106
+ }
107
+ }
108
+ };
109
+
110
+ // src/commands/traces/config/rm.ts
111
+ var USAGE = "traces config rm <environment> [requestPath]";
112
+ function matches(row, environment, selector) {
113
+ if (row.environment !== environment) {
114
+ return false;
115
+ }
116
+ switch (selector.kind) {
117
+ case "exact":
118
+ return row.requestPath === selector.requestPath;
119
+ case "default":
120
+ return row.requestPath === null;
121
+ case "every":
122
+ return true;
123
+ }
124
+ }
125
+ function describeSelection(environment, selector) {
126
+ switch (selector.kind) {
127
+ case "exact":
128
+ return formatRuleTarget(environment, selector.requestPath);
129
+ case "default":
130
+ return formatRuleTarget(environment, null);
131
+ case "every":
132
+ return environment;
133
+ }
134
+ }
135
+ function ruleWord(count) {
136
+ return count === 1 ? "rule" : "rules";
137
+ }
138
+ function canConfirm(client) {
139
+ return !client.nonInteractive && !client.isAgent && client.stdin.isTTY === true;
140
+ }
141
+ function commandToRunByHand(client, environment, pathArg, defaultFlag) {
142
+ const template = [
143
+ "traces config rm",
144
+ environment,
145
+ ...pathArg !== void 0 ? [quoteArg(pathArg)] : [],
146
+ ...defaultFlag ? ["--default"] : []
147
+ ].join(" ");
148
+ return buildCommandWithGlobalFlags(client.argv, template, void 0, {
149
+ // The command is for a terminal, so it must not carry the flag that says
150
+ // there is nobody at one.
151
+ excludeFlags: ["--non-interactive"],
152
+ preserveProject: true
153
+ });
154
+ }
155
+ async function rm(client) {
156
+ const telemetry = new TracesConfigRmTelemetryClient({
157
+ opts: { store: client.telemetryEventStore }
158
+ });
159
+ let parsedArgs;
160
+ const flagsSpecification = getFlagsSpecification(rmSubcommand.options);
161
+ try {
162
+ parsedArgs = parseArguments(client.argv.slice(2), flagsSpecification);
163
+ } catch (err) {
164
+ printError(err);
165
+ return 1;
166
+ }
167
+ const { flags } = parsedArgs;
168
+ const [environmentArg, ...pathArgs] = subcommandArguments(parsedArgs.args);
169
+ const pathArg = pathArgs[0];
170
+ const defaultFlag = Boolean(flags["--default"]);
171
+ telemetry.trackCliArgumentEnvironment(environmentArg);
172
+ telemetry.trackCliArgumentRequestPath(pathArg);
173
+ telemetry.trackCliFlagDefault(flags["--default"]);
174
+ telemetry.trackCliOptionFormat(flags["--format"]);
175
+ telemetry.trackCliFlagJson(flags["--json"]);
176
+ telemetry.trackCliOptionProject(flags["--project"]);
177
+ if (environmentArg === void 0) {
178
+ output_manager_default.print(
179
+ help(rmSubcommand, {
180
+ parent: { ...tracesCommand, name: "traces config" },
181
+ columns: client.stderr.columns
182
+ })
183
+ );
184
+ return 2;
185
+ }
186
+ if (pathArgs.length > 1) {
187
+ output_manager_default.error(`Too many arguments. Usage: ${getCommandName(USAGE)}`);
188
+ return 2;
189
+ }
190
+ if (!isRuleEnvironment(environmentArg)) {
191
+ return invalidArguments(
192
+ client,
193
+ `${ENVIRONMENT_ERROR} Received: ${environmentArg}`
194
+ );
195
+ }
196
+ if (pathArg !== void 0 && defaultFlag) {
197
+ return invalidArguments(
198
+ client,
199
+ "`--default` selects the rule that has no path prefix, so it cannot be combined with a path prefix."
200
+ );
201
+ }
202
+ if (pathArg !== void 0 && pathArg.trim() === "") {
203
+ return invalidArguments(client, EMPTY_PATH_ERROR);
204
+ }
205
+ const selector = pathArg !== void 0 ? { kind: "exact", requestPath: pathArg } : defaultFlag ? { kind: "default" } : { kind: "every" };
206
+ const formatResult = validateJsonOutput(flags);
207
+ if (!formatResult.valid) {
208
+ output_manager_default.error(formatResult.error);
209
+ return 1;
210
+ }
211
+ const asJson = formatResult.jsonOutput || client.nonInteractive;
212
+ const scope = await resolveConfigScope(client, {
213
+ project: flags["--project"]
214
+ });
215
+ if ("exitCode" in scope) {
216
+ return scope.exitCode;
217
+ }
218
+ if (!asJson) {
219
+ output_manager_default.spinner("Fetching trace sampling rules\u2026");
220
+ }
221
+ let project;
222
+ let tracing;
223
+ let entries;
224
+ try {
225
+ ({ project, tracing, entries } = await readProjectTracing({
226
+ client,
227
+ ...scope
228
+ }));
229
+ } catch (err) {
230
+ output_manager_default.stopSpinner();
231
+ return handleTracingApiError(client, err);
232
+ }
233
+ output_manager_default.stopSpinner();
234
+ const removed = entries.filter((entry) => matches(entry.row, environmentArg, selector)).map((entry) => entry.row);
235
+ const kept = entries.filter(
236
+ (entry) => !matches(entry.row, environmentArg, selector)
237
+ );
238
+ if (removed.length === 0) {
239
+ return ruleNotFound(
240
+ client,
241
+ `No trace sampling rule matches ${describeSelection(environmentArg, selector)} on ${project.name}.`
242
+ );
243
+ }
244
+ const removedLines = removed.map(formatRuleLine);
245
+ output_manager_default.log(
246
+ `The following ${removed.length} ${ruleWord(removed.length)} will be removed from ${import_chalk.default.bold(project.name)}:`
247
+ );
248
+ for (const line of removedLines) {
249
+ output_manager_default.print(` ${line}
250
+ `);
251
+ }
252
+ if (!canConfirm(client)) {
253
+ return confirmationRequired(
254
+ client,
255
+ `Removing ${removed.length} trace sampling ${ruleWord(removed.length)} from ${project.name} needs a confirmation, and this session cannot prompt for one. Rules at risk: ${removedLines.join(", ")}.`,
256
+ [
257
+ {
258
+ command: commandToRunByHand(
259
+ client,
260
+ environmentArg,
261
+ pathArg,
262
+ defaultFlag
263
+ ),
264
+ when: "Run this in a terminal and answer the prompt"
265
+ }
266
+ ]
267
+ );
268
+ }
269
+ const confirmed = await client.input.confirm(
270
+ `Remove ${removed.length} trace sampling ${ruleWord(removed.length)}?`,
271
+ false
272
+ );
273
+ if (!confirmed) {
274
+ output_manager_default.log("Canceled.");
275
+ return 0;
276
+ }
277
+ if (!asJson) {
278
+ output_manager_default.spinner("Updating trace sampling rules\u2026");
279
+ }
280
+ try {
281
+ await writeSamplingRules({
282
+ client,
283
+ ...scope,
284
+ tracing,
285
+ rules: kept.map((entry) => entry.rule)
286
+ });
287
+ } catch (err) {
288
+ output_manager_default.stopSpinner();
289
+ return handleTracingApiError(client, err);
290
+ }
291
+ output_manager_default.stopSpinner();
292
+ const message = `Removed ${removed.length} trace sampling ${ruleWord(removed.length)} from ${project.name}. ${kept.length} of ${RULE_LIMIT} rules.`;
293
+ if (asJson) {
294
+ writeConfigJson(client, {
295
+ project,
296
+ bare: removed,
297
+ envelope: { removed, ruleCount: kept.length, ruleLimit: RULE_LIMIT },
298
+ message,
299
+ next: [
300
+ {
301
+ command: getCommandNamePlain("traces config ls"),
302
+ when: "Read back every remaining sampling rule"
303
+ }
304
+ ]
305
+ });
306
+ return 0;
307
+ }
308
+ output_manager_default.success(
309
+ `Removed ${removed.length} trace sampling ${ruleWord(removed.length)} from ${import_chalk.default.bold(project.name)}. ${kept.length} of ${RULE_LIMIT} rules.`
310
+ );
311
+ return 0;
312
+ }
313
+ export {
314
+ rm as default
315
+ };
@@ -13,40 +13,44 @@ import {
13
13
  requireVcrRepository,
14
14
  resolveVcrScope,
15
15
  validateVcrJsonOutput
16
- } from "./chunk-ZFWNMVNR.js";
17
- import "./chunk-G75NFPIT.js";
18
- import "./chunk-KQRVZWJU.js";
16
+ } from "./chunk-6M2KZUED.js";
17
+ import "./chunk-WNAKOXGK.js";
18
+ import "./chunk-3T7WSWZH.js";
19
19
  import "./chunk-KXDWXXJH.js";
20
20
  import {
21
21
  removeSubcommand
22
- } from "./chunk-2MF3ZAVW.js";
23
- import "./chunk-WC7IINFV.js";
24
- import "./chunk-RIB4S2IB.js";
25
- import "./chunk-GFCTRJI5.js";
26
- import "./chunk-R6IGDGX3.js";
27
- import "./chunk-HMJVUXE6.js";
28
- import "./chunk-CYNB6LL4.js";
22
+ } from "./chunk-CJV7J7B5.js";
23
+ import "./chunk-EZKW5YJ2.js";
24
+ import "./chunk-NFU4XJIR.js";
25
+ import "./chunk-3HZLXCVL.js";
26
+ import "./chunk-5XECIWME.js";
27
+ import "./chunk-VJ5NAOWB.js";
28
+ import "./chunk-FXD67VN5.js";
29
+ import "./chunk-XNFHNTS2.js";
29
30
  import {
30
31
  AGENT_REASON,
31
32
  buildCommandWithYes,
32
33
  outputAgentError
33
- } from "./chunk-TH2XUVDP.js";
34
+ } from "./chunk-NGGLYKNU.js";
34
35
  import "./chunk-GGP5R3FU.js";
35
36
  import {
36
37
  printError
37
- } from "./chunk-VAFU7DXZ.js";
38
+ } from "./chunk-AYLY3ZVL.js";
38
39
  import {
39
40
  parseArguments
40
- } from "./chunk-XLKFJPMT.js";
41
+ } from "./chunk-57RHXXXG.js";
42
+ import "./chunk-RKDCNQ4S.js";
41
43
  import {
42
- getFlagsSpecification,
43
44
  isAPIError
44
- } from "./chunk-SOFC4MLS.js";
45
+ } from "./chunk-BMKU5KEL.js";
46
+ import {
47
+ getFlagsSpecification
48
+ } from "./chunk-Q2DGFCO7.js";
45
49
  import "./chunk-P4QNYOFB.js";
46
50
  import "./chunk-52QYYTM5.js";
47
51
  import {
48
52
  output_manager_default
49
- } from "./chunk-OX7KI3LF.js";
53
+ } from "./chunk-QFAS4OVW.js";
50
54
  import "./chunk-S7KYDPEM.js";
51
55
  import "./chunk-TZ2YI2VH.js";
52
56
 
@@ -8,9 +8,9 @@ import {
8
8
  RoutesAddTelemetryClient,
9
9
  RoutesEditTelemetryClient,
10
10
  RoutesTelemetryClient
11
- } from "./chunk-TVXCXIRO.js";
12
- import "./chunk-CYNB6LL4.js";
13
- import "./chunk-OX7KI3LF.js";
11
+ } from "./chunk-L3UXB2CW.js";
12
+ import "./chunk-XNFHNTS2.js";
13
+ import "./chunk-QFAS4OVW.js";
14
14
  import "./chunk-S7KYDPEM.js";
15
15
  import "./chunk-TZ2YI2VH.js";
16
16
  export {
@@ -9,7 +9,7 @@ import {
9
9
  handleRulesApiError,
10
10
  parseRulesFlagsAndScope,
11
11
  rulesItemPath
12
- } from "./chunk-CHEZBD7H.js";
12
+ } from "./chunk-R5PULMHT.js";
13
13
  import {
14
14
  formatCustomAlertMetric,
15
15
  formatCustomAlertTrigger,
@@ -18,8 +18,8 @@ import {
18
18
  isCustomAlertRule,
19
19
  parseCustomAlertQuery,
20
20
  renderAlertTable
21
- } from "./chunk-F7OXZLY2.js";
22
- import "./chunk-VCE6QKFE.js";
21
+ } from "./chunk-26XDDLXM.js";
22
+ import "./chunk-2O5J3KMT.js";
23
23
  import {
24
24
  formatDate
25
25
  } from "./chunk-GZLPFESR.js";
@@ -27,42 +27,46 @@ import {
27
27
  formatGranularity
28
28
  } from "./chunk-5AJPMLDV.js";
29
29
  import "./chunk-A3NYPUKZ.js";
30
- import "./chunk-KQRVZWJU.js";
30
+ import "./chunk-3T7WSWZH.js";
31
31
  import "./chunk-FGDKMNEN.js";
32
32
  import "./chunk-PRWJUY5U.js";
33
33
  import {
34
34
  truncateMiddle
35
- } from "./chunk-VDJN4WKH.js";
35
+ } from "./chunk-XRWOTCDO.js";
36
36
  import {
37
37
  validateJsonOutput
38
38
  } from "./chunk-KXDWXXJH.js";
39
39
  import {
40
40
  rulesInspectSubcommand
41
- } from "./chunk-UMA66MKW.js";
42
- import "./chunk-HMJVUXE6.js";
43
- import "./chunk-CYNB6LL4.js";
41
+ } from "./chunk-XM3LOQIX.js";
42
+ import "./chunk-VJ5NAOWB.js";
43
+ import "./chunk-FXD67VN5.js";
44
+ import "./chunk-XNFHNTS2.js";
44
45
  import {
45
46
  AGENT_REASON,
46
47
  buildCommandWithGlobalFlags,
47
48
  outputAgentError
48
- } from "./chunk-TH2XUVDP.js";
49
+ } from "./chunk-NGGLYKNU.js";
49
50
  import "./chunk-GGP5R3FU.js";
50
51
  import {
51
52
  printError
52
- } from "./chunk-VAFU7DXZ.js";
53
+ } from "./chunk-AYLY3ZVL.js";
53
54
  import {
54
55
  parseArguments
55
- } from "./chunk-XLKFJPMT.js";
56
+ } from "./chunk-57RHXXXG.js";
57
+ import "./chunk-RKDCNQ4S.js";
58
+ import {
59
+ isAPIError
60
+ } from "./chunk-BMKU5KEL.js";
56
61
  import {
57
62
  getFlagsSpecification,
58
- isAPIError,
59
63
  packageName
60
- } from "./chunk-SOFC4MLS.js";
64
+ } from "./chunk-Q2DGFCO7.js";
61
65
  import "./chunk-P4QNYOFB.js";
62
66
  import "./chunk-52QYYTM5.js";
63
67
  import {
64
68
  output_manager_default
65
- } from "./chunk-OX7KI3LF.js";
69
+ } from "./chunk-QFAS4OVW.js";
66
70
  import {
67
71
  require_source
68
72
  } from "./chunk-S7KYDPEM.js";
@@ -11,12 +11,13 @@ import {
11
11
  AGENT_REASON,
12
12
  buildCommandWithGlobalFlags,
13
13
  outputAgentError
14
- } from "./chunk-TH2XUVDP.js";
15
- import "./chunk-SOFC4MLS.js";
14
+ } from "./chunk-NGGLYKNU.js";
15
+ import "./chunk-BMKU5KEL.js";
16
+ import "./chunk-Q2DGFCO7.js";
16
17
  import "./chunk-P4QNYOFB.js";
17
18
  import {
18
19
  output_manager_default
19
- } from "./chunk-OX7KI3LF.js";
20
+ } from "./chunk-QFAS4OVW.js";
20
21
  import "./chunk-S7KYDPEM.js";
21
22
  import "./chunk-TZ2YI2VH.js";
22
23
 
@@ -31,7 +32,7 @@ var RULES_CONFIG = {
31
32
  };
32
33
  async function rules(client, argv) {
33
34
  if (argv.length === 0 || argv[0]?.startsWith("-")) {
34
- const lsFn = (await import("./ls-OKO4IHWB.js")).default;
35
+ const lsFn = (await import("./ls-KX2VBOGV.js")).default;
35
36
  return lsFn(client, argv);
36
37
  }
37
38
  const { subcommand, args, subcommandOriginal } = getSubcommand(
@@ -64,17 +65,17 @@ async function rules(client, argv) {
64
65
  }
65
66
  switch (subcommand) {
66
67
  case "ls":
67
- return (await import("./ls-OKO4IHWB.js")).default(client, args);
68
+ return (await import("./ls-KX2VBOGV.js")).default(client, args);
68
69
  case "schema":
69
- return (await import("./schema-LUVFYPWN.js")).default(client, args);
70
+ return (await import("./schema-45SJNY5L.js")).default(client, args);
70
71
  case "add":
71
- return (await import("./add-QJ3WT4FW.js")).default(client, args);
72
+ return (await import("./add-SIGUSM3Y.js")).default(client, args);
72
73
  case "inspect":
73
- return (await import("./rule-inspect-WFTVRK6B.js")).default(client, args);
74
+ return (await import("./rule-inspect-LJIGPTWS.js")).default(client, args);
74
75
  case "rm":
75
- return (await import("./rm-KGOEOWVK.js")).default(client, args);
76
+ return (await import("./rm-FTE33UHE.js")).default(client, args);
76
77
  case "update":
77
- return (await import("./update-I7QGAOYF.js")).default(client, args);
78
+ return (await import("./update-B6PSOHUW.js")).default(client, args);
78
79
  default:
79
80
  output_manager_default.error(`Unhandled rules subcommand: ${String(subcommandOriginal)}`);
80
81
  return 1;
@@ -12,30 +12,32 @@ import {
12
12
  } from "./chunk-A3NYPUKZ.js";
13
13
  import {
14
14
  outputError
15
- } from "./chunk-KQRVZWJU.js";
15
+ } from "./chunk-3T7WSWZH.js";
16
16
  import {
17
17
  formatTable
18
- } from "./chunk-BBSS3XIW.js";
18
+ } from "./chunk-OQ3C5VXZ.js";
19
19
  import {
20
20
  validateJsonOutput
21
21
  } from "./chunk-KXDWXXJH.js";
22
22
  import {
23
23
  rulesSchemaSubcommand
24
- } from "./chunk-UMA66MKW.js";
24
+ } from "./chunk-XM3LOQIX.js";
25
25
  import "./chunk-GGP5R3FU.js";
26
26
  import {
27
27
  printError
28
- } from "./chunk-VAFU7DXZ.js";
28
+ } from "./chunk-AYLY3ZVL.js";
29
29
  import {
30
30
  parseArguments
31
- } from "./chunk-XLKFJPMT.js";
31
+ } from "./chunk-57RHXXXG.js";
32
+ import "./chunk-RKDCNQ4S.js";
33
+ import "./chunk-BMKU5KEL.js";
32
34
  import {
33
35
  getFlagsSpecification
34
- } from "./chunk-SOFC4MLS.js";
36
+ } from "./chunk-Q2DGFCO7.js";
35
37
  import "./chunk-P4QNYOFB.js";
36
38
  import {
37
39
  output_manager_default
38
- } from "./chunk-OX7KI3LF.js";
40
+ } from "./chunk-QFAS4OVW.js";
39
41
  import "./chunk-S7KYDPEM.js";
40
42
  import "./chunk-TZ2YI2VH.js";
41
43
 
@@ -10,43 +10,46 @@ import {
10
10
  fetchCustomMetricDetailOrExit,
11
11
  fetchMetricCatalogListOrExit,
12
12
  fetchMetricDetailOrExit
13
- } from "./chunk-KAYSW4CJ.js";
13
+ } from "./chunk-6JPVTPTU.js";
14
14
  import {
15
15
  formatErrorJson
16
- } from "./chunk-CV4S27SS.js";
16
+ } from "./chunk-ASBP32T6.js";
17
17
  import {
18
18
  indent_default
19
19
  } from "./chunk-A3NYPUKZ.js";
20
20
  import {
21
21
  formatTable
22
- } from "./chunk-BBSS3XIW.js";
22
+ } from "./chunk-OQ3C5VXZ.js";
23
23
  import {
24
24
  validateJsonOutput
25
25
  } from "./chunk-KXDWXXJH.js";
26
26
  import {
27
27
  schemaSubcommand
28
- } from "./chunk-EG5BSAXD.js";
28
+ } from "./chunk-MTWHQEXI.js";
29
29
  import {
30
30
  getScope,
31
31
  require_pluralize
32
- } from "./chunk-HMJVUXE6.js";
33
- import "./chunk-CYNB6LL4.js";
34
- import "./chunk-TH2XUVDP.js";
32
+ } from "./chunk-VJ5NAOWB.js";
33
+ import "./chunk-FXD67VN5.js";
34
+ import "./chunk-XNFHNTS2.js";
35
+ import "./chunk-NGGLYKNU.js";
35
36
  import "./chunk-GGP5R3FU.js";
36
37
  import {
37
38
  printError
38
- } from "./chunk-VAFU7DXZ.js";
39
+ } from "./chunk-AYLY3ZVL.js";
39
40
  import {
40
41
  parseArguments
41
- } from "./chunk-XLKFJPMT.js";
42
+ } from "./chunk-57RHXXXG.js";
43
+ import "./chunk-RKDCNQ4S.js";
44
+ import "./chunk-BMKU5KEL.js";
42
45
  import {
43
46
  getFlagsSpecification
44
- } from "./chunk-SOFC4MLS.js";
47
+ } from "./chunk-Q2DGFCO7.js";
45
48
  import "./chunk-P4QNYOFB.js";
46
49
  import "./chunk-52QYYTM5.js";
47
50
  import {
48
51
  output_manager_default
49
- } from "./chunk-OX7KI3LF.js";
52
+ } from "./chunk-QFAS4OVW.js";
50
53
  import "./chunk-S7KYDPEM.js";
51
54
  import {
52
55
  __toESM