vercel 51.2.1 → 51.3.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-3MIOUOZC.js +180 -0
- package/dist/chunks/{chunk-W6FW7CCT.js → chunk-2JQVASXJ.js} +13 -8
- package/dist/chunks/{chunk-Q6BEDVOU.js → chunk-4PQA6H63.js} +1 -1
- package/dist/chunks/{chunk-IS2HEMF4.js → chunk-4RBF6ZDU.js} +4 -2
- package/dist/chunks/{chunk-7S7GE4BN.js → chunk-4VP55L4V.js} +208 -500
- package/dist/chunks/{chunk-5YQCJTZI.js → chunk-4WRHMYCG.js} +6 -6
- package/dist/chunks/chunk-4ZWTYJSP.js +139 -0
- package/dist/chunks/{chunk-3FMFPD7F.js → chunk-APGVHLAW.js} +2 -2
- package/dist/chunks/{chunk-5WHDQH2U.js → chunk-BAUYQ7AR.js} +1 -1
- package/dist/chunks/{chunk-BUBUVE23.js → chunk-BJQTGP42.js} +4 -2
- package/dist/chunks/{chunk-G6MVEB4W.js → chunk-BU3JMDDH.js} +3 -3
- package/dist/chunks/chunk-CGTXAXZ4.js +484 -0
- package/dist/chunks/{chunk-BQUQ5F7R.js → chunk-CRZM5WM2.js} +4 -2
- package/dist/chunks/{chunk-XRR5HDB3.js → chunk-CZXW3DJH.js} +2 -2
- package/dist/chunks/chunk-DVQ4SIWF.js +183 -0
- package/dist/chunks/{chunk-A4NVECX5.js → chunk-ECRBC4HL.js} +4 -581
- package/dist/chunks/{chunk-RK4TKB3D.js → chunk-FNFZO3WQ.js} +7 -5
- package/dist/chunks/{chunk-L2BKVTHL.js → chunk-G6RXZLQ2.js} +2 -2
- package/dist/chunks/{chunk-4YZKA4FN.js → chunk-GE6G37P4.js} +1 -1
- package/dist/chunks/{chunk-NELCIT4M.js → chunk-GLDQ23LD.js} +1 -1
- package/dist/chunks/{chunk-5DLMAFQU.js → chunk-GYBFQLYR.js} +6 -4
- package/dist/chunks/{chunk-XAVGWINL.js → chunk-JEON5XEH.js} +44 -13
- package/dist/chunks/{chunk-Y5YCSB6X.js → chunk-LDXYSGPZ.js} +2 -2
- package/dist/chunks/{chunk-U5J73OA3.js → chunk-N45K6NXC.js} +1 -1
- package/dist/chunks/{chunk-SSOWPEZT.js → chunk-NCQBQGI6.js} +2 -2
- package/dist/chunks/chunk-NE34PEHL.js +167 -0
- package/dist/chunks/{chunk-QQTF2FEY.js → chunk-OFUQPP26.js} +9 -5
- package/dist/chunks/{chunk-FSOFFJDV.js → chunk-R2BVH5SQ.js} +1 -1
- package/dist/chunks/chunk-RFMC2QXQ.js +602 -0
- package/dist/chunks/{chunk-VTQNSCUG.js → chunk-RHXEHBO3.js} +8 -6
- package/dist/chunks/{chunk-K5XJCQQO.js → chunk-RRYVGOVK.js} +1 -1
- package/dist/chunks/{chunk-EHZKWVK2.js → chunk-T7CL42FK.js} +5 -5
- package/dist/chunks/{chunk-WXNT7WJO.js → chunk-TAOVG4PS.js} +49 -4
- package/dist/chunks/{chunk-57RLFBKC.js → chunk-UB325PS7.js} +1 -1
- package/dist/chunks/{chunk-2IAZZEVQ.js → chunk-UWKTUK3W.js} +4 -2
- package/dist/chunks/{chunk-VE7MY76H.js → chunk-VGWGLBUC.js} +4 -2
- package/dist/chunks/{chunk-4EGCWWSR.js → chunk-VMTOBGCO.js} +50 -16
- package/dist/chunks/{chunk-W5K4YCTI.js → chunk-ZS5VKEZL.js} +5 -3
- package/dist/chunks/{compile-vercel-config-2GV46IDP.js → compile-vercel-config-A2SLMCWK.js} +4 -2
- package/dist/chunks/{delete-PXMYSQGR.js → delete-SEQBCYWT.js} +7 -5
- package/dist/chunks/{disable-2ZQ4OG4A.js → disable-GRM5DJGU.js} +7 -5
- package/dist/chunks/{discard-FQZTZ5HK.js → discard-IVQWWSPI.js} +7 -5
- package/dist/chunks/{edit-F3J7Q5SZ.js → edit-YTMZBT4Y.js} +8 -6
- package/dist/chunks/{enable-ZW4W33H5.js → enable-SSU3MG6J.js} +7 -5
- package/dist/chunks/{export-ZZV6ESIW.js → export-INCDZTYW.js} +7 -5
- package/dist/chunks/inspect-QMY2ZE6J.js +353 -0
- package/dist/chunks/{list-VFPV4TUW.js → list-FF4VGSZ2.js} +115 -85
- package/dist/chunks/{list-SSIMVNNN.js → list-MMIBPSB3.js} +10 -7
- package/dist/chunks/ls-TYEDISJD.js +114 -0
- package/dist/chunks/{publish-3K76MNS3.js → publish-OJQCVDL5.js} +7 -5
- package/dist/chunks/{query-CY7JJSSX.js → query-LACPOOBL.js} +15 -12
- package/dist/chunks/{reorder-6L7MENN5.js → reorder-TBFWHFQZ.js} +7 -5
- package/dist/chunks/{restore-XUYXOJQ2.js → restore-5LUZRUME.js} +7 -5
- package/dist/chunks/rm-LDXY2G45.js +164 -0
- package/dist/chunks/rule-inspect-THIN6POX.js +142 -0
- package/dist/chunks/rules-4ZH7VTGC.js +83 -0
- package/dist/chunks/{schema-G5FSLZVA.js → schema-OK4OOI2N.js} +9 -7
- package/dist/chunks/{types-A4EAQ6F6.js → types-QNN5CDCB.js} +6 -4
- package/dist/chunks/update-EXPUPEH6.js +196 -0
- package/dist/commands/build/index.js +27 -23
- package/dist/commands/deploy/index.js +171 -32
- package/dist/commands/dev/index.js +21 -17
- package/dist/commands/env/index.js +32 -27
- package/dist/commands/link/index.js +21 -17
- package/dist/commands/list/index.js +14 -11
- package/dist/commands-bulk.js +322 -128
- package/dist/index.js +28 -24
- package/dist/version.mjs +1 -1
- package/package.json +19 -19
|
@@ -0,0 +1,114 @@
|
|
|
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
|
+
emitRulesArgParseError,
|
|
9
|
+
handleRulesApiError,
|
|
10
|
+
parseRulesFlagsAndScope,
|
|
11
|
+
rulesCollectionPath
|
|
12
|
+
} from "./chunk-4ZWTYJSP.js";
|
|
13
|
+
import "./chunk-NE34PEHL.js";
|
|
14
|
+
import "./chunk-HTOH3MSD.js";
|
|
15
|
+
import "./chunk-APGVHLAW.js";
|
|
16
|
+
import {
|
|
17
|
+
validateJsonOutput
|
|
18
|
+
} from "./chunk-XPKWKPWA.js";
|
|
19
|
+
import {
|
|
20
|
+
rulesLsSubcommand
|
|
21
|
+
} from "./chunk-DVQ4SIWF.js";
|
|
22
|
+
import {
|
|
23
|
+
AGENT_REASON
|
|
24
|
+
} from "./chunk-E3NE4SKN.js";
|
|
25
|
+
import "./chunk-4VP55L4V.js";
|
|
26
|
+
import "./chunk-U3WLEFHU.js";
|
|
27
|
+
import {
|
|
28
|
+
outputAgentError
|
|
29
|
+
} from "./chunk-CGTXAXZ4.js";
|
|
30
|
+
import "./chunk-CO5D46AG.js";
|
|
31
|
+
import {
|
|
32
|
+
getFlagsSpecification,
|
|
33
|
+
parseArguments,
|
|
34
|
+
printError
|
|
35
|
+
} from "./chunk-RFMC2QXQ.js";
|
|
36
|
+
import {
|
|
37
|
+
isAPIError
|
|
38
|
+
} from "./chunk-ECRBC4HL.js";
|
|
39
|
+
import {
|
|
40
|
+
output_manager_default
|
|
41
|
+
} from "./chunk-ZQKJVHXY.js";
|
|
42
|
+
import "./chunk-S7KYDPEM.js";
|
|
43
|
+
import "./chunk-TZ2YI2VH.js";
|
|
44
|
+
|
|
45
|
+
// src/commands/alerts/rules/ls.ts
|
|
46
|
+
async function ls(client, argv) {
|
|
47
|
+
let parsedArgs;
|
|
48
|
+
try {
|
|
49
|
+
parsedArgs = parseArguments(
|
|
50
|
+
argv,
|
|
51
|
+
getFlagsSpecification(rulesLsSubcommand.options)
|
|
52
|
+
);
|
|
53
|
+
} catch (e) {
|
|
54
|
+
emitRulesArgParseError(client, e, "alerts rules ls --project <name-or-id>");
|
|
55
|
+
printError(e);
|
|
56
|
+
return 1;
|
|
57
|
+
}
|
|
58
|
+
const fr = validateJsonOutput(parsedArgs.flags);
|
|
59
|
+
if (!fr.valid) {
|
|
60
|
+
outputAgentError(
|
|
61
|
+
client,
|
|
62
|
+
{
|
|
63
|
+
status: "error",
|
|
64
|
+
reason: AGENT_REASON.INVALID_ARGUMENTS,
|
|
65
|
+
message: fr.error
|
|
66
|
+
},
|
|
67
|
+
1
|
|
68
|
+
);
|
|
69
|
+
output_manager_default.error(fr.error);
|
|
70
|
+
return 1;
|
|
71
|
+
}
|
|
72
|
+
const scope = await parseRulesFlagsAndScope(
|
|
73
|
+
client,
|
|
74
|
+
{
|
|
75
|
+
"--project": parsedArgs.flags["--project"],
|
|
76
|
+
"--all": parsedArgs.flags["--all"]
|
|
77
|
+
},
|
|
78
|
+
fr.jsonOutput
|
|
79
|
+
);
|
|
80
|
+
if (typeof scope === "number") {
|
|
81
|
+
return scope;
|
|
82
|
+
}
|
|
83
|
+
const path = rulesCollectionPath(scope);
|
|
84
|
+
output_manager_default.spinner("Fetching alert rules...");
|
|
85
|
+
try {
|
|
86
|
+
const rules = await client.fetch(path);
|
|
87
|
+
if (fr.jsonOutput) {
|
|
88
|
+
client.stdout.write(`${JSON.stringify({ rules }, null, 2)}
|
|
89
|
+
`);
|
|
90
|
+
} else if (rules.length === 0) {
|
|
91
|
+
output_manager_default.log("No alert rules found for this scope.");
|
|
92
|
+
} else {
|
|
93
|
+
for (const r of rules) {
|
|
94
|
+
const id = typeof r.id === "string" ? r.id : "";
|
|
95
|
+
const name = typeof r.name === "string" ? r.name : "";
|
|
96
|
+
const pid = typeof r.projectId === "string" ? r.projectId : "";
|
|
97
|
+
output_manager_default.log(
|
|
98
|
+
`${id} ${name}${pid ? ` project: ${pid}` : " (team-wide)"}`
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return 0;
|
|
103
|
+
} catch (err) {
|
|
104
|
+
if (isAPIError(err)) {
|
|
105
|
+
return handleRulesApiError(client, err, fr.jsonOutput);
|
|
106
|
+
}
|
|
107
|
+
throw err;
|
|
108
|
+
} finally {
|
|
109
|
+
output_manager_default.stopSpinner();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
export {
|
|
113
|
+
ls as default
|
|
114
|
+
};
|
|
@@ -17,21 +17,23 @@ import {
|
|
|
17
17
|
parseSubcommandArgs,
|
|
18
18
|
printDiffSummary,
|
|
19
19
|
withGlobalFlags
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-OFUQPP26.js";
|
|
21
21
|
import {
|
|
22
22
|
publishSubcommand
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-CRZM5WM2.js";
|
|
24
24
|
import "./chunk-E3NE4SKN.js";
|
|
25
|
+
import "./chunk-4VP55L4V.js";
|
|
26
|
+
import "./chunk-U3WLEFHU.js";
|
|
25
27
|
import {
|
|
26
28
|
outputAgentError
|
|
27
|
-
} from "./chunk-
|
|
28
|
-
import "./chunk-U3WLEFHU.js";
|
|
29
|
+
} from "./chunk-CGTXAXZ4.js";
|
|
29
30
|
import {
|
|
30
31
|
stamp_default
|
|
31
32
|
} from "./chunk-CO5D46AG.js";
|
|
33
|
+
import "./chunk-RFMC2QXQ.js";
|
|
32
34
|
import {
|
|
33
35
|
getCommandName
|
|
34
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-ECRBC4HL.js";
|
|
35
37
|
import {
|
|
36
38
|
output_manager_default
|
|
37
39
|
} from "./chunk-ZQKJVHXY.js";
|
|
@@ -4,10 +4,6 @@ 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
|
-
resolveTimeRange,
|
|
9
|
-
validateAllProjectMutualExclusivity
|
|
10
|
-
} from "./chunk-HTOH3MSD.js";
|
|
11
7
|
import {
|
|
12
8
|
fetchMetricDetailOrExit,
|
|
13
9
|
formatErrorJson,
|
|
@@ -15,37 +11,44 @@ import {
|
|
|
15
11
|
getDefaultAggregation,
|
|
16
12
|
getRollupColumnName,
|
|
17
13
|
handleApiError
|
|
18
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-GLDQ23LD.js";
|
|
15
|
+
import {
|
|
16
|
+
resolveTimeRange,
|
|
17
|
+
validateAllProjectMutualExclusivity
|
|
18
|
+
} from "./chunk-HTOH3MSD.js";
|
|
19
19
|
import {
|
|
20
20
|
indent_default
|
|
21
21
|
} from "./chunk-A3NYPUKZ.js";
|
|
22
22
|
import {
|
|
23
23
|
getScope
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-APGVHLAW.js";
|
|
25
25
|
import {
|
|
26
26
|
validateJsonOutput
|
|
27
27
|
} from "./chunk-XPKWKPWA.js";
|
|
28
28
|
import {
|
|
29
29
|
metricsCommand
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-4RBF6ZDU.js";
|
|
31
31
|
import {
|
|
32
32
|
table
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-GE6G37P4.js";
|
|
34
34
|
import {
|
|
35
35
|
getLinkedProject,
|
|
36
36
|
getProjectByNameOrId
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-4VP55L4V.js";
|
|
38
38
|
import "./chunk-U3WLEFHU.js";
|
|
39
|
+
import "./chunk-CGTXAXZ4.js";
|
|
39
40
|
import {
|
|
40
41
|
require_ms
|
|
41
42
|
} from "./chunk-CO5D46AG.js";
|
|
42
43
|
import {
|
|
43
|
-
ProjectNotFound,
|
|
44
44
|
getFlagsSpecification,
|
|
45
|
-
isAPIError,
|
|
46
45
|
parseArguments,
|
|
47
46
|
printError
|
|
48
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-RFMC2QXQ.js";
|
|
48
|
+
import {
|
|
49
|
+
ProjectNotFound,
|
|
50
|
+
isAPIError
|
|
51
|
+
} from "./chunk-ECRBC4HL.js";
|
|
49
52
|
import {
|
|
50
53
|
output_manager_default
|
|
51
54
|
} from "./chunk-ZQKJVHXY.js";
|
|
@@ -16,21 +16,23 @@ import {
|
|
|
16
16
|
resolveRoute,
|
|
17
17
|
shellQuoteRouteIdentifierForSuggestion,
|
|
18
18
|
withGlobalFlags
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-OFUQPP26.js";
|
|
20
20
|
import {
|
|
21
21
|
reorderSubcommand
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-CRZM5WM2.js";
|
|
23
23
|
import "./chunk-E3NE4SKN.js";
|
|
24
|
+
import "./chunk-4VP55L4V.js";
|
|
25
|
+
import "./chunk-U3WLEFHU.js";
|
|
24
26
|
import {
|
|
25
27
|
outputAgentError
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import "./chunk-U3WLEFHU.js";
|
|
28
|
+
} from "./chunk-CGTXAXZ4.js";
|
|
28
29
|
import {
|
|
29
30
|
stamp_default
|
|
30
31
|
} from "./chunk-CO5D46AG.js";
|
|
32
|
+
import "./chunk-RFMC2QXQ.js";
|
|
31
33
|
import {
|
|
32
34
|
getCommandName
|
|
33
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-ECRBC4HL.js";
|
|
34
36
|
import {
|
|
35
37
|
output_manager_default
|
|
36
38
|
} from "./chunk-ZQKJVHXY.js";
|
|
@@ -19,21 +19,23 @@ import {
|
|
|
19
19
|
printDiffSummary,
|
|
20
20
|
validateRequiredArgs,
|
|
21
21
|
withGlobalFlags
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-OFUQPP26.js";
|
|
23
23
|
import {
|
|
24
24
|
restoreSubcommand
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-CRZM5WM2.js";
|
|
26
26
|
import "./chunk-E3NE4SKN.js";
|
|
27
|
+
import "./chunk-4VP55L4V.js";
|
|
28
|
+
import "./chunk-U3WLEFHU.js";
|
|
27
29
|
import {
|
|
28
30
|
outputAgentError
|
|
29
|
-
} from "./chunk-
|
|
30
|
-
import "./chunk-U3WLEFHU.js";
|
|
31
|
+
} from "./chunk-CGTXAXZ4.js";
|
|
31
32
|
import {
|
|
32
33
|
stamp_default
|
|
33
34
|
} from "./chunk-CO5D46AG.js";
|
|
35
|
+
import "./chunk-RFMC2QXQ.js";
|
|
34
36
|
import {
|
|
35
37
|
getCommandName
|
|
36
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-ECRBC4HL.js";
|
|
37
39
|
import {
|
|
38
40
|
output_manager_default
|
|
39
41
|
} from "./chunk-ZQKJVHXY.js";
|
|
@@ -0,0 +1,164 @@
|
|
|
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
|
+
emitRulesArgParseError,
|
|
9
|
+
handleRulesApiError,
|
|
10
|
+
parseRulesFlagsAndScope,
|
|
11
|
+
rulesItemPath
|
|
12
|
+
} from "./chunk-4ZWTYJSP.js";
|
|
13
|
+
import "./chunk-NE34PEHL.js";
|
|
14
|
+
import "./chunk-HTOH3MSD.js";
|
|
15
|
+
import "./chunk-APGVHLAW.js";
|
|
16
|
+
import {
|
|
17
|
+
validateJsonOutput
|
|
18
|
+
} from "./chunk-XPKWKPWA.js";
|
|
19
|
+
import {
|
|
20
|
+
rulesRmSubcommand
|
|
21
|
+
} from "./chunk-DVQ4SIWF.js";
|
|
22
|
+
import {
|
|
23
|
+
AGENT_REASON
|
|
24
|
+
} from "./chunk-E3NE4SKN.js";
|
|
25
|
+
import "./chunk-4VP55L4V.js";
|
|
26
|
+
import "./chunk-U3WLEFHU.js";
|
|
27
|
+
import {
|
|
28
|
+
buildCommandWithGlobalFlags,
|
|
29
|
+
buildCommandWithYes,
|
|
30
|
+
outputAgentError
|
|
31
|
+
} from "./chunk-CGTXAXZ4.js";
|
|
32
|
+
import "./chunk-CO5D46AG.js";
|
|
33
|
+
import {
|
|
34
|
+
getFlagsSpecification,
|
|
35
|
+
parseArguments,
|
|
36
|
+
printError
|
|
37
|
+
} from "./chunk-RFMC2QXQ.js";
|
|
38
|
+
import {
|
|
39
|
+
isAPIError,
|
|
40
|
+
packageName
|
|
41
|
+
} from "./chunk-ECRBC4HL.js";
|
|
42
|
+
import {
|
|
43
|
+
output_manager_default
|
|
44
|
+
} from "./chunk-ZQKJVHXY.js";
|
|
45
|
+
import "./chunk-S7KYDPEM.js";
|
|
46
|
+
import "./chunk-TZ2YI2VH.js";
|
|
47
|
+
|
|
48
|
+
// src/commands/alerts/rules/rm.ts
|
|
49
|
+
async function rm(client, argv) {
|
|
50
|
+
let parsedArgs;
|
|
51
|
+
try {
|
|
52
|
+
parsedArgs = parseArguments(
|
|
53
|
+
argv,
|
|
54
|
+
getFlagsSpecification(rulesRmSubcommand.options)
|
|
55
|
+
);
|
|
56
|
+
} catch (e) {
|
|
57
|
+
emitRulesArgParseError(
|
|
58
|
+
client,
|
|
59
|
+
e,
|
|
60
|
+
"alerts rules rm <ruleId> --project <name-or-id> --yes"
|
|
61
|
+
);
|
|
62
|
+
printError(e);
|
|
63
|
+
return 1;
|
|
64
|
+
}
|
|
65
|
+
const ruleId = parsedArgs.args[0];
|
|
66
|
+
const fr = validateJsonOutput(parsedArgs.flags);
|
|
67
|
+
if (!fr.valid) {
|
|
68
|
+
outputAgentError(
|
|
69
|
+
client,
|
|
70
|
+
{
|
|
71
|
+
status: "error",
|
|
72
|
+
reason: AGENT_REASON.INVALID_ARGUMENTS,
|
|
73
|
+
message: fr.error
|
|
74
|
+
},
|
|
75
|
+
1
|
|
76
|
+
);
|
|
77
|
+
output_manager_default.error(fr.error);
|
|
78
|
+
return 1;
|
|
79
|
+
}
|
|
80
|
+
if (!ruleId) {
|
|
81
|
+
outputAgentError(
|
|
82
|
+
client,
|
|
83
|
+
{
|
|
84
|
+
status: "error",
|
|
85
|
+
reason: AGENT_REASON.MISSING_ARGUMENTS,
|
|
86
|
+
message: `Missing rule id. Example: ${packageName} alerts rules rm <ruleId> --yes`,
|
|
87
|
+
next: [
|
|
88
|
+
{
|
|
89
|
+
command: buildCommandWithGlobalFlags(
|
|
90
|
+
client.argv,
|
|
91
|
+
"alerts rules rm <ruleId> --yes"
|
|
92
|
+
),
|
|
93
|
+
when: "Replace <ruleId> with an id from `alerts rules ls`"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
command: buildCommandWithGlobalFlags(
|
|
97
|
+
client.argv,
|
|
98
|
+
"alerts rules ls"
|
|
99
|
+
),
|
|
100
|
+
when: "List rule ids in the current scope"
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
1
|
|
105
|
+
);
|
|
106
|
+
output_manager_default.error("Usage: `vercel alerts rules rm <ruleId>`");
|
|
107
|
+
return 1;
|
|
108
|
+
}
|
|
109
|
+
const skipConfirmation = Boolean(parsedArgs.flags["--yes"]);
|
|
110
|
+
const scope = await parseRulesFlagsAndScope(
|
|
111
|
+
client,
|
|
112
|
+
{
|
|
113
|
+
"--project": parsedArgs.flags["--project"],
|
|
114
|
+
"--all": parsedArgs.flags["--all"]
|
|
115
|
+
},
|
|
116
|
+
fr.jsonOutput
|
|
117
|
+
);
|
|
118
|
+
if (typeof scope === "number") {
|
|
119
|
+
return scope;
|
|
120
|
+
}
|
|
121
|
+
if (!skipConfirmation) {
|
|
122
|
+
outputAgentError(
|
|
123
|
+
client,
|
|
124
|
+
{
|
|
125
|
+
status: "error",
|
|
126
|
+
reason: AGENT_REASON.CONFIRMATION_REQUIRED,
|
|
127
|
+
message: "Removing an alert rule requires confirmation. Re-run with --yes.",
|
|
128
|
+
next: [{ command: buildCommandWithYes(client.argv) }]
|
|
129
|
+
},
|
|
130
|
+
1
|
|
131
|
+
);
|
|
132
|
+
if (!await client.input.confirm(
|
|
133
|
+
`Delete alert rule ${ruleId}? This cannot be undone.`,
|
|
134
|
+
false
|
|
135
|
+
)) {
|
|
136
|
+
output_manager_default.log("Canceled");
|
|
137
|
+
return 0;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
const path = rulesItemPath(scope, ruleId);
|
|
141
|
+
output_manager_default.spinner("Deleting alert rule...");
|
|
142
|
+
try {
|
|
143
|
+
await client.fetch(path, { method: "DELETE" });
|
|
144
|
+
if (fr.jsonOutput) {
|
|
145
|
+
client.stdout.write(
|
|
146
|
+
`${JSON.stringify({ ok: true, ruleId, deleted: true }, null, 2)}
|
|
147
|
+
`
|
|
148
|
+
);
|
|
149
|
+
} else {
|
|
150
|
+
output_manager_default.success(`Deleted alert rule ${ruleId}`);
|
|
151
|
+
}
|
|
152
|
+
return 0;
|
|
153
|
+
} catch (err) {
|
|
154
|
+
if (isAPIError(err)) {
|
|
155
|
+
return handleRulesApiError(client, err, fr.jsonOutput);
|
|
156
|
+
}
|
|
157
|
+
throw err;
|
|
158
|
+
} finally {
|
|
159
|
+
output_manager_default.stopSpinner();
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
export {
|
|
163
|
+
rm as default
|
|
164
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
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
|
+
emitRulesArgParseError,
|
|
9
|
+
handleRulesApiError,
|
|
10
|
+
parseRulesFlagsAndScope,
|
|
11
|
+
rulesItemPath
|
|
12
|
+
} from "./chunk-4ZWTYJSP.js";
|
|
13
|
+
import "./chunk-NE34PEHL.js";
|
|
14
|
+
import "./chunk-HTOH3MSD.js";
|
|
15
|
+
import "./chunk-APGVHLAW.js";
|
|
16
|
+
import {
|
|
17
|
+
validateJsonOutput
|
|
18
|
+
} from "./chunk-XPKWKPWA.js";
|
|
19
|
+
import {
|
|
20
|
+
rulesInspectSubcommand
|
|
21
|
+
} from "./chunk-DVQ4SIWF.js";
|
|
22
|
+
import {
|
|
23
|
+
AGENT_REASON
|
|
24
|
+
} from "./chunk-E3NE4SKN.js";
|
|
25
|
+
import "./chunk-4VP55L4V.js";
|
|
26
|
+
import "./chunk-U3WLEFHU.js";
|
|
27
|
+
import {
|
|
28
|
+
buildCommandWithGlobalFlags,
|
|
29
|
+
outputAgentError
|
|
30
|
+
} from "./chunk-CGTXAXZ4.js";
|
|
31
|
+
import "./chunk-CO5D46AG.js";
|
|
32
|
+
import {
|
|
33
|
+
getFlagsSpecification,
|
|
34
|
+
parseArguments,
|
|
35
|
+
printError
|
|
36
|
+
} from "./chunk-RFMC2QXQ.js";
|
|
37
|
+
import {
|
|
38
|
+
isAPIError,
|
|
39
|
+
packageName
|
|
40
|
+
} from "./chunk-ECRBC4HL.js";
|
|
41
|
+
import {
|
|
42
|
+
output_manager_default
|
|
43
|
+
} from "./chunk-ZQKJVHXY.js";
|
|
44
|
+
import "./chunk-S7KYDPEM.js";
|
|
45
|
+
import "./chunk-TZ2YI2VH.js";
|
|
46
|
+
|
|
47
|
+
// src/commands/alerts/rules/rule-inspect.ts
|
|
48
|
+
async function ruleInspect(client, argv) {
|
|
49
|
+
let parsedArgs;
|
|
50
|
+
try {
|
|
51
|
+
parsedArgs = parseArguments(
|
|
52
|
+
argv,
|
|
53
|
+
getFlagsSpecification(rulesInspectSubcommand.options)
|
|
54
|
+
);
|
|
55
|
+
} catch (e) {
|
|
56
|
+
emitRulesArgParseError(
|
|
57
|
+
client,
|
|
58
|
+
e,
|
|
59
|
+
"alerts rules inspect <ruleId> --project <name-or-id>"
|
|
60
|
+
);
|
|
61
|
+
printError(e);
|
|
62
|
+
return 1;
|
|
63
|
+
}
|
|
64
|
+
const ruleId = parsedArgs.args[0];
|
|
65
|
+
const fr = validateJsonOutput(parsedArgs.flags);
|
|
66
|
+
if (!fr.valid) {
|
|
67
|
+
outputAgentError(
|
|
68
|
+
client,
|
|
69
|
+
{
|
|
70
|
+
status: "error",
|
|
71
|
+
reason: AGENT_REASON.INVALID_ARGUMENTS,
|
|
72
|
+
message: fr.error
|
|
73
|
+
},
|
|
74
|
+
1
|
|
75
|
+
);
|
|
76
|
+
output_manager_default.error(fr.error);
|
|
77
|
+
return 1;
|
|
78
|
+
}
|
|
79
|
+
if (!ruleId) {
|
|
80
|
+
outputAgentError(
|
|
81
|
+
client,
|
|
82
|
+
{
|
|
83
|
+
status: "error",
|
|
84
|
+
reason: AGENT_REASON.MISSING_ARGUMENTS,
|
|
85
|
+
message: `Missing rule id. Example: ${packageName} alerts rules inspect <ruleId>`,
|
|
86
|
+
next: [
|
|
87
|
+
{
|
|
88
|
+
command: buildCommandWithGlobalFlags(
|
|
89
|
+
client.argv,
|
|
90
|
+
"alerts rules inspect <ruleId>"
|
|
91
|
+
),
|
|
92
|
+
when: "Replace <ruleId> with an id from `alerts rules ls`"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
command: buildCommandWithGlobalFlags(
|
|
96
|
+
client.argv,
|
|
97
|
+
"alerts rules ls"
|
|
98
|
+
),
|
|
99
|
+
when: "List rule ids in the current scope"
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
1
|
|
104
|
+
);
|
|
105
|
+
output_manager_default.error("Usage: `vercel alerts rules inspect <ruleId>`");
|
|
106
|
+
return 1;
|
|
107
|
+
}
|
|
108
|
+
const scope = await parseRulesFlagsAndScope(
|
|
109
|
+
client,
|
|
110
|
+
{
|
|
111
|
+
"--project": parsedArgs.flags["--project"],
|
|
112
|
+
"--all": parsedArgs.flags["--all"]
|
|
113
|
+
},
|
|
114
|
+
fr.jsonOutput
|
|
115
|
+
);
|
|
116
|
+
if (typeof scope === "number") {
|
|
117
|
+
return scope;
|
|
118
|
+
}
|
|
119
|
+
const path = rulesItemPath(scope, ruleId);
|
|
120
|
+
output_manager_default.spinner("Fetching alert rule...");
|
|
121
|
+
try {
|
|
122
|
+
const rule = await client.fetch(path);
|
|
123
|
+
if (fr.jsonOutput) {
|
|
124
|
+
client.stdout.write(`${JSON.stringify({ rule }, null, 2)}
|
|
125
|
+
`);
|
|
126
|
+
} else {
|
|
127
|
+
client.stdout.write(`${JSON.stringify(rule, null, 2)}
|
|
128
|
+
`);
|
|
129
|
+
}
|
|
130
|
+
return 0;
|
|
131
|
+
} catch (err) {
|
|
132
|
+
if (isAPIError(err)) {
|
|
133
|
+
return handleRulesApiError(client, err, fr.jsonOutput);
|
|
134
|
+
}
|
|
135
|
+
throw err;
|
|
136
|
+
} finally {
|
|
137
|
+
output_manager_default.stopSpinner();
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
export {
|
|
141
|
+
ruleInspect as default
|
|
142
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
getSubcommand
|
|
9
|
+
} from "./chunk-YPQSDAEW.js";
|
|
10
|
+
import {
|
|
11
|
+
AGENT_REASON
|
|
12
|
+
} from "./chunk-E3NE4SKN.js";
|
|
13
|
+
import {
|
|
14
|
+
buildCommandWithGlobalFlags,
|
|
15
|
+
outputAgentError
|
|
16
|
+
} from "./chunk-CGTXAXZ4.js";
|
|
17
|
+
import "./chunk-ECRBC4HL.js";
|
|
18
|
+
import {
|
|
19
|
+
output_manager_default
|
|
20
|
+
} from "./chunk-ZQKJVHXY.js";
|
|
21
|
+
import "./chunk-S7KYDPEM.js";
|
|
22
|
+
import "./chunk-TZ2YI2VH.js";
|
|
23
|
+
|
|
24
|
+
// src/commands/alerts/rules/index.ts
|
|
25
|
+
var RULES_CONFIG = {
|
|
26
|
+
ls: ["ls", "list"],
|
|
27
|
+
add: ["add", "create"],
|
|
28
|
+
inspect: ["inspect", "get"],
|
|
29
|
+
rm: ["rm", "remove", "delete"],
|
|
30
|
+
update: ["update", "patch"]
|
|
31
|
+
};
|
|
32
|
+
async function rules(client, argv) {
|
|
33
|
+
if (argv.length === 0) {
|
|
34
|
+
const lsFn = (await import("./ls-TYEDISJD.js")).default;
|
|
35
|
+
return lsFn(client, []);
|
|
36
|
+
}
|
|
37
|
+
const { subcommand, args, subcommandOriginal } = getSubcommand(
|
|
38
|
+
argv,
|
|
39
|
+
RULES_CONFIG
|
|
40
|
+
);
|
|
41
|
+
if (subcommand == null) {
|
|
42
|
+
outputAgentError(
|
|
43
|
+
client,
|
|
44
|
+
{
|
|
45
|
+
status: "error",
|
|
46
|
+
reason: AGENT_REASON.INVALID_ARGUMENTS,
|
|
47
|
+
message: `Unknown "alerts rules" subcommand "${argv[0]}".`,
|
|
48
|
+
next: [
|
|
49
|
+
{
|
|
50
|
+
command: buildCommandWithGlobalFlags(
|
|
51
|
+
client.argv,
|
|
52
|
+
"alerts rules --help"
|
|
53
|
+
),
|
|
54
|
+
when: "Show valid rules subcommands"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
1
|
|
59
|
+
);
|
|
60
|
+
output_manager_default.error(
|
|
61
|
+
`Unknown "alerts rules" subcommand "${argv[0]}". Run \`vercel alerts rules --help\`.`
|
|
62
|
+
);
|
|
63
|
+
return 1;
|
|
64
|
+
}
|
|
65
|
+
switch (subcommand) {
|
|
66
|
+
case "ls":
|
|
67
|
+
return (await import("./ls-TYEDISJD.js")).default(client, args);
|
|
68
|
+
case "add":
|
|
69
|
+
return (await import("./add-3MIOUOZC.js")).default(client, args);
|
|
70
|
+
case "inspect":
|
|
71
|
+
return (await import("./rule-inspect-THIN6POX.js")).default(client, args);
|
|
72
|
+
case "rm":
|
|
73
|
+
return (await import("./rm-LDXY2G45.js")).default(client, args);
|
|
74
|
+
case "update":
|
|
75
|
+
return (await import("./update-EXPUPEH6.js")).default(client, args);
|
|
76
|
+
default:
|
|
77
|
+
output_manager_default.error(`Unhandled rules subcommand: ${String(subcommandOriginal)}`);
|
|
78
|
+
return 1;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
export {
|
|
82
|
+
rules as default
|
|
83
|
+
};
|
|
@@ -8,33 +8,35 @@ import {
|
|
|
8
8
|
fetchMetricDetailOrExit,
|
|
9
9
|
fetchMetricListOrExit,
|
|
10
10
|
formatErrorJson
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-GLDQ23LD.js";
|
|
12
12
|
import {
|
|
13
13
|
indent_default
|
|
14
14
|
} from "./chunk-A3NYPUKZ.js";
|
|
15
15
|
import {
|
|
16
16
|
formatTable
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-G6RXZLQ2.js";
|
|
18
18
|
import {
|
|
19
19
|
getScope
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-APGVHLAW.js";
|
|
21
21
|
import {
|
|
22
22
|
validateJsonOutput
|
|
23
23
|
} from "./chunk-XPKWKPWA.js";
|
|
24
24
|
import {
|
|
25
25
|
schemaSubcommand
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import "./chunk-
|
|
26
|
+
} from "./chunk-4RBF6ZDU.js";
|
|
27
|
+
import "./chunk-GE6G37P4.js";
|
|
28
28
|
import {
|
|
29
29
|
require_pluralize
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-4VP55L4V.js";
|
|
31
31
|
import "./chunk-U3WLEFHU.js";
|
|
32
|
+
import "./chunk-CGTXAXZ4.js";
|
|
32
33
|
import "./chunk-CO5D46AG.js";
|
|
33
34
|
import {
|
|
34
35
|
getFlagsSpecification,
|
|
35
36
|
parseArguments,
|
|
36
37
|
printError
|
|
37
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-RFMC2QXQ.js";
|
|
39
|
+
import "./chunk-ECRBC4HL.js";
|
|
38
40
|
import {
|
|
39
41
|
output_manager_default
|
|
40
42
|
} from "./chunk-ZQKJVHXY.js";
|