@chainpatrol/sdk 1.1.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.
@@ -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;
@@ -872,6 +1034,45 @@ interface UserOrgTrademarkRegistration {
872
1034
  certificateFileUrl: string | null;
873
1035
  }
874
1036
  type OrganizationPortalVisibility = "PUBLIC" | "PRIVATE" | "DISABLED";
1037
+ type OrganizationReportVisibility = "PUBLIC" | "PRIVATE";
1038
+ type OrganizationMetricsVisibility = "PUBLIC" | "PRIVATE" | "DISABLED";
1039
+ interface UserOrgBrandMetadata {
1040
+ /** Public website URL of the brand (linked from the portal header). */
1041
+ websiteUrl: string | null;
1042
+ /** Public Twitter/X handle of the brand, stored with the leading `@` (e.g. `@acme`). */
1043
+ twitterHandle: string | null;
1044
+ /**
1045
+ * Email address for security correspondence — used by takedown providers
1046
+ * and researchers, distinct from the internal customer POC email.
1047
+ */
1048
+ securityContactEmail: string | null;
1049
+ /** Free-form industry label (e.g. `"DeFi"`, `"CEX"`, `"NFT"`, `"Wallet"`). */
1050
+ industry: string | null;
1051
+ }
1052
+ interface UserOrgPortalCustomization {
1053
+ /**
1054
+ * When `true`, the portal uses `name` / `slug` / `avatarUrl` from this
1055
+ * object instead of the org's own name / slug / avatar.
1056
+ */
1057
+ useCustomDetails: boolean;
1058
+ /** Custom display name shown on the portal (used only when `useCustomDetails=true`). */
1059
+ name: string | null;
1060
+ /**
1061
+ * Custom URL slug (`chainpatrol.io/<slug>`) — takes precedence over the
1062
+ * org's own slug when set, regardless of `useCustomDetails`.
1063
+ */
1064
+ slug: string | null;
1065
+ /** Custom avatar URL shown on the portal (used only when `useCustomDetails=true`). */
1066
+ avatarUrl: string | null;
1067
+ /** When `true`, the portal renders `bannerContent` as a highlighted banner. */
1068
+ bannerEnabled: boolean;
1069
+ /**
1070
+ * Markdown body of the portal banner. Null (or empty) with
1071
+ * `bannerEnabled=true` means the toggle is on but no content has been
1072
+ * written yet.
1073
+ */
1074
+ bannerContent: string | null;
1075
+ }
875
1076
  interface UserOrg {
876
1077
  id: number;
877
1078
  name: string;
@@ -886,6 +1087,29 @@ interface UserOrg {
886
1087
  * - `DISABLED` — the portal returns a 404.
887
1088
  */
888
1089
  portalVisibility: OrganizationPortalVisibility;
1090
+ /**
1091
+ * Whether the report listings on the public portal are visible to
1092
+ * visitors. `PUBLIC` shows the org's reports; `PRIVATE` hides the report
1093
+ * list even when the portal is discoverable.
1094
+ */
1095
+ reportVisibility: OrganizationReportVisibility;
1096
+ /**
1097
+ * Whether the metrics / threats-blocked stats render on the public portal.
1098
+ * - `PUBLIC` — metrics tab is visible.
1099
+ * - `PRIVATE` — metrics tab is hidden from anonymous visitors.
1100
+ * - `DISABLED` — metrics are not computed for this org.
1101
+ */
1102
+ metricsVisibility: OrganizationMetricsVisibility;
1103
+ /**
1104
+ * Public brand-facing metadata (website, twitter, security contact,
1105
+ * industry) shown on the portal and used by staff for outbound.
1106
+ */
1107
+ brandMetadata: UserOrgBrandMetadata;
1108
+ /**
1109
+ * Customer-configurable presentation of the public security portal —
1110
+ * custom name / slug / avatar and the banner content.
1111
+ */
1112
+ portalCustomization: UserOrgPortalCustomization;
889
1113
  services: {
890
1114
  reporting: {
891
1115
  active: boolean;
@@ -971,4 +1195,4 @@ declare class ChainPatrolApiClient implements ApiClient {
971
1195
  declare function parseIsoDate(value: string | undefined): Date | undefined;
972
1196
  declare function parseIsoDateString(value: string | undefined): string | undefined;
973
1197
 
974
- 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 OrganizationPortalVisibility, 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 UserOrgGetInput, type UserOrgGetResult, type UserOrgIntegrations, type UserOrgLegalDocument, type UserOrgLegalDocuments, 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 };