@chainpatrol/cli 0.12.0 → 0.14.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/CHANGELOG.md +56 -0
- package/dist/{breakdown-KCTKQNDY.js → breakdown-K5Q6TDKE.js} +21 -6
- package/dist/{check-P5JJJNEX.js → check-NJH7BUIM.js} +1 -1
- package/dist/{chunk-W42ITB5J.js → chunk-6X5BFFXA.js} +77 -5
- package/dist/{chunk-DJVB73FL.js → chunk-BIKTBRER.js} +1 -1
- package/dist/chunk-S37VFIZY.js +66 -0
- package/dist/{chunk-OSRFCVBT.js → chunk-YZEMTNCX.js} +26 -2
- package/dist/cli.js +53 -43
- package/dist/{configs-update-3ZVXGADV.js → configs-update-ON67NMXA.js} +1 -1
- package/dist/{create-DFH2G7RH.js → create-W5S2ZPVC.js} +1 -1
- package/dist/{drift-T74V2C3J.js → drift-ZOLDE24A.js} +1 -1
- package/dist/found-M5MX4VXK.js +59 -0
- package/dist/{healthcheck-HZYEIIOR.js → healthcheck-PFYP6PNW.js} +1 -1
- package/dist/{list-PBAXQSL5.js → list-5TMGSHFC.js} +1 -1
- package/dist/{list-QUFY4IP7.js → list-AHWEE3YZ.js} +1 -1
- package/dist/{list-IYJBKE2F.js → list-B5KLEFHA.js} +1 -1
- package/dist/{list-ZFPML3ZR.js → list-FV5IYCG4.js} +1 -1
- package/dist/{list-23QQYAV5.js → list-GKC7PEU5.js} +1 -1
- package/dist/{list-YCT6DYDI.js → list-HGYBEYOV.js} +1 -1
- package/dist/{list-YRJPN4PI.js → list-ISP5JL4M.js} +1 -1
- package/dist/{list-WX5G3IOF.js → list-LNNIEVB4.js} +2 -2
- package/dist/{list-WJQT2XLE.js → list-TUMVDWIZ.js} +1 -1
- package/dist/{list-I7SBGA52.js → list-VP5IY2SZ.js} +1 -1
- package/dist/{list-EIVPGMWJ.js → list-Z7RJWZH5.js} +1 -1
- package/dist/{list-json-T2Z7NV7G.js → list-json-QC6X25LI.js} +1 -1
- package/dist/organization-VSQQAGBS.js +105 -0
- package/dist/{run-CJGN6TX4.js → run-HRFJORDS.js} +1 -1
- package/dist/{run-BHEXWBAS.js → run-KDNQIR5E.js} +2 -2
- package/dist/{run-MSO6IXEV.js → run-VHFXOCGS.js} +1 -1
- package/dist/{search-WPSKQGUS.js → search-NOSQW75S.js} +1 -1
- package/dist/{setup-skill-FA4STSGA.js → setup-skill-Q6PCFIDE.js} +1 -1
- package/dist/{snapshot-ZWAHEG64.js → snapshot-55UV26NQ.js} +1 -1
- package/dist/{summary-Y2LG6UJM.js → summary-QUCLZYX6.js} +19 -6
- package/dist/{validate-SM5DD7I2.js → validate-TPG47SYS.js} +1 -1
- package/dist/{whoami-DH5HVLFN.js → whoami-Y3ZJGN4O.js} +1 -1
- package/package.json +1 -1
- package/dist/found-EVXJZGYX.js +0 -95
- package/dist/organization-IIIOSTHF.js +0 -75
package/dist/cli.js
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
getCliVersion,
|
|
14
14
|
isSkillInstalled,
|
|
15
15
|
readInstalledSkillVersion
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-6X5BFFXA.js";
|
|
17
17
|
import "./chunk-NQT77IB7.js";
|
|
18
18
|
import {
|
|
19
19
|
DateTime
|
|
@@ -263,49 +263,54 @@ var HELP = {
|
|
|
263
263
|
]
|
|
264
264
|
},
|
|
265
265
|
"metrics organization": {
|
|
266
|
-
description: "Get organization metrics via the documented GET /organization/metrics endpoint. Works with both API key auth (org derived from key) and session auth (pass --org).",
|
|
267
|
-
usage: "chainpatrol metrics organization [--org <slug>] [--from ISO --to ISO]",
|
|
266
|
+
description: "Get organization metrics via the documented GET /organization/metrics endpoint. Works with both API key auth (org derived from key) and session auth (pass --org). Defaults to the trailing 3 months if no date range is given. Use --include to skip aggregates the caller doesn't need \u2014 fields not included come back as null.",
|
|
267
|
+
usage: "chainpatrol metrics organization [--org <slug>] [--from ISO --to ISO|--this-week] [--include <list>]",
|
|
268
268
|
options: [
|
|
269
269
|
"--org <slug> Organization slug (omit when using an API key)",
|
|
270
270
|
"--brand-slug <slug> Filter by brand slug (requires brands-metrics flag)",
|
|
271
271
|
"--from <iso> Start date (ISO 8601, e.g. 2026-01-01)",
|
|
272
|
-
"--to <iso> End date (ISO 8601)"
|
|
272
|
+
"--to <iso> End date (ISO 8601)",
|
|
273
|
+
"--this-week Use the current ISO week (overrides default)",
|
|
274
|
+
"--include <list> Comma list of fields to compute: reports,newThreats,threatsWatchlisted,takedownsFiled,takedownsCompleted,domainThreats,twitterThreats,telegramThreats,otherThreats,blockedByType,blockedByDay (omit for all)"
|
|
273
275
|
],
|
|
274
276
|
examples: [
|
|
275
|
-
"chainpatrol metrics organization --org acme",
|
|
277
|
+
"chainpatrol metrics organization --org acme # defaults to last 3 months, all metrics",
|
|
278
|
+
"chainpatrol metrics organization --org acme --include takedownsFiled,takedownsCompleted",
|
|
276
279
|
"chainpatrol metrics organization --org acme --from 2026-01-01 --to 2026-02-01",
|
|
277
|
-
"CHAINPATROL_API_KEY=... chainpatrol metrics organization --json"
|
|
280
|
+
"CHAINPATROL_API_KEY=... chainpatrol metrics organization --json --include reports"
|
|
278
281
|
]
|
|
279
282
|
},
|
|
280
283
|
"metrics summary": {
|
|
281
|
-
description: "Summary metrics for an org over a date range.",
|
|
282
|
-
usage: "chainpatrol metrics summary --org <slug> [--from ISO --to ISO]",
|
|
284
|
+
description: "Summary metrics for an org over a date range. Defaults to the trailing 3 months if no date range is given.",
|
|
285
|
+
usage: "chainpatrol metrics summary --org <slug> [--from ISO --to ISO|--this-week]",
|
|
283
286
|
options: [
|
|
284
287
|
"--org <slug> Organization slug",
|
|
285
288
|
"--from <iso> Start date (ISO 8601)",
|
|
286
289
|
"--to <iso> End date (ISO 8601)",
|
|
290
|
+
"--this-week Use the current ISO week (overrides default)",
|
|
287
291
|
"--brand <ids> Comma-separated brand IDs"
|
|
288
292
|
]
|
|
289
293
|
},
|
|
290
294
|
"metrics found": {
|
|
291
|
-
description: "Count of newly found threats over a date range.",
|
|
295
|
+
description: "Count of newly found threats over a date range. Defaults to the trailing 3 months if no date range is given.",
|
|
292
296
|
usage: "chainpatrol metrics found --org <slug> [--from ISO --to ISO|--this-week]",
|
|
293
297
|
options: [
|
|
294
298
|
"--org <slug> Organization slug",
|
|
295
299
|
"--from <iso> Start date (ISO 8601)",
|
|
296
300
|
"--to <iso> End date (ISO 8601)",
|
|
297
|
-
"--this-week Use the current week",
|
|
301
|
+
"--this-week Use the current ISO week (overrides default)",
|
|
298
302
|
"--brand <ids> Comma-separated brand IDs"
|
|
299
303
|
]
|
|
300
304
|
},
|
|
301
305
|
"metrics breakdown": {
|
|
302
|
-
description: "Threat counts grouped by axis (day, type, brand).",
|
|
303
|
-
usage: "chainpatrol metrics breakdown --org <slug> --by <day|type|brand>",
|
|
306
|
+
description: "Threat counts grouped by axis (day, type, brand). Defaults to the trailing 3 months if no date range is given.",
|
|
307
|
+
usage: "chainpatrol metrics breakdown --org <slug> --by <day|type|brand> [--from ISO --to ISO|--this-week]",
|
|
304
308
|
options: [
|
|
305
309
|
"--org <slug> Organization slug",
|
|
306
310
|
"--by <axis> day|type|brand (required)",
|
|
307
311
|
"--from <iso> Start date",
|
|
308
312
|
"--to <iso> End date",
|
|
313
|
+
"--this-week Use the current ISO week (overrides default)",
|
|
309
314
|
"--brand <ids> Comma-separated brand IDs"
|
|
310
315
|
]
|
|
311
316
|
},
|
|
@@ -855,6 +860,7 @@ ${getTopLevelHelp()}
|
|
|
855
860
|
to: { type: "string" },
|
|
856
861
|
thisWeek: { type: "boolean", default: false },
|
|
857
862
|
by: { type: "string" },
|
|
863
|
+
include: { type: "string" },
|
|
858
864
|
brand: { type: "string" },
|
|
859
865
|
enable: { type: "boolean", default: false },
|
|
860
866
|
disable: { type: "boolean", default: false },
|
|
@@ -1028,12 +1034,12 @@ function parseAttachmentUrls() {
|
|
|
1028
1034
|
}
|
|
1029
1035
|
async function handleConfigsList(org) {
|
|
1030
1036
|
if (jsonMode) {
|
|
1031
|
-
const { listConfigsJson } = await import("./list-json-
|
|
1037
|
+
const { listConfigsJson } = await import("./list-json-QC6X25LI.js");
|
|
1032
1038
|
await listConfigsJson({ org });
|
|
1033
1039
|
return;
|
|
1034
1040
|
}
|
|
1035
1041
|
const { render } = await import("ink");
|
|
1036
|
-
const { default: ConfigsList } = await import("./list-
|
|
1042
|
+
const { default: ConfigsList } = await import("./list-B5KLEFHA.js");
|
|
1037
1043
|
const { default: React } = await import("react");
|
|
1038
1044
|
render(React.createElement(ConfigsList, { org }));
|
|
1039
1045
|
}
|
|
@@ -1133,7 +1139,7 @@ async function main() {
|
|
|
1133
1139
|
const positionals = cli.input.slice(2);
|
|
1134
1140
|
const flagAssets = parseAssetInputs();
|
|
1135
1141
|
const contents = [...positionals, ...flagAssets];
|
|
1136
|
-
const { runAssetCheck } = await import("./check-
|
|
1142
|
+
const { runAssetCheck } = await import("./check-NJH7BUIM.js");
|
|
1137
1143
|
await runAssetCheck({
|
|
1138
1144
|
contents,
|
|
1139
1145
|
json: jsonMode,
|
|
@@ -1143,7 +1149,7 @@ async function main() {
|
|
|
1143
1149
|
break;
|
|
1144
1150
|
}
|
|
1145
1151
|
if (subcommand === "list") {
|
|
1146
|
-
const { runAssetList } = await import("./list-
|
|
1152
|
+
const { runAssetList } = await import("./list-5TMGSHFC.js");
|
|
1147
1153
|
await runAssetList({
|
|
1148
1154
|
type: cli.flags.type ?? cli.flags.assetType,
|
|
1149
1155
|
status: cli.flags.assetStatus ?? cli.flags.status,
|
|
@@ -1164,7 +1170,7 @@ async function main() {
|
|
|
1164
1170
|
case "detections": {
|
|
1165
1171
|
const org = await resolveOrg();
|
|
1166
1172
|
if (subcommand === "healthcheck") {
|
|
1167
|
-
const { runDetectionsHealthcheck } = await import("./healthcheck-
|
|
1173
|
+
const { runDetectionsHealthcheck } = await import("./healthcheck-PFYP6PNW.js");
|
|
1168
1174
|
await runDetectionsHealthcheck({
|
|
1169
1175
|
org,
|
|
1170
1176
|
source: cli.flags.source,
|
|
@@ -1179,7 +1185,7 @@ async function main() {
|
|
|
1179
1185
|
break;
|
|
1180
1186
|
}
|
|
1181
1187
|
if (subcommand === "validate") {
|
|
1182
|
-
const { runDetectionsValidate } = await import("./validate-
|
|
1188
|
+
const { runDetectionsValidate } = await import("./validate-TPG47SYS.js");
|
|
1183
1189
|
await runDetectionsValidate({
|
|
1184
1190
|
org,
|
|
1185
1191
|
source: cli.flags.source,
|
|
@@ -1194,7 +1200,7 @@ async function main() {
|
|
|
1194
1200
|
break;
|
|
1195
1201
|
}
|
|
1196
1202
|
if (subcommand === "drift") {
|
|
1197
|
-
const { runDetectionsDrift } = await import("./drift-
|
|
1203
|
+
const { runDetectionsDrift } = await import("./drift-ZOLDE24A.js");
|
|
1198
1204
|
await runDetectionsDrift({
|
|
1199
1205
|
org,
|
|
1200
1206
|
source: cli.flags.source,
|
|
@@ -1208,7 +1214,7 @@ async function main() {
|
|
|
1208
1214
|
break;
|
|
1209
1215
|
}
|
|
1210
1216
|
if (subcommand === "run") {
|
|
1211
|
-
const { runDetectionsRun } = await import("./run-
|
|
1217
|
+
const { runDetectionsRun } = await import("./run-VHFXOCGS.js");
|
|
1212
1218
|
await runDetectionsRun({
|
|
1213
1219
|
org,
|
|
1214
1220
|
configId: cli.flags.configId,
|
|
@@ -1222,7 +1228,7 @@ async function main() {
|
|
|
1222
1228
|
break;
|
|
1223
1229
|
}
|
|
1224
1230
|
if (subcommand === "list") {
|
|
1225
|
-
const { runDetectionsList } = await import("./list-
|
|
1231
|
+
const { runDetectionsList } = await import("./list-AHWEE3YZ.js");
|
|
1226
1232
|
await runDetectionsList({
|
|
1227
1233
|
org,
|
|
1228
1234
|
cursor: cli.flags.cursor,
|
|
@@ -1251,7 +1257,7 @@ async function main() {
|
|
|
1251
1257
|
break;
|
|
1252
1258
|
}
|
|
1253
1259
|
if (action === "run") {
|
|
1254
|
-
const { runDetectionsRun } = await import("./run-
|
|
1260
|
+
const { runDetectionsRun } = await import("./run-VHFXOCGS.js");
|
|
1255
1261
|
await runDetectionsRun({
|
|
1256
1262
|
org,
|
|
1257
1263
|
configId: cli.flags.configId,
|
|
@@ -1269,7 +1275,7 @@ async function main() {
|
|
|
1269
1275
|
throw new Error("detections configs update requires --config-id");
|
|
1270
1276
|
}
|
|
1271
1277
|
const configPatch = getConfigPatchFromSetFlags();
|
|
1272
|
-
const { runDetectionsConfigsUpdate } = await import("./configs-update-
|
|
1278
|
+
const { runDetectionsConfigsUpdate } = await import("./configs-update-ON67NMXA.js");
|
|
1273
1279
|
await runDetectionsConfigsUpdate({
|
|
1274
1280
|
org,
|
|
1275
1281
|
configId: cli.flags.configId,
|
|
@@ -1303,12 +1309,14 @@ async function main() {
|
|
|
1303
1309
|
case "metrics": {
|
|
1304
1310
|
if (subcommand === "organization" || subcommand === "org") {
|
|
1305
1311
|
const org2 = await tryResolveOrg();
|
|
1306
|
-
const { runMetricsOrganization } = await import("./organization-
|
|
1312
|
+
const { runMetricsOrganization } = await import("./organization-VSQQAGBS.js");
|
|
1307
1313
|
await runMetricsOrganization({
|
|
1308
1314
|
org: org2,
|
|
1309
1315
|
brandSlug: cli.flags.brandSlug,
|
|
1310
1316
|
from: cli.flags.from,
|
|
1311
1317
|
to: cli.flags.to,
|
|
1318
|
+
thisWeek: cli.flags.thisWeek,
|
|
1319
|
+
include: parseCsvList(cli.flags.include),
|
|
1312
1320
|
json: jsonMode,
|
|
1313
1321
|
outputFormat: cliContext.outputFormat
|
|
1314
1322
|
});
|
|
@@ -1316,11 +1324,12 @@ async function main() {
|
|
|
1316
1324
|
}
|
|
1317
1325
|
const org = await resolveOrg();
|
|
1318
1326
|
if (subcommand === "summary") {
|
|
1319
|
-
const { runMetricsSummary } = await import("./summary-
|
|
1327
|
+
const { runMetricsSummary } = await import("./summary-QUCLZYX6.js");
|
|
1320
1328
|
await runMetricsSummary({
|
|
1321
1329
|
org,
|
|
1322
1330
|
from: cli.flags.from,
|
|
1323
1331
|
to: cli.flags.to,
|
|
1332
|
+
thisWeek: cli.flags.thisWeek,
|
|
1324
1333
|
brandIds: parseBrandIds(),
|
|
1325
1334
|
json: jsonMode,
|
|
1326
1335
|
outputFormat: cliContext.outputFormat
|
|
@@ -1328,7 +1337,7 @@ async function main() {
|
|
|
1328
1337
|
break;
|
|
1329
1338
|
}
|
|
1330
1339
|
if (subcommand === "found") {
|
|
1331
|
-
const { runMetricsFound } = await import("./found-
|
|
1340
|
+
const { runMetricsFound } = await import("./found-M5MX4VXK.js");
|
|
1332
1341
|
await runMetricsFound({
|
|
1333
1342
|
org,
|
|
1334
1343
|
from: cli.flags.from,
|
|
@@ -1345,12 +1354,13 @@ async function main() {
|
|
|
1345
1354
|
if (!by || !["day", "type", "brand"].includes(by)) {
|
|
1346
1355
|
throw new Error("metrics breakdown requires --by <day|type|brand>");
|
|
1347
1356
|
}
|
|
1348
|
-
const { runMetricsBreakdown } = await import("./breakdown-
|
|
1357
|
+
const { runMetricsBreakdown } = await import("./breakdown-K5Q6TDKE.js");
|
|
1349
1358
|
await runMetricsBreakdown({
|
|
1350
1359
|
org,
|
|
1351
1360
|
by,
|
|
1352
1361
|
from: cli.flags.from,
|
|
1353
1362
|
to: cli.flags.to,
|
|
1363
|
+
thisWeek: cli.flags.thisWeek,
|
|
1354
1364
|
brandIds: parseBrandIds(),
|
|
1355
1365
|
json: jsonMode,
|
|
1356
1366
|
outputFormat: cliContext.outputFormat
|
|
@@ -1365,7 +1375,7 @@ async function main() {
|
|
|
1365
1375
|
case "reports": {
|
|
1366
1376
|
if (subcommand === "list") {
|
|
1367
1377
|
const org = await resolveOrg();
|
|
1368
|
-
const { runReportsList } = await import("./list-
|
|
1378
|
+
const { runReportsList } = await import("./list-FV5IYCG4.js");
|
|
1369
1379
|
await runReportsList({
|
|
1370
1380
|
org,
|
|
1371
1381
|
limit: cli.flags.limit,
|
|
@@ -1393,7 +1403,7 @@ async function main() {
|
|
|
1393
1403
|
}
|
|
1394
1404
|
if (subcommand === "create") {
|
|
1395
1405
|
const org = await tryResolveOrg();
|
|
1396
|
-
const { runReportsCreate } = await import("./create-
|
|
1406
|
+
const { runReportsCreate } = await import("./create-W5S2ZPVC.js");
|
|
1397
1407
|
await runReportsCreate({
|
|
1398
1408
|
org,
|
|
1399
1409
|
title: cli.flags.title,
|
|
@@ -1414,7 +1424,7 @@ async function main() {
|
|
|
1414
1424
|
const positionals = cli.input.slice(2);
|
|
1415
1425
|
const flagAssets = parseAssetInputs();
|
|
1416
1426
|
const assetContents = [...positionals, ...flagAssets];
|
|
1417
|
-
const { runReportsSearch } = await import("./search-
|
|
1427
|
+
const { runReportsSearch } = await import("./search-NOSQW75S.js");
|
|
1418
1428
|
await runReportsSearch({
|
|
1419
1429
|
assetContents,
|
|
1420
1430
|
reportedByCustomer: cli.flags.reportedByCustomer,
|
|
@@ -1430,7 +1440,7 @@ async function main() {
|
|
|
1430
1440
|
}
|
|
1431
1441
|
case "threats": {
|
|
1432
1442
|
if (subcommand === "list") {
|
|
1433
|
-
const { runThreatsList } = await import("./list-
|
|
1443
|
+
const { runThreatsList } = await import("./list-HGYBEYOV.js");
|
|
1434
1444
|
await runThreatsList({
|
|
1435
1445
|
query: cli.flags.query,
|
|
1436
1446
|
from: cli.flags.from,
|
|
@@ -1453,7 +1463,7 @@ async function main() {
|
|
|
1453
1463
|
case "takedowns": {
|
|
1454
1464
|
if (subcommand === "list") {
|
|
1455
1465
|
const org = await tryResolveOrg();
|
|
1456
|
-
const { runTakedownsList } = await import("./list-
|
|
1466
|
+
const { runTakedownsList } = await import("./list-TUMVDWIZ.js");
|
|
1457
1467
|
await runTakedownsList({
|
|
1458
1468
|
org,
|
|
1459
1469
|
query: cli.flags.query,
|
|
@@ -1484,7 +1494,7 @@ async function main() {
|
|
|
1484
1494
|
}
|
|
1485
1495
|
case "queues": {
|
|
1486
1496
|
if (subcommand === "snapshot") {
|
|
1487
|
-
const { runQueuesSnapshot } = await import("./snapshot-
|
|
1497
|
+
const { runQueuesSnapshot } = await import("./snapshot-55UV26NQ.js");
|
|
1488
1498
|
await runQueuesSnapshot({
|
|
1489
1499
|
org: cli.flags.org,
|
|
1490
1500
|
all: cli.flags.all,
|
|
@@ -1502,7 +1512,7 @@ async function main() {
|
|
|
1502
1512
|
}
|
|
1503
1513
|
case "orgs": {
|
|
1504
1514
|
if (subcommand === "list") {
|
|
1505
|
-
const { runOrgsList } = await import("./list-
|
|
1515
|
+
const { runOrgsList } = await import("./list-ISP5JL4M.js");
|
|
1506
1516
|
await runOrgsList({
|
|
1507
1517
|
query: cli.flags.query,
|
|
1508
1518
|
subscriptionStatus: cli.flags.subscriptionStatus,
|
|
@@ -1517,7 +1527,7 @@ async function main() {
|
|
|
1517
1527
|
}
|
|
1518
1528
|
if (subcommand === "assets") {
|
|
1519
1529
|
if (action === "list") {
|
|
1520
|
-
const { runOrgsAssetsList } = await import("./list-
|
|
1530
|
+
const { runOrgsAssetsList } = await import("./list-Z7RJWZH5.js");
|
|
1521
1531
|
await runOrgsAssetsList({
|
|
1522
1532
|
type: cli.flags.type ?? cli.flags.assetType,
|
|
1523
1533
|
groupId: cli.flags.groupId,
|
|
@@ -1533,7 +1543,7 @@ async function main() {
|
|
|
1533
1543
|
}
|
|
1534
1544
|
if (subcommand === "asset-groups") {
|
|
1535
1545
|
if (action === "list") {
|
|
1536
|
-
const { runOrgsAssetGroupsList } = await import("./list-
|
|
1546
|
+
const { runOrgsAssetGroupsList } = await import("./list-VP5IY2SZ.js");
|
|
1537
1547
|
await runOrgsAssetGroupsList({
|
|
1538
1548
|
json: jsonMode,
|
|
1539
1549
|
outputFormat: cliContext.outputFormat
|
|
@@ -1548,7 +1558,7 @@ async function main() {
|
|
|
1548
1558
|
);
|
|
1549
1559
|
}
|
|
1550
1560
|
case "whoami": {
|
|
1551
|
-
const { runWhoami } = await import("./whoami-
|
|
1561
|
+
const { runWhoami } = await import("./whoami-Y3ZJGN4O.js");
|
|
1552
1562
|
await runWhoami({
|
|
1553
1563
|
json: jsonMode,
|
|
1554
1564
|
outputFormat: cliContext.outputFormat
|
|
@@ -1557,7 +1567,7 @@ async function main() {
|
|
|
1557
1567
|
}
|
|
1558
1568
|
case "healthchecks": {
|
|
1559
1569
|
if (subcommand === "list") {
|
|
1560
|
-
const { runHealthchecksList } = await import("./list-
|
|
1570
|
+
const { runHealthchecksList } = await import("./list-GKC7PEU5.js");
|
|
1561
1571
|
await runHealthchecksList({
|
|
1562
1572
|
json: jsonMode,
|
|
1563
1573
|
outputFormat: cliContext.outputFormat
|
|
@@ -1571,7 +1581,7 @@ async function main() {
|
|
|
1571
1581
|
thresholds.minResults = cli.flags.minResults;
|
|
1572
1582
|
if (cli.flags.lookbackHours !== void 0)
|
|
1573
1583
|
thresholds.lookbackHours = cli.flags.lookbackHours;
|
|
1574
|
-
const { runHealthchecksRun } = await import("./run-
|
|
1584
|
+
const { runHealthchecksRun } = await import("./run-HRFJORDS.js");
|
|
1575
1585
|
await runHealthchecksRun({
|
|
1576
1586
|
org,
|
|
1577
1587
|
id: action,
|
|
@@ -1589,7 +1599,7 @@ async function main() {
|
|
|
1589
1599
|
}
|
|
1590
1600
|
case "presets": {
|
|
1591
1601
|
if (subcommand === "list") {
|
|
1592
|
-
const { runPresetsList } = await import("./list-
|
|
1602
|
+
const { runPresetsList } = await import("./list-LNNIEVB4.js");
|
|
1593
1603
|
await runPresetsList({ outputFormat: cliContext.outputFormat });
|
|
1594
1604
|
break;
|
|
1595
1605
|
}
|
|
@@ -1600,7 +1610,7 @@ async function main() {
|
|
|
1600
1610
|
);
|
|
1601
1611
|
}
|
|
1602
1612
|
const org = await resolveOrg();
|
|
1603
|
-
const { runPresetsRun } = await import("./run-
|
|
1613
|
+
const { runPresetsRun } = await import("./run-KDNQIR5E.js");
|
|
1604
1614
|
await runPresetsRun({
|
|
1605
1615
|
presetId: action,
|
|
1606
1616
|
org,
|
|
@@ -1617,12 +1627,12 @@ async function main() {
|
|
|
1617
1627
|
case "setup":
|
|
1618
1628
|
case "install":
|
|
1619
1629
|
case "i": {
|
|
1620
|
-
const { setupSkill } = await import("./setup-skill-
|
|
1630
|
+
const { setupSkill } = await import("./setup-skill-Q6PCFIDE.js");
|
|
1621
1631
|
setupSkill({ json: jsonMode, cloud: cli.flags.cloud });
|
|
1622
1632
|
break;
|
|
1623
1633
|
}
|
|
1624
1634
|
case "uninstall": {
|
|
1625
|
-
const { uninstallSkill } = await import("./setup-skill-
|
|
1635
|
+
const { uninstallSkill } = await import("./setup-skill-Q6PCFIDE.js");
|
|
1626
1636
|
uninstallSkill({ json: jsonMode });
|
|
1627
1637
|
break;
|
|
1628
1638
|
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resolveDateRange
|
|
3
|
+
} from "./chunk-S37VFIZY.js";
|
|
4
|
+
import {
|
|
5
|
+
printOutput,
|
|
6
|
+
toCsvRows
|
|
7
|
+
} from "./chunk-VFT3TD3E.js";
|
|
8
|
+
import {
|
|
9
|
+
createApiClient
|
|
10
|
+
} from "./chunk-YZEMTNCX.js";
|
|
11
|
+
import "./chunk-EGWK6SRQ.js";
|
|
12
|
+
import "./chunk-TFCNKBRC.js";
|
|
13
|
+
import "./chunk-U73SABXK.js";
|
|
14
|
+
|
|
15
|
+
// src/commands/metrics/found.ts
|
|
16
|
+
async function runMetricsFound(options) {
|
|
17
|
+
const range = resolveDateRange({
|
|
18
|
+
from: options.from,
|
|
19
|
+
to: options.to,
|
|
20
|
+
thisWeek: options.thisWeek
|
|
21
|
+
});
|
|
22
|
+
const client = options.apiClient ?? createApiClient();
|
|
23
|
+
const result = await client.getMetricsFound({
|
|
24
|
+
slug: options.org,
|
|
25
|
+
startDate: range.startDate,
|
|
26
|
+
endDate: range.endDate,
|
|
27
|
+
brandIds: options.brandIds
|
|
28
|
+
});
|
|
29
|
+
const outputFormat = options.outputFormat ?? (options.json ? "json" : "human");
|
|
30
|
+
printOutput({
|
|
31
|
+
outputFormat,
|
|
32
|
+
json: { ...result, range },
|
|
33
|
+
markdown: [
|
|
34
|
+
`# Found Threats (${options.org}) \u2014 ${range.label}`,
|
|
35
|
+
"",
|
|
36
|
+
`- Metric: ${result.metric}`,
|
|
37
|
+
`- Found: ${result.found}`,
|
|
38
|
+
`- Range: ${range.startDate} \u2192 ${range.endDate}`
|
|
39
|
+
].join("\n"),
|
|
40
|
+
csv: toCsvRows([
|
|
41
|
+
{
|
|
42
|
+
rangeLabel: range.label,
|
|
43
|
+
metric: result.metric,
|
|
44
|
+
found: result.found,
|
|
45
|
+
startDate: range.startDate,
|
|
46
|
+
endDate: range.endDate
|
|
47
|
+
}
|
|
48
|
+
]),
|
|
49
|
+
human: () => {
|
|
50
|
+
console.log(
|
|
51
|
+
`Found threats (${result.metric}) for ${options.org} \u2014 ${range.label}: ${result.found}`
|
|
52
|
+
);
|
|
53
|
+
console.log(`Range: ${range.startDate} \u2192 ${range.endDate}`);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
runMetricsFound
|
|
59
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PRESETS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BIKTBRER.js";
|
|
4
4
|
import "./chunk-E2LAMILJ.js";
|
|
5
5
|
import {
|
|
6
6
|
printOutput,
|
|
7
7
|
toCsvRows
|
|
8
8
|
} from "./chunk-VFT3TD3E.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-YZEMTNCX.js";
|
|
10
10
|
import "./chunk-EGWK6SRQ.js";
|
|
11
11
|
import "./chunk-TFCNKBRC.js";
|
|
12
12
|
import "./chunk-U73SABXK.js";
|