@chainpatrol/sdk 1.3.0 → 1.5.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 +73 -0
- package/dist/api/index.d.mts +69 -1
- package/dist/api/index.d.ts +69 -1
- package/dist/api/index.js +20 -9
- package/dist/api/index.js.map +1 -1
- package/dist/api/index.mjs +20 -10
- package/dist/api/index.mjs.map +1 -1
- package/dist/{chunk-S5BCAUOT.mjs → chunk-5HP2K5SM.mjs} +42 -3
- package/dist/chunk-5HP2K5SM.mjs.map +1 -0
- package/dist/index.js +54 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +54 -5
- package/dist/index.mjs.map +1 -1
- package/dist/skill/cli.js +40 -1
- package/dist/skill/cli.js.map +1 -1
- package/dist/skill/cli.mjs +1 -1
- package/dist/skill/index.js +40 -1
- package/dist/skill/index.js.map +1 -1
- package/dist/skill/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-S5BCAUOT.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,78 @@
|
|
|
1
1
|
# @chainpatrol/sdk
|
|
2
2
|
|
|
3
|
+
## 1.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 5427cd8: Fixes `needsCustomerReview` (`--needs-customer-review`) so it returns the same
|
|
8
|
+
queue the organization's Review page shows. It previously treated "Obligatory
|
|
9
|
+
Organization Admin Approval" as "waiting on the customer", which for an org with
|
|
10
|
+
that toggle on returned every report with a pending proposal — a proposal
|
|
11
|
+
ChainPatrol has not triaged yet is still waiting on our review, and reaches the
|
|
12
|
+
customer only once staff escalate it. Reports the organization submitted itself
|
|
13
|
+
are now included, matching the Review page, instead of being excluded.
|
|
14
|
+
|
|
15
|
+
The predicate now lives in one place (`customerReviewQueueSql` in the private
|
|
16
|
+
`@chainpatrol/core` package) shared with the Review page, the customer view of
|
|
17
|
+
the Reports page, and the staff review-queue counts, so the definitions can no
|
|
18
|
+
longer drift.
|
|
19
|
+
|
|
20
|
+
## 1.4.0
|
|
21
|
+
|
|
22
|
+
### Minor Changes
|
|
23
|
+
|
|
24
|
+
- ccd3811: Adds `reporterKind` and `reviewerKind` filters (`human` | `automation`) to organization report listing so callers can separate automation vs human report sources and approvals.
|
|
25
|
+
|
|
26
|
+
The previous `excludeAutomation` boolean remains supported as a deprecated alias for `reporterKind: "human"`. CLI adds `--reporter-kind` and `--reviewer-kind`.
|
|
27
|
+
|
|
28
|
+
Server-side work in `@chainpatrol/core`, `@chainpatrol/trpc`, and `@chainpatrol/external-trpc` backs the new filters; those packages are private and don't need version bumps.
|
|
29
|
+
|
|
30
|
+
- 9dd02cf: Third and final tranche of the API-surface expansion — the join-required
|
|
31
|
+
slices. All additive, no removed fields.
|
|
32
|
+
|
|
33
|
+
**Takedowns — provider names on `listTakedowns` and `getTakedown`.** Each
|
|
34
|
+
`TakedownItem` and the `getTakedown` `takedown` object now carries
|
|
35
|
+
`domainRegistrar`, `hostingProvider`, and `tldRegistrar` (each
|
|
36
|
+
`{ id, name } | null`) alongside the existing `assignee` / `brand`.
|
|
37
|
+
Answers "who hosts phish.example?" without a follow-up call and unblocks
|
|
38
|
+
"which takedowns are stuck at registrar X?" cross-org queries. Distinct
|
|
39
|
+
from the per-task `takedownProvider` — the trio here is the
|
|
40
|
+
takedown-level assignment for the domain itself, whereas the task-level
|
|
41
|
+
provider is the entity handling the current step.
|
|
42
|
+
|
|
43
|
+
**Detection Configs — `lastResultAt` aggregate on
|
|
44
|
+
`listDetectionConfigs`.** Each `ConfigEntry` now carries `lastResultAt`
|
|
45
|
+
(nullable ISO timestamp) — the `MAX(createdAt)` of `ThreatDetectionResult`
|
|
46
|
+
rows tied to that config. Surfaces the same silent-config signal the
|
|
47
|
+
drift healthcheck already computes internally. A config with a stale
|
|
48
|
+
`lastResultAt` is going silent regardless of what its `updatedAt` says.
|
|
49
|
+
|
|
50
|
+
Computed with a single `groupBy` on `ThreatDetectionResult` scoped to the
|
|
51
|
+
response's config IDs — one extra query per call, index-friendly via
|
|
52
|
+
`ThreatDetectionResult.@@index([configId])`.
|
|
53
|
+
|
|
54
|
+
Server-side work in `@chainpatrol/external-trpc` and
|
|
55
|
+
`@chainpatrol/validation` supports the new fields; both are private
|
|
56
|
+
packages and don't need version bumps.
|
|
57
|
+
|
|
58
|
+
- 725d32c: `listOrganizationReports` now calls `GET /organization/reports` instead of the deprecated `POST /public/getOrganizationReports`. Inputs, outputs, and the CLI's `reports list --org <slug>` behaviour are unchanged.
|
|
59
|
+
|
|
60
|
+
Server-side work in `@chainpatrol/external-trpc` makes the switch safe. `GET /organization/reports` now accepts an optional `slug`, authorized the same way the deprecated endpoint authorized it, so callers whose credentials cover more than one organization — user-scoped API keys, staff and member sessions, which is how `chainpatrol login` authenticates — can still choose an organization instead of having it derived from an org-scoped API key. It also fixes two query-string bugs that made the endpoint's filters unusable: `?<flag>=false` was read as `true`, and array filters passed once rather than repeated (`?brandIds=12`, `?assetTypes=URL`) were rejected with a validation error. `@chainpatrol/external-trpc` is private and does not need a version bump.
|
|
61
|
+
|
|
62
|
+
- 725d32c: Adds a `needsCustomerReview` filter to organization report listing so callers can pull just the reports an organization still has to approve. CLI adds `--needs-customer-review` / `--no-needs-customer-review` to `reports list`.
|
|
63
|
+
|
|
64
|
+
The filter resolves what "waiting on the customer" means per organization: with Obligatory Organization Admin Approval on, every report with a pending proposal whose asset type is in the approval scope (all asset types when the scope is not narrowed) plus anything escalated to the customer; with it off, only reports escalated to the customer. Reports the organization submitted itself are excluded.
|
|
65
|
+
|
|
66
|
+
Server-side work in `@chainpatrol/core` and `@chainpatrol/external-trpc` backs the new filter; those packages are private and don't need version bumps.
|
|
67
|
+
|
|
68
|
+
- e73955d: Fixes three problems with report search (`POST /reports/search`, `chainpatrol reports search`):
|
|
69
|
+
|
|
70
|
+
- **It did not work for logged-in CLI users.** The endpoint resolved the organization only from an organization-scoped API key, so anyone authenticated with the bearer token `chainpatrol login` issues got `API Organization not found. Invalid or missing API key.` It now accepts an optional `slug`, authorized the same way the rest of the API authorizes one, and the CLI passes the resolved organization.
|
|
71
|
+
- **Results were unbounded.** An asset content shared across many reports returned every one of them. Responses are now capped by a `limit` (default 50, max 100, newest first) and carry `totalCount` so callers can see when results were truncated. The CLI gains `--limit` and reports "Matched 3 of 41 report(s)".
|
|
72
|
+
- **The endpoint's purpose was unclear next to report listing.** Both endpoints' descriptions now state the question each answers and point at the other: search looks reports up by asset content in one batched call to avoid filing a duplicate; `GET /organization/reports` browses and filters an organization's reports with full records and pagination.
|
|
73
|
+
|
|
74
|
+
Server-side work in `@chainpatrol/external-trpc`, which is private and does not need a version bump.
|
|
75
|
+
|
|
3
76
|
## 1.3.0
|
|
4
77
|
|
|
5
78
|
### Minor Changes
|
package/dist/api/index.d.mts
CHANGED
|
@@ -39,6 +39,12 @@ interface ConfigEntry {
|
|
|
39
39
|
* healthcheck to spot silent configs untouched in months.
|
|
40
40
|
*/
|
|
41
41
|
updatedAt: string;
|
|
42
|
+
/**
|
|
43
|
+
* When the most recent `ThreatDetectionResult` for this config was created
|
|
44
|
+
* (ISO 8601, UTC). Null when the config has never produced a hit. A config
|
|
45
|
+
* with no recent `lastResultAt` is going silent regardless of `updatedAt`.
|
|
46
|
+
*/
|
|
47
|
+
lastResultAt: string | null;
|
|
42
48
|
}
|
|
43
49
|
interface DetectionSource {
|
|
44
50
|
source: string;
|
|
@@ -445,6 +451,8 @@ declare const REPORT_REVIEW_DECISIONS: readonly ["APPROVE", "REJECT", "SKIP", "E
|
|
|
445
451
|
type ReportReviewDecision = (typeof REPORT_REVIEW_DECISIONS)[number];
|
|
446
452
|
declare const REPORT_STATUSES: readonly ["TODO", "IN_PROGRESS", "CLOSED"];
|
|
447
453
|
type ReportStatus = (typeof REPORT_STATUSES)[number];
|
|
454
|
+
declare const ACTOR_KINDS: readonly ["human", "automation"];
|
|
455
|
+
type ActorKind = (typeof ACTOR_KINDS)[number];
|
|
448
456
|
interface OrganizationReportsListInput {
|
|
449
457
|
slug: string;
|
|
450
458
|
limit?: number;
|
|
@@ -453,7 +461,12 @@ interface OrganizationReportsListInput {
|
|
|
453
461
|
searchQuery?: string;
|
|
454
462
|
reporterQuery?: string;
|
|
455
463
|
reportedByCustomer?: boolean;
|
|
464
|
+
/** @deprecated Prefer `reporterKind: "human"`. */
|
|
456
465
|
excludeAutomation?: boolean;
|
|
466
|
+
/** Filter by whether the report was submitted by a human or automation. */
|
|
467
|
+
reporterKind?: ActorKind;
|
|
468
|
+
/** Filter by whether the report was approved by a human or automation. */
|
|
469
|
+
reviewerKind?: ActorKind;
|
|
457
470
|
onlyRejected?: boolean;
|
|
458
471
|
reviewStatuses?: ReportReviewDecision[];
|
|
459
472
|
assetTypes?: string[];
|
|
@@ -464,6 +477,24 @@ interface OrganizationReportsListInput {
|
|
|
464
477
|
endDate?: string;
|
|
465
478
|
updatedAtStartDate?: string;
|
|
466
479
|
updatedAtEndDate?: string;
|
|
480
|
+
/**
|
|
481
|
+
* Filter to reports waiting on the organization's own approval — the reports
|
|
482
|
+
* a customer admin still has to sign off on before the assets in them can be
|
|
483
|
+
* blocked. `true` returns only those reports; `false` returns only reports
|
|
484
|
+
* that are not waiting on them.
|
|
485
|
+
*
|
|
486
|
+
* This is the same queue the organization's Review page shows. A report counts
|
|
487
|
+
* when it has at least one pending proposal that is the organization's to
|
|
488
|
+
* action: one ChainPatrol staff escalated to them and they have not answered
|
|
489
|
+
* yet, or one on a report the organization submitted itself.
|
|
490
|
+
*
|
|
491
|
+
* "Obligatory Organization Admin Approval" does not widen the filter. That
|
|
492
|
+
* setting says an asset type will eventually need admin sign-off, not that
|
|
493
|
+
* every pending proposal is waiting on the admin right now — an untriaged
|
|
494
|
+
* proposal is still ChainPatrol's to review, and it reaches the organization
|
|
495
|
+
* only once staff escalate it.
|
|
496
|
+
*/
|
|
497
|
+
needsCustomerReview?: boolean;
|
|
467
498
|
}
|
|
468
499
|
interface OrganizationReportAssetScanEnrichment {
|
|
469
500
|
id: number;
|
|
@@ -733,7 +764,19 @@ interface OrganizationBrandsListResult {
|
|
|
733
764
|
}
|
|
734
765
|
interface ReportsSearchInput {
|
|
735
766
|
assetContents: string[];
|
|
767
|
+
/**
|
|
768
|
+
* Organization slug. Optional for organization-scoped API keys, which resolve
|
|
769
|
+
* the organization from the key itself. Required when your credentials can
|
|
770
|
+
* reach more than one organization — including the bearer token issued by
|
|
771
|
+
* `chainpatrol login`.
|
|
772
|
+
*/
|
|
773
|
+
slug?: string;
|
|
736
774
|
reportedByCustomer?: boolean;
|
|
775
|
+
/**
|
|
776
|
+
* Maximum number of reports to return, newest first. Defaults to 50, maximum
|
|
777
|
+
* 100. Compare with `totalCount` to tell whether results were truncated.
|
|
778
|
+
*/
|
|
779
|
+
limit?: number;
|
|
737
780
|
}
|
|
738
781
|
interface ReportsSearchResultItem {
|
|
739
782
|
id: number;
|
|
@@ -749,6 +792,11 @@ interface ReportsSearchResultItem {
|
|
|
749
792
|
}
|
|
750
793
|
interface ReportsSearchResult {
|
|
751
794
|
reports: ReportsSearchResultItem[];
|
|
795
|
+
/**
|
|
796
|
+
* Total number of reports matching the search, ignoring `limit`. Greater than
|
|
797
|
+
* `reports.length` means the results were truncated.
|
|
798
|
+
*/
|
|
799
|
+
totalCount: number;
|
|
752
800
|
}
|
|
753
801
|
interface UserMeResult {
|
|
754
802
|
user: {
|
|
@@ -838,6 +886,26 @@ interface TakedownItem {
|
|
|
838
886
|
name: string;
|
|
839
887
|
slug: string | null;
|
|
840
888
|
} | null;
|
|
889
|
+
/**
|
|
890
|
+
* Domain registrar assigned to this takedown (e.g. Namecheap, GoDaddy).
|
|
891
|
+
* Null when unresolved. Distinct from per-task `takedownProvider` — this
|
|
892
|
+
* is the takedown-level assignment for the domain itself.
|
|
893
|
+
*/
|
|
894
|
+
domainRegistrar: TakedownProviderRef | null;
|
|
895
|
+
/**
|
|
896
|
+
* Hosting provider assigned to this takedown (e.g. Cloudflare, AWS).
|
|
897
|
+
* Answers "who hosts this?" without a follow-up call. Null when unresolved.
|
|
898
|
+
*/
|
|
899
|
+
hostingProvider: TakedownProviderRef | null;
|
|
900
|
+
/**
|
|
901
|
+
* Top-level-domain registrar assigned to this takedown (e.g. Verisign).
|
|
902
|
+
* Null when unresolved.
|
|
903
|
+
*/
|
|
904
|
+
tldRegistrar: TakedownProviderRef | null;
|
|
905
|
+
}
|
|
906
|
+
interface TakedownProviderRef {
|
|
907
|
+
id: number;
|
|
908
|
+
name: string;
|
|
841
909
|
}
|
|
842
910
|
interface TakedownsListResult {
|
|
843
911
|
takedowns: TakedownItem[];
|
|
@@ -1195,4 +1263,4 @@ declare class ChainPatrolApiClient implements ApiClient {
|
|
|
1195
1263
|
declare function parseIsoDate(value: string | undefined): Date | undefined;
|
|
1196
1264
|
declare function parseIsoDateString(value: string | undefined): string | undefined;
|
|
1197
1265
|
|
|
1198
|
-
export { type ApiClient, type ApiCredential, type AssetCheckInput, type AssetCheckResult, type AssetCheckSourceEntry, type AssetCheckStatus, type AssetGroupItem, type AssetListInput, type AssetListItem, type AssetListResult, type AssetSearchInput, type AssetSearchResult, type AssetSearchResultItem, type BrandItem, type BrandLegalDocument, type BrandLegalDocuments, type BrandTrademarkRegistrationItem, type BrandType, ChainPatrolApiClient, type ChainPatrolApiClientOptions, type ConfigEntry, type CredentialProvider, DETECTION_CONFIDENCE_LEVELS, DETECTION_REPORTED_FILTERS, type DetectionBrand, type DetectionConfidence, type DetectionConfigRunInput, type DetectionConfigRunResult, type DetectionConfigUpdateInput, type DetectionConfigUpdateResult, type DetectionConfigValidateInput, type DetectionConfigValidateResult, type DetectionDriftInput, type DetectionDriftResult, type DetectionListInput, type DetectionListItem, type DetectionListResult, type DetectionReportStatus, type DetectionReportedFilter, type DetectionSource, type HealthcheckCategory, type HealthcheckFinding, type HealthcheckRegistryEntry, type HealthcheckResult, type HealthcheckSeverity, type HealthchecksListResult, LIVENESS_FILTER_VALUES, LIVENESS_STATUSES, type LivenessFilterValue, type LivenessStatus, type MetricsBreakdownInput, type MetricsBreakdownResult, type MetricsFoundInput, type MetricsFoundResult, type MetricsSummaryInput, type MetricsSummaryResult, ORGANIZATION_METRICS_INCLUDE_FIELDS, type OperationsQueuesSnapshotInput, type OperationsQueuesSnapshotResult, type OrganizationAssetGroupsListResult, type OrganizationAssetItem, type OrganizationAssetsListInput, type OrganizationAssetsListResult, type OrganizationBrandsListResult, type OrganizationMetricsIncludeField, type OrganizationMetricsInput, type OrganizationMetricsResult, type OrganizationMetricsResultMetrics, type OrganizationMetricsServicesFilter, type OrganizationMetricsVisibility, type OrganizationPortalVisibility, type OrganizationReportAssetScan, type OrganizationReportAssetScanEnrichment, type OrganizationReportAttachment, type OrganizationReportVisibility, type OrganizationReportsListInput, type OrganizationReportsListResult, type PendingApprovalService, type PendingServiceApproval, REPORT_REVIEW_DECISIONS, REPORT_STATUSES, type ReportAssetInput, type ReportCreateInput, type ReportCreateResult, type ReportReviewDecision, type ReportStatus, type ReportsSearchInput, type ReportsSearchResult, type ReportsSearchResultItem, TAKEDOWN_SORT_KEYS, TAKEDOWN_STATUSES, type TakedownItem, type TakedownSortKey, type TakedownStatus, type TakedownsListInput, type TakedownsListResult, type ThreatItem, type ThreatsListInput, type ThreatsListResult, type UserMeResult, type UserOrg, type UserOrgBrandMetadata, type UserOrgGetInput, type UserOrgGetResult, type UserOrgIntegrations, type UserOrgLegalDocument, type UserOrgLegalDocuments, type UserOrgPortalCustomization, type UserOrgTrademarkRegistration, type UserOrgsInput, type UserOrgsObligatoryAdminApprovalFilter, type UserOrgsPendingServiceApprovalFilter, type UserOrgsResult, type UserOrgsServiceFilters, type UserOrgsSubscriptionStatus, type ValidateApiKeyResult, WATCHLIST_FILTER_VALUES, type WatchlistFilterValue, parseIsoDate, parseIsoDateString, staticApiKey, staticBearerToken };
|
|
1266
|
+
export { ACTOR_KINDS, type ActorKind, type ApiClient, type ApiCredential, type AssetCheckInput, type AssetCheckResult, type AssetCheckSourceEntry, type AssetCheckStatus, type AssetGroupItem, type AssetListInput, type AssetListItem, type AssetListResult, type AssetSearchInput, type AssetSearchResult, type AssetSearchResultItem, type BrandItem, type BrandLegalDocument, type BrandLegalDocuments, type BrandTrademarkRegistrationItem, type BrandType, ChainPatrolApiClient, type ChainPatrolApiClientOptions, type ConfigEntry, type CredentialProvider, DETECTION_CONFIDENCE_LEVELS, DETECTION_REPORTED_FILTERS, type DetectionBrand, type DetectionConfidence, type DetectionConfigRunInput, type DetectionConfigRunResult, type DetectionConfigUpdateInput, type DetectionConfigUpdateResult, type DetectionConfigValidateInput, type DetectionConfigValidateResult, type DetectionDriftInput, type DetectionDriftResult, type DetectionListInput, type DetectionListItem, type DetectionListResult, type DetectionReportStatus, type DetectionReportedFilter, type DetectionSource, type HealthcheckCategory, type HealthcheckFinding, type HealthcheckRegistryEntry, type HealthcheckResult, type HealthcheckSeverity, type HealthchecksListResult, LIVENESS_FILTER_VALUES, LIVENESS_STATUSES, type LivenessFilterValue, type LivenessStatus, type MetricsBreakdownInput, type MetricsBreakdownResult, type MetricsFoundInput, type MetricsFoundResult, type MetricsSummaryInput, type MetricsSummaryResult, ORGANIZATION_METRICS_INCLUDE_FIELDS, type OperationsQueuesSnapshotInput, type OperationsQueuesSnapshotResult, type OrganizationAssetGroupsListResult, type OrganizationAssetItem, type OrganizationAssetsListInput, type OrganizationAssetsListResult, type OrganizationBrandsListResult, type OrganizationMetricsIncludeField, type OrganizationMetricsInput, type OrganizationMetricsResult, type OrganizationMetricsResultMetrics, type OrganizationMetricsServicesFilter, type OrganizationMetricsVisibility, type OrganizationPortalVisibility, type OrganizationReportAssetScan, type OrganizationReportAssetScanEnrichment, type OrganizationReportAttachment, type OrganizationReportVisibility, type OrganizationReportsListInput, type OrganizationReportsListResult, type PendingApprovalService, type PendingServiceApproval, REPORT_REVIEW_DECISIONS, REPORT_STATUSES, type ReportAssetInput, type ReportCreateInput, type ReportCreateResult, type ReportReviewDecision, type ReportStatus, type ReportsSearchInput, type ReportsSearchResult, type ReportsSearchResultItem, TAKEDOWN_SORT_KEYS, TAKEDOWN_STATUSES, type TakedownItem, type TakedownProviderRef, type TakedownSortKey, type TakedownStatus, type TakedownsListInput, type TakedownsListResult, type ThreatItem, type ThreatsListInput, type ThreatsListResult, type UserMeResult, type UserOrg, type UserOrgBrandMetadata, type UserOrgGetInput, type UserOrgGetResult, type UserOrgIntegrations, type UserOrgLegalDocument, type UserOrgLegalDocuments, type UserOrgPortalCustomization, type UserOrgTrademarkRegistration, type UserOrgsInput, type UserOrgsObligatoryAdminApprovalFilter, type UserOrgsPendingServiceApprovalFilter, type UserOrgsResult, type UserOrgsServiceFilters, type UserOrgsSubscriptionStatus, type ValidateApiKeyResult, WATCHLIST_FILTER_VALUES, type WatchlistFilterValue, parseIsoDate, parseIsoDateString, staticApiKey, staticBearerToken };
|
package/dist/api/index.d.ts
CHANGED
|
@@ -39,6 +39,12 @@ interface ConfigEntry {
|
|
|
39
39
|
* healthcheck to spot silent configs untouched in months.
|
|
40
40
|
*/
|
|
41
41
|
updatedAt: string;
|
|
42
|
+
/**
|
|
43
|
+
* When the most recent `ThreatDetectionResult` for this config was created
|
|
44
|
+
* (ISO 8601, UTC). Null when the config has never produced a hit. A config
|
|
45
|
+
* with no recent `lastResultAt` is going silent regardless of `updatedAt`.
|
|
46
|
+
*/
|
|
47
|
+
lastResultAt: string | null;
|
|
42
48
|
}
|
|
43
49
|
interface DetectionSource {
|
|
44
50
|
source: string;
|
|
@@ -445,6 +451,8 @@ declare const REPORT_REVIEW_DECISIONS: readonly ["APPROVE", "REJECT", "SKIP", "E
|
|
|
445
451
|
type ReportReviewDecision = (typeof REPORT_REVIEW_DECISIONS)[number];
|
|
446
452
|
declare const REPORT_STATUSES: readonly ["TODO", "IN_PROGRESS", "CLOSED"];
|
|
447
453
|
type ReportStatus = (typeof REPORT_STATUSES)[number];
|
|
454
|
+
declare const ACTOR_KINDS: readonly ["human", "automation"];
|
|
455
|
+
type ActorKind = (typeof ACTOR_KINDS)[number];
|
|
448
456
|
interface OrganizationReportsListInput {
|
|
449
457
|
slug: string;
|
|
450
458
|
limit?: number;
|
|
@@ -453,7 +461,12 @@ interface OrganizationReportsListInput {
|
|
|
453
461
|
searchQuery?: string;
|
|
454
462
|
reporterQuery?: string;
|
|
455
463
|
reportedByCustomer?: boolean;
|
|
464
|
+
/** @deprecated Prefer `reporterKind: "human"`. */
|
|
456
465
|
excludeAutomation?: boolean;
|
|
466
|
+
/** Filter by whether the report was submitted by a human or automation. */
|
|
467
|
+
reporterKind?: ActorKind;
|
|
468
|
+
/** Filter by whether the report was approved by a human or automation. */
|
|
469
|
+
reviewerKind?: ActorKind;
|
|
457
470
|
onlyRejected?: boolean;
|
|
458
471
|
reviewStatuses?: ReportReviewDecision[];
|
|
459
472
|
assetTypes?: string[];
|
|
@@ -464,6 +477,24 @@ interface OrganizationReportsListInput {
|
|
|
464
477
|
endDate?: string;
|
|
465
478
|
updatedAtStartDate?: string;
|
|
466
479
|
updatedAtEndDate?: string;
|
|
480
|
+
/**
|
|
481
|
+
* Filter to reports waiting on the organization's own approval — the reports
|
|
482
|
+
* a customer admin still has to sign off on before the assets in them can be
|
|
483
|
+
* blocked. `true` returns only those reports; `false` returns only reports
|
|
484
|
+
* that are not waiting on them.
|
|
485
|
+
*
|
|
486
|
+
* This is the same queue the organization's Review page shows. A report counts
|
|
487
|
+
* when it has at least one pending proposal that is the organization's to
|
|
488
|
+
* action: one ChainPatrol staff escalated to them and they have not answered
|
|
489
|
+
* yet, or one on a report the organization submitted itself.
|
|
490
|
+
*
|
|
491
|
+
* "Obligatory Organization Admin Approval" does not widen the filter. That
|
|
492
|
+
* setting says an asset type will eventually need admin sign-off, not that
|
|
493
|
+
* every pending proposal is waiting on the admin right now — an untriaged
|
|
494
|
+
* proposal is still ChainPatrol's to review, and it reaches the organization
|
|
495
|
+
* only once staff escalate it.
|
|
496
|
+
*/
|
|
497
|
+
needsCustomerReview?: boolean;
|
|
467
498
|
}
|
|
468
499
|
interface OrganizationReportAssetScanEnrichment {
|
|
469
500
|
id: number;
|
|
@@ -733,7 +764,19 @@ interface OrganizationBrandsListResult {
|
|
|
733
764
|
}
|
|
734
765
|
interface ReportsSearchInput {
|
|
735
766
|
assetContents: string[];
|
|
767
|
+
/**
|
|
768
|
+
* Organization slug. Optional for organization-scoped API keys, which resolve
|
|
769
|
+
* the organization from the key itself. Required when your credentials can
|
|
770
|
+
* reach more than one organization — including the bearer token issued by
|
|
771
|
+
* `chainpatrol login`.
|
|
772
|
+
*/
|
|
773
|
+
slug?: string;
|
|
736
774
|
reportedByCustomer?: boolean;
|
|
775
|
+
/**
|
|
776
|
+
* Maximum number of reports to return, newest first. Defaults to 50, maximum
|
|
777
|
+
* 100. Compare with `totalCount` to tell whether results were truncated.
|
|
778
|
+
*/
|
|
779
|
+
limit?: number;
|
|
737
780
|
}
|
|
738
781
|
interface ReportsSearchResultItem {
|
|
739
782
|
id: number;
|
|
@@ -749,6 +792,11 @@ interface ReportsSearchResultItem {
|
|
|
749
792
|
}
|
|
750
793
|
interface ReportsSearchResult {
|
|
751
794
|
reports: ReportsSearchResultItem[];
|
|
795
|
+
/**
|
|
796
|
+
* Total number of reports matching the search, ignoring `limit`. Greater than
|
|
797
|
+
* `reports.length` means the results were truncated.
|
|
798
|
+
*/
|
|
799
|
+
totalCount: number;
|
|
752
800
|
}
|
|
753
801
|
interface UserMeResult {
|
|
754
802
|
user: {
|
|
@@ -838,6 +886,26 @@ interface TakedownItem {
|
|
|
838
886
|
name: string;
|
|
839
887
|
slug: string | null;
|
|
840
888
|
} | null;
|
|
889
|
+
/**
|
|
890
|
+
* Domain registrar assigned to this takedown (e.g. Namecheap, GoDaddy).
|
|
891
|
+
* Null when unresolved. Distinct from per-task `takedownProvider` — this
|
|
892
|
+
* is the takedown-level assignment for the domain itself.
|
|
893
|
+
*/
|
|
894
|
+
domainRegistrar: TakedownProviderRef | null;
|
|
895
|
+
/**
|
|
896
|
+
* Hosting provider assigned to this takedown (e.g. Cloudflare, AWS).
|
|
897
|
+
* Answers "who hosts this?" without a follow-up call. Null when unresolved.
|
|
898
|
+
*/
|
|
899
|
+
hostingProvider: TakedownProviderRef | null;
|
|
900
|
+
/**
|
|
901
|
+
* Top-level-domain registrar assigned to this takedown (e.g. Verisign).
|
|
902
|
+
* Null when unresolved.
|
|
903
|
+
*/
|
|
904
|
+
tldRegistrar: TakedownProviderRef | null;
|
|
905
|
+
}
|
|
906
|
+
interface TakedownProviderRef {
|
|
907
|
+
id: number;
|
|
908
|
+
name: string;
|
|
841
909
|
}
|
|
842
910
|
interface TakedownsListResult {
|
|
843
911
|
takedowns: TakedownItem[];
|
|
@@ -1195,4 +1263,4 @@ declare class ChainPatrolApiClient implements ApiClient {
|
|
|
1195
1263
|
declare function parseIsoDate(value: string | undefined): Date | undefined;
|
|
1196
1264
|
declare function parseIsoDateString(value: string | undefined): string | undefined;
|
|
1197
1265
|
|
|
1198
|
-
export { type ApiClient, type ApiCredential, type AssetCheckInput, type AssetCheckResult, type AssetCheckSourceEntry, type AssetCheckStatus, type AssetGroupItem, type AssetListInput, type AssetListItem, type AssetListResult, type AssetSearchInput, type AssetSearchResult, type AssetSearchResultItem, type BrandItem, type BrandLegalDocument, type BrandLegalDocuments, type BrandTrademarkRegistrationItem, type BrandType, ChainPatrolApiClient, type ChainPatrolApiClientOptions, type ConfigEntry, type CredentialProvider, DETECTION_CONFIDENCE_LEVELS, DETECTION_REPORTED_FILTERS, type DetectionBrand, type DetectionConfidence, type DetectionConfigRunInput, type DetectionConfigRunResult, type DetectionConfigUpdateInput, type DetectionConfigUpdateResult, type DetectionConfigValidateInput, type DetectionConfigValidateResult, type DetectionDriftInput, type DetectionDriftResult, type DetectionListInput, type DetectionListItem, type DetectionListResult, type DetectionReportStatus, type DetectionReportedFilter, type DetectionSource, type HealthcheckCategory, type HealthcheckFinding, type HealthcheckRegistryEntry, type HealthcheckResult, type HealthcheckSeverity, type HealthchecksListResult, LIVENESS_FILTER_VALUES, LIVENESS_STATUSES, type LivenessFilterValue, type LivenessStatus, type MetricsBreakdownInput, type MetricsBreakdownResult, type MetricsFoundInput, type MetricsFoundResult, type MetricsSummaryInput, type MetricsSummaryResult, ORGANIZATION_METRICS_INCLUDE_FIELDS, type OperationsQueuesSnapshotInput, type OperationsQueuesSnapshotResult, type OrganizationAssetGroupsListResult, type OrganizationAssetItem, type OrganizationAssetsListInput, type OrganizationAssetsListResult, type OrganizationBrandsListResult, type OrganizationMetricsIncludeField, type OrganizationMetricsInput, type OrganizationMetricsResult, type OrganizationMetricsResultMetrics, type OrganizationMetricsServicesFilter, type OrganizationMetricsVisibility, type OrganizationPortalVisibility, type OrganizationReportAssetScan, type OrganizationReportAssetScanEnrichment, type OrganizationReportAttachment, type OrganizationReportVisibility, type OrganizationReportsListInput, type OrganizationReportsListResult, type PendingApprovalService, type PendingServiceApproval, REPORT_REVIEW_DECISIONS, REPORT_STATUSES, type ReportAssetInput, type ReportCreateInput, type ReportCreateResult, type ReportReviewDecision, type ReportStatus, type ReportsSearchInput, type ReportsSearchResult, type ReportsSearchResultItem, TAKEDOWN_SORT_KEYS, TAKEDOWN_STATUSES, type TakedownItem, type TakedownSortKey, type TakedownStatus, type TakedownsListInput, type TakedownsListResult, type ThreatItem, type ThreatsListInput, type ThreatsListResult, type UserMeResult, type UserOrg, type UserOrgBrandMetadata, type UserOrgGetInput, type UserOrgGetResult, type UserOrgIntegrations, type UserOrgLegalDocument, type UserOrgLegalDocuments, type UserOrgPortalCustomization, type UserOrgTrademarkRegistration, type UserOrgsInput, type UserOrgsObligatoryAdminApprovalFilter, type UserOrgsPendingServiceApprovalFilter, type UserOrgsResult, type UserOrgsServiceFilters, type UserOrgsSubscriptionStatus, type ValidateApiKeyResult, WATCHLIST_FILTER_VALUES, type WatchlistFilterValue, parseIsoDate, parseIsoDateString, staticApiKey, staticBearerToken };
|
|
1266
|
+
export { ACTOR_KINDS, type ActorKind, type ApiClient, type ApiCredential, type AssetCheckInput, type AssetCheckResult, type AssetCheckSourceEntry, type AssetCheckStatus, type AssetGroupItem, type AssetListInput, type AssetListItem, type AssetListResult, type AssetSearchInput, type AssetSearchResult, type AssetSearchResultItem, type BrandItem, type BrandLegalDocument, type BrandLegalDocuments, type BrandTrademarkRegistrationItem, type BrandType, ChainPatrolApiClient, type ChainPatrolApiClientOptions, type ConfigEntry, type CredentialProvider, DETECTION_CONFIDENCE_LEVELS, DETECTION_REPORTED_FILTERS, type DetectionBrand, type DetectionConfidence, type DetectionConfigRunInput, type DetectionConfigRunResult, type DetectionConfigUpdateInput, type DetectionConfigUpdateResult, type DetectionConfigValidateInput, type DetectionConfigValidateResult, type DetectionDriftInput, type DetectionDriftResult, type DetectionListInput, type DetectionListItem, type DetectionListResult, type DetectionReportStatus, type DetectionReportedFilter, type DetectionSource, type HealthcheckCategory, type HealthcheckFinding, type HealthcheckRegistryEntry, type HealthcheckResult, type HealthcheckSeverity, type HealthchecksListResult, LIVENESS_FILTER_VALUES, LIVENESS_STATUSES, type LivenessFilterValue, type LivenessStatus, type MetricsBreakdownInput, type MetricsBreakdownResult, type MetricsFoundInput, type MetricsFoundResult, type MetricsSummaryInput, type MetricsSummaryResult, ORGANIZATION_METRICS_INCLUDE_FIELDS, type OperationsQueuesSnapshotInput, type OperationsQueuesSnapshotResult, type OrganizationAssetGroupsListResult, type OrganizationAssetItem, type OrganizationAssetsListInput, type OrganizationAssetsListResult, type OrganizationBrandsListResult, type OrganizationMetricsIncludeField, type OrganizationMetricsInput, type OrganizationMetricsResult, type OrganizationMetricsResultMetrics, type OrganizationMetricsServicesFilter, type OrganizationMetricsVisibility, type OrganizationPortalVisibility, type OrganizationReportAssetScan, type OrganizationReportAssetScanEnrichment, type OrganizationReportAttachment, type OrganizationReportVisibility, type OrganizationReportsListInput, type OrganizationReportsListResult, type PendingApprovalService, type PendingServiceApproval, REPORT_REVIEW_DECISIONS, REPORT_STATUSES, type ReportAssetInput, type ReportCreateInput, type ReportCreateResult, type ReportReviewDecision, type ReportStatus, type ReportsSearchInput, type ReportsSearchResult, type ReportsSearchResultItem, TAKEDOWN_SORT_KEYS, TAKEDOWN_STATUSES, type TakedownItem, type TakedownProviderRef, type TakedownSortKey, type TakedownStatus, type TakedownsListInput, type TakedownsListResult, type ThreatItem, type ThreatsListInput, type ThreatsListResult, type UserMeResult, type UserOrg, type UserOrgBrandMetadata, type UserOrgGetInput, type UserOrgGetResult, type UserOrgIntegrations, type UserOrgLegalDocument, type UserOrgLegalDocuments, type UserOrgPortalCustomization, type UserOrgTrademarkRegistration, type UserOrgsInput, type UserOrgsObligatoryAdminApprovalFilter, type UserOrgsPendingServiceApprovalFilter, type UserOrgsResult, type UserOrgsServiceFilters, type UserOrgsSubscriptionStatus, type ValidateApiKeyResult, WATCHLIST_FILTER_VALUES, type WatchlistFilterValue, parseIsoDate, parseIsoDateString, staticApiKey, staticBearerToken };
|
package/dist/api/index.js
CHANGED
|
@@ -43,6 +43,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
43
43
|
// src/api/types.ts
|
|
44
44
|
var REPORT_REVIEW_DECISIONS = ["APPROVE", "REJECT", "SKIP", "ESCALATE"];
|
|
45
45
|
var REPORT_STATUSES = ["TODO", "IN_PROGRESS", "CLOSED"];
|
|
46
|
+
var ACTOR_KINDS = ["human", "automation"];
|
|
46
47
|
var DETECTION_CONFIDENCE_LEVELS = ["none", "low", "medium", "high"];
|
|
47
48
|
var DETECTION_REPORTED_FILTERS = ["reported", "not_reported"];
|
|
48
49
|
var LIVENESS_FILTER_VALUES = ["ALIVE", "DEAD", "UNKNOWN"];
|
|
@@ -111,6 +112,12 @@ var DEFAULT_TIMEOUT_MS = 3e4;
|
|
|
111
112
|
function trimTrailingSlashes(url) {
|
|
112
113
|
return url.replace(/\/+$/, "");
|
|
113
114
|
}
|
|
115
|
+
function optionalBooleanParam(value) {
|
|
116
|
+
return value === void 0 ? void 0 : String(value);
|
|
117
|
+
}
|
|
118
|
+
function optionalNumberParam(value) {
|
|
119
|
+
return value === void 0 ? void 0 : String(value);
|
|
120
|
+
}
|
|
114
121
|
function staticApiKey(key) {
|
|
115
122
|
return () => ({ kind: "api-key", value: key });
|
|
116
123
|
}
|
|
@@ -286,25 +293,28 @@ var ChainPatrolApiClient = class {
|
|
|
286
293
|
}
|
|
287
294
|
listOrganizationReports(input) {
|
|
288
295
|
var _a, _b, _c, _d, _e;
|
|
289
|
-
return this.
|
|
296
|
+
return this.requestGet("/organization/reports", {
|
|
290
297
|
slug: input.slug,
|
|
291
|
-
limit: (_a = input.limit) != null ? _a : 10,
|
|
292
|
-
cursor: input.cursor,
|
|
298
|
+
limit: String((_a = input.limit) != null ? _a : 10),
|
|
299
|
+
cursor: optionalNumberParam(input.cursor),
|
|
293
300
|
status: input.status,
|
|
294
301
|
searchQuery: input.searchQuery,
|
|
295
302
|
reporterQuery: input.reporterQuery,
|
|
296
|
-
reportedByCustomer: input.reportedByCustomer,
|
|
297
|
-
excludeAutomation: input.excludeAutomation,
|
|
298
|
-
|
|
303
|
+
reportedByCustomer: optionalBooleanParam(input.reportedByCustomer),
|
|
304
|
+
excludeAutomation: optionalBooleanParam(input.excludeAutomation),
|
|
305
|
+
reporterKind: input.reporterKind,
|
|
306
|
+
reviewerKind: input.reviewerKind,
|
|
307
|
+
onlyRejected: optionalBooleanParam(input.onlyRejected),
|
|
299
308
|
reviewStatuses: ((_b = input.reviewStatuses) == null ? void 0 : _b.length) ? input.reviewStatuses : void 0,
|
|
300
309
|
assetTypes: ((_c = input.assetTypes) == null ? void 0 : _c.length) ? input.assetTypes : void 0,
|
|
301
|
-
brandIds: ((_d = input.brandIds) == null ? void 0 : _d.length) ? input.brandIds : void 0,
|
|
310
|
+
brandIds: ((_d = input.brandIds) == null ? void 0 : _d.length) ? input.brandIds.map(String) : void 0,
|
|
302
311
|
countryCodes: ((_e = input.countryCodes) == null ? void 0 : _e.length) ? input.countryCodes : void 0,
|
|
303
|
-
reviewedByUserId: input.reviewedByUserId,
|
|
312
|
+
reviewedByUserId: optionalNumberParam(input.reviewedByUserId),
|
|
304
313
|
startDate: parseIsoDateString(input.startDate),
|
|
305
314
|
endDate: parseIsoDateString(input.endDate),
|
|
306
315
|
updatedAtStartDate: parseIsoDateString(input.updatedAtStartDate),
|
|
307
|
-
updatedAtEndDate: parseIsoDateString(input.updatedAtEndDate)
|
|
316
|
+
updatedAtEndDate: parseIsoDateString(input.updatedAtEndDate),
|
|
317
|
+
needsCustomerReview: optionalBooleanParam(input.needsCustomerReview)
|
|
308
318
|
});
|
|
309
319
|
}
|
|
310
320
|
listTakedowns(input) {
|
|
@@ -457,6 +467,7 @@ var ChainPatrolApiClient = class {
|
|
|
457
467
|
}
|
|
458
468
|
};
|
|
459
469
|
|
|
470
|
+
exports.ACTOR_KINDS = ACTOR_KINDS;
|
|
460
471
|
exports.ChainPatrolApiClient = ChainPatrolApiClient;
|
|
461
472
|
exports.DETECTION_CONFIDENCE_LEVELS = DETECTION_CONFIDENCE_LEVELS;
|
|
462
473
|
exports.DETECTION_REPORTED_FILTERS = DETECTION_REPORTED_FILTERS;
|