@chainpatrol/cli 1.5.0 → 1.7.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 +69 -0
- package/README.md +6 -1
- package/dist/{breakdown-5DJMXRK4.js → breakdown-2HAZ2MX5.js} +1 -1
- package/dist/{check-5P3EXVSN.js → check-5LJI7N5I.js} +1 -1
- package/dist/{chunk-OFUIYMPD.js → chunk-322AVMUH.js} +4 -0
- package/dist/{chunk-6VTWWGNV.js → chunk-7BZUQSRO.js} +12 -1
- package/dist/{chunk-PEX2A3IL.js → chunk-FPCN4SNK.js} +1 -1
- package/dist/{chunk-MM5OAY2U.js → chunk-YMO4QK6Q.js} +1 -1
- package/dist/cli.js +153 -44
- package/dist/{completions-ILC76OX5.js → completions-3ESPMO65.js} +1 -1
- package/dist/{configs-update-TAYT4JTU.js → configs-update-N7ZIWWKQ.js} +1 -1
- package/dist/{create-UXRULUR7.js → create-4ZJ7DXHX.js} +1 -1
- package/dist/{drift-TCZELVHO.js → drift-BGWNH6QE.js} +1 -1
- package/dist/{found-NCP6H2SD.js → found-QOARB5G2.js} +1 -1
- package/dist/{get-SM5KGJVA.js → get-ON5JOCV7.js} +1 -1
- package/dist/{healthcheck-5YEZCTXC.js → healthcheck-34LQTSVZ.js} +1 -1
- package/dist/{list-MPSB2DYU.js → list-5TKOWBC4.js} +2 -1
- package/dist/{list-2RHEVI2T.js → list-6CAKS43I.js} +1 -1
- package/dist/{list-WQBXC3QS.js → list-AG6LWNMN.js} +1 -1
- package/dist/{list-W6JZUNS2.js → list-DJFIKDY6.js} +1 -1
- package/dist/{list-4YBWU2JZ.js → list-IVFZGLKN.js} +1 -1
- package/dist/{list-23C72EH4.js → list-JG5ARDTR.js} +2 -2
- package/dist/{list-BAPTZNTM.js → list-MHOHKFXT.js} +1 -1
- package/dist/{list-TA4HYD66.js → list-PAJBOVN2.js} +1 -1
- package/dist/{list-QLMFMYU6.js → list-SJFJT4V3.js} +1 -1
- package/dist/{list-SCA73PLA.js → list-UPY6PHY4.js} +1 -1
- package/dist/{list-GEJQ6N2Y.js → list-UXYGISAK.js} +1 -1
- package/dist/{list-QJYRXPXM.js → list-W6CF25ZS.js} +1 -1
- package/dist/{list-json-NJ5IFRDE.js → list-json-ZR3XOQPJ.js} +1 -1
- package/dist/{organization-N6RMWKJM.js → organization-YAID36GZ.js} +1 -1
- package/dist/review-7A7WV73T.js +270 -0
- package/dist/{run-RRG7D4SN.js → run-AIYPHWFJ.js} +1 -1
- package/dist/{run-KOZXEYTL.js → run-LZZOV4HG.js} +1 -1
- package/dist/{run-TUADYLU7.js → run-YP4O5VXZ.js} +2 -2
- package/dist/{search-Y37B2JVP.js → search-IWS42COG.js} +2 -2
- package/dist/{search-M6EKPO4D.js → search-OGGKNPUJ.js} +1 -1
- package/dist/{setup-skill-RRTDEOR4.js → setup-skill-LP5Z3Z5T.js} +2 -2
- package/dist/{snapshot-RFGSAHO7.js → snapshot-TLSOPK7C.js} +1 -1
- package/dist/{summary-XCN3DRYP.js → summary-XA3PVJIW.js} +1 -1
- package/dist/takedown-time-ARGVSPL6.js +87 -0
- package/dist/{validate-OYTNB2ZM.js → validate-WB5367QN.js} +1 -1
- package/dist/{whoami-5WCW3FOZ.js → whoami-YE3V6I65.js} +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,74 @@
|
|
|
1
1
|
# @chainpatrol/cli
|
|
2
2
|
|
|
3
|
+
## 1.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9f19c88: Adds time-to-takedown metrics: `client.getMetricsTakedownTime()` in the SDK and
|
|
8
|
+
`chainpatrol metrics takedown-time --org <slug>` in the CLI, both backed by the
|
|
9
|
+
new `POST /metrics/takedown-time` endpoint. Returns the median time from
|
|
10
|
+
takedown start to completion per asset type, over an optional date range.
|
|
11
|
+
|
|
12
|
+
Also adds `parseIsoDateEndOfDay` to `@chainpatrol/sdk/api`: a date-only bound
|
|
13
|
+
such as `2026-08-18` now covers that whole day instead of cutting off at
|
|
14
|
+
midnight UTC. Server-side work lives in @chainpatrol/external-trpc and
|
|
15
|
+
@chainpatrol/validation; both are private packages and don't need version bumps.
|
|
16
|
+
|
|
17
|
+
- b037a0b: `GET /organization/assets` now accepts an optional `slug`, so callers whose
|
|
18
|
+
credentials reach more than one organization (user-scoped API keys, staff and
|
|
19
|
+
member sessions) can pick one instead of getting a flat 401. Organization-scoped
|
|
20
|
+
keys keep working unchanged when they omit it.
|
|
21
|
+
|
|
22
|
+
In the SDK, `client.listOrganizationAssets()` takes a `slug`. In the CLI,
|
|
23
|
+
`chainpatrol orgs assets list` forwards `--org <slug>` when one is set — the
|
|
24
|
+
existing no-flag invocation still resolves the org from an org-scoped key.
|
|
25
|
+
|
|
26
|
+
Server-side work lives in @chainpatrol/external-trpc and @chainpatrol/validation;
|
|
27
|
+
both are private packages and don't need version bumps.
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- 0e5f156: Fix the install command in the CLI README. The unscoped `chainpatrol` package on npm is a
|
|
32
|
+
placeholder that points at `@chainpatrol/sdk`, so `npm install -g chainpatrol` never
|
|
33
|
+
installed the CLI — the published package is `@chainpatrol/cli`. Also link the README to
|
|
34
|
+
the new CLI documentation at https://chainpatrol.com/docs/cli.
|
|
35
|
+
- Updated dependencies [f98f547]
|
|
36
|
+
- Updated dependencies [9f19c88]
|
|
37
|
+
- Updated dependencies [b037a0b]
|
|
38
|
+
- @chainpatrol/sdk@1.7.0
|
|
39
|
+
|
|
40
|
+
## 1.6.0
|
|
41
|
+
|
|
42
|
+
### Minor Changes
|
|
43
|
+
|
|
44
|
+
- 9b15056: Adds `chainpatrol proposals review` for actioning proposals from the terminal.
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
chainpatrol proposals review 4321 --asset-id 987 --decision approve --label "General Phishing"
|
|
48
|
+
chainpatrol proposals review 4321 --asset-id 987 --decision reject --reject-reason irrelevant
|
|
49
|
+
chainpatrol proposals review 4321 --asset-id 987 --decision watchlist --watchlist-reason DEAD
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Take both IDs from `proposals[].id` and `proposals[].asset.id` in
|
|
53
|
+
`reports list --needs-customer-review --json`. `--asset-id` is required and must
|
|
54
|
+
match the proposal's current asset.
|
|
55
|
+
|
|
56
|
+
A review cannot be undone, so the command prints the decision it is about to
|
|
57
|
+
submit and waits for `yes`. `--yes` skips the prompt and is required with
|
|
58
|
+
`--json`, `--no-input`, or a non-TTY stdin. `--dry-run` prints the payload and
|
|
59
|
+
submits nothing.
|
|
60
|
+
|
|
61
|
+
`--label` is required when approving, plus `--brand-id` for the labels that name
|
|
62
|
+
an impersonation target; `--reject-reason` when rejecting; `--watchlist-reason`
|
|
63
|
+
when watchlisting; and `--note` when that reason is `OTHER`. Decisions and
|
|
64
|
+
reasons are case-insensitive.
|
|
65
|
+
|
|
66
|
+
### Patch Changes
|
|
67
|
+
|
|
68
|
+
- Updated dependencies [a253313]
|
|
69
|
+
- Updated dependencies [108f9f8]
|
|
70
|
+
- @chainpatrol/sdk@1.6.0
|
|
71
|
+
|
|
3
72
|
## 1.5.0
|
|
4
73
|
|
|
5
74
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -2,12 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Terminal interface for ChainPatrol threat detection.
|
|
4
4
|
|
|
5
|
+
Full documentation: https://chainpatrol.com/docs/cli
|
|
6
|
+
|
|
5
7
|
## Installation
|
|
6
8
|
|
|
7
9
|
```bash
|
|
8
|
-
npm install -g chainpatrol
|
|
10
|
+
npm install -g @chainpatrol/cli
|
|
9
11
|
```
|
|
10
12
|
|
|
13
|
+
The unscoped `chainpatrol` package on npm is a placeholder that points at
|
|
14
|
+
`@chainpatrol/sdk` — it does not contain the CLI.
|
|
15
|
+
|
|
11
16
|
## Usage
|
|
12
17
|
|
|
13
18
|
```bash
|
|
@@ -26,6 +26,8 @@ import {
|
|
|
26
26
|
LIVENESS_FILTER_VALUES,
|
|
27
27
|
LIVENESS_STATUSES,
|
|
28
28
|
ORGANIZATION_METRICS_INCLUDE_FIELDS,
|
|
29
|
+
PROPOSAL_REJECT_REASONS,
|
|
30
|
+
PROPOSAL_WATCHLIST_REASONS,
|
|
29
31
|
REPORT_REVIEW_DECISIONS,
|
|
30
32
|
REPORT_STATUSES,
|
|
31
33
|
TAKEDOWN_SORT_KEYS,
|
|
@@ -56,6 +58,8 @@ export {
|
|
|
56
58
|
LIVENESS_FILTER_VALUES,
|
|
57
59
|
LIVENESS_STATUSES,
|
|
58
60
|
ORGANIZATION_METRICS_INCLUDE_FIELDS,
|
|
61
|
+
PROPOSAL_REJECT_REASONS,
|
|
62
|
+
PROPOSAL_WATCHLIST_REASONS,
|
|
59
63
|
REPORT_REVIEW_DECISIONS,
|
|
60
64
|
REPORT_STATUSES,
|
|
61
65
|
TAKEDOWN_SORT_KEYS,
|
|
@@ -22,6 +22,7 @@ _chainpatrol() {
|
|
|
22
22
|
'detections:Validate, run, list, update detection configs and results'
|
|
23
23
|
'metrics:Query organization metrics'
|
|
24
24
|
'reports:Create, list, search reports from terminal'
|
|
25
|
+
'proposals:Review proposals waiting on your organization'
|
|
25
26
|
'queues:Snapshot operations queues'
|
|
26
27
|
'takedowns:List individual takedown records'
|
|
27
28
|
'threats:List confirmed threats blocked by ChainPatrol'
|
|
@@ -93,6 +94,7 @@ _chainpatrol() {
|
|
|
93
94
|
'summary:Show metrics summary'
|
|
94
95
|
'found:Show found threats count'
|
|
95
96
|
'breakdown:Show metrics breakdown'
|
|
97
|
+
'takedown-time:Show median time to takedown by asset type'
|
|
96
98
|
'organization:Get organization metrics (official endpoint)'
|
|
97
99
|
)
|
|
98
100
|
_describe 'subcommand' metrics_subcommands
|
|
@@ -106,6 +108,11 @@ _chainpatrol() {
|
|
|
106
108
|
)
|
|
107
109
|
_describe 'subcommand' reports_subcommands
|
|
108
110
|
;;
|
|
111
|
+
proposals)
|
|
112
|
+
local -a proposals_subcommands
|
|
113
|
+
proposals_subcommands=('review:Approve, reject, or watchlist a proposal')
|
|
114
|
+
_describe 'subcommand' proposals_subcommands
|
|
115
|
+
;;
|
|
109
116
|
queues)
|
|
110
117
|
local -a queues_subcommands
|
|
111
118
|
queues_subcommands=('snapshot:Show queue snapshot')
|
|
@@ -154,7 +161,7 @@ var BASH_COMPLETION = `_chainpatrol() {
|
|
|
154
161
|
COMPREPLY=()
|
|
155
162
|
cur="\${COMP_WORDS[COMP_CWORD]}"
|
|
156
163
|
prev="\${COMP_WORDS[COMP_CWORD-1]}"
|
|
157
|
-
commands="login logout whoami asset configs detections metrics reports queues takedowns threats orgs presets setup uninstall completions help"
|
|
164
|
+
commands="login logout whoami asset configs detections metrics reports proposals queues takedowns threats orgs presets setup uninstall completions help"
|
|
158
165
|
|
|
159
166
|
case "\${prev}" in
|
|
160
167
|
chainpatrol)
|
|
@@ -181,6 +188,10 @@ var BASH_COMPLETION = `_chainpatrol() {
|
|
|
181
188
|
COMPREPLY=( $(compgen -W "create list search" -- "\${cur}") )
|
|
182
189
|
return 0
|
|
183
190
|
;;
|
|
191
|
+
proposals)
|
|
192
|
+
COMPREPLY=( $(compgen -W "review" -- "\${cur}") )
|
|
193
|
+
return 0
|
|
194
|
+
;;
|
|
184
195
|
queues)
|
|
185
196
|
COMPREPLY=( $(compgen -W "snapshot" -- "\${cur}") )
|
|
186
197
|
return 0
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
installCompletions,
|
|
3
3
|
uninstallCompletions
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7BZUQSRO.js";
|
|
5
5
|
|
|
6
6
|
// src/commands/setup-skill.ts
|
|
7
7
|
import { mkdirSync as mkdirSync2, writeFileSync as writeFileSync2, existsSync as existsSync2, readFileSync as readFileSync3, rmSync } from "fs";
|