@rustrak/client 0.3.5 → 0.3.7

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/dist/index.d.cts CHANGED
@@ -336,6 +336,11 @@ interface ListProjectsOptions {
336
336
  interface ListTransactionsOptions {
337
337
  page?: number;
338
338
  per_page?: number;
339
+ name?: string;
340
+ op?: string;
341
+ status?: string;
342
+ environment?: string;
343
+ release?: string;
339
344
  }
340
345
 
341
346
  declare const eventSchema: z.ZodObject<{
@@ -511,6 +516,55 @@ interface AssembleInput {
511
516
  projects: string[];
512
517
  }
513
518
 
519
+ declare const sourceMapStorageSchema: z.ZodObject<{
520
+ chunk_bytes: z.ZodNumber;
521
+ source_file_bytes: z.ZodNumber;
522
+ total_bytes: z.ZodNumber;
523
+ file_count: z.ZodNumber;
524
+ }, z.core.$strip>;
525
+ declare const storageSummarySchema: z.ZodObject<{
526
+ total_db_size_bytes: z.ZodNumber;
527
+ events_count: z.ZodNumber;
528
+ transactions_count: z.ZodNumber;
529
+ spans_count: z.ZodNumber;
530
+ source_maps: z.ZodObject<{
531
+ chunk_bytes: z.ZodNumber;
532
+ source_file_bytes: z.ZodNumber;
533
+ total_bytes: z.ZodNumber;
534
+ file_count: z.ZodNumber;
535
+ }, z.core.$strip>;
536
+ }, z.core.$strip>;
537
+ declare const projectStorageSchema: z.ZodObject<{
538
+ project_id: z.ZodNumber;
539
+ project_name: z.ZodString;
540
+ events_count: z.ZodNumber;
541
+ transactions_count: z.ZodNumber;
542
+ spans_count: z.ZodNumber;
543
+ source_maps_count: z.ZodNumber;
544
+ estimated_bytes: z.ZodNumber;
545
+ }, z.core.$strip>;
546
+ declare const cleanupCountsSchema: z.ZodObject<{
547
+ events: z.ZodNumber;
548
+ transactions: z.ZodNumber;
549
+ spans: z.ZodNumber;
550
+ issues_removed: z.ZodNumber;
551
+ }, z.core.$strip>;
552
+ declare const sourceMapGcResultSchema: z.ZodObject<{
553
+ files_removed: z.ZodNumber;
554
+ bytes_freed: z.ZodNumber;
555
+ }, z.core.$strip>;
556
+ declare const cleanupOptionsSchema: z.ZodObject<{
557
+ older_than_days: z.ZodNumber;
558
+ project_id: z.ZodOptional<z.ZodNumber>;
559
+ }, z.core.$strip>;
560
+
561
+ type SourceMapStorage = z.infer<typeof sourceMapStorageSchema>;
562
+ type StorageSummary = z.infer<typeof storageSummarySchema>;
563
+ type ProjectStorage = z.infer<typeof projectStorageSchema>;
564
+ type CleanupCounts = z.infer<typeof cleanupCountsSchema>;
565
+ type SourceMapGcResult = z.infer<typeof sourceMapGcResultSchema>;
566
+ type CleanupOptions = z.infer<typeof cleanupOptionsSchema>;
567
+
514
568
  declare const globalRoleSchema: z.ZodEnum<{
515
569
  admin: "admin";
516
570
  member: "member";
@@ -584,9 +638,35 @@ declare const transactionDetailSchema: z.ZodObject<{
584
638
  ingested_at: z.ZodString;
585
639
  data: z.ZodRecord<z.ZodString, z.ZodAny>;
586
640
  }, z.core.$strip>;
641
+ declare const spanSchema: z.ZodObject<{
642
+ id: z.ZodString;
643
+ span_id: z.ZodNullable<z.ZodString>;
644
+ trace_id: z.ZodNullable<z.ZodString>;
645
+ parent_span_id: z.ZodNullable<z.ZodString>;
646
+ op: z.ZodNullable<z.ZodString>;
647
+ description: z.ZodNullable<z.ZodString>;
648
+ status: z.ZodNullable<z.ZodString>;
649
+ start_timestamp: z.ZodNullable<z.ZodString>;
650
+ timestamp: z.ZodNullable<z.ZodString>;
651
+ duration_ms: z.ZodNullable<z.ZodNumber>;
652
+ exclusive_time_ms: z.ZodNullable<z.ZodNumber>;
653
+ is_segment: z.ZodBoolean;
654
+ segment_id: z.ZodNullable<z.ZodString>;
655
+ }, z.core.$strip>;
656
+ declare const transactionStatsSchema: z.ZodObject<{
657
+ transaction_name: z.ZodString;
658
+ op: z.ZodNullable<z.ZodString>;
659
+ count: z.ZodNumber;
660
+ p50_ms: z.ZodNumber;
661
+ p95_ms: z.ZodNumber;
662
+ p99_ms: z.ZodNumber;
663
+ failure_rate: z.ZodNumber;
664
+ }, z.core.$strip>;
587
665
 
588
666
  type Transaction = z.infer<typeof transactionSchema>;
589
667
  type TransactionDetail = z.infer<typeof transactionDetailSchema>;
668
+ type Span = z.infer<typeof spanSchema>;
669
+ type TransactionStats = z.infer<typeof transactionStatsSchema>;
590
670
 
591
671
  declare class EventsResource extends BaseResource {
592
672
  list(projectId: number, issueId: string, options?: ListEventsOptions): Promise<PaginatedResponse<Event>>;
@@ -638,6 +718,15 @@ declare class SourceMapsResource extends BaseResource {
638
718
  list(orgSlug: string, projectSlug: string): Promise<ListSourceMapsResponse>;
639
719
  }
640
720
 
721
+ declare class StorageResource extends BaseResource {
722
+ getSummary(): Promise<StorageSummary>;
723
+ getProjects(): Promise<ProjectStorage[]>;
724
+ previewCleanup(options: CleanupOptions): Promise<CleanupCounts>;
725
+ executeCleanup(options: CleanupOptions): Promise<CleanupCounts>;
726
+ previewGcSourceMaps(): Promise<SourceMapGcResult>;
727
+ gcSourceMaps(): Promise<SourceMapGcResult>;
728
+ }
729
+
641
730
  declare class TeamResource extends BaseResource {
642
731
  list(): Promise<TeamMember[]>;
643
732
  updateRole(userId: number, role: GlobalRole): Promise<void>;
@@ -653,6 +742,12 @@ declare class TokensResource extends BaseResource {
653
742
 
654
743
  declare class TransactionsResource extends BaseResource {
655
744
  list(projectId: number, options?: ListTransactionsOptions): Promise<OffsetPaginatedResponse<Transaction>>;
745
+ getSpans(projectId: number, transactionId: string): Promise<Span[]>;
746
+ getStats(projectId: number, options?: {
747
+ page?: number;
748
+ per_page?: number;
749
+ }): Promise<OffsetPaginatedResponse<TransactionStats>>;
750
+ getStatForGroup(projectId: number, name: string, op?: string): Promise<TransactionStats>;
656
751
  get(projectId: number, transactionId: string): Promise<TransactionDetail>;
657
752
  }
658
753
 
@@ -671,6 +766,7 @@ declare class RustrakClient {
671
766
  readonly members: MembersResource;
672
767
  readonly sessions: SessionsResource;
673
768
  readonly transactions: TransactionsResource;
769
+ readonly storage: StorageResource;
674
770
  readonly health: HealthResource;
675
771
  constructor(config: ClientConfig);
676
772
  }
@@ -715,4 +811,4 @@ declare class ValidationError extends RustrakError {
715
811
  getValidationDetails(): string;
716
812
  }
717
813
 
718
- export { type AcceptInvitation, type AlertHistory, type AlertIntegration, type AlertRule, type AlertRuleChannelInput, type AlertStatus, type AlertType, type ApiError, type AssembleInput, type AssembleResponse, type AuthResponse, type AuthToken, type AuthTokenCreated, AuthenticationError, AuthorizationError, BadRequestError, type ChannelType, type ChunkUploadCapability, type ClientConfig, type CreateAlertIntegration, type CreateAlertRule, type CreateAuthToken, type CreateInvitation, type CreateNotificationChannel, type CreateProject, type Event, type EventDetail, type GlobalRole, type Invitation, type InvitationInfo, type Issue, type IssueFilter, type IssueSort, type ListAlertHistoryOptions, type ListEventsOptions, type ListIssuesOptions, type ListProjectsOptions, type ListSourceMapsResponse, type ListTransactionsOptions, type LoginRequest, type LoginResult, NetworkError, NotFoundError, type NotificationChannel, type OffsetPaginatedResponse, type PaginatedResponse, type Project, type ProjectMember, type ProjectRole, type ProviderType, RateLimitError, type RegisterRequest, type ReleaseHealth, type ReleaseHealthRow, type RoutingOverride, RustrakClient, RustrakError, ServerError, type ServerVersion, type SortOrder, type SourceMapFile, type TeamMember, type TestChannelResponse, type TestIntegrationBody, type Transaction, type TransactionDetail, type UpdateAlertIntegration, type UpdateAlertRule, type UpdateIssueState, type UpdateNotificationChannel, type UpdateProject, type UpdateUserRole, type UpsertProjectMember, type User, ValidationError };
814
+ export { type AcceptInvitation, type AlertHistory, type AlertIntegration, type AlertRule, type AlertRuleChannelInput, type AlertStatus, type AlertType, type ApiError, type AssembleInput, type AssembleResponse, type AuthResponse, type AuthToken, type AuthTokenCreated, AuthenticationError, AuthorizationError, BadRequestError, type ChannelType, type ChunkUploadCapability, type CleanupCounts, type CleanupOptions, type ClientConfig, type CreateAlertIntegration, type CreateAlertRule, type CreateAuthToken, type CreateInvitation, type CreateNotificationChannel, type CreateProject, type Event, type EventDetail, type GlobalRole, type Invitation, type InvitationInfo, type Issue, type IssueFilter, type IssueSort, type ListAlertHistoryOptions, type ListEventsOptions, type ListIssuesOptions, type ListProjectsOptions, type ListSourceMapsResponse, type ListTransactionsOptions, type LoginRequest, type LoginResult, NetworkError, NotFoundError, type NotificationChannel, type OffsetPaginatedResponse, type PaginatedResponse, type Project, type ProjectMember, type ProjectRole, type ProjectStorage, type ProviderType, RateLimitError, type RegisterRequest, type ReleaseHealth, type ReleaseHealthRow, type RoutingOverride, RustrakClient, RustrakError, ServerError, type ServerVersion, type SortOrder, type SourceMapFile, type SourceMapGcResult, type SourceMapStorage, type Span, type StorageSummary, type TeamMember, type TestChannelResponse, type TestIntegrationBody, type Transaction, type TransactionDetail, type TransactionStats, type UpdateAlertIntegration, type UpdateAlertRule, type UpdateIssueState, type UpdateNotificationChannel, type UpdateProject, type UpdateUserRole, type UpsertProjectMember, type User, ValidationError };
package/dist/index.d.ts CHANGED
@@ -336,6 +336,11 @@ interface ListProjectsOptions {
336
336
  interface ListTransactionsOptions {
337
337
  page?: number;
338
338
  per_page?: number;
339
+ name?: string;
340
+ op?: string;
341
+ status?: string;
342
+ environment?: string;
343
+ release?: string;
339
344
  }
340
345
 
341
346
  declare const eventSchema: z.ZodObject<{
@@ -511,6 +516,55 @@ interface AssembleInput {
511
516
  projects: string[];
512
517
  }
513
518
 
519
+ declare const sourceMapStorageSchema: z.ZodObject<{
520
+ chunk_bytes: z.ZodNumber;
521
+ source_file_bytes: z.ZodNumber;
522
+ total_bytes: z.ZodNumber;
523
+ file_count: z.ZodNumber;
524
+ }, z.core.$strip>;
525
+ declare const storageSummarySchema: z.ZodObject<{
526
+ total_db_size_bytes: z.ZodNumber;
527
+ events_count: z.ZodNumber;
528
+ transactions_count: z.ZodNumber;
529
+ spans_count: z.ZodNumber;
530
+ source_maps: z.ZodObject<{
531
+ chunk_bytes: z.ZodNumber;
532
+ source_file_bytes: z.ZodNumber;
533
+ total_bytes: z.ZodNumber;
534
+ file_count: z.ZodNumber;
535
+ }, z.core.$strip>;
536
+ }, z.core.$strip>;
537
+ declare const projectStorageSchema: z.ZodObject<{
538
+ project_id: z.ZodNumber;
539
+ project_name: z.ZodString;
540
+ events_count: z.ZodNumber;
541
+ transactions_count: z.ZodNumber;
542
+ spans_count: z.ZodNumber;
543
+ source_maps_count: z.ZodNumber;
544
+ estimated_bytes: z.ZodNumber;
545
+ }, z.core.$strip>;
546
+ declare const cleanupCountsSchema: z.ZodObject<{
547
+ events: z.ZodNumber;
548
+ transactions: z.ZodNumber;
549
+ spans: z.ZodNumber;
550
+ issues_removed: z.ZodNumber;
551
+ }, z.core.$strip>;
552
+ declare const sourceMapGcResultSchema: z.ZodObject<{
553
+ files_removed: z.ZodNumber;
554
+ bytes_freed: z.ZodNumber;
555
+ }, z.core.$strip>;
556
+ declare const cleanupOptionsSchema: z.ZodObject<{
557
+ older_than_days: z.ZodNumber;
558
+ project_id: z.ZodOptional<z.ZodNumber>;
559
+ }, z.core.$strip>;
560
+
561
+ type SourceMapStorage = z.infer<typeof sourceMapStorageSchema>;
562
+ type StorageSummary = z.infer<typeof storageSummarySchema>;
563
+ type ProjectStorage = z.infer<typeof projectStorageSchema>;
564
+ type CleanupCounts = z.infer<typeof cleanupCountsSchema>;
565
+ type SourceMapGcResult = z.infer<typeof sourceMapGcResultSchema>;
566
+ type CleanupOptions = z.infer<typeof cleanupOptionsSchema>;
567
+
514
568
  declare const globalRoleSchema: z.ZodEnum<{
515
569
  admin: "admin";
516
570
  member: "member";
@@ -584,9 +638,35 @@ declare const transactionDetailSchema: z.ZodObject<{
584
638
  ingested_at: z.ZodString;
585
639
  data: z.ZodRecord<z.ZodString, z.ZodAny>;
586
640
  }, z.core.$strip>;
641
+ declare const spanSchema: z.ZodObject<{
642
+ id: z.ZodString;
643
+ span_id: z.ZodNullable<z.ZodString>;
644
+ trace_id: z.ZodNullable<z.ZodString>;
645
+ parent_span_id: z.ZodNullable<z.ZodString>;
646
+ op: z.ZodNullable<z.ZodString>;
647
+ description: z.ZodNullable<z.ZodString>;
648
+ status: z.ZodNullable<z.ZodString>;
649
+ start_timestamp: z.ZodNullable<z.ZodString>;
650
+ timestamp: z.ZodNullable<z.ZodString>;
651
+ duration_ms: z.ZodNullable<z.ZodNumber>;
652
+ exclusive_time_ms: z.ZodNullable<z.ZodNumber>;
653
+ is_segment: z.ZodBoolean;
654
+ segment_id: z.ZodNullable<z.ZodString>;
655
+ }, z.core.$strip>;
656
+ declare const transactionStatsSchema: z.ZodObject<{
657
+ transaction_name: z.ZodString;
658
+ op: z.ZodNullable<z.ZodString>;
659
+ count: z.ZodNumber;
660
+ p50_ms: z.ZodNumber;
661
+ p95_ms: z.ZodNumber;
662
+ p99_ms: z.ZodNumber;
663
+ failure_rate: z.ZodNumber;
664
+ }, z.core.$strip>;
587
665
 
588
666
  type Transaction = z.infer<typeof transactionSchema>;
589
667
  type TransactionDetail = z.infer<typeof transactionDetailSchema>;
668
+ type Span = z.infer<typeof spanSchema>;
669
+ type TransactionStats = z.infer<typeof transactionStatsSchema>;
590
670
 
591
671
  declare class EventsResource extends BaseResource {
592
672
  list(projectId: number, issueId: string, options?: ListEventsOptions): Promise<PaginatedResponse<Event>>;
@@ -638,6 +718,15 @@ declare class SourceMapsResource extends BaseResource {
638
718
  list(orgSlug: string, projectSlug: string): Promise<ListSourceMapsResponse>;
639
719
  }
640
720
 
721
+ declare class StorageResource extends BaseResource {
722
+ getSummary(): Promise<StorageSummary>;
723
+ getProjects(): Promise<ProjectStorage[]>;
724
+ previewCleanup(options: CleanupOptions): Promise<CleanupCounts>;
725
+ executeCleanup(options: CleanupOptions): Promise<CleanupCounts>;
726
+ previewGcSourceMaps(): Promise<SourceMapGcResult>;
727
+ gcSourceMaps(): Promise<SourceMapGcResult>;
728
+ }
729
+
641
730
  declare class TeamResource extends BaseResource {
642
731
  list(): Promise<TeamMember[]>;
643
732
  updateRole(userId: number, role: GlobalRole): Promise<void>;
@@ -653,6 +742,12 @@ declare class TokensResource extends BaseResource {
653
742
 
654
743
  declare class TransactionsResource extends BaseResource {
655
744
  list(projectId: number, options?: ListTransactionsOptions): Promise<OffsetPaginatedResponse<Transaction>>;
745
+ getSpans(projectId: number, transactionId: string): Promise<Span[]>;
746
+ getStats(projectId: number, options?: {
747
+ page?: number;
748
+ per_page?: number;
749
+ }): Promise<OffsetPaginatedResponse<TransactionStats>>;
750
+ getStatForGroup(projectId: number, name: string, op?: string): Promise<TransactionStats>;
656
751
  get(projectId: number, transactionId: string): Promise<TransactionDetail>;
657
752
  }
658
753
 
@@ -671,6 +766,7 @@ declare class RustrakClient {
671
766
  readonly members: MembersResource;
672
767
  readonly sessions: SessionsResource;
673
768
  readonly transactions: TransactionsResource;
769
+ readonly storage: StorageResource;
674
770
  readonly health: HealthResource;
675
771
  constructor(config: ClientConfig);
676
772
  }
@@ -715,4 +811,4 @@ declare class ValidationError extends RustrakError {
715
811
  getValidationDetails(): string;
716
812
  }
717
813
 
718
- export { type AcceptInvitation, type AlertHistory, type AlertIntegration, type AlertRule, type AlertRuleChannelInput, type AlertStatus, type AlertType, type ApiError, type AssembleInput, type AssembleResponse, type AuthResponse, type AuthToken, type AuthTokenCreated, AuthenticationError, AuthorizationError, BadRequestError, type ChannelType, type ChunkUploadCapability, type ClientConfig, type CreateAlertIntegration, type CreateAlertRule, type CreateAuthToken, type CreateInvitation, type CreateNotificationChannel, type CreateProject, type Event, type EventDetail, type GlobalRole, type Invitation, type InvitationInfo, type Issue, type IssueFilter, type IssueSort, type ListAlertHistoryOptions, type ListEventsOptions, type ListIssuesOptions, type ListProjectsOptions, type ListSourceMapsResponse, type ListTransactionsOptions, type LoginRequest, type LoginResult, NetworkError, NotFoundError, type NotificationChannel, type OffsetPaginatedResponse, type PaginatedResponse, type Project, type ProjectMember, type ProjectRole, type ProviderType, RateLimitError, type RegisterRequest, type ReleaseHealth, type ReleaseHealthRow, type RoutingOverride, RustrakClient, RustrakError, ServerError, type ServerVersion, type SortOrder, type SourceMapFile, type TeamMember, type TestChannelResponse, type TestIntegrationBody, type Transaction, type TransactionDetail, type UpdateAlertIntegration, type UpdateAlertRule, type UpdateIssueState, type UpdateNotificationChannel, type UpdateProject, type UpdateUserRole, type UpsertProjectMember, type User, ValidationError };
814
+ export { type AcceptInvitation, type AlertHistory, type AlertIntegration, type AlertRule, type AlertRuleChannelInput, type AlertStatus, type AlertType, type ApiError, type AssembleInput, type AssembleResponse, type AuthResponse, type AuthToken, type AuthTokenCreated, AuthenticationError, AuthorizationError, BadRequestError, type ChannelType, type ChunkUploadCapability, type CleanupCounts, type CleanupOptions, type ClientConfig, type CreateAlertIntegration, type CreateAlertRule, type CreateAuthToken, type CreateInvitation, type CreateNotificationChannel, type CreateProject, type Event, type EventDetail, type GlobalRole, type Invitation, type InvitationInfo, type Issue, type IssueFilter, type IssueSort, type ListAlertHistoryOptions, type ListEventsOptions, type ListIssuesOptions, type ListProjectsOptions, type ListSourceMapsResponse, type ListTransactionsOptions, type LoginRequest, type LoginResult, NetworkError, NotFoundError, type NotificationChannel, type OffsetPaginatedResponse, type PaginatedResponse, type Project, type ProjectMember, type ProjectRole, type ProjectStorage, type ProviderType, RateLimitError, type RegisterRequest, type ReleaseHealth, type ReleaseHealthRow, type RoutingOverride, RustrakClient, RustrakError, ServerError, type ServerVersion, type SortOrder, type SourceMapFile, type SourceMapGcResult, type SourceMapStorage, type Span, type StorageSummary, type TeamMember, type TestChannelResponse, type TestIntegrationBody, type Transaction, type TransactionDetail, type TransactionStats, type UpdateAlertIntegration, type UpdateAlertRule, type UpdateIssueState, type UpdateNotificationChannel, type UpdateProject, type UpdateUserRole, type UpsertProjectMember, type User, ValidationError };
package/dist/index.js CHANGED
@@ -602,6 +602,42 @@ var sourceMapFileSchema = z.object({
602
602
  var listSourceMapsResponseSchema = z.object({
603
603
  data: z.array(sourceMapFileSchema)
604
604
  });
605
+ var sourceMapStorageSchema = z.object({
606
+ chunk_bytes: z.number(),
607
+ source_file_bytes: z.number(),
608
+ total_bytes: z.number(),
609
+ file_count: z.number()
610
+ });
611
+ var storageSummarySchema = z.object({
612
+ total_db_size_bytes: z.number(),
613
+ events_count: z.number(),
614
+ transactions_count: z.number(),
615
+ spans_count: z.number(),
616
+ source_maps: sourceMapStorageSchema
617
+ });
618
+ var projectStorageSchema = z.object({
619
+ project_id: z.number(),
620
+ project_name: z.string(),
621
+ events_count: z.number(),
622
+ transactions_count: z.number(),
623
+ spans_count: z.number(),
624
+ source_maps_count: z.number(),
625
+ estimated_bytes: z.number()
626
+ });
627
+ var cleanupCountsSchema = z.object({
628
+ events: z.number(),
629
+ transactions: z.number(),
630
+ spans: z.number(),
631
+ issues_removed: z.number()
632
+ });
633
+ var sourceMapGcResultSchema = z.object({
634
+ files_removed: z.number(),
635
+ bytes_freed: z.number()
636
+ });
637
+ var cleanupOptionsSchema = z.object({
638
+ older_than_days: z.number().int().min(1),
639
+ project_id: z.number().int().optional()
640
+ });
605
641
  var authTokenSchema = z.object({
606
642
  id: z.number().int(),
607
643
  token_prefix: z.string(),
@@ -644,6 +680,30 @@ var transactionDetailSchema = z.object({
644
680
  data: z.record(z.string(), z.any())
645
681
  // Full Sentry transaction payload
646
682
  });
683
+ var spanSchema = z.object({
684
+ id: uuidSchema,
685
+ span_id: z.string().nullable(),
686
+ trace_id: z.string().nullable(),
687
+ parent_span_id: z.string().nullable(),
688
+ op: z.string().nullable(),
689
+ description: z.string().nullable(),
690
+ status: z.string().nullable(),
691
+ start_timestamp: dateTimeSchema.nullable(),
692
+ timestamp: dateTimeSchema.nullable(),
693
+ duration_ms: z.number().nullable(),
694
+ exclusive_time_ms: z.number().nullable(),
695
+ is_segment: z.boolean(),
696
+ segment_id: z.string().nullable()
697
+ });
698
+ var transactionStatsSchema = z.object({
699
+ transaction_name: z.string(),
700
+ op: z.string().nullable(),
701
+ count: z.number().int(),
702
+ p50_ms: z.number(),
703
+ p95_ms: z.number(),
704
+ p99_ms: z.number(),
705
+ failure_rate: z.number()
706
+ });
647
707
 
648
708
  // src/resources/events.ts
649
709
  var EventsResource = class extends BaseResource {
@@ -911,6 +971,59 @@ var SourceMapsResource = class extends BaseResource {
911
971
  return this.validate(data, listSourceMapsResponseSchema);
912
972
  }
913
973
  };
974
+ var StorageResource = class extends BaseResource {
975
+ /**
976
+ * Get the instance-wide storage summary: row counts per data category, the
977
+ * whole-DB size, and exact source-map weight.
978
+ */
979
+ async getSummary() {
980
+ const data = await this.http.get("api/storage/summary").json();
981
+ return this.validate(data, storageSummarySchema);
982
+ }
983
+ /**
984
+ * Get the per-project storage breakdown (one row per project, including
985
+ * empty ones).
986
+ */
987
+ async getProjects() {
988
+ const data = await this.http.get("api/storage/projects").json();
989
+ return this.validate(data, z.array(projectStorageSchema));
990
+ }
991
+ /**
992
+ * Dry-run: count the rows a cleanup would remove. Mutates nothing — use it to
993
+ * confirm impact before {@link executeCleanup}.
994
+ */
995
+ async previewCleanup(options) {
996
+ const json = cleanupOptionsSchema.parse(options);
997
+ const data = await this.http.post("api/storage/cleanup/preview", { json }).json();
998
+ return this.validate(data, cleanupCountsSchema);
999
+ }
1000
+ /**
1001
+ * Execute a cleanup: delete data older than `older_than_days` (optionally
1002
+ * scoped to one project) and remove any issue left with zero events.
1003
+ */
1004
+ async executeCleanup(options) {
1005
+ const json = cleanupOptionsSchema.parse(options);
1006
+ const data = await this.http.post("api/storage/cleanup", { json }).json();
1007
+ return this.validate(data, cleanupCountsSchema);
1008
+ }
1009
+ /**
1010
+ * Dry-run for {@link gcSourceMaps}: count the orphaned source-map files and
1011
+ * bytes a GC would reclaim. Mutates nothing.
1012
+ */
1013
+ async previewGcSourceMaps() {
1014
+ const data = await this.http.post("api/storage/source-maps/gc/preview").json();
1015
+ return this.validate(data, sourceMapGcResultSchema);
1016
+ }
1017
+ /**
1018
+ * Garbage-collect orphaned source maps: files no longer referenced by any
1019
+ * upload, removed from the DB and unlinked from disk. Safe — never touches
1020
+ * referenced files.
1021
+ */
1022
+ async gcSourceMaps() {
1023
+ const data = await this.http.post("api/storage/source-maps/gc").json();
1024
+ return this.validate(data, sourceMapGcResultSchema);
1025
+ }
1026
+ };
914
1027
 
915
1028
  // src/resources/team.ts
916
1029
  var TeamResource = class extends BaseResource {
@@ -971,8 +1084,6 @@ var TokensResource = class extends BaseResource {
971
1084
  await this.http.delete(`api/tokens/${id}`);
972
1085
  }
973
1086
  };
974
-
975
- // src/resources/transactions.ts
976
1087
  var TransactionsResource = class extends BaseResource {
977
1088
  /**
978
1089
  * List transactions for a project with offset-based pagination (newest first)
@@ -985,6 +1096,21 @@ var TransactionsResource = class extends BaseResource {
985
1096
  if (options?.per_page) {
986
1097
  searchParams.per_page = String(options.per_page);
987
1098
  }
1099
+ if (options?.name) {
1100
+ searchParams.name = options.name;
1101
+ }
1102
+ if (options?.op) {
1103
+ searchParams.op = options.op;
1104
+ }
1105
+ if (options?.status) {
1106
+ searchParams.status = options.status;
1107
+ }
1108
+ if (options?.environment) {
1109
+ searchParams.environment = options.environment;
1110
+ }
1111
+ if (options?.release) {
1112
+ searchParams.release = options.release;
1113
+ }
988
1114
  const data = await this.http.get(`api/projects/${projectId}/transactions`, {
989
1115
  searchParams
990
1116
  }).json();
@@ -993,6 +1119,47 @@ var TransactionsResource = class extends BaseResource {
993
1119
  offsetPaginatedResponseSchema(transactionSchema)
994
1120
  );
995
1121
  }
1122
+ /**
1123
+ * Get the indexed spans extracted from a transaction, in waterfall order.
1124
+ */
1125
+ async getSpans(projectId, transactionId) {
1126
+ const data = await this.http.get(`api/projects/${projectId}/transactions/${transactionId}/spans`).json();
1127
+ return this.validate(data, z.array(spanSchema));
1128
+ }
1129
+ /**
1130
+ * Get aggregate performance stats (count, p50/p95/p99 latency, failure rate)
1131
+ * grouped by transaction name + op, most frequent first, with offset-based
1132
+ * pagination — same shape as the other list endpoints.
1133
+ */
1134
+ async getStats(projectId, options) {
1135
+ const searchParams = {};
1136
+ if (options?.page) {
1137
+ searchParams.page = String(options.page);
1138
+ }
1139
+ if (options?.per_page) {
1140
+ searchParams.per_page = String(options.per_page);
1141
+ }
1142
+ const data = await this.http.get(`api/projects/${projectId}/transactions/stats`, { searchParams }).json();
1143
+ return this.validate(
1144
+ data,
1145
+ offsetPaginatedResponseSchema(transactionStatsSchema)
1146
+ );
1147
+ }
1148
+ /**
1149
+ * Get aggregate stats for a single (transaction name, op) group — a direct
1150
+ * lookup that works regardless of how many groups the project has. Throws
1151
+ * NotFoundError when the group has no transactions.
1152
+ */
1153
+ async getStatForGroup(projectId, name, op) {
1154
+ const searchParams = { name };
1155
+ if (op) {
1156
+ searchParams.op = op;
1157
+ }
1158
+ const data = await this.http.get(`api/projects/${projectId}/transactions/stats/group`, {
1159
+ searchParams
1160
+ }).json();
1161
+ return this.validate(data, transactionStatsSchema);
1162
+ }
996
1163
  /**
997
1164
  * Get a single transaction by ID with its full Sentry payload (spans,
998
1165
  * contexts.trace, measurements, tags) for the performance detail view.
@@ -1121,6 +1288,10 @@ var RustrakClient = class {
1121
1288
  * Transactions API resource (performance monitoring)
1122
1289
  */
1123
1290
  transactions;
1291
+ /**
1292
+ * Storage API resource (usage + retention cleanup, admin only)
1293
+ */
1294
+ storage;
1124
1295
  /**
1125
1296
  * Health API resource (version info)
1126
1297
  */
@@ -1145,6 +1316,7 @@ var RustrakClient = class {
1145
1316
  this.members = new MembersResource(this.http);
1146
1317
  this.sessions = new SessionsResource(this.http);
1147
1318
  this.transactions = new TransactionsResource(this.http);
1319
+ this.storage = new StorageResource(this.http);
1148
1320
  this.health = new HealthResource(this.http);
1149
1321
  }
1150
1322
  };