@chainpatrol/sdk 1.9.0 → 1.11.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 CHANGED
@@ -1,5 +1,31 @@
1
1
  # @chainpatrol/sdk
2
2
 
3
+ ## 1.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 3895c2f: `/asset/list` no longer requires `type`. Omitting it returns assets of every
8
+ type on a single pagination cursor, so mirroring the whole blocklist no longer
9
+ means looping the `AssetType` enum. Supplying `type` behaves exactly as before.
10
+
11
+ - `@chainpatrol/sdk`: `listAssets` accepts an input without `type`.
12
+ - `@chainpatrol/mcp`: the generated `asset_list` tool drops `type` from its
13
+ required fields.
14
+
15
+ Server-side work lives in @chainpatrol/validation and @chainpatrol/external-trpc;
16
+ both are private packages and don't need version bumps.
17
+
18
+ - 7812a3b: Adds a `proofs` array to takedown list items, carrying provider confirmations that they removed the asset. Each entry has a `type` discriminator so further kinds of evidence can be added without a breaking change. Gated by a feature flag and empty until it is enabled.
19
+ - 8a78f60: Add `getMetricsFalsePositiveRate` for the false positive rate by asset type.
20
+
21
+ ## 1.10.0
22
+
23
+ ### Minor Changes
24
+
25
+ - 38025fe: Add `getMetricsTakedownTimeByProvider` for median time-to-takedown per takedown provider
26
+ - f65141b: Allow listing inactive organizations: `orgs list --subscription-status INACTIVE` (and the `subscriptionStatus` filter on `/user/orgs` and `/organization/metrics`) now accepts `INACTIVE`. Unfiltered calls are unchanged and still return only the live statuses.
27
+ - d6124a4: Add `getMetricsTakedownSuccessRate` for takedown success rate per asset type
28
+
3
29
  ## 1.9.0
4
30
 
5
31
  ### Minor Changes
@@ -66,6 +66,9 @@ interface ApiClient {
66
66
  getMetricsFound: (input: MetricsFoundInput) => Promise<MetricsFoundResult>;
67
67
  getMetricsBreakdown: (input: MetricsBreakdownInput) => Promise<MetricsBreakdownResult>;
68
68
  getMetricsTakedownTime: (input: MetricsTakedownTimeInput) => Promise<MetricsTakedownTimeResult>;
69
+ getMetricsTakedownTimeByProvider: (input: MetricsTakedownTimeByProviderInput) => Promise<MetricsTakedownTimeByProviderResult>;
70
+ getMetricsTakedownSuccessRate: (input: MetricsTakedownSuccessRateInput) => Promise<MetricsTakedownSuccessRateResult>;
71
+ getMetricsFalsePositiveRate: (input: MetricsFalsePositiveRateInput) => Promise<MetricsFalsePositiveRateResult>;
69
72
  getMetricsTakedownTimeTrend: (input: MetricsTakedownTimeTrendInput) => Promise<MetricsTakedownTimeTrendResult>;
70
73
  createReport: (input: ReportCreateInput) => Promise<ReportCreateResult>;
71
74
  listOrganizationReports: (input: OrganizationReportsListInput) => Promise<OrganizationReportsListResult>;
@@ -168,7 +171,11 @@ interface AssetSearchResult extends AssetSearchResultItem {
168
171
  results?: AssetSearchResultItem[];
169
172
  }
170
173
  interface AssetListInput {
171
- type: string;
174
+ /**
175
+ * Asset type to list. Omit the field entirely to list every asset type on a
176
+ * single cursor; the API rejects an explicit `null`.
177
+ */
178
+ type?: string;
172
179
  status?: string;
173
180
  startDate?: string;
174
181
  endDate?: string;
@@ -441,6 +448,62 @@ interface MetricsTakedownTimeResult {
441
448
  count: number;
442
449
  }>;
443
450
  }
451
+ type TakedownProviderRole = "HOSTING_PROVIDER" | "DOMAIN_REGISTRAR" | "TLD_REGISTRAR";
452
+ interface MetricsTakedownTimeByProviderInput {
453
+ slug: string;
454
+ startDate?: string;
455
+ endDate?: string;
456
+ roles?: TakedownProviderRole[];
457
+ blockLabel?: string;
458
+ brandType?: "INDIVIDUAL" | "ORGANIZATION" | "PRODUCT";
459
+ countryCodes?: string[];
460
+ brandIds?: number[];
461
+ }
462
+ interface MetricsTakedownTimeByProviderResult {
463
+ byProvider: Array<{
464
+ providerId: number;
465
+ providerName: string;
466
+ role: TakedownProviderRole;
467
+ medianTakedownMinutes: number;
468
+ medianTakedownHours: number;
469
+ medianTakedownDays: number;
470
+ count: number;
471
+ }>;
472
+ }
473
+ interface MetricsTakedownSuccessRateInput {
474
+ slug: string;
475
+ startDate?: string;
476
+ endDate?: string;
477
+ blockLabel?: string;
478
+ brandType?: "INDIVIDUAL" | "ORGANIZATION" | "PRODUCT";
479
+ countryCodes?: string[];
480
+ brandIds?: number[];
481
+ }
482
+ interface MetricsTakedownSuccessRateResult {
483
+ byAssetType: Array<{
484
+ assetType: string;
485
+ submitted: number;
486
+ completed: number;
487
+ stillOpen: number;
488
+ successRate: number;
489
+ resolvedSuccessRate: number | null;
490
+ }>;
491
+ }
492
+ interface MetricsFalsePositiveRateInput {
493
+ slug: string;
494
+ startDate?: string;
495
+ endDate?: string;
496
+ brandIds?: number[];
497
+ countryCodes?: string[];
498
+ }
499
+ interface MetricsFalsePositiveRateResult {
500
+ byAssetType: Array<{
501
+ assetType: string;
502
+ blocked: number;
503
+ falsePositives: number;
504
+ falsePositiveRate: number | null;
505
+ }>;
506
+ }
444
507
  interface MetricsTakedownTimeTrendInput {
445
508
  slug: string;
446
509
  months?: number;
@@ -1033,11 +1096,60 @@ interface TakedownItem {
1033
1096
  * Null when unresolved.
1034
1097
  */
1035
1098
  tldRegistrar: TakedownProviderRef | null;
1099
+ /**
1100
+ * Providers confirming they removed the asset — evidence that this takedown
1101
+ * is ours. Newest first, at most 5.
1102
+ *
1103
+ * A takedown filed at several providers can be confirmed by more than one of
1104
+ * them, so this is a list.
1105
+ *
1106
+ * Empty unless the takedown is COMPLETED and we hold a confirmation, which is
1107
+ * the common case: most providers either never reply or reply without
1108
+ * confirming they acted. An empty list is not evidence that the asset is
1109
+ * still up.
1110
+ *
1111
+ * Requires the `takedown-proof-api` feature flag; without it this is always
1112
+ * empty.
1113
+ */
1114
+ proofs: TakedownProof[];
1036
1115
  }
1037
1116
  interface TakedownProviderRef {
1038
1117
  id: number;
1039
1118
  name: string;
1040
1119
  }
1120
+ /**
1121
+ * Kinds of takedown evidence. More may be added over time — switch on
1122
+ * `TakedownProof["type"]` with a default branch rather than assuming this is
1123
+ * exhaustive.
1124
+ */
1125
+ type TakedownProofType = "provider-email";
1126
+ interface TakedownProof {
1127
+ /**
1128
+ * Which kind of evidence this is. Read it before reading any type-specific
1129
+ * object, and treat an unrecognised value as an opaque proof rather than an
1130
+ * error.
1131
+ */
1132
+ type: TakedownProofType;
1133
+ /**
1134
+ * Who confirmed the takedown, in whatever form that provider identifies
1135
+ * itself — an address such as `abuse@example.com` for `provider-email`.
1136
+ */
1137
+ source: string | null;
1138
+ /** When the provider confirmed the takedown (ISO 8601, UTC). */
1139
+ confirmedAt: string;
1140
+ /** Present when `type` is `provider-email`, null for every other type. */
1141
+ email: TakedownProofEmail | null;
1142
+ }
1143
+ interface TakedownProofEmail {
1144
+ /**
1145
+ * The provider's reply, verbatim. Plain-text body where the provider sent
1146
+ * one, otherwise the raw HTML body — treat it as untrusted content and
1147
+ * escape it before rendering.
1148
+ */
1149
+ text: string;
1150
+ /** Subject line of the provider's reply. */
1151
+ subject: string | null;
1152
+ }
1041
1153
  interface TakedownsListResult {
1042
1154
  takedowns: TakedownItem[];
1043
1155
  next_page: string | null;
@@ -1158,7 +1270,7 @@ interface HealthcheckRegistryEntry {
1158
1270
  interface HealthchecksListResult {
1159
1271
  checks: HealthcheckRegistryEntry[];
1160
1272
  }
1161
- type UserOrgsSubscriptionStatus = "PROSPECT" | "POC" | "ACTIVE" | "INTEGRATION";
1273
+ type UserOrgsSubscriptionStatus = "PROSPECT" | "POC" | "ACTIVE" | "INTEGRATION" | "INACTIVE";
1162
1274
  type PendingApprovalService = "protection" | "takedowns";
1163
1275
  interface PendingServiceApproval {
1164
1276
  service: PendingApprovalService;
@@ -1375,6 +1487,9 @@ declare class ChainPatrolApiClient implements ApiClient {
1375
1487
  getMetricsFound(input: MetricsFoundInput): Promise<MetricsFoundResult>;
1376
1488
  getMetricsBreakdown(input: MetricsBreakdownInput): Promise<MetricsBreakdownResult>;
1377
1489
  getMetricsTakedownTime(input: MetricsTakedownTimeInput): Promise<MetricsTakedownTimeResult>;
1490
+ getMetricsTakedownTimeByProvider(input: MetricsTakedownTimeByProviderInput): Promise<MetricsTakedownTimeByProviderResult>;
1491
+ getMetricsTakedownSuccessRate(input: MetricsTakedownSuccessRateInput): Promise<MetricsTakedownSuccessRateResult>;
1492
+ getMetricsFalsePositiveRate(input: MetricsFalsePositiveRateInput): Promise<MetricsFalsePositiveRateResult>;
1378
1493
  getMetricsTakedownTimeTrend(input: MetricsTakedownTimeTrendInput): Promise<MetricsTakedownTimeTrendResult>;
1379
1494
  createReport(input: ReportCreateInput): Promise<ReportCreateResult>;
1380
1495
  listOrganizationReports(input: OrganizationReportsListInput): Promise<OrganizationReportsListResult>;
@@ -1406,4 +1521,4 @@ declare function parseIsoDateString(value: string | undefined): string | undefin
1406
1521
  */
1407
1522
  declare function parseIsoDateEndOfDay(value: string | undefined): Date | undefined;
1408
1523
 
1409
- 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, type CustomerReviewDecision, 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, type MetricsTakedownTimeInput, type MetricsTakedownTimeResult, type MetricsTakedownTimeTrendInput, type MetricsTakedownTimeTrendPoint, type MetricsTakedownTimeTrendResult, 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 OrganizationProposalsReviewInput, type OrganizationProposalsReviewResult, type OrganizationReportAssetScan, type OrganizationReportAssetScanEnrichment, type OrganizationReportAttachment, type OrganizationReportVisibility, type OrganizationReportsListInput, type OrganizationReportsListResult, PROPOSAL_REJECT_REASONS, PROPOSAL_WATCHLIST_REASONS, type PendingApprovalService, type PendingServiceApproval, type ProposalRejectReason, type ProposalWatchlistReason, 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, parseIsoDateEndOfDay, parseIsoDateString, staticApiKey, staticBearerToken };
1524
+ 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, type CustomerReviewDecision, 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 MetricsFalsePositiveRateInput, type MetricsFalsePositiveRateResult, type MetricsFoundInput, type MetricsFoundResult, type MetricsSummaryInput, type MetricsSummaryResult, type MetricsTakedownSuccessRateInput, type MetricsTakedownSuccessRateResult, type MetricsTakedownTimeByProviderInput, type MetricsTakedownTimeByProviderResult, type MetricsTakedownTimeInput, type MetricsTakedownTimeResult, type MetricsTakedownTimeTrendInput, type MetricsTakedownTimeTrendPoint, type MetricsTakedownTimeTrendResult, 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 OrganizationProposalsReviewInput, type OrganizationProposalsReviewResult, type OrganizationReportAssetScan, type OrganizationReportAssetScanEnrichment, type OrganizationReportAttachment, type OrganizationReportVisibility, type OrganizationReportsListInput, type OrganizationReportsListResult, PROPOSAL_REJECT_REASONS, PROPOSAL_WATCHLIST_REASONS, type PendingApprovalService, type PendingServiceApproval, type ProposalRejectReason, type ProposalWatchlistReason, 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 TakedownProof, type TakedownProofEmail, type TakedownProofType, type TakedownProviderRef, type TakedownProviderRole, 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, parseIsoDateEndOfDay, parseIsoDateString, staticApiKey, staticBearerToken };
@@ -66,6 +66,9 @@ interface ApiClient {
66
66
  getMetricsFound: (input: MetricsFoundInput) => Promise<MetricsFoundResult>;
67
67
  getMetricsBreakdown: (input: MetricsBreakdownInput) => Promise<MetricsBreakdownResult>;
68
68
  getMetricsTakedownTime: (input: MetricsTakedownTimeInput) => Promise<MetricsTakedownTimeResult>;
69
+ getMetricsTakedownTimeByProvider: (input: MetricsTakedownTimeByProviderInput) => Promise<MetricsTakedownTimeByProviderResult>;
70
+ getMetricsTakedownSuccessRate: (input: MetricsTakedownSuccessRateInput) => Promise<MetricsTakedownSuccessRateResult>;
71
+ getMetricsFalsePositiveRate: (input: MetricsFalsePositiveRateInput) => Promise<MetricsFalsePositiveRateResult>;
69
72
  getMetricsTakedownTimeTrend: (input: MetricsTakedownTimeTrendInput) => Promise<MetricsTakedownTimeTrendResult>;
70
73
  createReport: (input: ReportCreateInput) => Promise<ReportCreateResult>;
71
74
  listOrganizationReports: (input: OrganizationReportsListInput) => Promise<OrganizationReportsListResult>;
@@ -168,7 +171,11 @@ interface AssetSearchResult extends AssetSearchResultItem {
168
171
  results?: AssetSearchResultItem[];
169
172
  }
170
173
  interface AssetListInput {
171
- type: string;
174
+ /**
175
+ * Asset type to list. Omit the field entirely to list every asset type on a
176
+ * single cursor; the API rejects an explicit `null`.
177
+ */
178
+ type?: string;
172
179
  status?: string;
173
180
  startDate?: string;
174
181
  endDate?: string;
@@ -441,6 +448,62 @@ interface MetricsTakedownTimeResult {
441
448
  count: number;
442
449
  }>;
443
450
  }
451
+ type TakedownProviderRole = "HOSTING_PROVIDER" | "DOMAIN_REGISTRAR" | "TLD_REGISTRAR";
452
+ interface MetricsTakedownTimeByProviderInput {
453
+ slug: string;
454
+ startDate?: string;
455
+ endDate?: string;
456
+ roles?: TakedownProviderRole[];
457
+ blockLabel?: string;
458
+ brandType?: "INDIVIDUAL" | "ORGANIZATION" | "PRODUCT";
459
+ countryCodes?: string[];
460
+ brandIds?: number[];
461
+ }
462
+ interface MetricsTakedownTimeByProviderResult {
463
+ byProvider: Array<{
464
+ providerId: number;
465
+ providerName: string;
466
+ role: TakedownProviderRole;
467
+ medianTakedownMinutes: number;
468
+ medianTakedownHours: number;
469
+ medianTakedownDays: number;
470
+ count: number;
471
+ }>;
472
+ }
473
+ interface MetricsTakedownSuccessRateInput {
474
+ slug: string;
475
+ startDate?: string;
476
+ endDate?: string;
477
+ blockLabel?: string;
478
+ brandType?: "INDIVIDUAL" | "ORGANIZATION" | "PRODUCT";
479
+ countryCodes?: string[];
480
+ brandIds?: number[];
481
+ }
482
+ interface MetricsTakedownSuccessRateResult {
483
+ byAssetType: Array<{
484
+ assetType: string;
485
+ submitted: number;
486
+ completed: number;
487
+ stillOpen: number;
488
+ successRate: number;
489
+ resolvedSuccessRate: number | null;
490
+ }>;
491
+ }
492
+ interface MetricsFalsePositiveRateInput {
493
+ slug: string;
494
+ startDate?: string;
495
+ endDate?: string;
496
+ brandIds?: number[];
497
+ countryCodes?: string[];
498
+ }
499
+ interface MetricsFalsePositiveRateResult {
500
+ byAssetType: Array<{
501
+ assetType: string;
502
+ blocked: number;
503
+ falsePositives: number;
504
+ falsePositiveRate: number | null;
505
+ }>;
506
+ }
444
507
  interface MetricsTakedownTimeTrendInput {
445
508
  slug: string;
446
509
  months?: number;
@@ -1033,11 +1096,60 @@ interface TakedownItem {
1033
1096
  * Null when unresolved.
1034
1097
  */
1035
1098
  tldRegistrar: TakedownProviderRef | null;
1099
+ /**
1100
+ * Providers confirming they removed the asset — evidence that this takedown
1101
+ * is ours. Newest first, at most 5.
1102
+ *
1103
+ * A takedown filed at several providers can be confirmed by more than one of
1104
+ * them, so this is a list.
1105
+ *
1106
+ * Empty unless the takedown is COMPLETED and we hold a confirmation, which is
1107
+ * the common case: most providers either never reply or reply without
1108
+ * confirming they acted. An empty list is not evidence that the asset is
1109
+ * still up.
1110
+ *
1111
+ * Requires the `takedown-proof-api` feature flag; without it this is always
1112
+ * empty.
1113
+ */
1114
+ proofs: TakedownProof[];
1036
1115
  }
1037
1116
  interface TakedownProviderRef {
1038
1117
  id: number;
1039
1118
  name: string;
1040
1119
  }
1120
+ /**
1121
+ * Kinds of takedown evidence. More may be added over time — switch on
1122
+ * `TakedownProof["type"]` with a default branch rather than assuming this is
1123
+ * exhaustive.
1124
+ */
1125
+ type TakedownProofType = "provider-email";
1126
+ interface TakedownProof {
1127
+ /**
1128
+ * Which kind of evidence this is. Read it before reading any type-specific
1129
+ * object, and treat an unrecognised value as an opaque proof rather than an
1130
+ * error.
1131
+ */
1132
+ type: TakedownProofType;
1133
+ /**
1134
+ * Who confirmed the takedown, in whatever form that provider identifies
1135
+ * itself — an address such as `abuse@example.com` for `provider-email`.
1136
+ */
1137
+ source: string | null;
1138
+ /** When the provider confirmed the takedown (ISO 8601, UTC). */
1139
+ confirmedAt: string;
1140
+ /** Present when `type` is `provider-email`, null for every other type. */
1141
+ email: TakedownProofEmail | null;
1142
+ }
1143
+ interface TakedownProofEmail {
1144
+ /**
1145
+ * The provider's reply, verbatim. Plain-text body where the provider sent
1146
+ * one, otherwise the raw HTML body — treat it as untrusted content and
1147
+ * escape it before rendering.
1148
+ */
1149
+ text: string;
1150
+ /** Subject line of the provider's reply. */
1151
+ subject: string | null;
1152
+ }
1041
1153
  interface TakedownsListResult {
1042
1154
  takedowns: TakedownItem[];
1043
1155
  next_page: string | null;
@@ -1158,7 +1270,7 @@ interface HealthcheckRegistryEntry {
1158
1270
  interface HealthchecksListResult {
1159
1271
  checks: HealthcheckRegistryEntry[];
1160
1272
  }
1161
- type UserOrgsSubscriptionStatus = "PROSPECT" | "POC" | "ACTIVE" | "INTEGRATION";
1273
+ type UserOrgsSubscriptionStatus = "PROSPECT" | "POC" | "ACTIVE" | "INTEGRATION" | "INACTIVE";
1162
1274
  type PendingApprovalService = "protection" | "takedowns";
1163
1275
  interface PendingServiceApproval {
1164
1276
  service: PendingApprovalService;
@@ -1375,6 +1487,9 @@ declare class ChainPatrolApiClient implements ApiClient {
1375
1487
  getMetricsFound(input: MetricsFoundInput): Promise<MetricsFoundResult>;
1376
1488
  getMetricsBreakdown(input: MetricsBreakdownInput): Promise<MetricsBreakdownResult>;
1377
1489
  getMetricsTakedownTime(input: MetricsTakedownTimeInput): Promise<MetricsTakedownTimeResult>;
1490
+ getMetricsTakedownTimeByProvider(input: MetricsTakedownTimeByProviderInput): Promise<MetricsTakedownTimeByProviderResult>;
1491
+ getMetricsTakedownSuccessRate(input: MetricsTakedownSuccessRateInput): Promise<MetricsTakedownSuccessRateResult>;
1492
+ getMetricsFalsePositiveRate(input: MetricsFalsePositiveRateInput): Promise<MetricsFalsePositiveRateResult>;
1378
1493
  getMetricsTakedownTimeTrend(input: MetricsTakedownTimeTrendInput): Promise<MetricsTakedownTimeTrendResult>;
1379
1494
  createReport(input: ReportCreateInput): Promise<ReportCreateResult>;
1380
1495
  listOrganizationReports(input: OrganizationReportsListInput): Promise<OrganizationReportsListResult>;
@@ -1406,4 +1521,4 @@ declare function parseIsoDateString(value: string | undefined): string | undefin
1406
1521
  */
1407
1522
  declare function parseIsoDateEndOfDay(value: string | undefined): Date | undefined;
1408
1523
 
1409
- 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, type CustomerReviewDecision, 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, type MetricsTakedownTimeInput, type MetricsTakedownTimeResult, type MetricsTakedownTimeTrendInput, type MetricsTakedownTimeTrendPoint, type MetricsTakedownTimeTrendResult, 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 OrganizationProposalsReviewInput, type OrganizationProposalsReviewResult, type OrganizationReportAssetScan, type OrganizationReportAssetScanEnrichment, type OrganizationReportAttachment, type OrganizationReportVisibility, type OrganizationReportsListInput, type OrganizationReportsListResult, PROPOSAL_REJECT_REASONS, PROPOSAL_WATCHLIST_REASONS, type PendingApprovalService, type PendingServiceApproval, type ProposalRejectReason, type ProposalWatchlistReason, 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, parseIsoDateEndOfDay, parseIsoDateString, staticApiKey, staticBearerToken };
1524
+ 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, type CustomerReviewDecision, 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 MetricsFalsePositiveRateInput, type MetricsFalsePositiveRateResult, type MetricsFoundInput, type MetricsFoundResult, type MetricsSummaryInput, type MetricsSummaryResult, type MetricsTakedownSuccessRateInput, type MetricsTakedownSuccessRateResult, type MetricsTakedownTimeByProviderInput, type MetricsTakedownTimeByProviderResult, type MetricsTakedownTimeInput, type MetricsTakedownTimeResult, type MetricsTakedownTimeTrendInput, type MetricsTakedownTimeTrendPoint, type MetricsTakedownTimeTrendResult, 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 OrganizationProposalsReviewInput, type OrganizationProposalsReviewResult, type OrganizationReportAssetScan, type OrganizationReportAssetScanEnrichment, type OrganizationReportAttachment, type OrganizationReportVisibility, type OrganizationReportsListInput, type OrganizationReportsListResult, PROPOSAL_REJECT_REASONS, PROPOSAL_WATCHLIST_REASONS, type PendingApprovalService, type PendingServiceApproval, type ProposalRejectReason, type ProposalWatchlistReason, 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 TakedownProof, type TakedownProofEmail, type TakedownProofType, type TakedownProviderRef, type TakedownProviderRole, 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, parseIsoDateEndOfDay, parseIsoDateString, staticApiKey, staticBearerToken };
package/dist/api/index.js CHANGED
@@ -333,6 +333,39 @@ var ChainPatrolApiClient = class {
333
333
  endDate: parseIsoDateEndOfDay(input.endDate)
334
334
  }));
335
335
  }
336
+ getMetricsTakedownTimeByProvider(input) {
337
+ return this.request(
338
+ "/metrics/takedown-time/by-provider",
339
+ __spreadProps(__spreadValues({}, input), {
340
+ startDate: parseIsoDate(input.startDate),
341
+ // Dates serialize as full timestamps, so a date-only `endDate` has to be
342
+ // widened here — the API can no longer tell it apart from an explicit
343
+ // midnight cut-off once it arrives.
344
+ endDate: parseIsoDateEndOfDay(input.endDate)
345
+ })
346
+ );
347
+ }
348
+ getMetricsTakedownSuccessRate(input) {
349
+ return this.request(
350
+ "/metrics/takedown-success-rate",
351
+ __spreadProps(__spreadValues({}, input), {
352
+ startDate: parseIsoDate(input.startDate),
353
+ // Dates serialize as full timestamps, so a date-only `endDate` has to be
354
+ // widened here — the API can no longer tell it apart from an explicit
355
+ // midnight cut-off once it arrives.
356
+ endDate: parseIsoDateEndOfDay(input.endDate)
357
+ })
358
+ );
359
+ }
360
+ getMetricsFalsePositiveRate(input) {
361
+ return this.request("/metrics/false-positive-rate", __spreadProps(__spreadValues({}, input), {
362
+ startDate: parseIsoDate(input.startDate),
363
+ // Dates serialize as full timestamps, so a date-only `endDate` has to be
364
+ // widened here — the API can no longer tell it apart from an explicit
365
+ // midnight cut-off once it arrives.
366
+ endDate: parseIsoDateEndOfDay(input.endDate)
367
+ }));
368
+ }
336
369
  getMetricsTakedownTimeTrend(input) {
337
370
  return this.request(
338
371
  "/metrics/takedown-time/trend",