@chainpatrol/sdk 1.2.0 → 1.3.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 +57 -0
- package/dist/api/index.d.mts +163 -1
- package/dist/api/index.d.ts +163 -1
- package/dist/api/index.js.map +1 -1
- package/dist/api/index.mjs.map +1 -1
- package/dist/index.js +29 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,62 @@
|
|
|
1
1
|
# @chainpatrol/sdk
|
|
2
2
|
|
|
3
|
+
## 1.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 08b9976: Broaden the public API surface across Reports, Takedowns, Detections,
|
|
8
|
+
Detection Configs, and Assets. Everything additive — no removed fields,
|
|
9
|
+
no renames — so existing callers are unaffected.
|
|
10
|
+
|
|
11
|
+
**Detections (`listDetections`)** — new fields on each `DetectionListItem`:
|
|
12
|
+
`reason` (free-text explanation of why the detection fired), `score` (raw
|
|
13
|
+
0–1 model score), `configId` (which `ThreatDetectionConfig` produced the
|
|
14
|
+
hit), `reportedAt` (when it transitioned to `REPORTED`, nullable), and
|
|
15
|
+
`brands[]` (brand associations).
|
|
16
|
+
|
|
17
|
+
**Detection Configs (`listDetectionConfigs`)** — each `ConfigEntry` now
|
|
18
|
+
carries `description` (nullable), `createdAt`, and `updatedAt` so
|
|
19
|
+
integrators can spot silent or stale configs.
|
|
20
|
+
|
|
21
|
+
**Reports** — `listOrganizationReports` gains `slaDueAt` (SLA deadline),
|
|
22
|
+
`externalSubmissionLink` (original external source URL when submitted from
|
|
23
|
+
a third-party surface), and `duplicateOfId` (canonical report ID when this
|
|
24
|
+
one is a duplicate). Type gaps are also closed: `imageDisplay`,
|
|
25
|
+
`favoritedAt`, `attachments[]`, and `proposals.asset.scans[]` were already
|
|
26
|
+
returned by the handler but omitted from the SDK type — they're now
|
|
27
|
+
declared. `searchReports` (`report/search-external`) response now
|
|
28
|
+
surfaces the `title` and `createdAt` fields the handler already fetched.
|
|
29
|
+
|
|
30
|
+
**Takedowns (`listTakedowns`)** — each `TakedownItem` gains `externalId`
|
|
31
|
+
(vendor's own reference — CleanDNS report ID / registrar ticket, for
|
|
32
|
+
reconciliation), `hasFilingDelay`, `hasLivenessCheckDelay` (staff-set
|
|
33
|
+
flags used by median-time metrics), and `asset.blockedAt`.
|
|
34
|
+
|
|
35
|
+
**Takedowns (`getTakedown`)** — the response was previously bare
|
|
36
|
+
(`{ assetContent, takedownStatus, createdAt, updatedAt }`). It's now
|
|
37
|
+
fully built out with `asset` details (id / content / type /
|
|
38
|
+
`livenessStatus` / `blockedAt`) and a nested `takedown` record (id /
|
|
39
|
+
status / `externalId` / delay flags / assignee / brand / tasks[]). The
|
|
40
|
+
original top-level fields (`takedownStatus`, `createdAt`, `updatedAt`)
|
|
41
|
+
are preserved for existing callers.
|
|
42
|
+
|
|
43
|
+
**Assets — `livenessStatus` + `blockedAt` parity.** `listAssets`,
|
|
44
|
+
`listOrganizationAssets`, `assetSearch` (`.asset`), and `listThreats`
|
|
45
|
+
(`livenessStatus` only, `blockedAt` already there) now consistently
|
|
46
|
+
return both fields. `listAssets` also fixes a bug where each returned
|
|
47
|
+
row's `id` was stripped from the response mapper (the column was already
|
|
48
|
+
selected). Note: `assetCheck` is intentionally deferred — its response
|
|
49
|
+
goes through `@chainpatrol/asset`'s own `checkAsset()` contract; parity
|
|
50
|
+
there needs a scoped follow-up in the asset package.
|
|
51
|
+
|
|
52
|
+
Server-side work in `@chainpatrol/external-trpc`, `@chainpatrol/core`,
|
|
53
|
+
`@chainpatrol/validation`, and `@chainpatrol/database` backs the new
|
|
54
|
+
fields; those are private packages and don't need version bumps. Also
|
|
55
|
+
adds a `/// @deprecated` doc-comment to `Report.threatLevel` in the
|
|
56
|
+
Prisma schema — the field is not surfaced through the public API and no
|
|
57
|
+
in-app UI reads it; the column stays for now, removal is a separate
|
|
58
|
+
destructive migration.
|
|
59
|
+
|
|
3
60
|
## 1.2.0
|
|
4
61
|
|
|
5
62
|
### Minor Changes
|
package/dist/api/index.d.mts
CHANGED
|
@@ -14,9 +14,31 @@ interface ChainPatrolApiClientOptions {
|
|
|
14
14
|
interface ConfigEntry {
|
|
15
15
|
id: number;
|
|
16
16
|
title: string;
|
|
17
|
+
/**
|
|
18
|
+
* Human-readable description of what the config does. `null` when unset
|
|
19
|
+
* — most configs seeded before this field existed do not have one.
|
|
20
|
+
*/
|
|
21
|
+
description: string | null;
|
|
17
22
|
status: string;
|
|
18
23
|
cron: string | null;
|
|
19
24
|
config: Record<string, unknown>;
|
|
25
|
+
/**
|
|
26
|
+
* Optional brand connection. Present only for org-scoped configs when the
|
|
27
|
+
* config targets a specific brand.
|
|
28
|
+
*/
|
|
29
|
+
brandId?: number | null;
|
|
30
|
+
brand?: {
|
|
31
|
+
id: number;
|
|
32
|
+
name: string;
|
|
33
|
+
slug: string;
|
|
34
|
+
} | null;
|
|
35
|
+
/** When the config was first created (ISO 8601, UTC). */
|
|
36
|
+
createdAt: string;
|
|
37
|
+
/**
|
|
38
|
+
* When the config was last updated (ISO 8601, UTC). Pair with the drift
|
|
39
|
+
* healthcheck to spot silent configs untouched in months.
|
|
40
|
+
*/
|
|
41
|
+
updatedAt: string;
|
|
20
42
|
}
|
|
21
43
|
interface DetectionSource {
|
|
22
44
|
source: string;
|
|
@@ -82,6 +104,16 @@ interface AssetSearchResultItem {
|
|
|
82
104
|
type: string;
|
|
83
105
|
status: string;
|
|
84
106
|
watchStatus: string;
|
|
107
|
+
/**
|
|
108
|
+
* Whether the asset is currently reachable (`"ALIVE"`), gone
|
|
109
|
+
* (`"DEAD"`), or unchecked (`"UNKNOWN"`). Null when never evaluated.
|
|
110
|
+
*/
|
|
111
|
+
livenessStatus: LivenessStatus | null;
|
|
112
|
+
/**
|
|
113
|
+
* When the asset transitioned to BLOCKED (ISO 8601, UTC). Null for
|
|
114
|
+
* non-blocked assets or blocks predating the field.
|
|
115
|
+
*/
|
|
116
|
+
blockedAt: string | null;
|
|
85
117
|
createdAt: string;
|
|
86
118
|
updatedAt: string;
|
|
87
119
|
} | null;
|
|
@@ -130,10 +162,22 @@ interface AssetListInput {
|
|
|
130
162
|
nextPage?: string;
|
|
131
163
|
}
|
|
132
164
|
interface AssetListItem {
|
|
165
|
+
/** Asset ID — reference in follow-up calls (was previously stripped from the response). */
|
|
166
|
+
id: number;
|
|
133
167
|
content: string;
|
|
134
168
|
type: string;
|
|
135
169
|
status: string;
|
|
136
170
|
watchStatus: string;
|
|
171
|
+
/**
|
|
172
|
+
* Whether the asset is currently reachable (`"ALIVE"`), gone
|
|
173
|
+
* (`"DEAD"`), or unchecked (`"UNKNOWN"`). Null when never evaluated.
|
|
174
|
+
*/
|
|
175
|
+
livenessStatus: LivenessStatus | null;
|
|
176
|
+
/**
|
|
177
|
+
* When the asset transitioned to BLOCKED (ISO 8601, UTC). Null for
|
|
178
|
+
* non-blocked assets.
|
|
179
|
+
*/
|
|
180
|
+
blockedAt: string | null;
|
|
137
181
|
updatedAt: string;
|
|
138
182
|
}
|
|
139
183
|
interface AssetListResult {
|
|
@@ -421,15 +465,53 @@ interface OrganizationReportsListInput {
|
|
|
421
465
|
updatedAtStartDate?: string;
|
|
422
466
|
updatedAtEndDate?: string;
|
|
423
467
|
}
|
|
468
|
+
interface OrganizationReportAssetScanEnrichment {
|
|
469
|
+
id: number;
|
|
470
|
+
type: string;
|
|
471
|
+
output: unknown;
|
|
472
|
+
status: string;
|
|
473
|
+
}
|
|
474
|
+
interface OrganizationReportAssetScan {
|
|
475
|
+
id: number;
|
|
476
|
+
status: string;
|
|
477
|
+
output: unknown;
|
|
478
|
+
createdAt: string;
|
|
479
|
+
enrichments: OrganizationReportAssetScanEnrichment[];
|
|
480
|
+
}
|
|
481
|
+
interface OrganizationReportAttachment {
|
|
482
|
+
id: number;
|
|
483
|
+
url: string;
|
|
484
|
+
}
|
|
424
485
|
interface OrganizationReportsListResult {
|
|
425
486
|
reports: Array<{
|
|
426
487
|
id: number;
|
|
427
488
|
title: string;
|
|
428
489
|
description: string;
|
|
490
|
+
/** Whether the report's images render inline or are hidden by default. */
|
|
491
|
+
imageDisplay: string;
|
|
492
|
+
/** When the report was starred/favorited (ISO 8601, UTC). Null when not favorited. */
|
|
493
|
+
favoritedAt: string | null;
|
|
429
494
|
status: string | null;
|
|
430
495
|
reportedByCustomer: boolean;
|
|
496
|
+
/**
|
|
497
|
+
* SLA deadline for this report (ISO 8601, UTC). Null when no SLA
|
|
498
|
+
* applies (e.g. staff-created reports).
|
|
499
|
+
*/
|
|
500
|
+
slaDueAt: string | null;
|
|
501
|
+
/**
|
|
502
|
+
* URL to the original external source of the report when submitted
|
|
503
|
+
* from a third-party surface (Discord/Twitter link, forwarded webform).
|
|
504
|
+
* Null for reports created directly in ChainPatrol.
|
|
505
|
+
*/
|
|
506
|
+
externalSubmissionLink: string | null;
|
|
507
|
+
/**
|
|
508
|
+
* ID of the canonical report this one duplicates. Null when the
|
|
509
|
+
* report is not a duplicate.
|
|
510
|
+
*/
|
|
511
|
+
duplicateOfId: number | null;
|
|
431
512
|
createdAt: string;
|
|
432
513
|
updatedAt: string;
|
|
514
|
+
attachments: OrganizationReportAttachment[];
|
|
433
515
|
proposals: Array<{
|
|
434
516
|
reviewStatus: string;
|
|
435
517
|
asset: {
|
|
@@ -437,6 +519,12 @@ interface OrganizationReportsListResult {
|
|
|
437
519
|
type: string;
|
|
438
520
|
content: string;
|
|
439
521
|
status: string;
|
|
522
|
+
/**
|
|
523
|
+
* Per-scan enrichment data. Large (Apple App Store enrichments run
|
|
524
|
+
* 50–200 KB each) — the agent42 tool strips these by default when
|
|
525
|
+
* relaying results. Present in the raw handler response.
|
|
526
|
+
*/
|
|
527
|
+
scans: OrganizationReportAssetScan[];
|
|
440
528
|
};
|
|
441
529
|
}>;
|
|
442
530
|
reporter: {
|
|
@@ -482,12 +570,42 @@ interface DetectionListInput {
|
|
|
482
570
|
countryCodes?: string[];
|
|
483
571
|
onlyDeleted?: boolean;
|
|
484
572
|
}
|
|
573
|
+
interface DetectionBrand {
|
|
574
|
+
id: number;
|
|
575
|
+
name: string;
|
|
576
|
+
slug: string;
|
|
577
|
+
}
|
|
485
578
|
interface DetectionListItem {
|
|
486
579
|
id: number;
|
|
487
580
|
threatContent: string;
|
|
488
581
|
source: string;
|
|
489
582
|
createdAt: string;
|
|
490
583
|
confidence: DetectionConfidence;
|
|
584
|
+
/**
|
|
585
|
+
* Raw model score (0–1). `confidence` buckets this into low/medium/high
|
|
586
|
+
* using the org's thresholds; use `score` when the buckets are too coarse.
|
|
587
|
+
*/
|
|
588
|
+
score: number;
|
|
589
|
+
/**
|
|
590
|
+
* Free-text explanation of why the detection fired (e.g. "matches
|
|
591
|
+
* brand-name typo squat", "TLS cert issued by known lookalike CA").
|
|
592
|
+
*/
|
|
593
|
+
reason: string;
|
|
594
|
+
/**
|
|
595
|
+
* ID of the `ThreatDetectionConfig` that produced this hit. Pair with
|
|
596
|
+
* `listDetectionConfigs` to drill back into the config.
|
|
597
|
+
*/
|
|
598
|
+
configId: number;
|
|
599
|
+
/**
|
|
600
|
+
* When the detection was reported (ISO 8601, UTC). Null when the
|
|
601
|
+
* detection has not been reported yet.
|
|
602
|
+
*/
|
|
603
|
+
reportedAt: string | null;
|
|
604
|
+
/**
|
|
605
|
+
* Brands the detection was associated with. Empty when the detection
|
|
606
|
+
* was not linked to any brand at classification time.
|
|
607
|
+
*/
|
|
608
|
+
brands: DetectionBrand[];
|
|
491
609
|
reportStatus: DetectionReportStatus;
|
|
492
610
|
asset: {
|
|
493
611
|
id: number;
|
|
@@ -516,6 +634,11 @@ interface ThreatItem {
|
|
|
516
634
|
id: number;
|
|
517
635
|
content: string;
|
|
518
636
|
type: string;
|
|
637
|
+
/**
|
|
638
|
+
* Liveness of the blocked threat. `"ALIVE"` still reachable, `"DEAD"`
|
|
639
|
+
* gone, `"UNKNOWN"` unchecked. Null when never evaluated.
|
|
640
|
+
*/
|
|
641
|
+
livenessStatus: LivenessStatus | null;
|
|
519
642
|
blockedAt: string;
|
|
520
643
|
}
|
|
521
644
|
interface ThreatsListResult {
|
|
@@ -540,6 +663,16 @@ interface OrganizationAssetItem {
|
|
|
540
663
|
id: number;
|
|
541
664
|
name: string;
|
|
542
665
|
} | null;
|
|
666
|
+
/**
|
|
667
|
+
* Whether the asset is currently reachable (`"ALIVE"`), gone
|
|
668
|
+
* (`"DEAD"`), or unchecked (`"UNKNOWN"`). Null when never evaluated.
|
|
669
|
+
*/
|
|
670
|
+
livenessStatus: LivenessStatus | null;
|
|
671
|
+
/**
|
|
672
|
+
* When the asset transitioned to BLOCKED (ISO 8601, UTC). Null for
|
|
673
|
+
* non-blocked assets.
|
|
674
|
+
*/
|
|
675
|
+
blockedAt: string | null;
|
|
543
676
|
createdAt: string;
|
|
544
677
|
updatedAt: string;
|
|
545
678
|
}
|
|
@@ -604,8 +737,14 @@ interface ReportsSearchInput {
|
|
|
604
737
|
}
|
|
605
738
|
interface ReportsSearchResultItem {
|
|
606
739
|
id: number;
|
|
740
|
+
/**
|
|
741
|
+
* Report title. Null for external / anonymous reports without one.
|
|
742
|
+
*/
|
|
743
|
+
title: string | null;
|
|
607
744
|
status: string;
|
|
608
745
|
reportedByCustomer: boolean;
|
|
746
|
+
/** When the report was created (ISO 8601, UTC). */
|
|
747
|
+
createdAt: string;
|
|
609
748
|
assets: string[];
|
|
610
749
|
}
|
|
611
750
|
interface ReportsSearchResult {
|
|
@@ -659,6 +798,24 @@ interface TakedownsListInput {
|
|
|
659
798
|
interface TakedownItem {
|
|
660
799
|
id: number;
|
|
661
800
|
status: TakedownStatus;
|
|
801
|
+
/**
|
|
802
|
+
* Provider's own reference for this takedown (e.g. CleanDNS report ID,
|
|
803
|
+
* registrar ticket). Reconcile with the vendor's dashboard. `null` when
|
|
804
|
+
* no vendor has picked it up yet.
|
|
805
|
+
*/
|
|
806
|
+
externalId: string | null;
|
|
807
|
+
/**
|
|
808
|
+
* Manually set by staff to exclude the takedown from median-time metrics
|
|
809
|
+
* when its filing was delayed for reasons unrelated to platform
|
|
810
|
+
* performance.
|
|
811
|
+
*/
|
|
812
|
+
hasFilingDelay: boolean;
|
|
813
|
+
/**
|
|
814
|
+
* Manually set by staff to exclude the takedown from median-time metrics
|
|
815
|
+
* when the liveness-check step was delayed for reasons unrelated to
|
|
816
|
+
* platform performance.
|
|
817
|
+
*/
|
|
818
|
+
hasLivenessCheckDelay: boolean;
|
|
662
819
|
createdAt: string;
|
|
663
820
|
updatedAt: string;
|
|
664
821
|
asset: {
|
|
@@ -666,6 +823,11 @@ interface TakedownItem {
|
|
|
666
823
|
content: string;
|
|
667
824
|
type: string;
|
|
668
825
|
livenessStatus: LivenessStatus | null;
|
|
826
|
+
/**
|
|
827
|
+
* When the asset transitioned to BLOCKED (ISO 8601, UTC). Null if the
|
|
828
|
+
* asset was never blocked (rare for takedown rows).
|
|
829
|
+
*/
|
|
830
|
+
blockedAt: string | null;
|
|
669
831
|
};
|
|
670
832
|
assignee: {
|
|
671
833
|
id: number;
|
|
@@ -1033,4 +1195,4 @@ declare class ChainPatrolApiClient implements ApiClient {
|
|
|
1033
1195
|
declare function parseIsoDate(value: string | undefined): Date | undefined;
|
|
1034
1196
|
declare function parseIsoDateString(value: string | undefined): string | undefined;
|
|
1035
1197
|
|
|
1036
|
-
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 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 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 };
|
|
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 };
|
package/dist/api/index.d.ts
CHANGED
|
@@ -14,9 +14,31 @@ interface ChainPatrolApiClientOptions {
|
|
|
14
14
|
interface ConfigEntry {
|
|
15
15
|
id: number;
|
|
16
16
|
title: string;
|
|
17
|
+
/**
|
|
18
|
+
* Human-readable description of what the config does. `null` when unset
|
|
19
|
+
* — most configs seeded before this field existed do not have one.
|
|
20
|
+
*/
|
|
21
|
+
description: string | null;
|
|
17
22
|
status: string;
|
|
18
23
|
cron: string | null;
|
|
19
24
|
config: Record<string, unknown>;
|
|
25
|
+
/**
|
|
26
|
+
* Optional brand connection. Present only for org-scoped configs when the
|
|
27
|
+
* config targets a specific brand.
|
|
28
|
+
*/
|
|
29
|
+
brandId?: number | null;
|
|
30
|
+
brand?: {
|
|
31
|
+
id: number;
|
|
32
|
+
name: string;
|
|
33
|
+
slug: string;
|
|
34
|
+
} | null;
|
|
35
|
+
/** When the config was first created (ISO 8601, UTC). */
|
|
36
|
+
createdAt: string;
|
|
37
|
+
/**
|
|
38
|
+
* When the config was last updated (ISO 8601, UTC). Pair with the drift
|
|
39
|
+
* healthcheck to spot silent configs untouched in months.
|
|
40
|
+
*/
|
|
41
|
+
updatedAt: string;
|
|
20
42
|
}
|
|
21
43
|
interface DetectionSource {
|
|
22
44
|
source: string;
|
|
@@ -82,6 +104,16 @@ interface AssetSearchResultItem {
|
|
|
82
104
|
type: string;
|
|
83
105
|
status: string;
|
|
84
106
|
watchStatus: string;
|
|
107
|
+
/**
|
|
108
|
+
* Whether the asset is currently reachable (`"ALIVE"`), gone
|
|
109
|
+
* (`"DEAD"`), or unchecked (`"UNKNOWN"`). Null when never evaluated.
|
|
110
|
+
*/
|
|
111
|
+
livenessStatus: LivenessStatus | null;
|
|
112
|
+
/**
|
|
113
|
+
* When the asset transitioned to BLOCKED (ISO 8601, UTC). Null for
|
|
114
|
+
* non-blocked assets or blocks predating the field.
|
|
115
|
+
*/
|
|
116
|
+
blockedAt: string | null;
|
|
85
117
|
createdAt: string;
|
|
86
118
|
updatedAt: string;
|
|
87
119
|
} | null;
|
|
@@ -130,10 +162,22 @@ interface AssetListInput {
|
|
|
130
162
|
nextPage?: string;
|
|
131
163
|
}
|
|
132
164
|
interface AssetListItem {
|
|
165
|
+
/** Asset ID — reference in follow-up calls (was previously stripped from the response). */
|
|
166
|
+
id: number;
|
|
133
167
|
content: string;
|
|
134
168
|
type: string;
|
|
135
169
|
status: string;
|
|
136
170
|
watchStatus: string;
|
|
171
|
+
/**
|
|
172
|
+
* Whether the asset is currently reachable (`"ALIVE"`), gone
|
|
173
|
+
* (`"DEAD"`), or unchecked (`"UNKNOWN"`). Null when never evaluated.
|
|
174
|
+
*/
|
|
175
|
+
livenessStatus: LivenessStatus | null;
|
|
176
|
+
/**
|
|
177
|
+
* When the asset transitioned to BLOCKED (ISO 8601, UTC). Null for
|
|
178
|
+
* non-blocked assets.
|
|
179
|
+
*/
|
|
180
|
+
blockedAt: string | null;
|
|
137
181
|
updatedAt: string;
|
|
138
182
|
}
|
|
139
183
|
interface AssetListResult {
|
|
@@ -421,15 +465,53 @@ interface OrganizationReportsListInput {
|
|
|
421
465
|
updatedAtStartDate?: string;
|
|
422
466
|
updatedAtEndDate?: string;
|
|
423
467
|
}
|
|
468
|
+
interface OrganizationReportAssetScanEnrichment {
|
|
469
|
+
id: number;
|
|
470
|
+
type: string;
|
|
471
|
+
output: unknown;
|
|
472
|
+
status: string;
|
|
473
|
+
}
|
|
474
|
+
interface OrganizationReportAssetScan {
|
|
475
|
+
id: number;
|
|
476
|
+
status: string;
|
|
477
|
+
output: unknown;
|
|
478
|
+
createdAt: string;
|
|
479
|
+
enrichments: OrganizationReportAssetScanEnrichment[];
|
|
480
|
+
}
|
|
481
|
+
interface OrganizationReportAttachment {
|
|
482
|
+
id: number;
|
|
483
|
+
url: string;
|
|
484
|
+
}
|
|
424
485
|
interface OrganizationReportsListResult {
|
|
425
486
|
reports: Array<{
|
|
426
487
|
id: number;
|
|
427
488
|
title: string;
|
|
428
489
|
description: string;
|
|
490
|
+
/** Whether the report's images render inline or are hidden by default. */
|
|
491
|
+
imageDisplay: string;
|
|
492
|
+
/** When the report was starred/favorited (ISO 8601, UTC). Null when not favorited. */
|
|
493
|
+
favoritedAt: string | null;
|
|
429
494
|
status: string | null;
|
|
430
495
|
reportedByCustomer: boolean;
|
|
496
|
+
/**
|
|
497
|
+
* SLA deadline for this report (ISO 8601, UTC). Null when no SLA
|
|
498
|
+
* applies (e.g. staff-created reports).
|
|
499
|
+
*/
|
|
500
|
+
slaDueAt: string | null;
|
|
501
|
+
/**
|
|
502
|
+
* URL to the original external source of the report when submitted
|
|
503
|
+
* from a third-party surface (Discord/Twitter link, forwarded webform).
|
|
504
|
+
* Null for reports created directly in ChainPatrol.
|
|
505
|
+
*/
|
|
506
|
+
externalSubmissionLink: string | null;
|
|
507
|
+
/**
|
|
508
|
+
* ID of the canonical report this one duplicates. Null when the
|
|
509
|
+
* report is not a duplicate.
|
|
510
|
+
*/
|
|
511
|
+
duplicateOfId: number | null;
|
|
431
512
|
createdAt: string;
|
|
432
513
|
updatedAt: string;
|
|
514
|
+
attachments: OrganizationReportAttachment[];
|
|
433
515
|
proposals: Array<{
|
|
434
516
|
reviewStatus: string;
|
|
435
517
|
asset: {
|
|
@@ -437,6 +519,12 @@ interface OrganizationReportsListResult {
|
|
|
437
519
|
type: string;
|
|
438
520
|
content: string;
|
|
439
521
|
status: string;
|
|
522
|
+
/**
|
|
523
|
+
* Per-scan enrichment data. Large (Apple App Store enrichments run
|
|
524
|
+
* 50–200 KB each) — the agent42 tool strips these by default when
|
|
525
|
+
* relaying results. Present in the raw handler response.
|
|
526
|
+
*/
|
|
527
|
+
scans: OrganizationReportAssetScan[];
|
|
440
528
|
};
|
|
441
529
|
}>;
|
|
442
530
|
reporter: {
|
|
@@ -482,12 +570,42 @@ interface DetectionListInput {
|
|
|
482
570
|
countryCodes?: string[];
|
|
483
571
|
onlyDeleted?: boolean;
|
|
484
572
|
}
|
|
573
|
+
interface DetectionBrand {
|
|
574
|
+
id: number;
|
|
575
|
+
name: string;
|
|
576
|
+
slug: string;
|
|
577
|
+
}
|
|
485
578
|
interface DetectionListItem {
|
|
486
579
|
id: number;
|
|
487
580
|
threatContent: string;
|
|
488
581
|
source: string;
|
|
489
582
|
createdAt: string;
|
|
490
583
|
confidence: DetectionConfidence;
|
|
584
|
+
/**
|
|
585
|
+
* Raw model score (0–1). `confidence` buckets this into low/medium/high
|
|
586
|
+
* using the org's thresholds; use `score` when the buckets are too coarse.
|
|
587
|
+
*/
|
|
588
|
+
score: number;
|
|
589
|
+
/**
|
|
590
|
+
* Free-text explanation of why the detection fired (e.g. "matches
|
|
591
|
+
* brand-name typo squat", "TLS cert issued by known lookalike CA").
|
|
592
|
+
*/
|
|
593
|
+
reason: string;
|
|
594
|
+
/**
|
|
595
|
+
* ID of the `ThreatDetectionConfig` that produced this hit. Pair with
|
|
596
|
+
* `listDetectionConfigs` to drill back into the config.
|
|
597
|
+
*/
|
|
598
|
+
configId: number;
|
|
599
|
+
/**
|
|
600
|
+
* When the detection was reported (ISO 8601, UTC). Null when the
|
|
601
|
+
* detection has not been reported yet.
|
|
602
|
+
*/
|
|
603
|
+
reportedAt: string | null;
|
|
604
|
+
/**
|
|
605
|
+
* Brands the detection was associated with. Empty when the detection
|
|
606
|
+
* was not linked to any brand at classification time.
|
|
607
|
+
*/
|
|
608
|
+
brands: DetectionBrand[];
|
|
491
609
|
reportStatus: DetectionReportStatus;
|
|
492
610
|
asset: {
|
|
493
611
|
id: number;
|
|
@@ -516,6 +634,11 @@ interface ThreatItem {
|
|
|
516
634
|
id: number;
|
|
517
635
|
content: string;
|
|
518
636
|
type: string;
|
|
637
|
+
/**
|
|
638
|
+
* Liveness of the blocked threat. `"ALIVE"` still reachable, `"DEAD"`
|
|
639
|
+
* gone, `"UNKNOWN"` unchecked. Null when never evaluated.
|
|
640
|
+
*/
|
|
641
|
+
livenessStatus: LivenessStatus | null;
|
|
519
642
|
blockedAt: string;
|
|
520
643
|
}
|
|
521
644
|
interface ThreatsListResult {
|
|
@@ -540,6 +663,16 @@ interface OrganizationAssetItem {
|
|
|
540
663
|
id: number;
|
|
541
664
|
name: string;
|
|
542
665
|
} | null;
|
|
666
|
+
/**
|
|
667
|
+
* Whether the asset is currently reachable (`"ALIVE"`), gone
|
|
668
|
+
* (`"DEAD"`), or unchecked (`"UNKNOWN"`). Null when never evaluated.
|
|
669
|
+
*/
|
|
670
|
+
livenessStatus: LivenessStatus | null;
|
|
671
|
+
/**
|
|
672
|
+
* When the asset transitioned to BLOCKED (ISO 8601, UTC). Null for
|
|
673
|
+
* non-blocked assets.
|
|
674
|
+
*/
|
|
675
|
+
blockedAt: string | null;
|
|
543
676
|
createdAt: string;
|
|
544
677
|
updatedAt: string;
|
|
545
678
|
}
|
|
@@ -604,8 +737,14 @@ interface ReportsSearchInput {
|
|
|
604
737
|
}
|
|
605
738
|
interface ReportsSearchResultItem {
|
|
606
739
|
id: number;
|
|
740
|
+
/**
|
|
741
|
+
* Report title. Null for external / anonymous reports without one.
|
|
742
|
+
*/
|
|
743
|
+
title: string | null;
|
|
607
744
|
status: string;
|
|
608
745
|
reportedByCustomer: boolean;
|
|
746
|
+
/** When the report was created (ISO 8601, UTC). */
|
|
747
|
+
createdAt: string;
|
|
609
748
|
assets: string[];
|
|
610
749
|
}
|
|
611
750
|
interface ReportsSearchResult {
|
|
@@ -659,6 +798,24 @@ interface TakedownsListInput {
|
|
|
659
798
|
interface TakedownItem {
|
|
660
799
|
id: number;
|
|
661
800
|
status: TakedownStatus;
|
|
801
|
+
/**
|
|
802
|
+
* Provider's own reference for this takedown (e.g. CleanDNS report ID,
|
|
803
|
+
* registrar ticket). Reconcile with the vendor's dashboard. `null` when
|
|
804
|
+
* no vendor has picked it up yet.
|
|
805
|
+
*/
|
|
806
|
+
externalId: string | null;
|
|
807
|
+
/**
|
|
808
|
+
* Manually set by staff to exclude the takedown from median-time metrics
|
|
809
|
+
* when its filing was delayed for reasons unrelated to platform
|
|
810
|
+
* performance.
|
|
811
|
+
*/
|
|
812
|
+
hasFilingDelay: boolean;
|
|
813
|
+
/**
|
|
814
|
+
* Manually set by staff to exclude the takedown from median-time metrics
|
|
815
|
+
* when the liveness-check step was delayed for reasons unrelated to
|
|
816
|
+
* platform performance.
|
|
817
|
+
*/
|
|
818
|
+
hasLivenessCheckDelay: boolean;
|
|
662
819
|
createdAt: string;
|
|
663
820
|
updatedAt: string;
|
|
664
821
|
asset: {
|
|
@@ -666,6 +823,11 @@ interface TakedownItem {
|
|
|
666
823
|
content: string;
|
|
667
824
|
type: string;
|
|
668
825
|
livenessStatus: LivenessStatus | null;
|
|
826
|
+
/**
|
|
827
|
+
* When the asset transitioned to BLOCKED (ISO 8601, UTC). Null if the
|
|
828
|
+
* asset was never blocked (rare for takedown rows).
|
|
829
|
+
*/
|
|
830
|
+
blockedAt: string | null;
|
|
669
831
|
};
|
|
670
832
|
assignee: {
|
|
671
833
|
id: number;
|
|
@@ -1033,4 +1195,4 @@ declare class ChainPatrolApiClient implements ApiClient {
|
|
|
1033
1195
|
declare function parseIsoDate(value: string | undefined): Date | undefined;
|
|
1034
1196
|
declare function parseIsoDateString(value: string | undefined): string | undefined;
|
|
1035
1197
|
|
|
1036
|
-
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 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 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 };
|
|
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 };
|