vercel 56.5.0 → 58.0.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.
- package/dist/chunks/{add-KNK5E2YT.js → add-7PPD4ZUJ.js} +2 -2
- package/dist/chunks/{add-6GRH6G2M.js → add-E4KH6P4A.js} +6 -5
- package/dist/chunks/{chunk-YS6EDZHB.js → chunk-2MJROFVC.js} +5 -1
- package/dist/chunks/chunk-3PGXYIKC.js +147 -0
- package/dist/chunks/chunk-5AJPMLDV.js +28 -0
- package/dist/chunks/{chunk-V5P25P7F.js → chunk-A3NYPUKZ.js} +7 -12
- package/dist/chunks/{chunk-JQG5EDRD.js → chunk-AZTV7WPZ.js} +1 -1
- package/dist/chunks/{chunk-3BHSS5E2.js → chunk-B2MTCHPO.js} +65 -210
- package/dist/chunks/{chunk-GAOAGU5K.js → chunk-BYQQLGCT.js} +1 -1
- package/dist/chunks/{chunk-ARKHETJP.js → chunk-DGFASMSE.js} +1 -1
- package/dist/chunks/{chunk-W346YNDN.js → chunk-DWMH5M4Q.js} +4 -1
- package/dist/chunks/{chunk-PRYNIKBZ.js → chunk-EA22NMFU.js} +1 -1
- package/dist/chunks/{chunk-26TEKOBZ.js → chunk-FB4UFWEC.js} +8 -1
- package/dist/chunks/chunk-FGDKMNEN.js +21 -0
- package/dist/chunks/{chunk-23U6FANO.js → chunk-FYR7WEUJ.js} +11 -18
- package/dist/chunks/chunk-GZLPFESR.js +48 -0
- package/dist/chunks/{chunk-STJJ3DFO.js → chunk-KCF6S3XF.js} +16 -1
- package/dist/chunks/{chunk-PPEQUJ7T.js → chunk-KGVT2RSG.js} +3 -3
- package/dist/chunks/{chunk-4MK452Y5.js → chunk-L4WYMJB3.js} +8 -8
- package/dist/chunks/{chunk-BM36UWE2.js → chunk-MDQJLTGN.js} +1 -1
- package/dist/chunks/{chunk-Z7NPYIZ6.js → chunk-NM43FFV6.js} +0 -8
- package/dist/chunks/chunk-OF2GNB42.js +53 -0
- package/dist/chunks/{chunk-YTFJGKRG.js → chunk-OQGN4TEC.js} +1 -1
- package/dist/chunks/chunk-PRWJUY5U.js +848 -0
- package/dist/chunks/{chunk-F5OMERHI.js → chunk-QZD5DKUR.js} +10 -23
- package/dist/chunks/{chunk-SWEPOMSA.js → chunk-R54DAHCL.js} +4 -3
- package/dist/chunks/{chunk-DOF6CJLL.js → chunk-RSCSALZH.js} +15 -839
- package/dist/chunks/{chunk-G4MTGCZ5.js → chunk-TEWJ7TIW.js} +1 -1
- package/dist/chunks/{chunk-TMK6RSYW.js → chunk-TPX7RZBM.js} +1433 -979
- package/dist/chunks/chunk-V4RMJKQP.js +36 -0
- package/dist/chunks/{chunk-DI3HR3K6.js → chunk-VUESC3YO.js} +1 -1
- package/dist/chunks/{chunk-IBP2XAUH.js → chunk-WANVKOVB.js} +39 -5
- package/dist/chunks/{chunk-X43U65TH.js → chunk-WDE2EDYX.js} +2 -2
- package/dist/chunks/{chunk-6RTK6BWX.js → chunk-YA3WQFLY.js} +1 -1
- package/dist/chunks/{chunk-EYICIM2K.js → chunk-YZMZCQP3.js} +4 -4
- package/dist/chunks/{chunk-CM3DLBDY.js → chunk-ZMVFTCQF.js} +1 -1
- package/dist/chunks/{compile-vercel-config-IFET4E6H.js → compile-vercel-config-G2IVBXEI.js} +1 -1
- package/dist/chunks/config-validator.mjs +1 -1
- package/dist/chunks/{delete-PXB5WRH7.js → delete-2EIVGM6P.js} +2 -2
- package/dist/chunks/{delete-X2MUMONI.js → delete-E6ZQNE5X.js} +2 -2
- package/dist/chunks/{disable-GBL3SHJL.js → disable-M3Q6BBB7.js} +2 -2
- package/dist/chunks/{discard-XVVSRGDR.js → discard-3R6ETBPS.js} +2 -2
- package/dist/chunks/{edit-EIHRP6XT.js → edit-7JUDPVXD.js} +3 -3
- package/dist/chunks/{edit-K5Y2BDJO.js → edit-ICVMGRRU.js} +2 -2
- package/dist/chunks/{enable-W7AMJWKH.js → enable-HLTA35QL.js} +2 -2
- package/dist/chunks/{export-N3AZ2KOO.js → export-E6XZUFW3.js} +2 -2
- package/dist/chunks/{image-DRTGVPVJ.js → image-SIRPPQZT.js} +3 -3
- package/dist/chunks/{inspect-DYXTX6P4.js → inspect-4FYBOOM5.js} +2 -2
- package/dist/chunks/{inspect-AAIVWSJI.js → inspect-65YX7L3O.js} +2 -2
- package/dist/chunks/inspect-6TQWDIBG.js +587 -0
- package/dist/chunks/{inspect-IPSAYR2C.js → inspect-NFOURIGN.js} +2 -2
- package/dist/chunks/{inspect-SLZLI6ZC.js → inspect-OEWWGAHZ.js} +3 -3
- package/dist/chunks/{list-IF2YW73F.js → list-27DCGMBI.js} +1 -1
- package/dist/chunks/{list-V7VTXVK4.js → list-APFMKZJO.js} +41 -54
- package/dist/chunks/{list-K2HLGUXV.js → list-XQCZVLES.js} +3 -3
- package/dist/chunks/{login-7C6HQEOG.js → login-FMU4CQOV.js} +2 -2
- package/dist/chunks/{ls-2NU353QP.js → ls-24BRCAZR.js} +2 -2
- package/dist/chunks/ls-3L6EN4YU.js +188 -0
- package/dist/chunks/{ls-NKECPPOR.js → ls-BFACWH6C.js} +2 -2
- package/dist/chunks/{ls-QQQHOJBE.js → ls-T5RGDBCV.js} +2 -2
- package/dist/chunks/{open-2FAPZA6V.js → open-AG3VYJZM.js} +2 -2
- package/dist/chunks/{publish-G7PB64LJ.js → publish-5OVCPS4J.js} +2 -2
- package/dist/chunks/{query-D4QBT4WR.js → query-QS4VKBXJ.js} +8 -8
- package/dist/chunks/{reorder-3Z7YIPAX.js → reorder-B5V2P7YM.js} +2 -2
- package/dist/chunks/{reply-7QQBXL5H.js → reply-JBLWE6RS.js} +2 -2
- package/dist/chunks/{resolve-UYKTDZEX.js → resolve-2I6XH2G3.js} +2 -2
- package/dist/chunks/{restore-Q2DR7SMW.js → restore-O63FZXCL.js} +2 -2
- package/dist/chunks/{rm-OCLUTM57.js → rm-HUED5R3Q.js} +6 -5
- package/dist/chunks/{rm-O4M4GFSK.js → rm-N7W3QYWZ.js} +2 -2
- package/dist/chunks/{rm-PCWMEHQ2.js → rm-P3NJSCMY.js} +2 -2
- package/dist/chunks/rule-inspect-M3QUSPU2.js +283 -0
- package/dist/chunks/{rules-LIH5FLPJ.js → rules-NSSWPJ2B.js} +7 -7
- package/dist/chunks/{schema-OFALTXXM.js → schema-G2PAXPVA.js} +6 -4
- package/dist/chunks/{tags-P4HIAI6D.js → tags-JFMO63D4.js} +2 -2
- package/dist/chunks/{update-E3ZQAFBS.js → update-VJCKD6YG.js} +6 -5
- package/dist/commands/build/index.js +42 -10
- package/dist/commands/deploy/index.js +34 -24
- package/dist/commands/dev/index.js +23 -13
- package/dist/commands/env/index.js +8 -7
- package/dist/commands/link/index.js +8 -8
- package/dist/commands/list/index.js +2 -2
- package/dist/commands-bulk.js +1959 -1816
- package/dist/index.js +19 -20
- package/dist/vc.js +54 -18
- package/dist/version.mjs +1 -1
- package/package.json +35 -35
- package/dist/chunks/chunk-GNV7547O.js +0 -86
- package/dist/chunks/inspect-5YUAEI3L.js +0 -351
- package/dist/chunks/ls-RH6Y4XBS.js +0 -113
- package/dist/chunks/rule-inspect-XJ47UEG7.js +0 -141
|
@@ -4,9 +4,20 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
+
import {
|
|
8
|
+
getGroupStartedAt,
|
|
9
|
+
getGroupTitle,
|
|
10
|
+
getGroupType,
|
|
11
|
+
normalizeTimestamp,
|
|
12
|
+
renderAlertTable
|
|
13
|
+
} from "./chunk-3PGXYIKC.js";
|
|
7
14
|
import {
|
|
8
15
|
resolveAlertsScope
|
|
9
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-FYR7WEUJ.js";
|
|
17
|
+
import {
|
|
18
|
+
formatDate
|
|
19
|
+
} from "./chunk-GZLPFESR.js";
|
|
20
|
+
import "./chunk-A3NYPUKZ.js";
|
|
10
21
|
import {
|
|
11
22
|
handleValidationError,
|
|
12
23
|
normalizeRepeatableStringFilters,
|
|
@@ -16,17 +27,20 @@ import {
|
|
|
16
27
|
validateTimeBound,
|
|
17
28
|
validateTimeOrder
|
|
18
29
|
} from "./chunk-BUZRVER7.js";
|
|
30
|
+
import "./chunk-FGDKMNEN.js";
|
|
31
|
+
import "./chunk-PRWJUY5U.js";
|
|
32
|
+
import {
|
|
33
|
+
truncateEnd
|
|
34
|
+
} from "./chunk-OF2GNB42.js";
|
|
19
35
|
import {
|
|
20
36
|
validateJsonOutput
|
|
21
37
|
} from "./chunk-XPKWKPWA.js";
|
|
22
38
|
import {
|
|
23
39
|
alertsCommand
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import
|
|
27
|
-
|
|
28
|
-
} from "./chunk-NZRWTCRM.js";
|
|
29
|
-
import "./chunk-TMK6RSYW.js";
|
|
40
|
+
} from "./chunk-2MJROFVC.js";
|
|
41
|
+
import "./chunk-KCF6S3XF.js";
|
|
42
|
+
import "./chunk-NZRWTCRM.js";
|
|
43
|
+
import "./chunk-TPX7RZBM.js";
|
|
30
44
|
import "./chunk-ECCWJHC6.js";
|
|
31
45
|
import {
|
|
32
46
|
AGENT_REASON,
|
|
@@ -92,45 +106,17 @@ function getDefaultRange() {
|
|
|
92
106
|
const from = new Date(to.getTime() - 24 * 60 * 60 * 1e3);
|
|
93
107
|
return { from: from.toISOString(), to: to.toISOString() };
|
|
94
108
|
}
|
|
95
|
-
function getGroupTitle(group) {
|
|
96
|
-
return group.ai?.title || "Alert group";
|
|
97
|
-
}
|
|
98
|
-
function parseDateInput(value) {
|
|
99
|
-
if (value === void 0) {
|
|
100
|
-
return void 0;
|
|
101
|
-
}
|
|
102
|
-
const epochMs = value < 1e12 ? value * 1e3 : value;
|
|
103
|
-
const date = new Date(epochMs);
|
|
104
|
-
return Number.isNaN(date.getTime()) ? void 0 : date;
|
|
105
|
-
}
|
|
106
|
-
function formatDateForDisplay(value) {
|
|
107
|
-
const date = parseDateInput(value);
|
|
108
|
-
if (!date) {
|
|
109
|
-
return "-";
|
|
110
|
-
}
|
|
111
|
-
return date.toLocaleString("en-US", {
|
|
112
|
-
year: "numeric",
|
|
113
|
-
month: "short",
|
|
114
|
-
day: "2-digit",
|
|
115
|
-
hour: "2-digit",
|
|
116
|
-
minute: "2-digit",
|
|
117
|
-
second: "2-digit",
|
|
118
|
-
hour12: false,
|
|
119
|
-
timeZoneName: "short"
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
109
|
function getStartedAt(group) {
|
|
123
|
-
return
|
|
124
|
-
}
|
|
125
|
-
function getGroupStartedAt(group) {
|
|
126
|
-
return parseDateInput(group.recordedStartedAt) || parseDateInput(group.alerts?.[0]?.startedAt);
|
|
110
|
+
return formatDate(getGroupStartedAt(group));
|
|
127
111
|
}
|
|
128
112
|
function getGroupResolvedAt(group) {
|
|
129
|
-
const resolvedTimes = (group.alerts ?? []).map(
|
|
113
|
+
const resolvedTimes = (group.alerts ?? []).map(
|
|
114
|
+
(alert) => normalizeTimestamp(alert.recordedResolvedAt ?? alert.resolvedAt)
|
|
115
|
+
).filter((time) => time !== void 0);
|
|
130
116
|
if (resolvedTimes.length > 0) {
|
|
131
|
-
return
|
|
117
|
+
return Math.max(...resolvedTimes);
|
|
132
118
|
}
|
|
133
|
-
return
|
|
119
|
+
return void 0;
|
|
134
120
|
}
|
|
135
121
|
function getStatus(group) {
|
|
136
122
|
const normalizedStatus = (group.status || "").toLowerCase();
|
|
@@ -140,8 +126,8 @@ function getStatus(group) {
|
|
|
140
126
|
if (normalizedStatus === "resolved") {
|
|
141
127
|
const startedAt = getGroupStartedAt(group);
|
|
142
128
|
const resolvedAt = getGroupResolvedAt(group);
|
|
143
|
-
if (startedAt && resolvedAt && resolvedAt
|
|
144
|
-
return `resolved after ${(0, import_ms.default)(resolvedAt
|
|
129
|
+
if (startedAt && resolvedAt && resolvedAt >= startedAt) {
|
|
130
|
+
return `resolved after ${(0, import_ms.default)(resolvedAt - startedAt)}`;
|
|
145
131
|
}
|
|
146
132
|
return "resolved";
|
|
147
133
|
}
|
|
@@ -152,7 +138,7 @@ function getResolvedAt(group) {
|
|
|
152
138
|
if (normalizedStatus === "active") {
|
|
153
139
|
return "active";
|
|
154
140
|
}
|
|
155
|
-
return
|
|
141
|
+
return formatDate(getGroupResolvedAt(group));
|
|
156
142
|
}
|
|
157
143
|
function getAlertsCount(group) {
|
|
158
144
|
return String(group.alerts?.length ?? 0);
|
|
@@ -192,18 +178,19 @@ function printGroups(groups) {
|
|
|
192
178
|
].map((h) => import_chalk.default.cyan(h));
|
|
193
179
|
const rows = [
|
|
194
180
|
headers,
|
|
195
|
-
...groups.map((group) =>
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
181
|
+
...groups.map((group) => {
|
|
182
|
+
const row = [
|
|
183
|
+
import_chalk.default.bold(truncateEnd(getGroupTitle(group), 80)),
|
|
184
|
+
import_chalk.default.dim(group.id || "-"),
|
|
185
|
+
getStartedAt(group),
|
|
186
|
+
getGroupType(group)
|
|
187
|
+
];
|
|
188
|
+
row.push(getStatus(group), getAlertsCount(group));
|
|
189
|
+
return row;
|
|
190
|
+
})
|
|
203
191
|
];
|
|
204
|
-
const tableOutput = table(rows, { hsep: 3 }).split("\n").map((line) => line.trimEnd()).join("\n").replace(/^/gm, " ");
|
|
205
192
|
output_manager_default.print(`
|
|
206
|
-
${
|
|
193
|
+
${renderAlertTable(rows, 3)}
|
|
207
194
|
`);
|
|
208
195
|
}
|
|
209
196
|
function printAiSections(groups) {
|
|
@@ -6,13 +6,13 @@ const __filename = __fileURLToPath(import.meta.url);
|
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
7
|
import {
|
|
8
8
|
renderThreadRow
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MDQJLTGN.js";
|
|
10
10
|
import {
|
|
11
11
|
handleCommentsParseError,
|
|
12
12
|
inferBranch,
|
|
13
13
|
listThreads,
|
|
14
14
|
resolveCommentsScope
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-OQGN4TEC.js";
|
|
16
16
|
import {
|
|
17
17
|
handleValidationError,
|
|
18
18
|
outputError,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
} from "./chunk-FHEMFAHB.js";
|
|
27
27
|
import {
|
|
28
28
|
getScope
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-TPX7RZBM.js";
|
|
30
30
|
import "./chunk-ECCWJHC6.js";
|
|
31
31
|
import "./chunk-UDWRZXIT.js";
|
|
32
32
|
import {
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
resolveVcrScope,
|
|
14
14
|
validateVcrChoice,
|
|
15
15
|
validateVcrJsonOutput
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-VUESC3YO.js";
|
|
17
17
|
import {
|
|
18
18
|
require_lib
|
|
19
19
|
} from "./chunk-G75NFPIT.js";
|
|
@@ -29,7 +29,7 @@ import "./chunk-FYQPTH5C.js";
|
|
|
29
29
|
import {
|
|
30
30
|
require_execa
|
|
31
31
|
} from "./chunk-R6IGDGX3.js";
|
|
32
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-TPX7RZBM.js";
|
|
33
33
|
import "./chunk-ECCWJHC6.js";
|
|
34
34
|
import {
|
|
35
35
|
AGENT_REASON,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
resolveVcrScope,
|
|
20
20
|
validateVcrChoice,
|
|
21
21
|
validateVcrJsonOutput
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-VUESC3YO.js";
|
|
23
23
|
import {
|
|
24
24
|
outputError,
|
|
25
25
|
validateOptionalIntegerRange
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
import {
|
|
34
34
|
table
|
|
35
35
|
} from "./chunk-NZRWTCRM.js";
|
|
36
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-TPX7RZBM.js";
|
|
37
37
|
import "./chunk-ECCWJHC6.js";
|
|
38
38
|
import {
|
|
39
39
|
AGENT_REASON,
|
|
@@ -0,0 +1,188 @@
|
|
|
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
|
+
formatCustomAlertMetric,
|
|
9
|
+
formatCustomAlertTrigger,
|
|
10
|
+
formatRuleScope,
|
|
11
|
+
isCustomAlertRule,
|
|
12
|
+
parseCustomAlertQuery,
|
|
13
|
+
renderAlertTable
|
|
14
|
+
} from "./chunk-3PGXYIKC.js";
|
|
15
|
+
import {
|
|
16
|
+
emitRulesArgParseError,
|
|
17
|
+
handleRulesApiError,
|
|
18
|
+
parseRulesFlagsAndScope,
|
|
19
|
+
rulesCollectionPath
|
|
20
|
+
} from "./chunk-R54DAHCL.js";
|
|
21
|
+
import "./chunk-FYR7WEUJ.js";
|
|
22
|
+
import {
|
|
23
|
+
formatGranularity
|
|
24
|
+
} from "./chunk-5AJPMLDV.js";
|
|
25
|
+
import "./chunk-A3NYPUKZ.js";
|
|
26
|
+
import {
|
|
27
|
+
normalizeRepeatableStringFilters
|
|
28
|
+
} from "./chunk-BUZRVER7.js";
|
|
29
|
+
import "./chunk-FGDKMNEN.js";
|
|
30
|
+
import {
|
|
31
|
+
truncateEnd
|
|
32
|
+
} from "./chunk-OF2GNB42.js";
|
|
33
|
+
import {
|
|
34
|
+
validateJsonOutput
|
|
35
|
+
} from "./chunk-XPKWKPWA.js";
|
|
36
|
+
import {
|
|
37
|
+
rulesLsSubcommand
|
|
38
|
+
} from "./chunk-KCF6S3XF.js";
|
|
39
|
+
import "./chunk-NZRWTCRM.js";
|
|
40
|
+
import "./chunk-TPX7RZBM.js";
|
|
41
|
+
import "./chunk-ECCWJHC6.js";
|
|
42
|
+
import {
|
|
43
|
+
AGENT_REASON,
|
|
44
|
+
outputAgentError
|
|
45
|
+
} from "./chunk-UDWRZXIT.js";
|
|
46
|
+
import {
|
|
47
|
+
parseArguments,
|
|
48
|
+
printError
|
|
49
|
+
} from "./chunk-SZXT3PDQ.js";
|
|
50
|
+
import {
|
|
51
|
+
getFlagsSpecification,
|
|
52
|
+
isAPIError
|
|
53
|
+
} from "./chunk-KSSNLCL4.js";
|
|
54
|
+
import "./chunk-P4QNYOFB.js";
|
|
55
|
+
import "./chunk-52QYYTM5.js";
|
|
56
|
+
import {
|
|
57
|
+
output_manager_default
|
|
58
|
+
} from "./chunk-OX7KI3LF.js";
|
|
59
|
+
import "./chunk-GGP5R3FU.js";
|
|
60
|
+
import {
|
|
61
|
+
require_source
|
|
62
|
+
} from "./chunk-S7KYDPEM.js";
|
|
63
|
+
import {
|
|
64
|
+
__toESM
|
|
65
|
+
} from "./chunk-TZ2YI2VH.js";
|
|
66
|
+
|
|
67
|
+
// src/commands/alerts/rules/ls.ts
|
|
68
|
+
var import_chalk = __toESM(require_source(), 1);
|
|
69
|
+
function getCustomAlertRuleDetails(rule) {
|
|
70
|
+
const customAlert = rule.customAlert;
|
|
71
|
+
if (!isCustomAlertRule(rule) || !customAlert) {
|
|
72
|
+
return "";
|
|
73
|
+
}
|
|
74
|
+
const metric = formatCustomAlertMetric(customAlert);
|
|
75
|
+
const trigger = formatCustomAlertTrigger(customAlert);
|
|
76
|
+
const min = typeof customAlert.minThreshold === "number" ? `min ${customAlert.minThreshold}` : void 0;
|
|
77
|
+
const granularity = formatGranularity(
|
|
78
|
+
parseCustomAlertQuery(customAlert.queryJsonString).granularity
|
|
79
|
+
);
|
|
80
|
+
const interval = granularity ? `every ${granularity}` : void 0;
|
|
81
|
+
return [metric, trigger, min, interval].filter(Boolean).join("; ");
|
|
82
|
+
}
|
|
83
|
+
function ruleMatchesTypes(rule, types) {
|
|
84
|
+
if (types.length === 0) {
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
return rule.alertTypes?.some((alertType) => types.includes(alertType.type)) || types.includes("custom_alert") && isCustomAlertRule(rule);
|
|
88
|
+
}
|
|
89
|
+
function getRuleScope(rule) {
|
|
90
|
+
return formatRuleScope(rule.projectId, {
|
|
91
|
+
projectIdMaxLength: 24,
|
|
92
|
+
filterMaxLength: 24
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function printRules(rules) {
|
|
96
|
+
const showDetails = rules.some((rule) => getCustomAlertRuleDetails(rule));
|
|
97
|
+
const headers = [
|
|
98
|
+
"Name",
|
|
99
|
+
"Rule id",
|
|
100
|
+
"Scope",
|
|
101
|
+
...showDetails ? ["Details"] : []
|
|
102
|
+
].map((h) => import_chalk.default.cyan(h));
|
|
103
|
+
const rows = [
|
|
104
|
+
headers,
|
|
105
|
+
...rules.map((rule) => {
|
|
106
|
+
const row = [
|
|
107
|
+
import_chalk.default.bold(truncateEnd(rule.name || "-", 44)),
|
|
108
|
+
import_chalk.default.dim(rule.id || "-"),
|
|
109
|
+
getRuleScope(rule)
|
|
110
|
+
];
|
|
111
|
+
if (showDetails) {
|
|
112
|
+
row.push(truncateEnd(getCustomAlertRuleDetails(rule) || "-", 72));
|
|
113
|
+
}
|
|
114
|
+
return row;
|
|
115
|
+
})
|
|
116
|
+
];
|
|
117
|
+
output_manager_default.print(`
|
|
118
|
+
${renderAlertTable(rows, 2)}
|
|
119
|
+
`);
|
|
120
|
+
}
|
|
121
|
+
async function ls(client, argv) {
|
|
122
|
+
let parsedArgs;
|
|
123
|
+
try {
|
|
124
|
+
parsedArgs = parseArguments(
|
|
125
|
+
argv,
|
|
126
|
+
getFlagsSpecification(rulesLsSubcommand.options)
|
|
127
|
+
);
|
|
128
|
+
} catch (e) {
|
|
129
|
+
emitRulesArgParseError(client, e, "alerts rules ls --project <name-or-id>");
|
|
130
|
+
printError(e);
|
|
131
|
+
return 1;
|
|
132
|
+
}
|
|
133
|
+
const flags = parsedArgs.flags;
|
|
134
|
+
const fr = validateJsonOutput(flags);
|
|
135
|
+
if (!fr.valid) {
|
|
136
|
+
outputAgentError(
|
|
137
|
+
client,
|
|
138
|
+
{
|
|
139
|
+
status: "error",
|
|
140
|
+
reason: AGENT_REASON.INVALID_ARGUMENTS,
|
|
141
|
+
message: fr.error
|
|
142
|
+
},
|
|
143
|
+
1
|
|
144
|
+
);
|
|
145
|
+
output_manager_default.error(fr.error);
|
|
146
|
+
return 1;
|
|
147
|
+
}
|
|
148
|
+
const scope = await parseRulesFlagsAndScope(
|
|
149
|
+
client,
|
|
150
|
+
{
|
|
151
|
+
"--project": flags["--project"],
|
|
152
|
+
"--all": flags["--all"]
|
|
153
|
+
},
|
|
154
|
+
fr.jsonOutput,
|
|
155
|
+
"alerts rules ls"
|
|
156
|
+
);
|
|
157
|
+
if (typeof scope === "number") {
|
|
158
|
+
return scope;
|
|
159
|
+
}
|
|
160
|
+
const path = rulesCollectionPath(scope);
|
|
161
|
+
output_manager_default.spinner("Fetching alert rules...");
|
|
162
|
+
try {
|
|
163
|
+
const rules = await client.fetch(path);
|
|
164
|
+
const types = normalizeRepeatableStringFilters(flags["--type"]);
|
|
165
|
+
const filteredRules = rules.filter((rule) => ruleMatchesTypes(rule, types));
|
|
166
|
+
if (fr.jsonOutput) {
|
|
167
|
+
client.stdout.write(
|
|
168
|
+
`${JSON.stringify({ rules: filteredRules }, null, 2)}
|
|
169
|
+
`
|
|
170
|
+
);
|
|
171
|
+
} else if (filteredRules.length === 0) {
|
|
172
|
+
output_manager_default.log("No alert rules found for this scope.");
|
|
173
|
+
} else {
|
|
174
|
+
printRules(filteredRules);
|
|
175
|
+
}
|
|
176
|
+
return 0;
|
|
177
|
+
} catch (err) {
|
|
178
|
+
if (isAPIError(err)) {
|
|
179
|
+
return handleRulesApiError(client, err, fr.jsonOutput);
|
|
180
|
+
}
|
|
181
|
+
throw err;
|
|
182
|
+
} finally {
|
|
183
|
+
output_manager_default.stopSpinner();
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
export {
|
|
187
|
+
ls as default
|
|
188
|
+
};
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
handleVcrApiError,
|
|
16
16
|
resolveVcrScope,
|
|
17
17
|
validateVcrJsonOutput
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-VUESC3YO.js";
|
|
19
19
|
import {
|
|
20
20
|
outputError,
|
|
21
21
|
validateOptionalIntegerRange
|
|
@@ -29,7 +29,7 @@ import "./chunk-FYQPTH5C.js";
|
|
|
29
29
|
import {
|
|
30
30
|
table
|
|
31
31
|
} from "./chunk-NZRWTCRM.js";
|
|
32
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-TPX7RZBM.js";
|
|
33
33
|
import "./chunk-ECCWJHC6.js";
|
|
34
34
|
import {
|
|
35
35
|
AGENT_REASON,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
requireVcrRepository,
|
|
20
20
|
resolveVcrScope,
|
|
21
21
|
validateVcrJsonOutput
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-VUESC3YO.js";
|
|
23
23
|
import {
|
|
24
24
|
outputError,
|
|
25
25
|
validateOptionalIntegerRange
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
import {
|
|
32
32
|
table
|
|
33
33
|
} from "./chunk-NZRWTCRM.js";
|
|
34
|
-
import "./chunk-
|
|
34
|
+
import "./chunk-TPX7RZBM.js";
|
|
35
35
|
import "./chunk-ECCWJHC6.js";
|
|
36
36
|
import {
|
|
37
37
|
AGENT_REASON,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
resolveCommentsScope,
|
|
14
14
|
threadNotFoundMessage,
|
|
15
15
|
toApiErrorParts
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-OQGN4TEC.js";
|
|
17
17
|
import {
|
|
18
18
|
outputError
|
|
19
19
|
} from "./chunk-BUZRVER7.js";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
} from "./chunk-FHEMFAHB.js";
|
|
23
23
|
import {
|
|
24
24
|
require_open
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-TPX7RZBM.js";
|
|
26
26
|
import "./chunk-ECCWJHC6.js";
|
|
27
27
|
import "./chunk-UDWRZXIT.js";
|
|
28
28
|
import {
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
printDiffSummary,
|
|
18
18
|
requireProjectContext,
|
|
19
19
|
withGlobalFlags
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-DGFASMSE.js";
|
|
21
21
|
import {
|
|
22
22
|
publishSubcommand
|
|
23
23
|
} from "./chunk-VZSZBD4V.js";
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
stamp_default
|
|
26
26
|
} from "./chunk-64IF634X.js";
|
|
27
27
|
import "./chunk-VXYGCOKL.js";
|
|
28
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-TPX7RZBM.js";
|
|
29
29
|
import "./chunk-ECCWJHC6.js";
|
|
30
30
|
import {
|
|
31
31
|
outputAgentError
|
|
@@ -7,21 +7,24 @@ const __dirname = __dirname_(__filename);
|
|
|
7
7
|
import {
|
|
8
8
|
fetchMetricDetailOrExit,
|
|
9
9
|
getDefaultAggregation
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-YA3WQFLY.js";
|
|
11
11
|
import {
|
|
12
12
|
computeGranularity,
|
|
13
13
|
formatText
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-QZD5DKUR.js";
|
|
15
15
|
import {
|
|
16
16
|
formatErrorJson,
|
|
17
17
|
formatQueryJson,
|
|
18
18
|
getRollupColumnName,
|
|
19
19
|
handleApiError
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-NM43FFV6.js";
|
|
21
|
+
import "./chunk-5AJPMLDV.js";
|
|
22
|
+
import "./chunk-A3NYPUKZ.js";
|
|
21
23
|
import {
|
|
22
24
|
resolveTimeRange,
|
|
23
25
|
validateAllProjectMutualExclusivity
|
|
24
26
|
} from "./chunk-BUZRVER7.js";
|
|
27
|
+
import "./chunk-OF2GNB42.js";
|
|
25
28
|
import {
|
|
26
29
|
validateJsonOutput
|
|
27
30
|
} from "./chunk-XPKWKPWA.js";
|
|
@@ -34,7 +37,7 @@ import {
|
|
|
34
37
|
getLinkedProject,
|
|
35
38
|
getProjectByNameOrId,
|
|
36
39
|
getScope
|
|
37
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-TPX7RZBM.js";
|
|
38
41
|
import "./chunk-ECCWJHC6.js";
|
|
39
42
|
import "./chunk-UDWRZXIT.js";
|
|
40
43
|
import {
|
|
@@ -56,9 +59,6 @@ import "./chunk-S7KYDPEM.js";
|
|
|
56
59
|
import "./chunk-TZ2YI2VH.js";
|
|
57
60
|
|
|
58
61
|
// src/commands/metrics/validation.ts
|
|
59
|
-
function validateMutualExclusivity(all, project) {
|
|
60
|
-
return validateAllProjectMutualExclusivity(all, project);
|
|
61
|
-
}
|
|
62
62
|
function validateRequiredMetric(metric) {
|
|
63
63
|
if (metric) {
|
|
64
64
|
return { valid: true, value: metric };
|
|
@@ -253,7 +253,7 @@ async function query(client, telemetry) {
|
|
|
253
253
|
return handleValidationError(requiredMetric, jsonOutput, client);
|
|
254
254
|
}
|
|
255
255
|
const metric = requiredMetric.value;
|
|
256
|
-
const mutualResult =
|
|
256
|
+
const mutualResult = validateAllProjectMutualExclusivity(all, project);
|
|
257
257
|
if (!mutualResult.valid) {
|
|
258
258
|
return handleValidationError(mutualResult, jsonOutput, client);
|
|
259
259
|
}
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
resolveRoute,
|
|
17
17
|
shellQuoteRouteIdentifierForSuggestion,
|
|
18
18
|
withGlobalFlags
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-DGFASMSE.js";
|
|
20
20
|
import {
|
|
21
21
|
reorderSubcommand
|
|
22
22
|
} from "./chunk-VZSZBD4V.js";
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
stamp_default
|
|
25
25
|
} from "./chunk-64IF634X.js";
|
|
26
26
|
import "./chunk-VXYGCOKL.js";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-TPX7RZBM.js";
|
|
28
28
|
import "./chunk-ECCWJHC6.js";
|
|
29
29
|
import {
|
|
30
30
|
outputAgentError
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
resolveCommentsScope,
|
|
17
17
|
threadNotFoundMessage,
|
|
18
18
|
toApiErrorParts
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-OQGN4TEC.js";
|
|
20
20
|
import "./chunk-2473DUBR.js";
|
|
21
21
|
import {
|
|
22
22
|
outputError
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
import {
|
|
28
28
|
replySubcommand
|
|
29
29
|
} from "./chunk-FHEMFAHB.js";
|
|
30
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-TPX7RZBM.js";
|
|
31
31
|
import "./chunk-ECCWJHC6.js";
|
|
32
32
|
import "./chunk-UDWRZXIT.js";
|
|
33
33
|
import {
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
threadNotFoundMessage,
|
|
15
15
|
toApiErrorParts,
|
|
16
16
|
updateThread
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-OQGN4TEC.js";
|
|
18
18
|
import {
|
|
19
19
|
canPrompt
|
|
20
20
|
} from "./chunk-2473DUBR.js";
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
reopenSubcommand,
|
|
29
29
|
resolveSubcommand
|
|
30
30
|
} from "./chunk-FHEMFAHB.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-TPX7RZBM.js";
|
|
32
32
|
import "./chunk-ECCWJHC6.js";
|
|
33
33
|
import "./chunk-UDWRZXIT.js";
|
|
34
34
|
import {
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
requireProjectContext,
|
|
20
20
|
validateRequiredArguments,
|
|
21
21
|
withGlobalFlags
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-DGFASMSE.js";
|
|
23
23
|
import {
|
|
24
24
|
restoreSubcommand
|
|
25
25
|
} from "./chunk-VZSZBD4V.js";
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
stamp_default
|
|
28
28
|
} from "./chunk-64IF634X.js";
|
|
29
29
|
import "./chunk-VXYGCOKL.js";
|
|
30
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-TPX7RZBM.js";
|
|
31
31
|
import "./chunk-ECCWJHC6.js";
|
|
32
32
|
import {
|
|
33
33
|
outputAgentError
|
|
@@ -9,16 +9,16 @@ import {
|
|
|
9
9
|
handleRulesApiError,
|
|
10
10
|
parseRulesFlagsAndScope,
|
|
11
11
|
rulesItemPath
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-R54DAHCL.js";
|
|
13
|
+
import "./chunk-FYR7WEUJ.js";
|
|
14
14
|
import "./chunk-BUZRVER7.js";
|
|
15
15
|
import {
|
|
16
16
|
validateJsonOutput
|
|
17
17
|
} from "./chunk-XPKWKPWA.js";
|
|
18
18
|
import {
|
|
19
19
|
rulesRmSubcommand
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-KCF6S3XF.js";
|
|
21
|
+
import "./chunk-TPX7RZBM.js";
|
|
22
22
|
import "./chunk-ECCWJHC6.js";
|
|
23
23
|
import {
|
|
24
24
|
AGENT_REASON,
|
|
@@ -112,7 +112,8 @@ async function rm(client, argv) {
|
|
|
112
112
|
"--project": parsedArgs.flags["--project"],
|
|
113
113
|
"--all": parsedArgs.flags["--all"]
|
|
114
114
|
},
|
|
115
|
-
fr.jsonOutput
|
|
115
|
+
fr.jsonOutput,
|
|
116
|
+
`alerts rules rm ${ruleId}`
|
|
116
117
|
);
|
|
117
118
|
if (typeof scope === "number") {
|
|
118
119
|
return scope;
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
requireVcrRepository,
|
|
14
14
|
resolveVcrScope,
|
|
15
15
|
validateVcrJsonOutput
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-VUESC3YO.js";
|
|
17
17
|
import "./chunk-BUZRVER7.js";
|
|
18
18
|
import "./chunk-XPKWKPWA.js";
|
|
19
19
|
import {
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from "./chunk-3VS4DTAU.js";
|
|
22
22
|
import "./chunk-GIL3VAUR.js";
|
|
23
23
|
import "./chunk-FYQPTH5C.js";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-TPX7RZBM.js";
|
|
25
25
|
import "./chunk-ECCWJHC6.js";
|
|
26
26
|
import {
|
|
27
27
|
AGENT_REASON,
|
|
@@ -13,13 +13,13 @@ import {
|
|
|
13
13
|
requireVcrRepositoryAndImageId,
|
|
14
14
|
resolveVcrScope,
|
|
15
15
|
validateVcrJsonOutput
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-VUESC3YO.js";
|
|
17
17
|
import "./chunk-BUZRVER7.js";
|
|
18
18
|
import "./chunk-XPKWKPWA.js";
|
|
19
19
|
import {
|
|
20
20
|
imageRmSubcommand
|
|
21
21
|
} from "./chunk-FYQPTH5C.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-TPX7RZBM.js";
|
|
23
23
|
import "./chunk-ECCWJHC6.js";
|
|
24
24
|
import {
|
|
25
25
|
AGENT_REASON,
|