vercel 59.11.2 → 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-BKSHWTPX.js → add-OO3JGLZW.js} +23 -18
- package/dist/chunks/{add-HPLJZFM2.js → add-RTXDASSS.js} +23 -18
- package/dist/chunks/add-XGO6LHMD.js +221 -0
- package/dist/chunks/{build-V4ZLAJWB.js → build-JINV2UD4.js} +23 -18
- package/dist/chunks/{chunk-NGGLYKNU.js → chunk-26CU4Q3C.js} +3 -115
- package/dist/chunks/{chunk-QFAS4OVW.js → chunk-2JIX6UMI.js} +3 -84
- package/dist/chunks/chunk-2NIDTSQJ.js +305 -0
- package/dist/chunks/chunk-32XSMM3W.js +49 -0
- package/dist/chunks/chunk-332LMJLZ.js +16014 -0
- package/dist/chunks/{chunk-RO44KX6Y.js → chunk-3BB2HOO2.js} +12 -7
- package/dist/chunks/{chunk-HDBQPBL6.js → chunk-3F25W3GA.js} +13 -9
- package/dist/chunks/{chunk-AYLY3ZVL.js → chunk-3VM7HWF6.js} +2 -2
- package/dist/chunks/chunk-4IALDGB7.js +22 -0
- package/dist/chunks/{chunk-MTWHQEXI.js → chunk-4TUMNBEE.js} +7 -5
- package/dist/chunks/{chunk-5XECIWME.js → chunk-5NF5HOBJ.js} +5 -3
- package/dist/chunks/chunk-6E6KPBXY.js +43 -0
- package/dist/chunks/{chunk-ASBP32T6.js → chunk-7MRDIPJY.js} +1 -1
- package/dist/chunks/chunk-ABSZNJQO.js +522 -0
- package/dist/chunks/{chunk-7ST552E3.js → chunk-AKLTIZCU.js} +1 -1
- package/dist/chunks/{chunk-ONRLTUP2.js → chunk-AV747POV.js} +43 -36
- package/dist/chunks/chunk-B5XLQKHI.js +849 -0
- package/dist/chunks/{chunk-BMKU5KEL.js → chunk-CV5YC2EN.js} +1 -1
- package/dist/chunks/{chunk-TPATD2MM.js → chunk-CZ5QQRXD.js} +14 -6
- package/dist/chunks/{chunk-2EAIC3SH.js → chunk-E47NARDE.js} +8 -8
- package/dist/chunks/{chunk-XM3LOQIX.js → chunk-EDMW7SBH.js} +76 -92
- package/dist/chunks/{chunk-QAT3CW4G.js → chunk-EFYMIIER.js} +2 -2
- package/dist/chunks/chunk-ELZ6WQQA.js +81 -0
- package/dist/chunks/{chunk-FKDO3CM4.js → chunk-EOLGLGXJ.js} +17 -13
- package/dist/chunks/chunk-FRVG4OW3.js +7438 -0
- package/dist/chunks/chunk-G5FBSUL4.js +822 -0
- package/dist/chunks/chunk-GDOUDU6O.js +74 -0
- package/dist/chunks/{chunk-OQ3C5VXZ.js → chunk-GVNCVKCI.js} +4 -2
- package/dist/chunks/chunk-HB4UKFDO.js +1295 -0
- package/dist/chunks/{chunk-FRAXI2WT.js → chunk-HD4DR3DA.js} +4 -3
- package/dist/chunks/{chunk-DWIC7MRV.js → chunk-HKHXKSXQ.js} +1 -1
- package/dist/chunks/{chunk-6JPVTPTU.js → chunk-HM24ZWQL.js} +4 -4
- package/dist/chunks/chunk-HR2MP4XF.js +324 -0
- package/dist/chunks/chunk-HRXRELD3.js +338 -0
- package/dist/chunks/{chunk-IJ4X426J.js → chunk-IIMSID24.js} +1 -1
- package/dist/chunks/{chunk-B4TXCKXE.js → chunk-JOXNBQ7W.js} +10 -8
- package/dist/chunks/{chunk-O75LSD3C.js → chunk-JSD4EZL3.js} +1 -1
- package/dist/chunks/{chunk-7AEEQOD4.js → chunk-K3RED3VO.js} +1 -1
- package/dist/chunks/chunk-KAF4WFF3.js +257 -0
- package/dist/chunks/{chunk-3T7WSWZH.js → chunk-KFWQ3EFH.js} +1 -1
- package/dist/chunks/{chunk-6CZZ3SH3.js → chunk-KNO327AW.js} +2 -2
- package/dist/chunks/{chunk-L3UXB2CW.js → chunk-KW7BS25T.js} +1 -1
- package/dist/chunks/{chunk-2NJJ2K5S.js → chunk-L6B6BRHH.js} +6 -6
- package/dist/chunks/{chunk-FZRBF25Y.js → chunk-LDV2R4P4.js} +4 -4
- package/dist/chunks/chunk-MADFAH3O.js +14059 -0
- package/dist/chunks/{chunk-OO3OF6MK.js → chunk-MDGPZHSM.js} +151 -26
- package/dist/chunks/{chunk-XRWOTCDO.js → chunk-ND5CF2H3.js} +1 -1
- package/dist/chunks/{chunk-6TBDHUXK.js → chunk-NDY3JDOU.js} +21 -15
- package/dist/chunks/{chunk-RKDCNQ4S.js → chunk-NW34PW6V.js} +3 -105
- package/dist/chunks/{chunk-C5HKWXRR.js → chunk-OAMU5QO6.js} +1 -1
- package/dist/chunks/{chunk-RSJBU3ON.js → chunk-OJHDGHOB.js} +35 -27
- package/dist/chunks/chunk-P7VSBDR4.js +827 -0
- package/dist/chunks/chunk-PEC3CQSK.js +90 -0
- package/dist/chunks/{chunk-KJBZ5ZST.js → chunk-PIMIVJYK.js} +1 -0
- package/dist/chunks/chunk-PNGVSHR3.js +40 -0
- package/dist/chunks/chunk-PP5GKSIX.js +137 -0
- package/dist/chunks/chunk-QB2UHSUB.js +58 -0
- package/dist/chunks/chunk-QIUK4Z7Q.js +79 -0
- package/dist/chunks/chunk-RN6V5ODW.js +114 -0
- package/dist/chunks/chunk-RNK3LXLR.js +1288 -0
- package/dist/chunks/chunk-RVBZ64EQ.js +52 -0
- package/dist/chunks/{chunk-WA2SJE5S.js → chunk-SWO66HE2.js} +4 -4
- package/dist/chunks/{chunk-NBW3BWOJ.js → chunk-TDGK45FB.js} +2 -2
- package/dist/chunks/{chunk-WNAKOXGK.js → chunk-TO7QZGYK.js} +1 -1
- package/dist/chunks/{chunk-QDV5LZ4Q.js → chunk-UA55I7M6.js} +12 -8
- package/dist/chunks/{chunk-FWKSJYDV.js → chunk-UG2WOB5L.js} +1 -1
- package/dist/chunks/chunk-UJPVHLL5.js +233 -0
- package/dist/chunks/chunk-V4RMJKQP.js +36 -0
- package/dist/chunks/chunk-VJSREJVM.js +875 -0
- package/dist/chunks/chunk-VUS2JQB2.js +121 -0
- package/dist/chunks/{chunk-4KVJ2M4J.js → chunk-WPBCUXMZ.js} +582 -37
- package/dist/chunks/chunk-WSZ5E4WH.js +92 -0
- package/dist/chunks/{chunk-Q5K5DEOK.js → chunk-WT2Y7FRD.js} +42 -28
- package/dist/chunks/chunk-WT6C2ALC.js +18188 -0
- package/dist/chunks/chunk-X6TGUHFD.js +59 -0
- package/dist/chunks/{chunk-ZSFEACZU.js → chunk-XFF5TGRA.js} +1 -1
- package/dist/chunks/chunk-XNIZGCN5.js +58 -0
- package/dist/chunks/chunk-XPJLPUKO.js +117 -0
- package/dist/chunks/{chunk-FXD67VN5.js → chunk-XUAWTW4W.js} +1 -1
- package/dist/chunks/chunk-YPMFZRTN.js +417 -0
- package/dist/chunks/chunk-YRESLJCW.js +1536 -0
- package/dist/chunks/{chunk-I526H4AS.js → chunk-YS76T533.js} +2 -2
- package/dist/chunks/{chunk-52QYYTM5.js → chunk-ZDU2NODC.js} +3 -127
- package/dist/chunks/chunk-ZW6HETRE.js +97 -0
- package/dist/chunks/{clear-IYGWCNXT.js → clear-GQTDYSKJ.js} +23 -18
- package/dist/chunks/{compile-vercel-config-NEEBZRUJ.js → compile-vercel-config-URVMKDVW.js} +8 -11
- package/dist/chunks/{config-6DS6BBR2.js → config-MSVQR5T6.js} +23 -18
- package/dist/chunks/{config-NTB5EMV4.js → config-OAXY4J6P.js} +23 -18
- package/dist/chunks/config-validator.mjs +1 -1
- package/dist/chunks/{delete-LSGID5FV.js → delete-57QO64HD.js} +19 -14
- package/dist/chunks/{delete-LLC2OGHA.js → delete-XN6ESD7C.js} +16 -12
- package/dist/chunks/detect-projects-ODNU4PK2.js +18 -0
- package/dist/chunks/detect-services-UPY4LTBZ.js +40 -0
- package/dist/chunks/{disable-H4EXEQK7.js → disable-BYI46V7B.js} +17 -13
- package/dist/chunks/{discard-FG6VKHWN.js → discard-IIQL44ZZ.js} +17 -13
- package/dist/chunks/{edit-BZJSGUHT.js → edit-BRNS3OR4.js} +19 -15
- package/dist/chunks/{edit-YE7D3CPJ.js → edit-JTW7XZH7.js} +17 -13
- package/dist/chunks/{enable-6ESD4QTE.js → enable-CH5FSQMR.js} +17 -13
- package/dist/chunks/{exec-XH4K34JM.js → exec-4IPHZ55G.js} +9 -5
- package/dist/chunks/{export-QWSJROLG.js → export-6WHQOWKM.js} +16 -13
- package/dist/chunks/{image-LTHQMKFG.js → image-ZSLYATWG.js} +11 -8
- package/dist/chunks/{import-builders-6O7ILGQJ.js → import-builders-FNMYJZGG.js} +18 -13
- package/dist/chunks/{inspect-2C4ZSNYC.js → inspect-4RDZSYWU.js} +27 -23
- package/dist/chunks/{inspect-N6SMHV3Z.js → inspect-7WQXZWET.js} +18 -14
- package/dist/chunks/{inspect-F7KCTHIL.js → inspect-CGXTNMMO.js} +19 -15
- package/dist/chunks/{inspect-ICKNCDMT.js → inspect-XJ7BYLZ5.js} +18 -14
- package/dist/chunks/{inspect-TWDPMXZ5.js → inspect-Z2MBTTB7.js} +18 -14
- package/dist/chunks/{list-NWTIJF3L.js → list-65LW6OTM.js} +20 -16
- package/dist/chunks/{list-DS7ZOUXA.js → list-7W3PHRB6.js} +25 -21
- package/dist/chunks/{list-IPGQVBJO.js → list-KS22Y57L.js} +16 -14
- package/dist/chunks/{login-F7A7ONKC.js → login-NXULVQZ2.js} +23 -18
- package/dist/chunks/{ls-2QW3ZSM6.js → ls-35EOVEIQ.js} +24 -18
- package/dist/chunks/{ls-XINES6PL.js → ls-5GKS5QRW.js} +24 -18
- package/dist/chunks/ls-ADYFYYIW.js +204 -0
- package/dist/chunks/{ls-D4TUDBIH.js → ls-DZYN3SNS.js} +24 -18
- package/dist/chunks/{ls-LSJEUPFX.js → ls-HVQOGBGV.js} +23 -16
- package/dist/chunks/{ls-NBDX3MKN.js → ls-I2PWG7YN.js} +24 -18
- package/dist/chunks/{open-VRQDWZAW.js → open-H34HXJHP.js} +18 -13
- package/dist/chunks/{permissions-6C5C7TEV.js → permissions-ZPPEPKVE.js} +14 -11
- package/dist/chunks/{publish-GVIZPNLN.js → publish-NRMKXHAU.js} +17 -13
- package/dist/chunks/pull-WUT3XTZX.js +45 -0
- package/dist/chunks/{push-EFZ5P5Z6.js → push-WFNCEA5J.js} +23 -18
- package/dist/chunks/{query-GBS2PIT4.js → query-2FQM3F7N.js} +23 -20
- package/dist/chunks/{reorder-TN65IFRL.js → reorder-GYCT7L3C.js} +17 -13
- package/dist/chunks/{reply-DYVEV3PY.js → reply-RFEXNYZ7.js} +17 -13
- package/dist/chunks/{resolve-JAWFBPUM.js → resolve-ZFGT7W6Z.js} +16 -12
- package/dist/chunks/resolve-deployment-framework-preset-NPE6RLV3.js +36 -0
- package/dist/chunks/{restore-TJVMHUBQ.js → restore-JAXPMYL5.js} +17 -13
- package/dist/chunks/rm-CLKQN5E4.js +162 -0
- package/dist/chunks/{rm-HQ5CYNJA.js → rm-JPV5V2SH.js} +23 -18
- package/dist/chunks/{rm-7XACNZ2U.js → rm-N7SGFQOA.js} +23 -18
- package/dist/chunks/{rm-REJVXALW.js → rm-UQJ4CZJH.js} +23 -18
- package/dist/chunks/{rm-CBPNMSRP.js → rm-ZUQ4U454.js} +24 -17
- package/dist/chunks/{routes-2OLIBRYX.js → routes-QVMBXOSX.js} +7 -3
- package/dist/chunks/rule-inspect-HI3YY7OY.js +123 -0
- package/dist/chunks/{rules-VGV4M4KY.js → rules-DA3Q64M4.js} +15 -12
- package/dist/chunks/{schema-GMTQOQCV.js → schema-R3C4CXJ6.js} +20 -18
- package/dist/chunks/schema-UYYFV3JB.js +381 -0
- package/dist/chunks/{set-Z5FO2FCC.js → set-TOJPGW4J.js} +21 -14
- package/dist/chunks/setup-and-link-DRYXQOH4.js +65 -0
- package/dist/chunks/{tags-SDRXWJ63.js → tags-TNLVFNVI.js} +10 -7
- package/dist/chunks/{types-JGANJ5EQ.js → types-4GAJ7XQQ.js} +9 -7
- package/dist/chunks/update-X6JB3NPI.js +224 -0
- package/dist/chunks/vlt-builder-importer-USCFHWPL.js +322 -0
- package/dist/commands/build/index.js +86 -49
- package/dist/commands/deploy/index.js +76 -67
- package/dist/commands/dev/index.js +98 -52
- package/dist/commands/env/index.js +68 -44
- package/dist/commands/link/index.js +49 -28
- package/dist/commands/list/index.js +33 -22
- package/dist/commands-bulk.js +8715 -3581
- package/dist/help.js +1 -1
- package/dist/index.js +74 -42
- 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-RBW7QITR.js +0 -219
- package/dist/chunks/chunk-26XDDLXM.js +0 -144
- package/dist/chunks/chunk-5GGUB4EO.js +0 -31
- package/dist/chunks/chunk-MXLA3VQS.js +0 -20
- package/dist/chunks/chunk-OTXE7MHI.js +0 -96
- package/dist/chunks/chunk-RSEAADCE.js +0 -138
- package/dist/chunks/chunk-WYU64FLP.js +0 -62123
- package/dist/chunks/chunk-XNFHNTS2.js +0 -2939
- package/dist/chunks/ls-RNGO257R.js +0 -193
- package/dist/chunks/rm-5B5VHWWN.js +0 -170
- package/dist/chunks/rule-inspect-ZSTDDFID.js +0 -281
- package/dist/chunks/schema-45SJNY5L.js +0 -427
- package/dist/chunks/update-JBQBC3IV.js +0 -233
|
@@ -1,427 +0,0 @@
|
|
|
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
|
-
CUSTOM_ALERT_EVENT_HELP
|
|
9
|
-
} from "./chunk-MXLA3VQS.js";
|
|
10
|
-
import {
|
|
11
|
-
indent_default
|
|
12
|
-
} from "./chunk-A3NYPUKZ.js";
|
|
13
|
-
import {
|
|
14
|
-
outputError
|
|
15
|
-
} from "./chunk-3T7WSWZH.js";
|
|
16
|
-
import {
|
|
17
|
-
formatTable
|
|
18
|
-
} from "./chunk-OQ3C5VXZ.js";
|
|
19
|
-
import {
|
|
20
|
-
validateJsonOutput
|
|
21
|
-
} from "./chunk-KXDWXXJH.js";
|
|
22
|
-
import {
|
|
23
|
-
rulesSchemaSubcommand
|
|
24
|
-
} from "./chunk-XM3LOQIX.js";
|
|
25
|
-
import "./chunk-GGP5R3FU.js";
|
|
26
|
-
import {
|
|
27
|
-
printError
|
|
28
|
-
} from "./chunk-AYLY3ZVL.js";
|
|
29
|
-
import {
|
|
30
|
-
parseArguments
|
|
31
|
-
} from "./chunk-57RHXXXG.js";
|
|
32
|
-
import "./chunk-RKDCNQ4S.js";
|
|
33
|
-
import "./chunk-BMKU5KEL.js";
|
|
34
|
-
import {
|
|
35
|
-
getFlagsSpecification
|
|
36
|
-
} from "./chunk-Q2DGFCO7.js";
|
|
37
|
-
import "./chunk-P4QNYOFB.js";
|
|
38
|
-
import {
|
|
39
|
-
output_manager_default
|
|
40
|
-
} from "./chunk-QFAS4OVW.js";
|
|
41
|
-
import "./chunk-S7KYDPEM.js";
|
|
42
|
-
import "./chunk-TZ2YI2VH.js";
|
|
43
|
-
|
|
44
|
-
// src/commands/alerts/rules/schema.ts
|
|
45
|
-
var RULE_TYPES = [
|
|
46
|
-
{
|
|
47
|
-
type: "usage_anomaly",
|
|
48
|
-
description: "Built-in usage anomaly alerts"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
type: "error_anomaly",
|
|
52
|
-
description: "Built-in error anomaly alerts"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
type: "custom_alert",
|
|
56
|
-
description: "Custom Observability metric alerts"
|
|
57
|
-
}
|
|
58
|
-
];
|
|
59
|
-
var BUILT_IN_COMMON_FIELDS = [
|
|
60
|
-
field("name", "yes", "string", "Rule name"),
|
|
61
|
-
field("alertTypes", "yes", "array", "One or more alert type configs"),
|
|
62
|
-
field(
|
|
63
|
-
"projectId",
|
|
64
|
-
"no",
|
|
65
|
-
"string",
|
|
66
|
-
"OData project filter; omit for team-wide"
|
|
67
|
-
),
|
|
68
|
-
field(
|
|
69
|
-
"autosubscribeOwnersInKnock",
|
|
70
|
-
"no",
|
|
71
|
-
"boolean",
|
|
72
|
-
"Subscribe project owners"
|
|
73
|
-
)
|
|
74
|
-
];
|
|
75
|
-
var CUSTOM_ALERT_COMMON_FIELDS = [
|
|
76
|
-
field("name", "yes", "string", "Rule name"),
|
|
77
|
-
field(
|
|
78
|
-
"projectId",
|
|
79
|
-
"no",
|
|
80
|
-
"string",
|
|
81
|
-
"Defaults to --project or the linked project"
|
|
82
|
-
),
|
|
83
|
-
field("alertTypes", "yes", "array", "One or more alert type configs"),
|
|
84
|
-
field("customAlert", "yes", "object", "Custom alert definition"),
|
|
85
|
-
field(
|
|
86
|
-
"autosubscribeOwnersInKnock",
|
|
87
|
-
"no",
|
|
88
|
-
"boolean",
|
|
89
|
-
"Subscribe project owners"
|
|
90
|
-
)
|
|
91
|
-
];
|
|
92
|
-
var USAGE_METRICS = [
|
|
93
|
-
"fluid_cpu_duration",
|
|
94
|
-
"fluid_duration",
|
|
95
|
-
"fast_data_transfer",
|
|
96
|
-
"edge_requests",
|
|
97
|
-
"function_invocations"
|
|
98
|
-
];
|
|
99
|
-
var customQueryJson = {
|
|
100
|
-
event: "incomingRequest",
|
|
101
|
-
rollups: {
|
|
102
|
-
requests: {
|
|
103
|
-
measure: "count",
|
|
104
|
-
aggregation: "sum"
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
groupBy: ["route"],
|
|
108
|
-
granularity: { minutes: 5 }
|
|
109
|
-
};
|
|
110
|
-
var ratioQueryJson = {
|
|
111
|
-
event: "incomingRequest",
|
|
112
|
-
rollups: {
|
|
113
|
-
numerator: {
|
|
114
|
-
measure: "count",
|
|
115
|
-
aggregation: "sum",
|
|
116
|
-
filter: "httpStatus ge 500"
|
|
117
|
-
},
|
|
118
|
-
denominator: {
|
|
119
|
-
measure: "count",
|
|
120
|
-
aggregation: "sum"
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
granularity: { hours: 1 }
|
|
124
|
-
};
|
|
125
|
-
var SCHEMAS = {
|
|
126
|
-
usage_anomaly: {
|
|
127
|
-
type: "usage_anomaly",
|
|
128
|
-
description: "Built-in usage anomaly alerts",
|
|
129
|
-
fields: [
|
|
130
|
-
...BUILT_IN_COMMON_FIELDS,
|
|
131
|
-
field("alertTypes[].type", "yes", "string", "usage_anomaly"),
|
|
132
|
-
field(
|
|
133
|
-
"alertTypes[].filter",
|
|
134
|
-
"no",
|
|
135
|
-
"string",
|
|
136
|
-
"OData filter for this type"
|
|
137
|
-
)
|
|
138
|
-
],
|
|
139
|
-
alertTypeFilterValues: [["metric", USAGE_METRICS.join(", ")]],
|
|
140
|
-
examples: [
|
|
141
|
-
{
|
|
142
|
-
name: "Minimal",
|
|
143
|
-
body: {
|
|
144
|
-
name: "Usage anomalies",
|
|
145
|
-
alertTypes: [{ type: "usage_anomaly" }]
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
name: "Filtered to one metric",
|
|
150
|
-
body: {
|
|
151
|
-
name: "Edge request anomalies",
|
|
152
|
-
projectId: "projectId eq 'prj_123'",
|
|
153
|
-
alertTypes: [
|
|
154
|
-
{ type: "usage_anomaly", filter: "metric eq 'edge_requests'" }
|
|
155
|
-
]
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
]
|
|
159
|
-
},
|
|
160
|
-
error_anomaly: {
|
|
161
|
-
type: "error_anomaly",
|
|
162
|
-
description: "Built-in error anomaly alerts",
|
|
163
|
-
fields: [
|
|
164
|
-
...BUILT_IN_COMMON_FIELDS,
|
|
165
|
-
field("alertTypes[].type", "yes", "string", "error_anomaly"),
|
|
166
|
-
field(
|
|
167
|
-
"alertTypes[].filter",
|
|
168
|
-
"no",
|
|
169
|
-
"string",
|
|
170
|
-
"OData filter for this type"
|
|
171
|
-
)
|
|
172
|
-
],
|
|
173
|
-
alertTypeFilterValues: [
|
|
174
|
-
["statusGroup", "4xx, 5xx"],
|
|
175
|
-
["route", `route eq '/api/checkout', contains(route, '/api')`]
|
|
176
|
-
],
|
|
177
|
-
examples: [
|
|
178
|
-
{
|
|
179
|
-
name: "Minimal",
|
|
180
|
-
body: {
|
|
181
|
-
name: "Error anomalies",
|
|
182
|
-
alertTypes: [{ type: "error_anomaly" }]
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
name: "Filtered to 5xx on one route",
|
|
187
|
-
body: {
|
|
188
|
-
name: "Checkout 5xx errors",
|
|
189
|
-
projectId: "projectId eq 'prj_123'",
|
|
190
|
-
alertTypes: [
|
|
191
|
-
{
|
|
192
|
-
type: "error_anomaly",
|
|
193
|
-
filter: "statusGroup eq '5xx' and route eq '/api/checkout'"
|
|
194
|
-
}
|
|
195
|
-
]
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
]
|
|
199
|
-
},
|
|
200
|
-
custom_alert: {
|
|
201
|
-
type: "custom_alert",
|
|
202
|
-
description: "Custom Observability metric alerts",
|
|
203
|
-
fields: [
|
|
204
|
-
...CUSTOM_ALERT_COMMON_FIELDS,
|
|
205
|
-
field("alertTypes[].type", "yes", "string", "custom_alert")
|
|
206
|
-
],
|
|
207
|
-
customAlertFields: [
|
|
208
|
-
field(
|
|
209
|
-
"customAlert.queryJsonString",
|
|
210
|
-
"yes",
|
|
211
|
-
"string",
|
|
212
|
-
"Escaped query JSON"
|
|
213
|
-
),
|
|
214
|
-
field("customAlert.triggerType", "yes", "string", "threshold, anomaly"),
|
|
215
|
-
field("customAlert.triggerOperator", "yes", "string", "gt, gte, lt, lte"),
|
|
216
|
-
field(
|
|
217
|
-
"customAlert.triggerThreshold",
|
|
218
|
-
"yes",
|
|
219
|
-
"number",
|
|
220
|
-
"Threshold value or z-score"
|
|
221
|
-
),
|
|
222
|
-
field(
|
|
223
|
-
"customAlert.minThreshold",
|
|
224
|
-
"no",
|
|
225
|
-
"number",
|
|
226
|
-
"Minimum observed value"
|
|
227
|
-
),
|
|
228
|
-
field(
|
|
229
|
-
"customAlert.formula",
|
|
230
|
-
"no",
|
|
231
|
-
"object",
|
|
232
|
-
"Ratio formula; left and right reference rollup keys"
|
|
233
|
-
)
|
|
234
|
-
],
|
|
235
|
-
queryJsonFields: [
|
|
236
|
-
field("scope", "no", "object", "Project scope"),
|
|
237
|
-
field(
|
|
238
|
-
"event",
|
|
239
|
-
"yes",
|
|
240
|
-
"string",
|
|
241
|
-
"Alert query event name, for example incomingRequest"
|
|
242
|
-
),
|
|
243
|
-
field("rollups", "yes", "object", "Named measure aggregations"),
|
|
244
|
-
field("rollups.*.measure", "yes", "string", "Metric measure"),
|
|
245
|
-
field("rollups.*.aggregation", "yes", "string", "Metric aggregation"),
|
|
246
|
-
field("rollups.*.filter", "no", "string", "Rollup-level OData filter"),
|
|
247
|
-
field("groupBy", "no", "array", "At most one dimension"),
|
|
248
|
-
field("filter", "no", "string", "Top-level OData filter"),
|
|
249
|
-
field("granularity", "no", "object", "5m, 1h, or 1d; defaults to 5m")
|
|
250
|
-
],
|
|
251
|
-
queryJsonBeforeEscaping: customQueryJson,
|
|
252
|
-
help: CUSTOM_ALERT_EVENT_HELP,
|
|
253
|
-
examples: [
|
|
254
|
-
{
|
|
255
|
-
name: "Anomaly",
|
|
256
|
-
body: {
|
|
257
|
-
name: "Request volume anomaly",
|
|
258
|
-
alertTypes: [{ type: "custom_alert" }],
|
|
259
|
-
customAlert: {
|
|
260
|
-
queryJsonString: JSON.stringify(customQueryJson),
|
|
261
|
-
triggerType: "anomaly",
|
|
262
|
-
triggerOperator: "gt",
|
|
263
|
-
triggerThreshold: 3
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
name: "Threshold ratio",
|
|
269
|
-
body: {
|
|
270
|
-
name: "Checkout error rate",
|
|
271
|
-
alertTypes: [{ type: "custom_alert" }],
|
|
272
|
-
customAlert: {
|
|
273
|
-
queryJsonString: JSON.stringify(ratioQueryJson),
|
|
274
|
-
triggerType: "threshold",
|
|
275
|
-
triggerOperator: "gt",
|
|
276
|
-
triggerThreshold: 0.05,
|
|
277
|
-
formula: {
|
|
278
|
-
operator: "divide",
|
|
279
|
-
left: "numerator",
|
|
280
|
-
right: "denominator"
|
|
281
|
-
},
|
|
282
|
-
minThreshold: 20
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
]
|
|
287
|
-
}
|
|
288
|
-
};
|
|
289
|
-
async function schema(client, argv) {
|
|
290
|
-
let parsedArgs;
|
|
291
|
-
try {
|
|
292
|
-
parsedArgs = parseArguments(
|
|
293
|
-
argv,
|
|
294
|
-
getFlagsSpecification(rulesSchemaSubcommand.options)
|
|
295
|
-
);
|
|
296
|
-
} catch (err) {
|
|
297
|
-
printError(err);
|
|
298
|
-
return 1;
|
|
299
|
-
}
|
|
300
|
-
const formatResult = validateJsonOutput(parsedArgs.flags);
|
|
301
|
-
if (!formatResult.valid) {
|
|
302
|
-
output_manager_default.error(formatResult.error);
|
|
303
|
-
return 1;
|
|
304
|
-
}
|
|
305
|
-
const jsonOutput = formatResult.jsonOutput;
|
|
306
|
-
const ruleType = normalizeRuleType(parsedArgs.flags["--type"]);
|
|
307
|
-
if (!ruleType) {
|
|
308
|
-
if (parsedArgs.flags["--type"]) {
|
|
309
|
-
return outputError(
|
|
310
|
-
client,
|
|
311
|
-
jsonOutput,
|
|
312
|
-
"INVALID_ARGUMENTS",
|
|
313
|
-
`Invalid alert rule type "${String(parsedArgs.flags["--type"])}". Use usage_anomaly, error_anomaly, or custom_alert.`
|
|
314
|
-
);
|
|
315
|
-
}
|
|
316
|
-
if (jsonOutput) {
|
|
317
|
-
client.stdout.write(
|
|
318
|
-
`${JSON.stringify({ types: RULE_TYPES }, null, 2)}
|
|
319
|
-
`
|
|
320
|
-
);
|
|
321
|
-
} else {
|
|
322
|
-
output_manager_default.log("Alert rule schema");
|
|
323
|
-
output_manager_default.print(
|
|
324
|
-
`
|
|
325
|
-
${formatRows(
|
|
326
|
-
["Type", "Description"],
|
|
327
|
-
RULE_TYPES.map((type) => [type.type, type.description])
|
|
328
|
-
)}
|
|
329
|
-
|
|
330
|
-
Run \`vercel alerts rules schema --type <type>\` to see a rule body schema.
|
|
331
|
-
`
|
|
332
|
-
);
|
|
333
|
-
}
|
|
334
|
-
return 0;
|
|
335
|
-
}
|
|
336
|
-
printRuleSchema(client, SCHEMAS[ruleType], jsonOutput);
|
|
337
|
-
return 0;
|
|
338
|
-
}
|
|
339
|
-
function field(field2, required, type, notes) {
|
|
340
|
-
return { field: field2, required, type, notes };
|
|
341
|
-
}
|
|
342
|
-
function normalizeRuleType(value) {
|
|
343
|
-
if (typeof value !== "string") {
|
|
344
|
-
return void 0;
|
|
345
|
-
}
|
|
346
|
-
const normalized = value.trim().toLowerCase().replace(/[-\s]+/g, "_");
|
|
347
|
-
return RULE_TYPES.some((type) => type.type === normalized) ? normalized : void 0;
|
|
348
|
-
}
|
|
349
|
-
function printRuleSchema(client, schema2, jsonOutput) {
|
|
350
|
-
if (jsonOutput) {
|
|
351
|
-
client.stdout.write(`${JSON.stringify({ schema: schema2 }, null, 2)}
|
|
352
|
-
`);
|
|
353
|
-
return;
|
|
354
|
-
}
|
|
355
|
-
output_manager_default.log(`Alert rule schema: ${schema2.type}`);
|
|
356
|
-
output_manager_default.print("\n");
|
|
357
|
-
printFieldSection("Fields", schema2.fields);
|
|
358
|
-
if (schema2.alertTypeFilterValues) {
|
|
359
|
-
output_manager_default.print("alertTypes[].filter values\n\n");
|
|
360
|
-
output_manager_default.print(
|
|
361
|
-
`${formatRows(
|
|
362
|
-
["Field", "Allowed values / examples"],
|
|
363
|
-
schema2.alertTypeFilterValues
|
|
364
|
-
)}
|
|
365
|
-
|
|
366
|
-
`
|
|
367
|
-
);
|
|
368
|
-
}
|
|
369
|
-
if (schema2.customAlertFields) {
|
|
370
|
-
printFieldSection("Custom alert fields", schema2.customAlertFields);
|
|
371
|
-
}
|
|
372
|
-
if (schema2.queryJsonFields) {
|
|
373
|
-
printFieldSection(
|
|
374
|
-
"customAlert.queryJsonString fields",
|
|
375
|
-
schema2.queryJsonFields
|
|
376
|
-
);
|
|
377
|
-
}
|
|
378
|
-
if (schema2.queryJsonBeforeEscaping) {
|
|
379
|
-
output_manager_default.print("customAlert.queryJsonString before escaping\n\n");
|
|
380
|
-
output_manager_default.print(
|
|
381
|
-
`${indent_default(JSON.stringify(schema2.queryJsonBeforeEscaping, null, 2), 2)}
|
|
382
|
-
|
|
383
|
-
`
|
|
384
|
-
);
|
|
385
|
-
}
|
|
386
|
-
if (schema2.help) {
|
|
387
|
-
output_manager_default.print("Custom alert metric discovery\n\n");
|
|
388
|
-
output_manager_default.print(`${indent_default(schema2.help.join("\n"), 2)}
|
|
389
|
-
|
|
390
|
-
`);
|
|
391
|
-
}
|
|
392
|
-
output_manager_default.print("Body examples\n\n");
|
|
393
|
-
for (const example of schema2.examples) {
|
|
394
|
-
output_manager_default.print(` ${example.name}
|
|
395
|
-
|
|
396
|
-
`);
|
|
397
|
-
output_manager_default.print(`${indent_default(JSON.stringify(example.body, null, 2), 4)}
|
|
398
|
-
|
|
399
|
-
`);
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
function printFieldSection(title, fields) {
|
|
403
|
-
output_manager_default.print(`${title}
|
|
404
|
-
|
|
405
|
-
`);
|
|
406
|
-
output_manager_default.print(
|
|
407
|
-
`${formatRows(
|
|
408
|
-
["Field", "Required", "Type", "Values / notes"],
|
|
409
|
-
fields.map((field2) => [
|
|
410
|
-
field2.field,
|
|
411
|
-
field2.required,
|
|
412
|
-
field2.type,
|
|
413
|
-
field2.notes
|
|
414
|
-
])
|
|
415
|
-
)}
|
|
416
|
-
|
|
417
|
-
`
|
|
418
|
-
);
|
|
419
|
-
}
|
|
420
|
-
function formatRows(headers, rows) {
|
|
421
|
-
const alignment = headers.map(() => "l");
|
|
422
|
-
const tableRows = rows.map((row) => [...row]);
|
|
423
|
-
return formatTable(headers, alignment, [{ rows: tableRows }]).trim();
|
|
424
|
-
}
|
|
425
|
-
export {
|
|
426
|
-
schema as default
|
|
427
|
-
};
|
|
@@ -1,233 +0,0 @@
|
|
|
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
|
-
parseCustomAlertQueryBody,
|
|
9
|
-
resolveCustomAlertProjectName,
|
|
10
|
-
setMissingCustomAlertProjectScope
|
|
11
|
-
} from "./chunk-OTXE7MHI.js";
|
|
12
|
-
import {
|
|
13
|
-
emitRulesArgParseError,
|
|
14
|
-
handleRulesApiError,
|
|
15
|
-
parseRulesFlagsAndScope,
|
|
16
|
-
rulesItemPath
|
|
17
|
-
} from "./chunk-RSEAADCE.js";
|
|
18
|
-
import "./chunk-RO44KX6Y.js";
|
|
19
|
-
import "./chunk-3T7WSWZH.js";
|
|
20
|
-
import "./chunk-Q5K5DEOK.js";
|
|
21
|
-
import "./chunk-AINIBIP4.js";
|
|
22
|
-
import {
|
|
23
|
-
validateJsonOutput
|
|
24
|
-
} from "./chunk-KXDWXXJH.js";
|
|
25
|
-
import {
|
|
26
|
-
rulesUpdateSubcommand
|
|
27
|
-
} from "./chunk-XM3LOQIX.js";
|
|
28
|
-
import "./chunk-WYU64FLP.js";
|
|
29
|
-
import "./chunk-FXD67VN5.js";
|
|
30
|
-
import "./chunk-XNFHNTS2.js";
|
|
31
|
-
import {
|
|
32
|
-
AGENT_REASON,
|
|
33
|
-
buildCommandWithGlobalFlags,
|
|
34
|
-
outputAgentError
|
|
35
|
-
} from "./chunk-NGGLYKNU.js";
|
|
36
|
-
import "./chunk-GGP5R3FU.js";
|
|
37
|
-
import {
|
|
38
|
-
printError
|
|
39
|
-
} from "./chunk-AYLY3ZVL.js";
|
|
40
|
-
import {
|
|
41
|
-
parseArguments
|
|
42
|
-
} from "./chunk-57RHXXXG.js";
|
|
43
|
-
import "./chunk-RKDCNQ4S.js";
|
|
44
|
-
import {
|
|
45
|
-
isAPIError
|
|
46
|
-
} from "./chunk-BMKU5KEL.js";
|
|
47
|
-
import {
|
|
48
|
-
getFlagsSpecification,
|
|
49
|
-
packageName
|
|
50
|
-
} from "./chunk-Q2DGFCO7.js";
|
|
51
|
-
import "./chunk-P4QNYOFB.js";
|
|
52
|
-
import "./chunk-52QYYTM5.js";
|
|
53
|
-
import {
|
|
54
|
-
output_manager_default
|
|
55
|
-
} from "./chunk-QFAS4OVW.js";
|
|
56
|
-
import "./chunk-S7KYDPEM.js";
|
|
57
|
-
import "./chunk-TZ2YI2VH.js";
|
|
58
|
-
|
|
59
|
-
// src/commands/alerts/rules/update.ts
|
|
60
|
-
import { readFileSync } from "fs";
|
|
61
|
-
import { resolve } from "path";
|
|
62
|
-
async function update(client, argv) {
|
|
63
|
-
let parsedArgs;
|
|
64
|
-
try {
|
|
65
|
-
parsedArgs = parseArguments(
|
|
66
|
-
argv,
|
|
67
|
-
getFlagsSpecification(rulesUpdateSubcommand.options)
|
|
68
|
-
);
|
|
69
|
-
} catch (e) {
|
|
70
|
-
emitRulesArgParseError(
|
|
71
|
-
client,
|
|
72
|
-
e,
|
|
73
|
-
"alerts rules update <ruleId> --project <name-or-id> --body <path>"
|
|
74
|
-
);
|
|
75
|
-
printError(e);
|
|
76
|
-
return 1;
|
|
77
|
-
}
|
|
78
|
-
const ruleId = parsedArgs.args[0];
|
|
79
|
-
const fr = validateJsonOutput(parsedArgs.flags);
|
|
80
|
-
if (!fr.valid) {
|
|
81
|
-
outputAgentError(
|
|
82
|
-
client,
|
|
83
|
-
{
|
|
84
|
-
status: "error",
|
|
85
|
-
reason: AGENT_REASON.INVALID_ARGUMENTS,
|
|
86
|
-
message: fr.error
|
|
87
|
-
},
|
|
88
|
-
1
|
|
89
|
-
);
|
|
90
|
-
output_manager_default.error(fr.error);
|
|
91
|
-
return 1;
|
|
92
|
-
}
|
|
93
|
-
if (!ruleId) {
|
|
94
|
-
outputAgentError(
|
|
95
|
-
client,
|
|
96
|
-
{
|
|
97
|
-
status: "error",
|
|
98
|
-
reason: AGENT_REASON.MISSING_ARGUMENTS,
|
|
99
|
-
message: `Missing rule id. Example: ${packageName} alerts rules update <ruleId> --body <file>`,
|
|
100
|
-
next: [
|
|
101
|
-
{
|
|
102
|
-
command: buildCommandWithGlobalFlags(
|
|
103
|
-
client.argv,
|
|
104
|
-
"alerts rules update <ruleId> --body <file>"
|
|
105
|
-
),
|
|
106
|
-
when: "Replace <ruleId> and <file> with id and JSON patch path"
|
|
107
|
-
}
|
|
108
|
-
]
|
|
109
|
-
},
|
|
110
|
-
1
|
|
111
|
-
);
|
|
112
|
-
output_manager_default.error("Usage: `vercel alerts rules update <ruleId> --body <PATH>`");
|
|
113
|
-
return 1;
|
|
114
|
-
}
|
|
115
|
-
const bodyPath = parsedArgs.flags["--body"];
|
|
116
|
-
if (!bodyPath) {
|
|
117
|
-
outputAgentError(
|
|
118
|
-
client,
|
|
119
|
-
{
|
|
120
|
-
status: "error",
|
|
121
|
-
reason: AGENT_REASON.MISSING_ARGUMENTS,
|
|
122
|
-
message: `Missing required flag --body. Example: ${packageName} alerts rules update ${ruleId} --body <file>`,
|
|
123
|
-
next: [
|
|
124
|
-
{
|
|
125
|
-
command: buildCommandWithGlobalFlags(
|
|
126
|
-
client.argv,
|
|
127
|
-
`alerts rules update ${ruleId} --body <file>`
|
|
128
|
-
),
|
|
129
|
-
when: "Replace <file> with a path to JSON patch payload"
|
|
130
|
-
}
|
|
131
|
-
]
|
|
132
|
-
},
|
|
133
|
-
1
|
|
134
|
-
);
|
|
135
|
-
output_manager_default.error("Missing required flag: --body <PATH> (JSON patch payload).");
|
|
136
|
-
return 1;
|
|
137
|
-
}
|
|
138
|
-
const scope = await parseRulesFlagsAndScope(
|
|
139
|
-
client,
|
|
140
|
-
{
|
|
141
|
-
"--project": parsedArgs.flags["--project"],
|
|
142
|
-
"--all": parsedArgs.flags["--all"]
|
|
143
|
-
},
|
|
144
|
-
fr.jsonOutput,
|
|
145
|
-
`alerts rules update ${ruleId}`
|
|
146
|
-
);
|
|
147
|
-
if (typeof scope === "number") {
|
|
148
|
-
return scope;
|
|
149
|
-
}
|
|
150
|
-
let raw;
|
|
151
|
-
try {
|
|
152
|
-
raw = readFileSync(resolve(client.cwd, bodyPath), "utf8");
|
|
153
|
-
} catch {
|
|
154
|
-
outputAgentError(
|
|
155
|
-
client,
|
|
156
|
-
{
|
|
157
|
-
status: "error",
|
|
158
|
-
reason: AGENT_REASON.INVALID_ARGUMENTS,
|
|
159
|
-
message: `Could not read --body file: ${bodyPath}`
|
|
160
|
-
},
|
|
161
|
-
1
|
|
162
|
-
);
|
|
163
|
-
output_manager_default.error(`Could not read --body file: ${bodyPath}`);
|
|
164
|
-
return 1;
|
|
165
|
-
}
|
|
166
|
-
let body;
|
|
167
|
-
try {
|
|
168
|
-
body = JSON.parse(raw);
|
|
169
|
-
} catch {
|
|
170
|
-
outputAgentError(
|
|
171
|
-
client,
|
|
172
|
-
{
|
|
173
|
-
status: "error",
|
|
174
|
-
reason: AGENT_REASON.INVALID_ARGUMENTS,
|
|
175
|
-
message: "Invalid JSON in --body file."
|
|
176
|
-
},
|
|
177
|
-
1
|
|
178
|
-
);
|
|
179
|
-
output_manager_default.error("Invalid JSON in --body file.");
|
|
180
|
-
return 1;
|
|
181
|
-
}
|
|
182
|
-
const parsedCustomAlertQuery = parseCustomAlertQueryBody(client, body);
|
|
183
|
-
if (typeof parsedCustomAlertQuery === "number") {
|
|
184
|
-
return parsedCustomAlertQuery;
|
|
185
|
-
}
|
|
186
|
-
delete body.id;
|
|
187
|
-
delete body.teamId;
|
|
188
|
-
const path = rulesItemPath(scope, ruleId);
|
|
189
|
-
output_manager_default.spinner("Updating alert rule...");
|
|
190
|
-
try {
|
|
191
|
-
if (parsedCustomAlertQuery && !Object.hasOwn(parsedCustomAlertQuery.query, "scope")) {
|
|
192
|
-
let projectId = typeof body.projectId === "string" ? body.projectId : void 0;
|
|
193
|
-
if (!projectId) {
|
|
194
|
-
const rule = await client.fetch(path);
|
|
195
|
-
projectId = rule.projectId;
|
|
196
|
-
}
|
|
197
|
-
if (projectId) {
|
|
198
|
-
const projectName = await resolveCustomAlertProjectName(
|
|
199
|
-
client,
|
|
200
|
-
scope,
|
|
201
|
-
projectId
|
|
202
|
-
);
|
|
203
|
-
setMissingCustomAlertProjectScope(
|
|
204
|
-
parsedCustomAlertQuery,
|
|
205
|
-
scope.teamId,
|
|
206
|
-
projectId,
|
|
207
|
-
projectName
|
|
208
|
-
);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
const updated = await client.fetch(path, {
|
|
212
|
-
method: "PATCH",
|
|
213
|
-
body
|
|
214
|
-
});
|
|
215
|
-
if (fr.jsonOutput) {
|
|
216
|
-
client.stdout.write(`${JSON.stringify({ rule: updated }, null, 2)}
|
|
217
|
-
`);
|
|
218
|
-
} else {
|
|
219
|
-
output_manager_default.success(`Updated alert rule ${ruleId}`);
|
|
220
|
-
}
|
|
221
|
-
return 0;
|
|
222
|
-
} catch (err) {
|
|
223
|
-
if (isAPIError(err)) {
|
|
224
|
-
return handleRulesApiError(client, err, fr.jsonOutput);
|
|
225
|
-
}
|
|
226
|
-
throw err;
|
|
227
|
-
} finally {
|
|
228
|
-
output_manager_default.stopSpinner();
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
export {
|
|
232
|
-
update as default
|
|
233
|
-
};
|