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.
- package/dist/chunks/{add-KSJQYR5C.js → add-OO3JGLZW.js} +3 -3
- package/dist/chunks/{add-WU2QYHYL.js → add-RTXDASSS.js} +3 -3
- package/dist/chunks/add-XGO6LHMD.js +221 -0
- package/dist/chunks/{build-F3J6FLPD.js → build-JINV2UD4.js} +3 -3
- package/dist/chunks/chunk-2NIDTSQJ.js +305 -0
- package/dist/chunks/{chunk-SHFNEZVI.js → chunk-32XSMM3W.js} +1 -1
- package/dist/chunks/{chunk-N4QHMXOO.js → chunk-3BB2HOO2.js} +3 -2
- package/dist/chunks/{chunk-DSTNNQVV.js → chunk-3F25W3GA.js} +3 -3
- package/dist/chunks/{chunk-OIH6FP5Y.js → chunk-4TUMNBEE.js} +2 -2
- package/dist/chunks/{chunk-4IVSM24H.js → chunk-ABSZNJQO.js} +1 -1
- package/dist/chunks/{chunk-CNDPIHY5.js → chunk-AV747POV.js} +24 -19
- package/dist/chunks/{chunk-QHS645AZ.js → chunk-CZ5QQRXD.js} +3 -3
- package/dist/chunks/{chunk-FL4JLNT2.js → chunk-E47NARDE.js} +2 -2
- package/dist/chunks/{chunk-XM3LOQIX.js → chunk-EDMW7SBH.js} +76 -92
- package/dist/chunks/{chunk-PJXMXMCO.js → chunk-ELZ6WQQA.js} +2 -2
- package/dist/chunks/{chunk-FVNJTRCE.js → chunk-EOLGLGXJ.js} +2 -2
- package/dist/chunks/chunk-GDOUDU6O.js +74 -0
- package/dist/chunks/{chunk-GCVXKRR5.js → chunk-HD4DR3DA.js} +1 -0
- package/dist/chunks/{chunk-DWIC7MRV.js → chunk-HKHXKSXQ.js} +1 -1
- package/dist/chunks/{chunk-ZBEECGFD.js → chunk-HM24ZWQL.js} +1 -1
- package/dist/chunks/chunk-HR2MP4XF.js +324 -0
- package/dist/chunks/{chunk-EZQDYIVB.js → chunk-JOXNBQ7W.js} +1 -1
- package/dist/chunks/{chunk-DBYHS3CK.js → chunk-KAF4WFF3.js} +2 -2
- package/dist/chunks/{chunk-VYC45Q4Z.js → chunk-KNO327AW.js} +1 -1
- package/dist/chunks/{chunk-XD4DCYMX.js → chunk-L6B6BRHH.js} +2 -2
- package/dist/chunks/{chunk-X7DBBZQD.js → chunk-LDV2R4P4.js} +1 -1
- package/dist/chunks/{chunk-2TSBB22D.js → chunk-MADFAH3O.js} +2 -2
- package/dist/chunks/{chunk-TGNEG57M.js → chunk-MDGPZHSM.js} +110 -14
- package/dist/chunks/{chunk-XIFATBH5.js → chunk-NDY3JDOU.js} +4 -4
- package/dist/chunks/{chunk-NSOYO6JQ.js → chunk-OJHDGHOB.js} +6 -6
- package/dist/chunks/{chunk-KJBZ5ZST.js → chunk-PIMIVJYK.js} +1 -0
- package/dist/chunks/{chunk-C762AAVU.js → chunk-PP5GKSIX.js} +4 -4
- package/dist/chunks/{chunk-Z7JWYFOY.js → chunk-QB2UHSUB.js} +1 -1
- package/dist/chunks/chunk-QIUK4Z7Q.js +79 -0
- package/dist/chunks/{chunk-GHKJAK5V.js → chunk-RNK3LXLR.js} +4 -4
- package/dist/chunks/{chunk-CEDN47PH.js → chunk-SWO66HE2.js} +1 -1
- package/dist/chunks/{chunk-EPOLDWRA.js → chunk-TDGK45FB.js} +1 -1
- package/dist/chunks/{chunk-PFM75KY3.js → chunk-UA55I7M6.js} +3 -3
- package/dist/chunks/{chunk-VT3Z7HF6.js → chunk-UJPVHLL5.js} +4 -4
- package/dist/chunks/{chunk-UARGTFCT.js → chunk-VJSREJVM.js} +1 -1
- package/dist/chunks/{chunk-WL6QYSGD.js → chunk-WPBCUXMZ.js} +506 -22
- package/dist/chunks/{chunk-A5JZS6ZN.js → chunk-WSZ5E4WH.js} +1 -1
- package/dist/chunks/{chunk-GUU4Z2AQ.js → chunk-WT2Y7FRD.js} +6 -6
- package/dist/chunks/{chunk-G3PXSXIB.js → chunk-WT6C2ALC.js} +3 -3
- package/dist/chunks/{chunk-7KROIXQM.js → chunk-X6TGUHFD.js} +3 -3
- package/dist/chunks/{chunk-QOPTXV4G.js → chunk-YPMFZRTN.js} +1 -1
- package/dist/chunks/{chunk-FVT74RZ5.js → chunk-YRESLJCW.js} +11 -11
- package/dist/chunks/{clear-XUQO4ZTK.js → clear-GQTDYSKJ.js} +3 -3
- package/dist/chunks/{compile-vercel-config-D3ARNHTN.js → compile-vercel-config-URVMKDVW.js} +2 -2
- package/dist/chunks/{config-37OAE7QJ.js → config-MSVQR5T6.js} +7 -7
- package/dist/chunks/{config-MEDLXUVM.js → config-OAXY4J6P.js} +3 -3
- package/dist/chunks/config-validator.mjs +1 -1
- package/dist/chunks/{delete-VSWDZ2SW.js → delete-57QO64HD.js} +5 -5
- package/dist/chunks/{delete-3N3YZZOF.js → delete-XN6ESD7C.js} +5 -5
- package/dist/chunks/{detect-services-TESZCQWG.js → detect-services-UPY4LTBZ.js} +6 -6
- package/dist/chunks/{disable-A4FLFMC7.js → disable-BYI46V7B.js} +5 -5
- package/dist/chunks/{discard-CHGFULBZ.js → discard-IIQL44ZZ.js} +5 -5
- package/dist/chunks/{edit-MHSYAPDR.js → edit-BRNS3OR4.js} +6 -6
- package/dist/chunks/{edit-JZ63AJYQ.js → edit-JTW7XZH7.js} +5 -5
- package/dist/chunks/{enable-KD46SEC5.js → enable-CH5FSQMR.js} +5 -5
- package/dist/chunks/{export-42QZLBSN.js → export-6WHQOWKM.js} +5 -5
- package/dist/chunks/{image-GP4H73A2.js → image-ZSLYATWG.js} +3 -3
- package/dist/chunks/{import-builders-6TBLMPL2.js → import-builders-FNMYJZGG.js} +4 -4
- package/dist/chunks/{inspect-5FMWMY3C.js → inspect-4RDZSYWU.js} +10 -10
- package/dist/chunks/{inspect-MUVK6MMT.js → inspect-7WQXZWET.js} +3 -3
- package/dist/chunks/{inspect-Q3DWW7MC.js → inspect-CGXTNMMO.js} +9 -9
- package/dist/chunks/{inspect-RNTSYM6O.js → inspect-XJ7BYLZ5.js} +3 -3
- package/dist/chunks/{inspect-QFXAOUL4.js → inspect-Z2MBTTB7.js} +3 -3
- package/dist/chunks/{list-IHHIPXEC.js → list-65LW6OTM.js} +6 -6
- package/dist/chunks/{list-XHD5DLEX.js → list-7W3PHRB6.js} +7 -7
- package/dist/chunks/{list-JRNWLSO5.js → list-KS22Y57L.js} +2 -2
- package/dist/chunks/{login-PCT6KFWY.js → login-NXULVQZ2.js} +3 -3
- package/dist/chunks/{ls-TGHCCARZ.js → ls-35EOVEIQ.js} +4 -4
- package/dist/chunks/{ls-PQZ2RIDX.js → ls-5GKS5QRW.js} +4 -4
- package/dist/chunks/ls-ADYFYYIW.js +204 -0
- package/dist/chunks/{ls-SVOHC3XW.js → ls-DZYN3SNS.js} +4 -4
- package/dist/chunks/{ls-VRIH5WA3.js → ls-HVQOGBGV.js} +7 -7
- package/dist/chunks/{ls-GPEHEFCF.js → ls-I2PWG7YN.js} +4 -4
- package/dist/chunks/{open-E7DEKYDU.js → open-H34HXJHP.js} +5 -5
- package/dist/chunks/{permissions-JKOONWVL.js → permissions-ZPPEPKVE.js} +4 -4
- package/dist/chunks/{publish-EDDELDE5.js → publish-NRMKXHAU.js} +5 -5
- package/dist/chunks/{pull-646WEVDE.js → pull-WUT3XTZX.js} +7 -7
- package/dist/chunks/{push-LTNW5OVD.js → push-WFNCEA5J.js} +3 -3
- package/dist/chunks/{query-LU4N6KPO.js → query-2FQM3F7N.js} +7 -7
- package/dist/chunks/{reorder-22PKJMZP.js → reorder-GYCT7L3C.js} +5 -5
- package/dist/chunks/{reply-SF2EZMVZ.js → reply-RFEXNYZ7.js} +5 -5
- package/dist/chunks/{resolve-ZCZGXTOT.js → resolve-ZFGT7W6Z.js} +5 -5
- package/dist/chunks/{restore-VJAWZXB4.js → restore-JAXPMYL5.js} +5 -5
- package/dist/chunks/rm-CLKQN5E4.js +162 -0
- package/dist/chunks/{rm-WNPGTUBH.js → rm-JPV5V2SH.js} +3 -3
- package/dist/chunks/{rm-KN2QFCKO.js → rm-N7SGFQOA.js} +3 -3
- package/dist/chunks/{rm-KVEAJPRE.js → rm-UQJ4CZJH.js} +3 -3
- package/dist/chunks/{rm-OSZ5FZUM.js → rm-ZUQ4U454.js} +7 -7
- package/dist/chunks/rule-inspect-HI3YY7OY.js +123 -0
- package/dist/chunks/{rules-65LKAQ35.js → rules-DA3Q64M4.js} +7 -7
- package/dist/chunks/{schema-NXCW4M75.js → schema-R3C4CXJ6.js} +6 -6
- package/dist/chunks/schema-UYYFV3JB.js +381 -0
- package/dist/chunks/{set-FYJVKMPV.js → set-TOJPGW4J.js} +7 -7
- package/dist/chunks/{setup-and-link-KXPZE32P.js → setup-and-link-DRYXQOH4.js} +16 -16
- package/dist/chunks/{tags-ANIRP5E3.js → tags-TNLVFNVI.js} +2 -2
- package/dist/chunks/update-X6JB3NPI.js +224 -0
- package/dist/chunks/vlt-builder-importer-USCFHWPL.js +322 -0
- package/dist/commands/build/index.js +19 -19
- package/dist/commands/deploy/index.js +19 -19
- package/dist/commands/dev/index.js +25 -25
- package/dist/commands/env/index.js +12 -12
- package/dist/commands/link/index.js +12 -12
- package/dist/commands/list/index.js +5 -5
- package/dist/commands-bulk.js +8273 -3511
- package/dist/help.js +1 -1
- package/dist/index.js +28 -18
- package/dist/runtime-assets/node-preloads/next-dev-websocket.cjs +6 -0
- package/dist/version.mjs +1 -1
- package/package.json +52 -48
- package/dist/chunks/add-PERLOALD.js +0 -233
- package/dist/chunks/chunk-5GGUB4EO.js +0 -31
- package/dist/chunks/chunk-ARU7VBKR.js +0 -144
- package/dist/chunks/chunk-KEKR7OCB.js +0 -140
- package/dist/chunks/chunk-MXLA3VQS.js +0 -20
- package/dist/chunks/chunk-QKX7WKIN.js +0 -98
- package/dist/chunks/ls-PF7F4PP4.js +0 -197
- package/dist/chunks/rm-W722Q2AO.js +0 -173
- package/dist/chunks/rule-inspect-25Z6SNX3.js +0 -285
- package/dist/chunks/schema-7D6IGJEJ.js +0 -429
- package/dist/chunks/update-UT6CTKVG.js +0 -246
|
@@ -7,14 +7,14 @@ const __dirname = __dirname_(__filename);
|
|
|
7
7
|
import {
|
|
8
8
|
getUpdateCommandInfo,
|
|
9
9
|
isGlobal
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SWO66HE2.js";
|
|
11
11
|
import {
|
|
12
12
|
progress,
|
|
13
13
|
require_ci_info
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-E47NARDE.js";
|
|
15
15
|
import {
|
|
16
16
|
writeToConfigFile
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-WT2Y7FRD.js";
|
|
18
18
|
import {
|
|
19
19
|
getGlobalPathConfig
|
|
20
20
|
} from "./chunk-AINIBIP4.js";
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
import {
|
|
25
25
|
apiCommand,
|
|
26
26
|
listSubcommand4 as listSubcommand
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-WPBCUXMZ.js";
|
|
28
28
|
import {
|
|
29
29
|
require_semver
|
|
30
30
|
} from "./chunk-IB5L4LKZ.js";
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
require_mkdirp,
|
|
34
34
|
require_pump,
|
|
35
35
|
require_tar_stream
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-WT6C2ALC.js";
|
|
37
37
|
import {
|
|
38
38
|
require_ms
|
|
39
39
|
} from "./chunk-GGP5R3FU.js";
|
|
@@ -3138,20 +3138,25 @@ async function fetchPrBuildSha(pr) {
|
|
|
3138
3138
|
const res = await fetch2(url);
|
|
3139
3139
|
if (res.status === 404) {
|
|
3140
3140
|
throw new Error(
|
|
3141
|
-
`
|
|
3141
|
+
`Couldn't find a binary for PR #${pr}. The current-sha pointer is not published yet.`
|
|
3142
3142
|
);
|
|
3143
3143
|
}
|
|
3144
3144
|
if (!res.ok) {
|
|
3145
3145
|
throw new Error(
|
|
3146
|
-
`Failed to fetch current build for PR #${pr} (HTTP ${res.status})
|
|
3146
|
+
`Failed to fetch the current build for PR #${pr} (HTTP ${res.status}).`
|
|
3147
3147
|
);
|
|
3148
3148
|
}
|
|
3149
3149
|
const sha = (await res.text()).trim().toLowerCase();
|
|
3150
3150
|
if (!/^[0-9a-f]{40}$/.test(sha)) {
|
|
3151
|
-
throw new Error(`Unexpected build SHA format for PR #${pr}
|
|
3151
|
+
throw new Error(`Unexpected build SHA format for PR #${pr}.`);
|
|
3152
3152
|
}
|
|
3153
3153
|
return sha;
|
|
3154
3154
|
}
|
|
3155
|
+
function missingPrPlatformMessage(pr, buildSha) {
|
|
3156
|
+
const platform = platformTarget();
|
|
3157
|
+
const shortSha = buildSha.slice(0, 12);
|
|
3158
|
+
return `Couldn't find a ${platform} binary for PR #${pr} (${shortSha}). This SHA exists, but this platform isn't ready yet.`;
|
|
3159
|
+
}
|
|
3155
3160
|
function getPrBinaryBaseUrl(pr, buildSha) {
|
|
3156
3161
|
return `${PR_BINARIES_URL}/${pr}/shas/${buildSha}`;
|
|
3157
3162
|
}
|
|
@@ -3159,19 +3164,17 @@ async function fetchPrChecksum(pr, buildSha) {
|
|
|
3159
3164
|
const url = `${getPrBinaryBaseUrl(pr, buildSha)}/vercel-${platformTarget()}.sha256`;
|
|
3160
3165
|
const res = await fetch2(url);
|
|
3161
3166
|
if (res.status === 404) {
|
|
3162
|
-
throw new Error(
|
|
3163
|
-
`No binary found for PR #${pr} on ${platformTarget()}. The PR may not have a build yet, or the build may still be running.`
|
|
3164
|
-
);
|
|
3167
|
+
throw new Error(missingPrPlatformMessage(pr, buildSha));
|
|
3165
3168
|
}
|
|
3166
3169
|
if (!res.ok) {
|
|
3167
3170
|
throw new Error(
|
|
3168
|
-
`Failed to fetch checksum for PR #${pr} (HTTP ${res.status})
|
|
3171
|
+
`Failed to fetch the checksum for PR #${pr} (HTTP ${res.status}).`
|
|
3169
3172
|
);
|
|
3170
3173
|
}
|
|
3171
3174
|
const text = (await res.text()).trim();
|
|
3172
3175
|
const sha = text.split(/\s+/)[0]?.toLowerCase();
|
|
3173
3176
|
if (!/^[0-9a-f]{64}$/.test(sha ?? "")) {
|
|
3174
|
-
throw new Error(`Unexpected checksum format for PR #${pr}
|
|
3177
|
+
throw new Error(`Unexpected checksum format for PR #${pr}.`);
|
|
3175
3178
|
}
|
|
3176
3179
|
return sha;
|
|
3177
3180
|
}
|
|
@@ -3182,9 +3185,7 @@ async function downloadPrBinary(pr, buildSha, expectedSha, destination) {
|
|
|
3182
3185
|
const url = `${getPrBinaryBaseUrl(pr, buildSha)}/vercel-${platformTarget()}`;
|
|
3183
3186
|
const res = await fetch2(url);
|
|
3184
3187
|
if (res.status === 404) {
|
|
3185
|
-
throw new Error(
|
|
3186
|
-
`No binary found for PR #${pr} on ${platformTarget()}. The PR may not have a build yet, or the build may still be running.`
|
|
3187
|
-
);
|
|
3188
|
+
throw new Error(missingPrPlatformMessage(pr, buildSha));
|
|
3188
3189
|
}
|
|
3189
3190
|
if (!res.ok) {
|
|
3190
3191
|
throw new Error(`Failed to download ${url} (HTTP ${res.status})`);
|
|
@@ -3222,11 +3223,15 @@ async function installAndLinkPrBinary(pr) {
|
|
|
3222
3223
|
const existing = await stat(binaryPath).catch(() => null);
|
|
3223
3224
|
const localSha = existing?.isFile() ? (await readFile4(shaPath, "utf8").catch(() => "")).trim().split(/\s+/)[0] : void 0;
|
|
3224
3225
|
if (existing?.isFile() && localSha === remoteSha) {
|
|
3226
|
+
await writeFile2(join2(versionDir, "build-sha"), `${buildSha}
|
|
3227
|
+
`);
|
|
3225
3228
|
await linkVersion(prVersionDirName(pr));
|
|
3226
3229
|
return { updated: false, buildSha };
|
|
3227
3230
|
}
|
|
3228
3231
|
output_manager_default.spinner(`Downloading Vercel CLI build for PR #${pr}\u2026`, 0);
|
|
3229
3232
|
await downloadPrBinary(pr, buildSha, remoteSha, versionDir);
|
|
3233
|
+
await writeFile2(join2(versionDir, "build-sha"), `${buildSha}
|
|
3234
|
+
`);
|
|
3230
3235
|
await linkVersion(prVersionDirName(pr));
|
|
3231
3236
|
return { updated: true, buildSha };
|
|
3232
3237
|
}
|
|
@@ -3286,9 +3291,9 @@ async function getPinnedVersion() {
|
|
|
3286
3291
|
return pinned === linked ? pinned : void 0;
|
|
3287
3292
|
}
|
|
3288
3293
|
async function getPrBuildSha(name) {
|
|
3289
|
-
const shaPath = join2(getInstallRoot(), "versions", name, "
|
|
3290
|
-
const sha = (await readFile4(shaPath, "utf8").catch(() => "")).trim().
|
|
3291
|
-
return /^[0-9a-f]{
|
|
3294
|
+
const shaPath = join2(getInstallRoot(), "versions", name, "build-sha");
|
|
3295
|
+
const sha = (await readFile4(shaPath, "utf8").catch(() => "")).trim().toLowerCase();
|
|
3296
|
+
return /^[0-9a-f]{40}$/.test(sha) ? sha : void 0;
|
|
3292
3297
|
}
|
|
3293
3298
|
function packageManagerRemovalCommand() {
|
|
3294
3299
|
const segments = process.execPath.split(sep);
|
|
@@ -6,16 +6,16 @@ const __filename = __fileURLToPath(import.meta.url);
|
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
7
|
import {
|
|
8
8
|
require_dist as require_dist4
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VJSREJVM.js";
|
|
10
10
|
import {
|
|
11
11
|
require_dist2 as require_dist3
|
|
12
12
|
} from "./chunk-332LMJLZ.js";
|
|
13
13
|
import {
|
|
14
14
|
require_dist as require_dist2
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-WT6C2ALC.js";
|
|
16
16
|
import {
|
|
17
17
|
require_lib
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-MADFAH3O.js";
|
|
19
19
|
import {
|
|
20
20
|
output_manager_default
|
|
21
21
|
} from "./chunk-2JIX6UMI.js";
|
|
@@ -6,10 +6,10 @@ const __filename = __fileURLToPath(import.meta.url);
|
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
7
|
import {
|
|
8
8
|
loginCommand
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WPBCUXMZ.js";
|
|
10
10
|
import {
|
|
11
11
|
login
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-KAF4WFF3.js";
|
|
13
13
|
import {
|
|
14
14
|
help
|
|
15
15
|
} from "./chunk-YS76T533.js";
|
|
@@ -13,68 +13,76 @@ import {
|
|
|
13
13
|
} from "./chunk-Q2DGFCO7.js";
|
|
14
14
|
|
|
15
15
|
// src/commands/alerts/rules/command.ts
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
scopeOptions[1]
|
|
16
|
+
var projectScopeOption = {
|
|
17
|
+
...projectOption,
|
|
18
|
+
shorthand: "p",
|
|
19
|
+
description: "Use a project by name or ID"
|
|
20
|
+
};
|
|
21
|
+
var listAllOption = {
|
|
22
|
+
name: "all",
|
|
23
|
+
shorthand: "a",
|
|
24
|
+
type: Boolean,
|
|
25
|
+
deprecated: false,
|
|
26
|
+
description: "List all accessible rules in the selected team"
|
|
27
|
+
};
|
|
28
|
+
var mutationAllOption = {
|
|
29
|
+
...listAllOption,
|
|
30
|
+
description: "Apply the rule to all projects in the selected team"
|
|
31
|
+
};
|
|
32
|
+
var deprecatedItemScopeOptions = [
|
|
33
|
+
{ ...projectScopeOption, deprecated: true },
|
|
34
|
+
{ ...listAllOption, deprecated: true }
|
|
36
35
|
];
|
|
36
|
+
var bodyOption = {
|
|
37
|
+
name: "body",
|
|
38
|
+
shorthand: null,
|
|
39
|
+
type: String,
|
|
40
|
+
argument: "PATH",
|
|
41
|
+
deprecated: false,
|
|
42
|
+
description: "Read the alert rule body from a JSON file"
|
|
43
|
+
};
|
|
37
44
|
var rulesLsSubcommand = {
|
|
38
45
|
name: "ls",
|
|
39
46
|
aliases: ["list"],
|
|
40
|
-
description: "List alert rules for
|
|
47
|
+
description: "List alert rules for a project or team",
|
|
41
48
|
arguments: [],
|
|
42
49
|
options: [
|
|
43
|
-
|
|
50
|
+
projectScopeOption,
|
|
51
|
+
listAllOption,
|
|
44
52
|
{
|
|
45
53
|
name: "type",
|
|
46
54
|
shorthand: null,
|
|
47
55
|
type: [String],
|
|
48
56
|
argument: "TYPE",
|
|
49
57
|
deprecated: false,
|
|
50
|
-
description: "Filter by
|
|
58
|
+
description: "Filter by rule type: built-in or custom"
|
|
51
59
|
},
|
|
52
60
|
formatOption,
|
|
53
61
|
jsonOption
|
|
54
62
|
],
|
|
55
63
|
examples: [
|
|
56
64
|
{
|
|
57
|
-
name: "List rules
|
|
65
|
+
name: "List rules affecting the linked project",
|
|
58
66
|
value: `${packageName} alerts rules ls`
|
|
59
67
|
},
|
|
60
68
|
{
|
|
61
|
-
name: "List
|
|
69
|
+
name: "List all rules in the selected team",
|
|
62
70
|
value: `${packageName} alerts rules ls --all`
|
|
63
71
|
},
|
|
64
72
|
{
|
|
65
|
-
name: "List custom
|
|
66
|
-
value: `${packageName} alerts rules ls --type
|
|
73
|
+
name: "List custom rules for a project",
|
|
74
|
+
value: `${packageName} alerts rules ls --project my-app --type custom`
|
|
67
75
|
},
|
|
68
76
|
{
|
|
69
|
-
name: "JSON output",
|
|
70
|
-
value: `${packageName} alerts rules ls --json`
|
|
77
|
+
name: "Write JSON output",
|
|
78
|
+
value: `${packageName} alerts rules ls --all --json`
|
|
71
79
|
}
|
|
72
80
|
]
|
|
73
81
|
};
|
|
74
82
|
var rulesSchemaSubcommand = {
|
|
75
83
|
name: "schema",
|
|
76
84
|
aliases: [],
|
|
77
|
-
description: "Show alert rule
|
|
85
|
+
description: "Show alert rule request fields and examples",
|
|
78
86
|
arguments: [],
|
|
79
87
|
options: [
|
|
80
88
|
{
|
|
@@ -83,7 +91,7 @@ var rulesSchemaSubcommand = {
|
|
|
83
91
|
type: String,
|
|
84
92
|
argument: "TYPE",
|
|
85
93
|
deprecated: false,
|
|
86
|
-
description: "
|
|
94
|
+
description: "Rule type to describe: built-in or custom"
|
|
87
95
|
},
|
|
88
96
|
formatOption
|
|
89
97
|
],
|
|
@@ -93,62 +101,51 @@ var rulesSchemaSubcommand = {
|
|
|
93
101
|
value: `${packageName} alerts rules schema`
|
|
94
102
|
},
|
|
95
103
|
{
|
|
96
|
-
name: "Show
|
|
97
|
-
value: `${packageName} alerts rules schema --type
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
name: "Show custom alert rule schema",
|
|
101
|
-
value: `${packageName} alerts rules schema --type custom_alert`
|
|
104
|
+
name: "Show the built-in rule schema",
|
|
105
|
+
value: `${packageName} alerts rules schema --type built-in`
|
|
102
106
|
},
|
|
103
107
|
{
|
|
104
|
-
name: "
|
|
105
|
-
value: `${packageName} alerts rules schema --type
|
|
108
|
+
name: "Show the custom rule schema as JSON",
|
|
109
|
+
value: `${packageName} alerts rules schema --type custom --format json`
|
|
106
110
|
}
|
|
107
111
|
]
|
|
108
112
|
};
|
|
109
113
|
var rulesAddSubcommand = {
|
|
110
114
|
name: "add",
|
|
111
115
|
aliases: ["create"],
|
|
112
|
-
description: "Create an alert rule from a JSON body
|
|
116
|
+
description: "Create an alert rule from a JSON body",
|
|
113
117
|
arguments: [],
|
|
114
118
|
options: [
|
|
115
|
-
|
|
119
|
+
projectScopeOption,
|
|
120
|
+
mutationAllOption,
|
|
116
121
|
formatOption,
|
|
117
122
|
jsonOption,
|
|
118
|
-
|
|
119
|
-
name: "body",
|
|
120
|
-
shorthand: null,
|
|
121
|
-
type: String,
|
|
122
|
-
argument: "PATH",
|
|
123
|
-
deprecated: false,
|
|
124
|
-
description: "Path to JSON for the new rule. Do not include id or teamId; the API assigns them."
|
|
125
|
-
}
|
|
123
|
+
bodyOption
|
|
126
124
|
],
|
|
127
125
|
examples: [
|
|
128
126
|
{
|
|
129
|
-
name: "Create
|
|
130
|
-
value: `${packageName} alerts rules add --body ./rule.json`
|
|
127
|
+
name: "Create a project-scoped rule",
|
|
128
|
+
value: `${packageName} alerts rules add --project my-app --body ./rule.json`
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: "Create a team-wide built-in rule",
|
|
132
|
+
value: `${packageName} alerts rules add --all --body ./rule.json`
|
|
131
133
|
}
|
|
132
134
|
]
|
|
133
135
|
};
|
|
134
136
|
var rulesInspectSubcommand = {
|
|
135
137
|
name: "inspect",
|
|
136
138
|
aliases: ["get"],
|
|
137
|
-
description: "Show one alert rule by
|
|
138
|
-
arguments: [
|
|
139
|
-
|
|
140
|
-
name: "ruleId",
|
|
141
|
-
required: true
|
|
142
|
-
}
|
|
143
|
-
],
|
|
144
|
-
options: [...scopeOptions, formatOption, jsonOption],
|
|
139
|
+
description: "Show one alert rule by ID",
|
|
140
|
+
arguments: [{ name: "ruleId", required: true }],
|
|
141
|
+
options: [...deprecatedItemScopeOptions, formatOption, jsonOption],
|
|
145
142
|
examples: [
|
|
146
143
|
{
|
|
147
144
|
name: "Inspect a rule",
|
|
148
145
|
value: `${packageName} alerts rules inspect ar_abc123`
|
|
149
146
|
},
|
|
150
147
|
{
|
|
151
|
-
name: "JSON output",
|
|
148
|
+
name: "Write JSON output",
|
|
152
149
|
value: `${packageName} alerts rules inspect ar_abc123 --json`
|
|
153
150
|
}
|
|
154
151
|
]
|
|
@@ -157,20 +154,15 @@ var rulesRmSubcommand = {
|
|
|
157
154
|
name: "rm",
|
|
158
155
|
aliases: ["remove", "delete"],
|
|
159
156
|
description: "Delete an alert rule",
|
|
160
|
-
arguments: [
|
|
161
|
-
|
|
162
|
-
name: "ruleId",
|
|
163
|
-
required: true
|
|
164
|
-
}
|
|
165
|
-
],
|
|
166
|
-
options: [...scopeOptions, formatOption, jsonOption, yesOption],
|
|
157
|
+
arguments: [{ name: "ruleId", required: true }],
|
|
158
|
+
options: [...deprecatedItemScopeOptions, formatOption, jsonOption, yesOption],
|
|
167
159
|
examples: [
|
|
168
160
|
{
|
|
169
161
|
name: "Delete with confirmation",
|
|
170
162
|
value: `${packageName} alerts rules rm ar_abc123`
|
|
171
163
|
},
|
|
172
164
|
{
|
|
173
|
-
name: "Delete without prompt",
|
|
165
|
+
name: "Delete without a prompt",
|
|
174
166
|
value: `${packageName} alerts rules rm ar_abc123 --yes`
|
|
175
167
|
}
|
|
176
168
|
]
|
|
@@ -178,37 +170,33 @@ var rulesRmSubcommand = {
|
|
|
178
170
|
var rulesUpdateSubcommand = {
|
|
179
171
|
name: "update",
|
|
180
172
|
aliases: ["patch"],
|
|
181
|
-
description: "Patch an alert rule
|
|
182
|
-
arguments: [
|
|
183
|
-
{
|
|
184
|
-
name: "ruleId",
|
|
185
|
-
required: true
|
|
186
|
-
}
|
|
187
|
-
],
|
|
173
|
+
description: "Patch an alert rule or change its scope",
|
|
174
|
+
arguments: [{ name: "ruleId", required: true }],
|
|
188
175
|
options: [
|
|
189
|
-
|
|
176
|
+
projectScopeOption,
|
|
177
|
+
mutationAllOption,
|
|
190
178
|
formatOption,
|
|
191
179
|
jsonOption,
|
|
192
180
|
{
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
type: String,
|
|
196
|
-
argument: "PATH",
|
|
197
|
-
deprecated: false,
|
|
198
|
-
description: "Path to partial JSON. Omitted fields remain unchanged; null clears supported optional fields."
|
|
181
|
+
...bodyOption,
|
|
182
|
+
description: "Read the partial update body from a JSON file"
|
|
199
183
|
}
|
|
200
184
|
],
|
|
201
185
|
examples: [
|
|
202
186
|
{
|
|
203
|
-
name: "Update from file",
|
|
187
|
+
name: "Update fields from a file",
|
|
204
188
|
value: `${packageName} alerts rules update ar_abc123 --body ./patch.json`
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: "Move a rule to a project",
|
|
192
|
+
value: `${packageName} alerts rules update ar_abc123 --project my-app`
|
|
205
193
|
}
|
|
206
194
|
]
|
|
207
195
|
};
|
|
208
196
|
var rulesAggregateCommand = {
|
|
209
197
|
name: "rules",
|
|
210
198
|
aliases: [],
|
|
211
|
-
description: "Create, list, update,
|
|
199
|
+
description: "Create, inspect, list, update, and delete alert rules",
|
|
212
200
|
arguments: [],
|
|
213
201
|
subcommands: [
|
|
214
202
|
rulesLsSubcommand,
|
|
@@ -221,20 +209,16 @@ var rulesAggregateCommand = {
|
|
|
221
209
|
options: [],
|
|
222
210
|
examples: [
|
|
223
211
|
{
|
|
224
|
-
name: "List rules",
|
|
212
|
+
name: "List rules for the linked project",
|
|
225
213
|
value: `${packageName} alerts rules ls`
|
|
226
214
|
},
|
|
227
215
|
{
|
|
228
|
-
name: "
|
|
229
|
-
value: `${packageName} alerts rules
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
name: "Show schema for a rule type",
|
|
233
|
-
value: `${packageName} alerts rules schema --type custom_alert`
|
|
216
|
+
name: "Show the custom rule schema",
|
|
217
|
+
value: `${packageName} alerts rules schema --type custom`
|
|
234
218
|
},
|
|
235
219
|
{
|
|
236
220
|
name: "Add a rule",
|
|
237
|
-
value: `${packageName} alerts rules add --body ./rule.json`
|
|
221
|
+
value: `${packageName} alerts rules add --project my-app --body ./rule.json`
|
|
238
222
|
},
|
|
239
223
|
{
|
|
240
224
|
name: "Inspect a rule",
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
} from "./chunk-VUS2JQB2.js";
|
|
11
11
|
import {
|
|
12
12
|
getScope
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ABSZNJQO.js";
|
|
14
14
|
import {
|
|
15
15
|
getOrgById
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-MADFAH3O.js";
|
|
17
17
|
import {
|
|
18
18
|
buildCommandWithGlobalFlags,
|
|
19
19
|
outputAgentError,
|
|
@@ -24,11 +24,11 @@ import {
|
|
|
24
24
|
} from "./chunk-VUS2JQB2.js";
|
|
25
25
|
import {
|
|
26
26
|
getScope
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-ABSZNJQO.js";
|
|
28
28
|
import {
|
|
29
29
|
getLinkedProject,
|
|
30
30
|
getProjectByNameOrId
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-MADFAH3O.js";
|
|
32
32
|
import {
|
|
33
33
|
buildCommandWithGlobalFlags,
|
|
34
34
|
outputAgentError
|
|
@@ -0,0 +1,74 @@
|
|
|
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
|
+
indent_default
|
|
9
|
+
} from "./chunk-A3NYPUKZ.js";
|
|
10
|
+
import {
|
|
11
|
+
humanizeIdentifier
|
|
12
|
+
} from "./chunk-FGDKMNEN.js";
|
|
13
|
+
import {
|
|
14
|
+
table
|
|
15
|
+
} from "./chunk-NW34PW6V.js";
|
|
16
|
+
|
|
17
|
+
// src/commands/alerts/format.ts
|
|
18
|
+
function renderAlertTable(rows, hsep = 3) {
|
|
19
|
+
return indent_default(
|
|
20
|
+
table(rows, { hsep }).split("\n").map((line) => line.trimEnd()).join("\n"),
|
|
21
|
+
2
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
function normalizeTimestamp(value) {
|
|
25
|
+
if (value === void 0 || !Number.isFinite(value)) {
|
|
26
|
+
return void 0;
|
|
27
|
+
}
|
|
28
|
+
return Math.abs(value) < 1e12 ? value * 1e3 : value;
|
|
29
|
+
}
|
|
30
|
+
function getPrimaryAlert(group) {
|
|
31
|
+
return group.alerts?.[0];
|
|
32
|
+
}
|
|
33
|
+
function getGroupTitle(group) {
|
|
34
|
+
return group.ai?.title || group.title || getPrimaryAlert(group)?.title || "Alert group";
|
|
35
|
+
}
|
|
36
|
+
function getGroupType(group) {
|
|
37
|
+
return group.type || getPrimaryAlert(group)?.type || "-";
|
|
38
|
+
}
|
|
39
|
+
function getGroupStartedAt(group) {
|
|
40
|
+
const primaryAlert = getPrimaryAlert(group);
|
|
41
|
+
return normalizeTimestamp(
|
|
42
|
+
group.recordedStartedAt ?? primaryAlert?.recordedStartedAt ?? primaryAlert?.startedAt
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
function formatTriggerOperator(value) {
|
|
46
|
+
switch (value) {
|
|
47
|
+
case "gt":
|
|
48
|
+
return ">";
|
|
49
|
+
case "gte":
|
|
50
|
+
return ">=";
|
|
51
|
+
case "lt":
|
|
52
|
+
return "<";
|
|
53
|
+
case "lte":
|
|
54
|
+
return "<=";
|
|
55
|
+
default:
|
|
56
|
+
return void 0;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function humanizeReference(value, opts = {}) {
|
|
60
|
+
return value.split("/").map((part) => {
|
|
61
|
+
const label = humanizeIdentifier(part);
|
|
62
|
+
return opts.case === "title" ? label : label.toLowerCase();
|
|
63
|
+
}).join(" / ");
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export {
|
|
67
|
+
renderAlertTable,
|
|
68
|
+
normalizeTimestamp,
|
|
69
|
+
getGroupTitle,
|
|
70
|
+
getGroupType,
|
|
71
|
+
getGroupStartedAt,
|
|
72
|
+
formatTriggerOperator,
|
|
73
|
+
humanizeReference
|
|
74
|
+
};
|
|
@@ -57,7 +57,7 @@ async function fetchMetricCatalog(client, accountId, kind, search, activeSince)
|
|
|
57
57
|
}
|
|
58
58
|
const response = await client.fetch(
|
|
59
59
|
`${OBSERVABILITY_METRICS_PATH}?${searchParams}`,
|
|
60
|
-
{ accountId }
|
|
60
|
+
{ accountId, bailOn429: true }
|
|
61
61
|
);
|
|
62
62
|
metrics.push(
|
|
63
63
|
...response.metrics.map((metric) => ({
|