@chainpatrol/cli 1.13.0 → 1.15.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 +51 -0
- package/dist/{breakdown-BLCYJP7O.js → breakdown-5GXBOZBZ.js} +1 -1
- package/dist/{check-2IFMTAIU.js → check-OQISBUEC.js} +1 -1
- package/dist/{chunk-CABRZEYB.js → chunk-EZGE4YJG.js} +1 -1
- package/dist/{chunk-NSRQ62C4.js → chunk-LM7R7JUX.js} +2 -0
- package/dist/cli.js +101 -41
- package/dist/{configs-update-XUN4X4T2.js → configs-update-5Y47BRAV.js} +1 -1
- package/dist/{create-ILSWAUVI.js → create-G4XGWIVM.js} +1 -1
- package/dist/{drift-DPYW7LYN.js → drift-FRZEQXYK.js} +1 -1
- package/dist/{found-YLTMVPBZ.js → found-WZFO7ZP5.js} +1 -1
- package/dist/{get-NDEY54AO.js → get-7WRWHCX2.js} +7 -3
- package/dist/{healthcheck-SYZQ2ILK.js → healthcheck-STFYE55C.js} +1 -1
- package/dist/{list-WYC4ZP7X.js → list-2KCPCEPO.js} +1 -1
- package/dist/{list-4THJBDSU.js → list-6HRKMH4L.js} +1 -1
- package/dist/{list-VHDU3XMN.js → list-7I4ANMXJ.js} +1 -1
- package/dist/{list-GTN2HNGZ.js → list-B227P3DE.js} +1 -1
- package/dist/{list-RUIQIVEA.js → list-BC7SU3DD.js} +12 -5
- package/dist/{list-FUQK3TIN.js → list-GHM6Z5KK.js} +2 -2
- package/dist/{list-LWB5JQAY.js → list-KNBID2DJ.js} +1 -1
- package/dist/{list-2H2CV3JJ.js → list-MHONLKMX.js} +1 -1
- package/dist/list-PTXXL5IW.js +87 -0
- package/dist/{list-YFBZVQWK.js → list-RSWYZWUL.js} +6 -3
- package/dist/{list-Q5K4RMM4.js → list-RWFAVAAI.js} +1 -1
- package/dist/{list-PV5GY2DY.js → list-S3TP5EEA.js} +1 -1
- package/dist/{list-H4RCDI6Q.js → list-ZIRNAMJR.js} +43 -4
- package/dist/{list-json-B4X74BTZ.js → list-json-RZCY7FWL.js} +1 -1
- package/dist/{organization-KANXTARX.js → organization-33CRAMP2.js} +1 -1
- package/dist/{review-5J3EQRCB.js → review-YT6TH6TS.js} +1 -1
- package/dist/{run-FDZWPY4W.js → run-QTRTOOHA.js} +1 -1
- package/dist/{run-XWM67MBV.js → run-TZOVF7YE.js} +2 -2
- package/dist/{run-JBQ43OW6.js → run-YQERI2GH.js} +1 -1
- package/dist/{search-A75YUJFI.js → search-5EJCY3VV.js} +1 -1
- package/dist/{search-DRTTZJJP.js → search-GXPWTIPY.js} +1 -1
- package/dist/{snapshot-2IT4KG4F.js → snapshot-SCLXRXLX.js} +1 -1
- package/dist/{summary-A24TNQNR.js → summary-Y5JITMCT.js} +1 -1
- package/dist/{takedown-time-HB3J2FTZ.js → takedown-time-C7FIZTOO.js} +1 -1
- package/dist/{takedown-time-trend-KYPA3W3U.js → takedown-time-trend-SAMO7JAZ.js} +1 -1
- package/dist/{time-to-detection-5L7ECKYU.js → time-to-detection-VO7BCUCK.js} +1 -1
- package/dist/{validate-FOZCI7HX.js → validate-SUTLVGAV.js} +1 -1
- package/dist/{whoami-DSXNLG3B.js → whoami-KVIYPM23.js} +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
1
|
# @chainpatrol/cli
|
|
2
2
|
|
|
3
|
+
## 1.15.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- ab80828: Support the new public API detection, threat and watchlist options.
|
|
8
|
+
|
|
9
|
+
- **SDK**: `listDetections` accepts `blockStatus`, `minScore`, `maxScore` and `includeTotal`, and returns `total` and `asset.pendingStatus`. `listThreats` accepts `includePending` and returns `pendingStatus`. New `listOrganizationWatchlist` for `GET /organization/watchlist`.
|
|
10
|
+
- **CLI**: `detections list` gains `--block-status`, `--min-score`, `--max-score` and `--include-total`, and shows pending blocks as `PENDING_BLOCKED`. `threats list` gains `--include-pending`. New `orgs watchlist list`.
|
|
11
|
+
- **MCP**: new `detection_evaluation` prompt that answers the usual evaluation questions (confirmed threats, domain detections, watchlist, detections above a score) with counts rather than samples.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [5011c77]
|
|
16
|
+
- Updated dependencies [b09ce6c]
|
|
17
|
+
- Updated dependencies [75f8fb4]
|
|
18
|
+
- Updated dependencies [4ff67a0]
|
|
19
|
+
- Updated dependencies [662216d]
|
|
20
|
+
- Updated dependencies [ab80828]
|
|
21
|
+
- @chainpatrol/mcp@1.13.0
|
|
22
|
+
- @chainpatrol/sdk@1.14.0
|
|
23
|
+
|
|
24
|
+
## 1.14.0
|
|
25
|
+
|
|
26
|
+
### Minor Changes
|
|
27
|
+
|
|
28
|
+
- da80cde: Trademark registrations now carry a lifecycle `status` of `ACTIVE`, `PENDING`,
|
|
29
|
+
`EXPIRED`, `ABANDONED` or `CANCELLED`.
|
|
30
|
+
|
|
31
|
+
`status` is added to the trademark registration objects returned by
|
|
32
|
+
`listOrganizationBrands()` and the user-org endpoints. Every registration is
|
|
33
|
+
still returned whatever its status — filter on the new field if you only want
|
|
34
|
+
marks currently in force. Existing rows report `ACTIVE`, so responses are
|
|
35
|
+
unchanged for anyone who has not set a status.
|
|
36
|
+
|
|
37
|
+
The CLI shows the status on each trademark in `chainpatrol brands list` and
|
|
38
|
+
`chainpatrol orgs get`, and `orgs get` now reports how many of an organization's
|
|
39
|
+
marks are active.
|
|
40
|
+
|
|
41
|
+
Only `ACTIVE` registrations are used by ChainPatrol's takedown and enforcement
|
|
42
|
+
workflows. That gating lives in @chainpatrol/trpc and @chainpatrol/core, and the
|
|
43
|
+
column itself in @chainpatrol/database — all private packages that do not need
|
|
44
|
+
version bumps.
|
|
45
|
+
|
|
46
|
+
### Patch Changes
|
|
47
|
+
|
|
48
|
+
- Updated dependencies [a90b542]
|
|
49
|
+
- Updated dependencies [1333cf9]
|
|
50
|
+
- Updated dependencies [da80cde]
|
|
51
|
+
- @chainpatrol/mcp@1.12.1
|
|
52
|
+
- @chainpatrol/sdk@1.13.0
|
|
53
|
+
|
|
3
54
|
## 1.13.0
|
|
4
55
|
|
|
5
56
|
### Minor Changes
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
// src/lib/api-client.ts
|
|
9
9
|
import { ChainPatrolApiClient } from "@chainpatrol/sdk/api";
|
|
10
10
|
import {
|
|
11
|
+
DETECTION_BLOCK_STATUS_FILTERS,
|
|
11
12
|
DETECTION_CONFIDENCE_LEVELS,
|
|
12
13
|
DETECTION_REPORTED_FILTERS,
|
|
13
14
|
LIVENESS_FILTER_VALUES,
|
|
@@ -40,6 +41,7 @@ function createApiClient(options) {
|
|
|
40
41
|
|
|
41
42
|
export {
|
|
42
43
|
createApiClient,
|
|
44
|
+
DETECTION_BLOCK_STATUS_FILTERS,
|
|
43
45
|
DETECTION_CONFIDENCE_LEVELS,
|
|
44
46
|
DETECTION_REPORTED_FILTERS,
|
|
45
47
|
LIVENESS_FILTER_VALUES,
|
package/dist/cli.js
CHANGED
|
@@ -203,6 +203,10 @@ var HELP = {
|
|
|
203
203
|
"--reported <list> Comma list: reported|not_reported",
|
|
204
204
|
"--country-code <list> Comma list of 2-letter ISO country codes (e.g. US,GB)",
|
|
205
205
|
"--only-deleted Return only soft-deleted detections. Without this flag the endpoint returns both deleted and non-deleted (existing public-API behavior).",
|
|
206
|
+
"--block-status <list> Comma list: blocked|pending. Both = every confirmed threat, including pending blocks for orgs without active protection",
|
|
207
|
+
"--min-score <n> Only detections with raw score >= n (0-1). Use instead of --confidence for a fixed cut-off",
|
|
208
|
+
"--max-score <n> Only detections with raw score <= n (0-1)",
|
|
209
|
+
"--include-total Also print how many detections match across all pages",
|
|
206
210
|
"--from <iso> Start date (ISO 8601)",
|
|
207
211
|
"--to <iso> End date (ISO 8601)"
|
|
208
212
|
],
|
|
@@ -210,7 +214,9 @@ var HELP = {
|
|
|
210
214
|
"chainpatrol detections list --org acme --confidence medium,high",
|
|
211
215
|
"chainpatrol detections list --org acme --source twitter --liveness ALIVE",
|
|
212
216
|
"chainpatrol detections list --org acme --reported not_reported --watchlist ENABLED",
|
|
213
|
-
"chainpatrol detections list --org acme --brand 12,34 --country-code US,GB"
|
|
217
|
+
"chainpatrol detections list --org acme --brand 12,34 --country-code US,GB",
|
|
218
|
+
"chainpatrol detections list --org acme --min-score 0.8 --include-total",
|
|
219
|
+
"chainpatrol detections list --org acme --block-status blocked,pending --include-total"
|
|
214
220
|
]
|
|
215
221
|
},
|
|
216
222
|
"detections healthcheck": {
|
|
@@ -523,10 +529,12 @@ var HELP = {
|
|
|
523
529
|
"--sort-by <key> Sort key (e.g. blockedAt)",
|
|
524
530
|
"--sort-direction <dir> asc|desc",
|
|
525
531
|
"--per-page <n> Page size 1-100 (default 10)",
|
|
526
|
-
"--next-page <cursor> Cursor returned from a previous response"
|
|
532
|
+
"--next-page <cursor> Cursor returned from a previous response",
|
|
533
|
+
"--include-pending Also list threats confirmed while protection is not active (Pending Blocked)"
|
|
527
534
|
],
|
|
528
535
|
examples: [
|
|
529
536
|
"chainpatrol threats list --from 2026-05-01 --asset-type URL",
|
|
537
|
+
"chainpatrol threats list --from 2020-01-01 --include-pending",
|
|
530
538
|
"CHAINPATROL_API_KEY=... chainpatrol threats list --json"
|
|
531
539
|
]
|
|
532
540
|
},
|
|
@@ -580,11 +588,12 @@ var HELP = {
|
|
|
580
588
|
},
|
|
581
589
|
orgs: {
|
|
582
590
|
description: "List organizations, their assets, and asset groups. Top-level `orgs list` lists organizations accessible to you; `orgs get <slug>` returns details for a single accessible org; the nested subcommands operate on the org tied to your API key.",
|
|
583
|
-
usage: "chainpatrol orgs <list|get <slug>|assets list|asset-groups list>",
|
|
591
|
+
usage: "chainpatrol orgs <list|get <slug>|assets list|watchlist list|asset-groups list>",
|
|
584
592
|
examples: [
|
|
585
593
|
"chainpatrol orgs list",
|
|
586
594
|
"chainpatrol orgs get acme",
|
|
587
595
|
"chainpatrol orgs assets list --asset-type URL",
|
|
596
|
+
"chainpatrol orgs watchlist list --include-total",
|
|
588
597
|
"chainpatrol orgs asset-groups list"
|
|
589
598
|
]
|
|
590
599
|
},
|
|
@@ -610,6 +619,28 @@ var HELP = {
|
|
|
610
619
|
"chainpatrol orgs assets list --group-id 12 --per-page 250 --output csv"
|
|
611
620
|
]
|
|
612
621
|
},
|
|
622
|
+
"orgs watchlist": {
|
|
623
|
+
description: "List the assets ChainPatrol is watching for your organization.",
|
|
624
|
+
usage: "chainpatrol orgs watchlist list [filters]"
|
|
625
|
+
},
|
|
626
|
+
"orgs watchlist list": {
|
|
627
|
+
description: "List watchlisted assets: ones your organization reported that were not blocked (dead, parked, not enough evidence, ...) and are re-scanned so they can be blocked later. Same set the threatsWatchlisted metric counts. Pass --org <slug> or omit it to use the org tied to your API key.",
|
|
628
|
+
usage: "chainpatrol orgs watchlist list [filters]",
|
|
629
|
+
options: [
|
|
630
|
+
"--org <slug> Organization slug (omit for org-scoped API keys)",
|
|
631
|
+
"--asset-type <type> Filter by asset type (URL, TWITTER, ...)",
|
|
632
|
+
"--query <text> Search asset content (substring)",
|
|
633
|
+
"--from <iso> Only assets your org reported at or after this time",
|
|
634
|
+
"--to <iso> Only assets your org reported at or before this time",
|
|
635
|
+
"--include-total Also print the total number of watchlisted assets",
|
|
636
|
+
"--per-page <n> Page size 1-1000 (default 100; --limit also accepted)",
|
|
637
|
+
"--next-page <cursor> Cursor returned from a previous response"
|
|
638
|
+
],
|
|
639
|
+
examples: [
|
|
640
|
+
"chainpatrol orgs watchlist list --include-total",
|
|
641
|
+
"chainpatrol orgs watchlist list --org acme --asset-type URL --output csv"
|
|
642
|
+
]
|
|
643
|
+
},
|
|
613
644
|
"orgs asset-groups": {
|
|
614
645
|
description: "List asset groups in your organization.",
|
|
615
646
|
usage: "chainpatrol orgs asset-groups list"
|
|
@@ -1075,6 +1106,11 @@ ${getTopLevelHelp()}
|
|
|
1075
1106
|
reported: { type: "string" },
|
|
1076
1107
|
countryCode: { type: "string" },
|
|
1077
1108
|
onlyDeleted: { type: "boolean", default: false },
|
|
1109
|
+
blockStatus: { type: "string" },
|
|
1110
|
+
minScore: { type: "number" },
|
|
1111
|
+
maxScore: { type: "number" },
|
|
1112
|
+
includeTotal: { type: "boolean", default: false },
|
|
1113
|
+
includePending: { type: "boolean", default: false },
|
|
1078
1114
|
assignee: { type: "string" },
|
|
1079
1115
|
startedFrom: { type: "string" },
|
|
1080
1116
|
startedTo: { type: "string" },
|
|
@@ -1222,12 +1258,12 @@ function parseAttachmentUrls() {
|
|
|
1222
1258
|
}
|
|
1223
1259
|
async function handleConfigsList(org) {
|
|
1224
1260
|
if (jsonMode) {
|
|
1225
|
-
const { listConfigsJson } = await import("./list-json-
|
|
1261
|
+
const { listConfigsJson } = await import("./list-json-RZCY7FWL.js");
|
|
1226
1262
|
await listConfigsJson({ org });
|
|
1227
1263
|
return;
|
|
1228
1264
|
}
|
|
1229
1265
|
const { render } = await import("ink");
|
|
1230
|
-
const { default: ConfigsList } = await import("./list-
|
|
1266
|
+
const { default: ConfigsList } = await import("./list-S3TP5EEA.js");
|
|
1231
1267
|
const { default: React } = await import("react");
|
|
1232
1268
|
render(React.createElement(ConfigsList, { org }));
|
|
1233
1269
|
}
|
|
@@ -1327,7 +1363,7 @@ async function main() {
|
|
|
1327
1363
|
const positionals = cli.input.slice(2);
|
|
1328
1364
|
const flagAssets = parseAssetInputs();
|
|
1329
1365
|
const contents = [...positionals, ...flagAssets];
|
|
1330
|
-
const { runAssetCheck } = await import("./check-
|
|
1366
|
+
const { runAssetCheck } = await import("./check-OQISBUEC.js");
|
|
1331
1367
|
await runAssetCheck({
|
|
1332
1368
|
contents,
|
|
1333
1369
|
json: jsonMode,
|
|
@@ -1337,7 +1373,7 @@ async function main() {
|
|
|
1337
1373
|
break;
|
|
1338
1374
|
}
|
|
1339
1375
|
if (subcommand === "list") {
|
|
1340
|
-
const { runAssetList } = await import("./list-
|
|
1376
|
+
const { runAssetList } = await import("./list-B227P3DE.js");
|
|
1341
1377
|
await runAssetList({
|
|
1342
1378
|
type: cli.flags.type ?? cli.flags.assetType,
|
|
1343
1379
|
status: cli.flags.assetStatus ?? cli.flags.status,
|
|
@@ -1362,7 +1398,7 @@ async function main() {
|
|
|
1362
1398
|
}
|
|
1363
1399
|
return n;
|
|
1364
1400
|
});
|
|
1365
|
-
const { runAssetSearch } = await import("./search-
|
|
1401
|
+
const { runAssetSearch } = await import("./search-GXPWTIPY.js");
|
|
1366
1402
|
await runAssetSearch({
|
|
1367
1403
|
contents: contents.length > 0 ? contents : void 0,
|
|
1368
1404
|
ids: ids.length > 0 ? ids : void 0,
|
|
@@ -1387,7 +1423,7 @@ async function main() {
|
|
|
1387
1423
|
case "detections": {
|
|
1388
1424
|
const org = await resolveOrg();
|
|
1389
1425
|
if (subcommand === "healthcheck") {
|
|
1390
|
-
const { runDetectionsHealthcheck } = await import("./healthcheck-
|
|
1426
|
+
const { runDetectionsHealthcheck } = await import("./healthcheck-STFYE55C.js");
|
|
1391
1427
|
await runDetectionsHealthcheck({
|
|
1392
1428
|
org,
|
|
1393
1429
|
source: cli.flags.source,
|
|
@@ -1402,7 +1438,7 @@ async function main() {
|
|
|
1402
1438
|
break;
|
|
1403
1439
|
}
|
|
1404
1440
|
if (subcommand === "validate") {
|
|
1405
|
-
const { runDetectionsValidate } = await import("./validate-
|
|
1441
|
+
const { runDetectionsValidate } = await import("./validate-SUTLVGAV.js");
|
|
1406
1442
|
await runDetectionsValidate({
|
|
1407
1443
|
org,
|
|
1408
1444
|
source: cli.flags.source,
|
|
@@ -1417,7 +1453,7 @@ async function main() {
|
|
|
1417
1453
|
break;
|
|
1418
1454
|
}
|
|
1419
1455
|
if (subcommand === "drift") {
|
|
1420
|
-
const { runDetectionsDrift } = await import("./drift-
|
|
1456
|
+
const { runDetectionsDrift } = await import("./drift-FRZEQXYK.js");
|
|
1421
1457
|
await runDetectionsDrift({
|
|
1422
1458
|
org,
|
|
1423
1459
|
source: cli.flags.source,
|
|
@@ -1431,7 +1467,7 @@ async function main() {
|
|
|
1431
1467
|
break;
|
|
1432
1468
|
}
|
|
1433
1469
|
if (subcommand === "run") {
|
|
1434
|
-
const { runDetectionsRun } = await import("./run-
|
|
1470
|
+
const { runDetectionsRun } = await import("./run-QTRTOOHA.js");
|
|
1435
1471
|
await runDetectionsRun({
|
|
1436
1472
|
org,
|
|
1437
1473
|
configId: cli.flags.configId,
|
|
@@ -1445,7 +1481,7 @@ async function main() {
|
|
|
1445
1481
|
break;
|
|
1446
1482
|
}
|
|
1447
1483
|
if (subcommand === "list") {
|
|
1448
|
-
const { runDetectionsList } = await import("./list-
|
|
1484
|
+
const { runDetectionsList } = await import("./list-ZIRNAMJR.js");
|
|
1449
1485
|
await runDetectionsList({
|
|
1450
1486
|
org,
|
|
1451
1487
|
cursor: cli.flags.cursor,
|
|
@@ -1463,6 +1499,10 @@ async function main() {
|
|
|
1463
1499
|
reported: parseCsvList(cli.flags.reported),
|
|
1464
1500
|
countryCodes: parseCsvList(cli.flags.countryCode),
|
|
1465
1501
|
onlyDeleted: cli.flags.onlyDeleted,
|
|
1502
|
+
blockStatus: parseCsvList(cli.flags.blockStatus),
|
|
1503
|
+
minScore: cli.flags.minScore,
|
|
1504
|
+
maxScore: cli.flags.maxScore,
|
|
1505
|
+
includeTotal: cli.flags.includeTotal,
|
|
1466
1506
|
json: jsonMode,
|
|
1467
1507
|
outputFormat: cliContext.outputFormat
|
|
1468
1508
|
});
|
|
@@ -1474,7 +1514,7 @@ async function main() {
|
|
|
1474
1514
|
break;
|
|
1475
1515
|
}
|
|
1476
1516
|
if (action === "run") {
|
|
1477
|
-
const { runDetectionsRun } = await import("./run-
|
|
1517
|
+
const { runDetectionsRun } = await import("./run-QTRTOOHA.js");
|
|
1478
1518
|
await runDetectionsRun({
|
|
1479
1519
|
org,
|
|
1480
1520
|
configId: cli.flags.configId,
|
|
@@ -1492,7 +1532,7 @@ async function main() {
|
|
|
1492
1532
|
throw new Error("detections configs update requires --config-id");
|
|
1493
1533
|
}
|
|
1494
1534
|
const configPatch = getConfigPatchFromSetFlags();
|
|
1495
|
-
const { runDetectionsConfigsUpdate } = await import("./configs-update-
|
|
1535
|
+
const { runDetectionsConfigsUpdate } = await import("./configs-update-5Y47BRAV.js");
|
|
1496
1536
|
await runDetectionsConfigsUpdate({
|
|
1497
1537
|
org,
|
|
1498
1538
|
configId: cli.flags.configId,
|
|
@@ -1528,7 +1568,7 @@ async function main() {
|
|
|
1528
1568
|
const slugs = parseCsvList(cli.flags.slugs);
|
|
1529
1569
|
const allMyOrgs = cli.flags.allMyOrgs;
|
|
1530
1570
|
const org2 = slugs && slugs.length > 0 || allMyOrgs ? void 0 : await tryResolveOrg();
|
|
1531
|
-
const { runMetricsOrganization } = await import("./organization-
|
|
1571
|
+
const { runMetricsOrganization } = await import("./organization-33CRAMP2.js");
|
|
1532
1572
|
await runMetricsOrganization({
|
|
1533
1573
|
org: org2,
|
|
1534
1574
|
slugs,
|
|
@@ -1547,7 +1587,7 @@ async function main() {
|
|
|
1547
1587
|
}
|
|
1548
1588
|
const org = await resolveOrg();
|
|
1549
1589
|
if (subcommand === "summary") {
|
|
1550
|
-
const { runMetricsSummary } = await import("./summary-
|
|
1590
|
+
const { runMetricsSummary } = await import("./summary-Y5JITMCT.js");
|
|
1551
1591
|
await runMetricsSummary({
|
|
1552
1592
|
org,
|
|
1553
1593
|
from: cli.flags.from,
|
|
@@ -1560,7 +1600,7 @@ async function main() {
|
|
|
1560
1600
|
break;
|
|
1561
1601
|
}
|
|
1562
1602
|
if (subcommand === "found") {
|
|
1563
|
-
const { runMetricsFound } = await import("./found-
|
|
1603
|
+
const { runMetricsFound } = await import("./found-WZFO7ZP5.js");
|
|
1564
1604
|
await runMetricsFound({
|
|
1565
1605
|
org,
|
|
1566
1606
|
from: cli.flags.from,
|
|
@@ -1573,7 +1613,7 @@ async function main() {
|
|
|
1573
1613
|
break;
|
|
1574
1614
|
}
|
|
1575
1615
|
if (subcommand === "takedown-time" || subcommand === "takedownTime") {
|
|
1576
|
-
const { runMetricsTakedownTime } = await import("./takedown-time-
|
|
1616
|
+
const { runMetricsTakedownTime } = await import("./takedown-time-C7FIZTOO.js");
|
|
1577
1617
|
await runMetricsTakedownTime({
|
|
1578
1618
|
org,
|
|
1579
1619
|
from: cli.flags.from,
|
|
@@ -1586,7 +1626,7 @@ async function main() {
|
|
|
1586
1626
|
break;
|
|
1587
1627
|
}
|
|
1588
1628
|
if (subcommand === "time-to-detection" || subcommand === "timeToDetection") {
|
|
1589
|
-
const { runMetricsTimeToDetection } = await import("./time-to-detection-
|
|
1629
|
+
const { runMetricsTimeToDetection } = await import("./time-to-detection-VO7BCUCK.js");
|
|
1590
1630
|
await runMetricsTimeToDetection({
|
|
1591
1631
|
org,
|
|
1592
1632
|
from: cli.flags.from,
|
|
@@ -1599,7 +1639,7 @@ async function main() {
|
|
|
1599
1639
|
break;
|
|
1600
1640
|
}
|
|
1601
1641
|
if (subcommand === "takedown-time-trend" || subcommand === "takedownTimeTrend") {
|
|
1602
|
-
const { runMetricsTakedownTimeTrend } = await import("./takedown-time-trend-
|
|
1642
|
+
const { runMetricsTakedownTimeTrend } = await import("./takedown-time-trend-SAMO7JAZ.js");
|
|
1603
1643
|
await runMetricsTakedownTimeTrend({
|
|
1604
1644
|
org,
|
|
1605
1645
|
months: cli.flags.months,
|
|
@@ -1615,7 +1655,7 @@ async function main() {
|
|
|
1615
1655
|
if (!by || !["day", "type", "brand"].includes(by)) {
|
|
1616
1656
|
throw new Error("metrics breakdown requires --by <day|type|brand>");
|
|
1617
1657
|
}
|
|
1618
|
-
const { runMetricsBreakdown } = await import("./breakdown-
|
|
1658
|
+
const { runMetricsBreakdown } = await import("./breakdown-5GXBOZBZ.js");
|
|
1619
1659
|
await runMetricsBreakdown({
|
|
1620
1660
|
org,
|
|
1621
1661
|
by,
|
|
@@ -1644,7 +1684,7 @@ async function main() {
|
|
|
1644
1684
|
case "reports": {
|
|
1645
1685
|
if (subcommand === "list") {
|
|
1646
1686
|
const org = await resolveOrg();
|
|
1647
|
-
const { runReportsList } = await import("./list-
|
|
1687
|
+
const { runReportsList } = await import("./list-MHONLKMX.js");
|
|
1648
1688
|
await runReportsList({
|
|
1649
1689
|
org,
|
|
1650
1690
|
limit: cli.flags.limit,
|
|
@@ -1675,7 +1715,7 @@ async function main() {
|
|
|
1675
1715
|
}
|
|
1676
1716
|
if (subcommand === "create") {
|
|
1677
1717
|
const org = await tryResolveOrg();
|
|
1678
|
-
const { runReportsCreate } = await import("./create-
|
|
1718
|
+
const { runReportsCreate } = await import("./create-G4XGWIVM.js");
|
|
1679
1719
|
await runReportsCreate({
|
|
1680
1720
|
org,
|
|
1681
1721
|
title: cli.flags.title,
|
|
@@ -1697,7 +1737,7 @@ async function main() {
|
|
|
1697
1737
|
const positionals = cli.input.slice(2);
|
|
1698
1738
|
const flagAssets = parseAssetInputs();
|
|
1699
1739
|
const assetContents = [...positionals, ...flagAssets];
|
|
1700
|
-
const { runReportsSearch } = await import("./search-
|
|
1740
|
+
const { runReportsSearch } = await import("./search-5EJCY3VV.js");
|
|
1701
1741
|
await runReportsSearch({
|
|
1702
1742
|
assetContents,
|
|
1703
1743
|
org,
|
|
@@ -1717,7 +1757,7 @@ async function main() {
|
|
|
1717
1757
|
if (subcommand === "review") {
|
|
1718
1758
|
const org = await tryResolveOrg();
|
|
1719
1759
|
const positionalProposalId = cli.input[2];
|
|
1720
|
-
const { runProposalsReview } = await import("./review-
|
|
1760
|
+
const { runProposalsReview } = await import("./review-YT6TH6TS.js");
|
|
1721
1761
|
await runProposalsReview({
|
|
1722
1762
|
org,
|
|
1723
1763
|
proposalId: cli.flags.proposalId ?? (positionalProposalId ? Number(positionalProposalId) : void 0),
|
|
@@ -1744,7 +1784,7 @@ async function main() {
|
|
|
1744
1784
|
}
|
|
1745
1785
|
case "threats": {
|
|
1746
1786
|
if (subcommand === "list") {
|
|
1747
|
-
const { runThreatsList } = await import("./list-
|
|
1787
|
+
const { runThreatsList } = await import("./list-BC7SU3DD.js");
|
|
1748
1788
|
await runThreatsList({
|
|
1749
1789
|
query: cli.flags.query,
|
|
1750
1790
|
from: cli.flags.from,
|
|
@@ -1754,6 +1794,7 @@ async function main() {
|
|
|
1754
1794
|
sortDirection: cli.flags.sortDirection,
|
|
1755
1795
|
perPage: cli.flags.perPage ?? cli.flags.limit,
|
|
1756
1796
|
nextPage: cli.flags.nextPage,
|
|
1797
|
+
includePending: cli.flags.includePending,
|
|
1757
1798
|
json: jsonMode,
|
|
1758
1799
|
outputFormat: cliContext.outputFormat
|
|
1759
1800
|
});
|
|
@@ -1767,7 +1808,7 @@ async function main() {
|
|
|
1767
1808
|
case "takedowns": {
|
|
1768
1809
|
if (subcommand === "list") {
|
|
1769
1810
|
const org = await tryResolveOrg();
|
|
1770
|
-
const { runTakedownsList } = await import("./list-
|
|
1811
|
+
const { runTakedownsList } = await import("./list-KNBID2DJ.js");
|
|
1771
1812
|
await runTakedownsList({
|
|
1772
1813
|
org,
|
|
1773
1814
|
query: cli.flags.query,
|
|
@@ -1798,7 +1839,7 @@ async function main() {
|
|
|
1798
1839
|
}
|
|
1799
1840
|
case "queues": {
|
|
1800
1841
|
if (subcommand === "snapshot") {
|
|
1801
|
-
const { runQueuesSnapshot } = await import("./snapshot-
|
|
1842
|
+
const { runQueuesSnapshot } = await import("./snapshot-SCLXRXLX.js");
|
|
1802
1843
|
await runQueuesSnapshot({
|
|
1803
1844
|
org: cli.flags.org,
|
|
1804
1845
|
all: cli.flags.all,
|
|
@@ -1816,7 +1857,7 @@ async function main() {
|
|
|
1816
1857
|
}
|
|
1817
1858
|
case "orgs": {
|
|
1818
1859
|
if (subcommand === "list") {
|
|
1819
|
-
const { runOrgsList } = await import("./list-
|
|
1860
|
+
const { runOrgsList } = await import("./list-6HRKMH4L.js");
|
|
1820
1861
|
await runOrgsList({
|
|
1821
1862
|
query: cli.flags.query,
|
|
1822
1863
|
subscriptionStatus: cli.flags.subscriptionStatus,
|
|
@@ -1838,7 +1879,7 @@ async function main() {
|
|
|
1838
1879
|
if (subcommand === "get") {
|
|
1839
1880
|
const positionalSlug = action;
|
|
1840
1881
|
const slug = positionalSlug ?? await tryResolveOrg();
|
|
1841
|
-
const { runOrgsGet } = await import("./get-
|
|
1882
|
+
const { runOrgsGet } = await import("./get-7WRWHCX2.js");
|
|
1842
1883
|
await runOrgsGet({
|
|
1843
1884
|
slug,
|
|
1844
1885
|
json: jsonMode,
|
|
@@ -1848,7 +1889,7 @@ async function main() {
|
|
|
1848
1889
|
}
|
|
1849
1890
|
if (subcommand === "assets") {
|
|
1850
1891
|
if (action === "list") {
|
|
1851
|
-
const { runOrgsAssetsList } = await import("./list-
|
|
1892
|
+
const { runOrgsAssetsList } = await import("./list-7I4ANMXJ.js");
|
|
1852
1893
|
await runOrgsAssetsList({
|
|
1853
1894
|
// Optional: organization-scoped API keys resolve the org from the
|
|
1854
1895
|
// key, so only pass a slug when one is actually available.
|
|
@@ -1865,9 +1906,28 @@ async function main() {
|
|
|
1865
1906
|
}
|
|
1866
1907
|
throw new Error("Usage: chainpatrol orgs assets list [filters]");
|
|
1867
1908
|
}
|
|
1909
|
+
if (subcommand === "watchlist") {
|
|
1910
|
+
if (action === "list") {
|
|
1911
|
+
const { runOrgsWatchlistList } = await import("./list-PTXXL5IW.js");
|
|
1912
|
+
await runOrgsWatchlistList({
|
|
1913
|
+
slug: await tryResolveOrg(),
|
|
1914
|
+
assetType: cli.flags.assetType ?? cli.flags.type,
|
|
1915
|
+
query: cli.flags.query ?? cli.flags.search,
|
|
1916
|
+
from: cli.flags.from,
|
|
1917
|
+
to: cli.flags.to,
|
|
1918
|
+
includeTotal: cli.flags.includeTotal,
|
|
1919
|
+
perPage: cli.flags.perPage ?? cli.flags.limit,
|
|
1920
|
+
nextPage: cli.flags.nextPage,
|
|
1921
|
+
json: jsonMode,
|
|
1922
|
+
outputFormat: cliContext.outputFormat
|
|
1923
|
+
});
|
|
1924
|
+
break;
|
|
1925
|
+
}
|
|
1926
|
+
throw new Error("Usage: chainpatrol orgs watchlist list [filters]");
|
|
1927
|
+
}
|
|
1868
1928
|
if (subcommand === "asset-groups") {
|
|
1869
1929
|
if (action === "list") {
|
|
1870
|
-
const { runOrgsAssetGroupsList } = await import("./list-
|
|
1930
|
+
const { runOrgsAssetGroupsList } = await import("./list-2KCPCEPO.js");
|
|
1871
1931
|
await runOrgsAssetGroupsList({
|
|
1872
1932
|
json: jsonMode,
|
|
1873
1933
|
outputFormat: cliContext.outputFormat
|
|
@@ -1876,9 +1936,9 @@ async function main() {
|
|
|
1876
1936
|
}
|
|
1877
1937
|
throw new Error("Usage: chainpatrol orgs asset-groups list");
|
|
1878
1938
|
}
|
|
1879
|
-
const hint = subcommand ? suggest(subcommand, ["list", "get", "assets", "asset-groups"]) : null;
|
|
1939
|
+
const hint = subcommand ? suggest(subcommand, ["list", "get", "assets", "watchlist", "asset-groups"]) : null;
|
|
1880
1940
|
throw new Error(
|
|
1881
|
-
subcommand ? `Unknown subcommand: orgs ${subcommand}${hint ? `. Did you mean "orgs ${hint}"?` : ""}` : "Usage: chainpatrol orgs <list|get <slug>|assets list|asset-groups list> [filters]"
|
|
1941
|
+
subcommand ? `Unknown subcommand: orgs ${subcommand}${hint ? `. Did you mean "orgs ${hint}"?` : ""}` : "Usage: chainpatrol orgs <list|get <slug>|assets list|watchlist list|asset-groups list> [filters]"
|
|
1882
1942
|
);
|
|
1883
1943
|
}
|
|
1884
1944
|
case "brands": {
|
|
@@ -1889,7 +1949,7 @@ async function main() {
|
|
|
1889
1949
|
"brands list --type must be ORGANIZATION, INDIVIDUAL, or PRODUCT (case-insensitive)."
|
|
1890
1950
|
);
|
|
1891
1951
|
}
|
|
1892
|
-
const { runBrandsList } = await import("./list-
|
|
1952
|
+
const { runBrandsList } = await import("./list-RSWYZWUL.js");
|
|
1893
1953
|
await runBrandsList({
|
|
1894
1954
|
type: rawType,
|
|
1895
1955
|
json: jsonMode,
|
|
@@ -1910,7 +1970,7 @@ async function main() {
|
|
|
1910
1970
|
break;
|
|
1911
1971
|
}
|
|
1912
1972
|
case "whoami": {
|
|
1913
|
-
const { runWhoami } = await import("./whoami-
|
|
1973
|
+
const { runWhoami } = await import("./whoami-KVIYPM23.js");
|
|
1914
1974
|
await runWhoami({
|
|
1915
1975
|
json: jsonMode,
|
|
1916
1976
|
outputFormat: cliContext.outputFormat
|
|
@@ -1919,7 +1979,7 @@ async function main() {
|
|
|
1919
1979
|
}
|
|
1920
1980
|
case "healthchecks": {
|
|
1921
1981
|
if (subcommand === "list") {
|
|
1922
|
-
const { runHealthchecksList } = await import("./list-
|
|
1982
|
+
const { runHealthchecksList } = await import("./list-RWFAVAAI.js");
|
|
1923
1983
|
await runHealthchecksList({
|
|
1924
1984
|
json: jsonMode,
|
|
1925
1985
|
outputFormat: cliContext.outputFormat
|
|
@@ -1933,7 +1993,7 @@ async function main() {
|
|
|
1933
1993
|
thresholds.minResults = cli.flags.minResults;
|
|
1934
1994
|
if (cli.flags.lookbackHours !== void 0)
|
|
1935
1995
|
thresholds.lookbackHours = cli.flags.lookbackHours;
|
|
1936
|
-
const { runHealthchecksRun } = await import("./run-
|
|
1996
|
+
const { runHealthchecksRun } = await import("./run-YQERI2GH.js");
|
|
1937
1997
|
await runHealthchecksRun({
|
|
1938
1998
|
org,
|
|
1939
1999
|
id: action,
|
|
@@ -1951,7 +2011,7 @@ async function main() {
|
|
|
1951
2011
|
}
|
|
1952
2012
|
case "presets": {
|
|
1953
2013
|
if (subcommand === "list") {
|
|
1954
|
-
const { runPresetsList } = await import("./list-
|
|
2014
|
+
const { runPresetsList } = await import("./list-GHM6Z5KK.js");
|
|
1955
2015
|
await runPresetsList({ outputFormat: cliContext.outputFormat });
|
|
1956
2016
|
break;
|
|
1957
2017
|
}
|
|
@@ -1962,7 +2022,7 @@ async function main() {
|
|
|
1962
2022
|
);
|
|
1963
2023
|
}
|
|
1964
2024
|
const org = await resolveOrg();
|
|
1965
|
-
const { runPresetsRun } = await import("./run-
|
|
2025
|
+
const { runPresetsRun } = await import("./run-TZOVF7YE.js");
|
|
1966
2026
|
await runPresetsRun({
|
|
1967
2027
|
presetId: action,
|
|
1968
2028
|
org,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-VFT3TD3E.js";
|
|
9
9
|
import {
|
|
10
10
|
createApiClient
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-LM7R7JUX.js";
|
|
12
12
|
import "./chunk-4QZ7KD2Y.js";
|
|
13
13
|
import "./chunk-ORAY4KMA.js";
|
|
14
14
|
import "./chunk-K4RAUZSD.js";
|
|
@@ -81,8 +81,12 @@ function summarizePortalCustomization(org) {
|
|
|
81
81
|
function summarizeTrademarks(org) {
|
|
82
82
|
const count = org.trademarkRegistrations.length;
|
|
83
83
|
if (count === 0) return "none";
|
|
84
|
+
const activeCount = org.trademarkRegistrations.filter(
|
|
85
|
+
(tm) => tm.status === "ACTIVE"
|
|
86
|
+
).length;
|
|
84
87
|
const labels = org.trademarkRegistrations.slice(0, 3).map((tm) => `${tm.brandName} (${tm.trademarkOffice} #${tm.registrationNumber})`);
|
|
85
|
-
|
|
88
|
+
const onFile = `${count} on file (${activeCount} active)`;
|
|
89
|
+
return count > labels.length ? `${onFile} \u2014 ${labels.join(", ")}, +${count - labels.length} more` : `${onFile} \u2014 ${labels.join(", ")}`;
|
|
86
90
|
}
|
|
87
91
|
async function runOrgsGet(options) {
|
|
88
92
|
const slug = options.slug?.trim();
|
|
@@ -118,7 +122,7 @@ async function runOrgsGet(options) {
|
|
|
118
122
|
organization.legalDocuments.powerOfAttorney.fileUrl ? ` - POA: ${organization.legalDocuments.powerOfAttorney.fileUrl}` : "",
|
|
119
123
|
`- Trademarks: ${summarizeTrademarks(organization)}`,
|
|
120
124
|
...organization.trademarkRegistrations.map(
|
|
121
|
-
(tm) => ` - #${tm.id} ${tm.brandName} \u2014 ${tm.trademarkOffice} #${tm.registrationNumber}` + (tm.registrationPageUrl ? ` \u2014 page: ${tm.registrationPageUrl}` : "") + (tm.certificateFileUrl ? ` \u2014 certificate: ${tm.certificateFileUrl}` : "")
|
|
125
|
+
(tm) => ` - #${tm.id} ${tm.brandName} [${tm.status}] \u2014 ${tm.trademarkOffice} #${tm.registrationNumber}` + (tm.registrationPageUrl ? ` \u2014 page: ${tm.registrationPageUrl}` : "") + (tm.certificateFileUrl ? ` \u2014 certificate: ${tm.certificateFileUrl}` : "")
|
|
122
126
|
)
|
|
123
127
|
].filter((line) => line !== "").join("\n"),
|
|
124
128
|
csv: toCsvRows([
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-VFT3TD3E.js";
|
|
9
9
|
import {
|
|
10
10
|
createApiClient
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-LM7R7JUX.js";
|
|
12
12
|
import "./chunk-4QZ7KD2Y.js";
|
|
13
13
|
import "./chunk-ORAY4KMA.js";
|
|
14
14
|
import "./chunk-K4RAUZSD.js";
|
|
@@ -19,9 +19,13 @@ function toRow(threat) {
|
|
|
19
19
|
id: threat.id,
|
|
20
20
|
content: threat.content,
|
|
21
21
|
type: threat.type,
|
|
22
|
-
blockedAt: threat.blockedAt
|
|
22
|
+
blockedAt: threat.blockedAt,
|
|
23
|
+
pendingStatus: threat.pendingStatus ?? ""
|
|
23
24
|
};
|
|
24
25
|
}
|
|
26
|
+
function pendingSuffix(row) {
|
|
27
|
+
return row.pendingStatus === "BLOCKED" ? " (pending: protection not active)" : "";
|
|
28
|
+
}
|
|
25
29
|
async function runThreatsList(options) {
|
|
26
30
|
const outputFormat = options.outputFormat ?? (options.json ? "json" : "human");
|
|
27
31
|
const perPage = options.perPage;
|
|
@@ -51,7 +55,8 @@ async function runThreatsList(options) {
|
|
|
51
55
|
}
|
|
52
56
|
] : void 0,
|
|
53
57
|
perPage,
|
|
54
|
-
nextPage: options.nextPage
|
|
58
|
+
nextPage: options.nextPage,
|
|
59
|
+
includePending: options.includePending || void 0
|
|
55
60
|
};
|
|
56
61
|
const result = await client.listThreats(input);
|
|
57
62
|
const rows = result.threats.map(toRow);
|
|
@@ -65,7 +70,7 @@ async function runThreatsList(options) {
|
|
|
65
70
|
`- Next page cursor: ${result.next_page ?? "none"}`,
|
|
66
71
|
"",
|
|
67
72
|
...rows.map(
|
|
68
|
-
(row) => `- #${row.id} (${row.type}) ${row.content} \u2014 blocked=${row.blockedAt}`
|
|
73
|
+
(row) => `- #${row.id} (${row.type}) ${row.content} \u2014 blocked=${row.blockedAt}${pendingSuffix(row)}`
|
|
69
74
|
)
|
|
70
75
|
].join("\n"),
|
|
71
76
|
csv: toCsvRows(rows),
|
|
@@ -76,7 +81,9 @@ async function runThreatsList(options) {
|
|
|
76
81
|
}
|
|
77
82
|
console.log(`Threats \u2014 returned ${result.threats.length}`);
|
|
78
83
|
for (const row of rows) {
|
|
79
|
-
console.log(
|
|
84
|
+
console.log(
|
|
85
|
+
`#${row.id} (${row.type}) ${row.content} \u2014 blocked=${row.blockedAt}${pendingSuffix(row)}`
|
|
86
|
+
);
|
|
80
87
|
}
|
|
81
88
|
if (result.next_page) {
|
|
82
89
|
console.log(`Next page cursor: ${result.next_page}`);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PRESETS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EZGE4YJG.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-LM7R7JUX.js";
|
|
10
10
|
import "./chunk-4QZ7KD2Y.js";
|
|
11
11
|
import "./chunk-TFCNKBRC.js";
|
|
12
12
|
import "./chunk-ORAY4KMA.js";
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CliExitError,
|
|
3
|
+
ExitCode
|
|
4
|
+
} from "./chunk-E2LAMILJ.js";
|
|
5
|
+
import {
|
|
6
|
+
printOutput,
|
|
7
|
+
toCsvRows
|
|
8
|
+
} from "./chunk-VFT3TD3E.js";
|
|
9
|
+
import {
|
|
10
|
+
createApiClient
|
|
11
|
+
} from "./chunk-LM7R7JUX.js";
|
|
12
|
+
import "./chunk-4QZ7KD2Y.js";
|
|
13
|
+
import "./chunk-ORAY4KMA.js";
|
|
14
|
+
import "./chunk-K4RAUZSD.js";
|
|
15
|
+
|
|
16
|
+
// src/commands/orgs/watchlist/list.ts
|
|
17
|
+
function toRow(item) {
|
|
18
|
+
return {
|
|
19
|
+
id: item.id,
|
|
20
|
+
content: item.content,
|
|
21
|
+
type: item.type,
|
|
22
|
+
status: item.status,
|
|
23
|
+
pendingStatus: item.pendingStatus ?? "",
|
|
24
|
+
livenessStatus: item.livenessStatus,
|
|
25
|
+
reason: item.reason ?? "",
|
|
26
|
+
watchlistedAt: item.watchlistedAt ?? "",
|
|
27
|
+
firstReportedAt: item.firstReportedAt,
|
|
28
|
+
lastScanAt: item.lastScanAt ?? ""
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
async function runOrgsWatchlistList(options) {
|
|
32
|
+
const outputFormat = options.outputFormat ?? (options.json ? "json" : "human");
|
|
33
|
+
const perPage = options.perPage;
|
|
34
|
+
if (perPage !== void 0 && (perPage < 1 || perPage > 1e3)) {
|
|
35
|
+
throw new CliExitError(
|
|
36
|
+
"orgs watchlist list requires --per-page between 1 and 1000.",
|
|
37
|
+
ExitCode.USAGE
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
const client = options.apiClient ?? createApiClient();
|
|
41
|
+
const input = {
|
|
42
|
+
slug: options.slug,
|
|
43
|
+
assetType: options.assetType ? options.assetType.toUpperCase() : void 0,
|
|
44
|
+
query: options.query,
|
|
45
|
+
reportedSince: options.from,
|
|
46
|
+
reportedUntil: options.to,
|
|
47
|
+
includeTotal: options.includeTotal || void 0,
|
|
48
|
+
perPage,
|
|
49
|
+
nextPage: options.nextPage
|
|
50
|
+
};
|
|
51
|
+
const result = await client.listOrganizationWatchlist(input);
|
|
52
|
+
const rows = result.watchlist.map(toRow);
|
|
53
|
+
const describe = (row) => `#${row.id} ${row.content} (${row.type}) ${row.livenessStatus} reason=${row.reason || "-"} watchlisted=${row.watchlistedAt || "-"} lastScan=${row.lastScanAt || "-"}`;
|
|
54
|
+
printOutput({
|
|
55
|
+
outputFormat,
|
|
56
|
+
json: result,
|
|
57
|
+
markdown: [
|
|
58
|
+
"# Organization watchlist",
|
|
59
|
+
"",
|
|
60
|
+
`- Returned: ${result.watchlist.length}`,
|
|
61
|
+
...result.total !== void 0 ? [`- Total watchlisted: ${result.total}`] : [],
|
|
62
|
+
`- Next page cursor: ${result.next_page ?? "none"}`,
|
|
63
|
+
"",
|
|
64
|
+
...rows.map((row) => `- ${describe(row)}`)
|
|
65
|
+
].join("\n"),
|
|
66
|
+
csv: toCsvRows(rows),
|
|
67
|
+
human: () => {
|
|
68
|
+
if (result.total !== void 0) {
|
|
69
|
+
console.log(`Total watchlisted: ${result.total}`);
|
|
70
|
+
}
|
|
71
|
+
if (result.watchlist.length === 0) {
|
|
72
|
+
console.log("No watchlisted assets found.");
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
console.log(`Organization watchlist \u2014 returned ${result.watchlist.length}`);
|
|
76
|
+
for (const row of rows) {
|
|
77
|
+
console.log(describe(row));
|
|
78
|
+
}
|
|
79
|
+
if (result.next_page) {
|
|
80
|
+
console.log(`Next page cursor: ${result.next_page}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
export {
|
|
86
|
+
runOrgsWatchlistList
|
|
87
|
+
};
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-VFT3TD3E.js";
|
|
5
5
|
import {
|
|
6
6
|
createApiClient
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-LM7R7JUX.js";
|
|
8
8
|
import "./chunk-4QZ7KD2Y.js";
|
|
9
9
|
import "./chunk-ORAY4KMA.js";
|
|
10
10
|
import "./chunk-K4RAUZSD.js";
|
|
@@ -38,7 +38,10 @@ function toRow(brand) {
|
|
|
38
38
|
powerOfAttorneyPresent: brand.legalDocuments.powerOfAttorney.present,
|
|
39
39
|
powerOfAttorneyFileUrl: brand.legalDocuments.powerOfAttorney.fileUrl ?? "",
|
|
40
40
|
trademarkRegistrationCount: brand.trademarkRegistrations.length,
|
|
41
|
-
trademarkBrandNames: brand.trademarkRegistrations.map((tm) => tm.brandName).join("|")
|
|
41
|
+
trademarkBrandNames: brand.trademarkRegistrations.map((tm) => tm.brandName).join("|"),
|
|
42
|
+
trademarkActiveCount: brand.trademarkRegistrations.filter(
|
|
43
|
+
(tm) => tm.status === "ACTIVE"
|
|
44
|
+
).length
|
|
42
45
|
};
|
|
43
46
|
}
|
|
44
47
|
async function runBrandsList(options) {
|
|
@@ -82,7 +85,7 @@ async function runBrandsList(options) {
|
|
|
82
85
|
if (tm.certificateFileUrl) extras.push(`certificate: ${tm.certificateFileUrl}`);
|
|
83
86
|
const extraStr = extras.length > 0 ? ` \u2014 ${extras.join(", ")}` : "";
|
|
84
87
|
lines.push(
|
|
85
|
-
` - trademark #${tm.id} ${tm.brandName} \u2014 ${tm.trademarkOffice} #${tm.registrationNumber}${extraStr}`
|
|
88
|
+
` - trademark #${tm.id} ${tm.brandName} [${tm.status}] \u2014 ${tm.trademarkOffice} #${tm.registrationNumber}${extraStr}`
|
|
86
89
|
);
|
|
87
90
|
}
|
|
88
91
|
return lines;
|
|
@@ -7,12 +7,13 @@ import {
|
|
|
7
7
|
toCsvRows
|
|
8
8
|
} from "./chunk-VFT3TD3E.js";
|
|
9
9
|
import {
|
|
10
|
+
DETECTION_BLOCK_STATUS_FILTERS,
|
|
10
11
|
DETECTION_CONFIDENCE_LEVELS,
|
|
11
12
|
DETECTION_REPORTED_FILTERS,
|
|
12
13
|
LIVENESS_FILTER_VALUES,
|
|
13
14
|
WATCHLIST_FILTER_VALUES,
|
|
14
15
|
createApiClient
|
|
15
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-LM7R7JUX.js";
|
|
16
17
|
import "./chunk-4QZ7KD2Y.js";
|
|
17
18
|
import "./chunk-ORAY4KMA.js";
|
|
18
19
|
import "./chunk-K4RAUZSD.js";
|
|
@@ -22,6 +23,17 @@ var CONFIDENCE_SET = new Set(DETECTION_CONFIDENCE_LEVELS);
|
|
|
22
23
|
var REPORTED_SET = new Set(DETECTION_REPORTED_FILTERS);
|
|
23
24
|
var LIVENESS_SET = new Set(LIVENESS_FILTER_VALUES);
|
|
24
25
|
var WATCHLIST_SET = new Set(WATCHLIST_FILTER_VALUES);
|
|
26
|
+
var BLOCK_STATUS_SET = new Set(DETECTION_BLOCK_STATUS_FILTERS);
|
|
27
|
+
function validateScore(value, flagName) {
|
|
28
|
+
if (value === void 0) return void 0;
|
|
29
|
+
if (!Number.isFinite(value) || value < 0 || value > 1) {
|
|
30
|
+
throw new CliExitError(
|
|
31
|
+
`--${flagName} must be a raw score between 0 and 1 (e.g. 0.8), got ${value}.`,
|
|
32
|
+
ExitCode.USAGE
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
25
37
|
function validateEnumList(values, validSet, flagName, transform = (v) => v) {
|
|
26
38
|
if (!values || values.length === 0) return void 0;
|
|
27
39
|
const normalized = values.map(transform);
|
|
@@ -41,14 +53,19 @@ function toRow(detection) {
|
|
|
41
53
|
id: detection.id,
|
|
42
54
|
source: detection.source,
|
|
43
55
|
confidence: detection.confidence,
|
|
56
|
+
score: detection.score,
|
|
44
57
|
reportStatus: detection.reportStatus,
|
|
45
58
|
threatContent: detection.threatContent,
|
|
46
59
|
assetContent: detection.asset.content,
|
|
47
60
|
assetType: detection.asset.type,
|
|
48
61
|
assetStatus: detection.asset.status,
|
|
62
|
+
assetPendingStatus: detection.asset.pendingStatus ?? "",
|
|
49
63
|
createdAt: detection.createdAt
|
|
50
64
|
};
|
|
51
65
|
}
|
|
66
|
+
function displayStatus(row) {
|
|
67
|
+
return row.assetPendingStatus === "BLOCKED" ? "PENDING_BLOCKED" : row.assetStatus;
|
|
68
|
+
}
|
|
52
69
|
async function runDetectionsList(options) {
|
|
53
70
|
const outputFormat = options.outputFormat ?? (options.json ? "json" : "human");
|
|
54
71
|
const limit = options.limit;
|
|
@@ -82,6 +99,20 @@ async function runDetectionsList(options) {
|
|
|
82
99
|
"watchlist",
|
|
83
100
|
(v) => v.toUpperCase()
|
|
84
101
|
);
|
|
102
|
+
const blockStatus = validateEnumList(
|
|
103
|
+
options.blockStatus,
|
|
104
|
+
BLOCK_STATUS_SET,
|
|
105
|
+
"block-status",
|
|
106
|
+
(v) => v.toLowerCase()
|
|
107
|
+
);
|
|
108
|
+
const minScore = validateScore(options.minScore, "min-score");
|
|
109
|
+
const maxScore = validateScore(options.maxScore, "max-score");
|
|
110
|
+
if (minScore !== void 0 && maxScore !== void 0 && minScore > maxScore) {
|
|
111
|
+
throw new CliExitError(
|
|
112
|
+
"--min-score must not be greater than --max-score.",
|
|
113
|
+
ExitCode.USAGE
|
|
114
|
+
);
|
|
115
|
+
}
|
|
85
116
|
const countryCodes = options.countryCodes?.length ? options.countryCodes.map((code) => code.toUpperCase()) : void 0;
|
|
86
117
|
if (countryCodes?.some((code) => code.length !== 2)) {
|
|
87
118
|
throw new CliExitError(
|
|
@@ -106,7 +137,11 @@ async function runDetectionsList(options) {
|
|
|
106
137
|
watchlist,
|
|
107
138
|
reported,
|
|
108
139
|
countryCodes,
|
|
109
|
-
onlyDeleted: options.onlyDeleted
|
|
140
|
+
onlyDeleted: options.onlyDeleted,
|
|
141
|
+
blockStatus,
|
|
142
|
+
minScore,
|
|
143
|
+
maxScore,
|
|
144
|
+
includeTotal: options.includeTotal || void 0
|
|
110
145
|
};
|
|
111
146
|
const result = await client.listDetections(input);
|
|
112
147
|
const rows = result.detections.map(toRow);
|
|
@@ -117,14 +152,18 @@ async function runDetectionsList(options) {
|
|
|
117
152
|
`# Detections (${options.org})`,
|
|
118
153
|
"",
|
|
119
154
|
`- Returned: ${result.detections.length}`,
|
|
155
|
+
...result.total !== void 0 ? [`- Total matching: ${result.total}`] : [],
|
|
120
156
|
`- Next cursor: ${result.nextCursor ?? "none"}`,
|
|
121
157
|
"",
|
|
122
158
|
...rows.map(
|
|
123
|
-
(row) => `- #${row.id} [${row.confidence}] ${row.source} \u2192 ${row.assetContent} (${row.assetType}) ${row
|
|
159
|
+
(row) => `- #${row.id} [${row.confidence} ${row.score}] ${row.source} \u2192 ${row.assetContent} (${row.assetType}) ${displayStatus(row)} reported=${row.reportStatus} created=${row.createdAt}`
|
|
124
160
|
)
|
|
125
161
|
].join("\n"),
|
|
126
162
|
csv: toCsvRows(rows),
|
|
127
163
|
human: () => {
|
|
164
|
+
if (result.total !== void 0) {
|
|
165
|
+
console.log(`Total matching: ${result.total}`);
|
|
166
|
+
}
|
|
128
167
|
if (result.detections.length === 0) {
|
|
129
168
|
console.log("No detections found.");
|
|
130
169
|
return;
|
|
@@ -132,7 +171,7 @@ async function runDetectionsList(options) {
|
|
|
132
171
|
console.log(`Detections for ${options.org} \u2014 returned ${result.detections.length}`);
|
|
133
172
|
for (const row of rows) {
|
|
134
173
|
console.log(
|
|
135
|
-
`#${row.id} [${row.confidence}] ${row.source} \u2192 ${row.assetContent} (${row.assetType}/${row
|
|
174
|
+
`#${row.id} [${row.confidence} ${row.score}] ${row.source} \u2192 ${row.assetContent} (${row.assetType}/${displayStatus(row)}) ${row.reportStatus} ${row.createdAt}`
|
|
136
175
|
);
|
|
137
176
|
}
|
|
138
177
|
if (result.nextCursor !== void 0) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getPresetDefinition,
|
|
3
3
|
runPreset
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-EZGE4YJG.js";
|
|
5
5
|
import {
|
|
6
6
|
CliExitError,
|
|
7
7
|
ExitCode
|
|
8
8
|
} from "./chunk-E2LAMILJ.js";
|
|
9
9
|
import "./chunk-VFT3TD3E.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-LM7R7JUX.js";
|
|
11
11
|
import "./chunk-4QZ7KD2Y.js";
|
|
12
12
|
import "./chunk-TFCNKBRC.js";
|
|
13
13
|
import "./chunk-ORAY4KMA.js";
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@chainpatrol/cli",
|
|
3
3
|
"description": "The official ChainPatrol CLI — terminal interface for threat detection",
|
|
4
4
|
"author": "Umar Ahmed <umar@chainpatrol.io>",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.15.0",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"homepage": "https://chainpatrol.com/docs/cli",
|
|
8
8
|
"keywords": [
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"lint": "npx oxlint ."
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@chainpatrol/mcp": "1.
|
|
37
|
-
"@chainpatrol/sdk": "1.
|
|
36
|
+
"@chainpatrol/mcp": "1.13.0",
|
|
37
|
+
"@chainpatrol/sdk": "1.14.0",
|
|
38
38
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
39
39
|
"ink": "^7.0.1",
|
|
40
40
|
"meow": "^14.1.0",
|