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