@rustrak/client 0.12.2 → 0.13.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/dist/index.d.cts CHANGED
@@ -256,6 +256,7 @@ interface ListProjectsOptions {
256
256
  page?: number;
257
257
  per_page?: number;
258
258
  order?: SortOrder;
259
+ stats_period?: string;
259
260
  }
260
261
  interface ListTransactionsOptions {
261
262
  page?: number;
@@ -272,6 +273,12 @@ interface ListLogsOptions {
272
273
  level?: string;
273
274
  trace_id?: string;
274
275
  }
276
+ interface ReleaseHealthStatsOptions {
277
+ page?: number;
278
+ per_page?: number;
279
+ period?: string;
280
+ release?: string;
281
+ }
275
282
 
276
283
  declare const eventSchema: z.ZodObject<{
277
284
  id: z.ZodString;
@@ -560,6 +567,19 @@ type ProjectRole = z.infer<typeof projectRoleSchema>;
560
567
  type ProjectMember = z.infer<typeof projectMemberSchema>;
561
568
  type UpsertProjectMember = z.infer<typeof upsertProjectMemberSchema>;
562
569
 
570
+ declare const projectListStatsSchema: z.ZodObject<{
571
+ trend: z.ZodArray<z.ZodNumber>;
572
+ events: z.ZodObject<{
573
+ current: z.ZodNumber;
574
+ previous: z.ZodNullable<z.ZodNumber>;
575
+ }, z.core.$strip>;
576
+ new_issues: z.ZodObject<{
577
+ current: z.ZodNumber;
578
+ previous: z.ZodNullable<z.ZodNumber>;
579
+ }, z.core.$strip>;
580
+ open_issues: z.ZodNumber;
581
+ fatal_issues: z.ZodNumber;
582
+ }, z.core.$strip>;
563
583
  declare const projectSchema: z.ZodObject<{
564
584
  id: z.ZodNumber;
565
585
  name: z.ZodString;
@@ -571,17 +591,33 @@ declare const projectSchema: z.ZodObject<{
571
591
  created_at: z.ZodString;
572
592
  updated_at: z.ZodString;
573
593
  platform: z.ZodNullable<z.ZodString>;
594
+ stats: z.ZodOptional<z.ZodObject<{
595
+ trend: z.ZodArray<z.ZodNumber>;
596
+ events: z.ZodObject<{
597
+ current: z.ZodNumber;
598
+ previous: z.ZodNullable<z.ZodNumber>;
599
+ }, z.core.$strip>;
600
+ new_issues: z.ZodObject<{
601
+ current: z.ZodNumber;
602
+ previous: z.ZodNullable<z.ZodNumber>;
603
+ }, z.core.$strip>;
604
+ open_issues: z.ZodNumber;
605
+ fatal_issues: z.ZodNumber;
606
+ }, z.core.$strip>>;
574
607
  }, z.core.$strip>;
575
608
  declare const createProjectSchema: z.ZodObject<{
576
609
  name: z.ZodString;
577
610
  slug: z.ZodOptional<z.ZodString>;
611
+ platform: z.ZodOptional<z.ZodString>;
578
612
  }, z.core.$strip>;
579
613
  declare const updateProjectSchema: z.ZodObject<{
580
614
  name: z.ZodOptional<z.ZodString>;
581
615
  platform: z.ZodOptional<z.ZodString>;
616
+ slug: z.ZodOptional<z.ZodString>;
582
617
  }, z.core.$strip>;
583
618
 
584
619
  type Project = z.infer<typeof projectSchema>;
620
+ type ProjectListStats = z.infer<typeof projectListStatsSchema>;
585
621
  type CreateProject = z.infer<typeof createProjectSchema>;
586
622
  type UpdateProject = z.infer<typeof updateProjectSchema>;
587
623
 
@@ -596,17 +632,6 @@ declare const releaseHealthRowSchema: z.ZodObject<{
596
632
  crash_free_sessions_rate: z.ZodNullable<z.ZodNumber>;
597
633
  crash_free_users_rate: z.ZodNullable<z.ZodNumber>;
598
634
  }, z.core.$strip>;
599
- declare const releaseHealthSchema: z.ZodArray<z.ZodObject<{
600
- release: z.ZodString;
601
- environment: z.ZodString;
602
- total: z.ZodNumber;
603
- errored: z.ZodNumber;
604
- crashed: z.ZodNumber;
605
- abnormal: z.ZodNumber;
606
- healthy: z.ZodNumber;
607
- crash_free_sessions_rate: z.ZodNullable<z.ZodNumber>;
608
- crash_free_users_rate: z.ZodNullable<z.ZodNumber>;
609
- }, z.core.$strip>>;
610
635
  declare const sessionSummarySchema: z.ZodObject<{
611
636
  total: z.ZodNumber;
612
637
  errored: z.ZodNumber;
@@ -630,7 +655,6 @@ declare const sessionTimeseriesSchema: z.ZodArray<z.ZodObject<{
630
655
  }, z.core.$strip>>;
631
656
 
632
657
  type ReleaseHealthRow = z.infer<typeof releaseHealthRowSchema>;
633
- type ReleaseHealth = z.infer<typeof releaseHealthSchema>;
634
658
  type SessionSummary = z.infer<typeof sessionSummarySchema>;
635
659
  type SessionTimeseriesPoint = z.infer<typeof sessionTimeseriesPointSchema>;
636
660
  type SessionTimeseries = z.infer<typeof sessionTimeseriesSchema>;
@@ -676,6 +700,44 @@ interface AssembleInput {
676
700
  projects: string[];
677
701
  }
678
702
 
703
+ declare const eventTimeseriesPointSchema: z.ZodObject<{
704
+ bucket: z.ZodString;
705
+ total: z.ZodNumber;
706
+ fatal: z.ZodNumber;
707
+ error: z.ZodNumber;
708
+ warning: z.ZodNumber;
709
+ info: z.ZodNumber;
710
+ }, z.core.$strip>;
711
+ declare const eventTimeseriesSchema: z.ZodArray<z.ZodObject<{
712
+ bucket: z.ZodString;
713
+ total: z.ZodNumber;
714
+ fatal: z.ZodNumber;
715
+ error: z.ZodNumber;
716
+ warning: z.ZodNumber;
717
+ info: z.ZodNumber;
718
+ }, z.core.$strip>>;
719
+ declare const metricDeltaSchema: z.ZodObject<{
720
+ current: z.ZodNumber;
721
+ previous: z.ZodNullable<z.ZodNumber>;
722
+ }, z.core.$strip>;
723
+ declare const projectStatsSummarySchema: z.ZodObject<{
724
+ period_hours: z.ZodNullable<z.ZodNumber>;
725
+ events: z.ZodObject<{
726
+ current: z.ZodNumber;
727
+ previous: z.ZodNullable<z.ZodNumber>;
728
+ }, z.core.$strip>;
729
+ new_issues: z.ZodObject<{
730
+ current: z.ZodNumber;
731
+ previous: z.ZodNullable<z.ZodNumber>;
732
+ }, z.core.$strip>;
733
+ open_issues: z.ZodNumber;
734
+ }, z.core.$strip>;
735
+
736
+ type EventTimeseriesPoint = z.infer<typeof eventTimeseriesPointSchema>;
737
+ type EventTimeseries = z.infer<typeof eventTimeseriesSchema>;
738
+ type MetricDelta = z.infer<typeof metricDeltaSchema>;
739
+ type ProjectStatsSummary = z.infer<typeof projectStatsSummarySchema>;
740
+
679
741
  declare const sourceMapStorageSchema: z.ZodObject<{
680
742
  chunk_bytes: z.ZodNumber;
681
743
  source_file_bytes: z.ZodNumber;
@@ -1013,7 +1075,7 @@ declare class ReleasesResource extends BaseResource {
1013
1075
  }
1014
1076
 
1015
1077
  declare class SessionsResource extends BaseResource {
1016
- stats(projectId: number, period?: string, release?: string): Promise<ReleaseHealth>;
1078
+ stats(projectId: number, options?: ReleaseHealthStatsOptions): Promise<OffsetPaginatedResponse<ReleaseHealthRow>>;
1017
1079
  summary(projectId: number, period?: string): Promise<SessionSummary>;
1018
1080
  timeseries(projectId: number, period?: string, interval?: number): Promise<SessionTimeseries>;
1019
1081
  }
@@ -1032,6 +1094,11 @@ declare class SpansResource extends BaseResource {
1032
1094
  list(projectId: number, options?: ListSpansOptions): Promise<OffsetPaginatedResponse<Span>>;
1033
1095
  }
1034
1096
 
1097
+ declare class StatsResource extends BaseResource {
1098
+ timeseries(projectId: number, period?: string, interval?: number): Promise<EventTimeseries>;
1099
+ summary(projectId: number, period?: string): Promise<ProjectStatsSummary>;
1100
+ }
1101
+
1035
1102
  declare class StorageResource extends BaseResource {
1036
1103
  getSummary(): Promise<StorageSummary>;
1037
1104
  getProjects(): Promise<ProjectStorage[]>;
@@ -1084,6 +1151,7 @@ declare class RustrakClient {
1084
1151
  readonly logs: LogsResource;
1085
1152
  readonly spans: SpansResource;
1086
1153
  readonly agents: AgentsResource;
1154
+ readonly stats: StatsResource;
1087
1155
  readonly storage: StorageResource;
1088
1156
  readonly health: HealthResource;
1089
1157
  constructor(config: ClientConfig);
@@ -1129,4 +1197,4 @@ declare class ValidationError extends RustrakError {
1129
1197
  getValidationDetails(): string;
1130
1198
  }
1131
1199
 
1132
- export { type AcceptInvitation, type ActivityEntry, type AgentBreakdownOptions, type AgentDurationPoint, type AgentTimeseriesOptions, type AgentTimeseriesPoint, type AgentTraceSummary, type AgentTracesOptions, 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 BulkDeleteIssues, type BulkUpdateIssues, type ChannelType, type ChunkUploadCapability, type CleanupCounts, type CleanupOptions, type ClientConfig, type CreateAlertIntegration, type CreateAlertRule, type CreateAuthToken, type CreateComment, type CreateInvitation, type CreateNotificationChannel, type CreateProject, type CreateUserReport, type Event, type EventDetail, type GenAiBreakdownRow, type GlobalRole, type Invitation, type InvitationInfo, type Issue, type IssueAggregates, type IssueFilter, type IssueHash, type IssuePriority, type IssueSort, type IssueStats, type IssueStatsWindow, type IssueStatus, type IssueTagValue, type ListAlertHistoryOptions, type ListEventsOptions, type ListIssuesOptions, type ListLogsOptions, type ListProjectsOptions, type ListSourceMapsResponse, type ListSpansOptions, type ListTransactionsOptions, type Log, 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 SessionSummary, type SessionTimeseries, type SessionTimeseriesPoint, type SortOrder, type SourceMapFile, type SourceMapGcResult, type SourceMapStorage, type Span, type StorageSummary, type TagSummary, type TagValueCount, 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, type UserReport, ValidationError };
1200
+ export { type AcceptInvitation, type ActivityEntry, type AgentBreakdownOptions, type AgentDurationPoint, type AgentTimeseriesOptions, type AgentTimeseriesPoint, type AgentTraceSummary, type AgentTracesOptions, 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 BulkDeleteIssues, type BulkUpdateIssues, type ChannelType, type ChunkUploadCapability, type CleanupCounts, type CleanupOptions, type ClientConfig, type CreateAlertIntegration, type CreateAlertRule, type CreateAuthToken, type CreateComment, type CreateInvitation, type CreateNotificationChannel, type CreateProject, type CreateUserReport, type Event, type EventDetail, type EventTimeseries, type EventTimeseriesPoint, type GenAiBreakdownRow, type GlobalRole, type Invitation, type InvitationInfo, type Issue, type IssueAggregates, type IssueFilter, type IssueHash, type IssuePriority, type IssueSort, type IssueStats, type IssueStatsWindow, type IssueStatus, type IssueTagValue, type ListAlertHistoryOptions, type ListEventsOptions, type ListIssuesOptions, type ListLogsOptions, type ListProjectsOptions, type ListSourceMapsResponse, type ListSpansOptions, type ListTransactionsOptions, type Log, type LoginRequest, type LoginResult, type MetricDelta, NetworkError, NotFoundError, type NotificationChannel, type OffsetPaginatedResponse, type PaginatedResponse, type Project, type ProjectListStats, type ProjectMember, type ProjectRole, type ProjectStatsSummary, type ProjectStorage, type ProviderType, RateLimitError, type RegisterRequest, type ReleaseHealthRow, type ReleaseHealthStatsOptions, type RoutingOverride, RustrakClient, RustrakError, ServerError, type ServerVersion, type SessionSummary, type SessionTimeseries, type SessionTimeseriesPoint, type SortOrder, type SourceMapFile, type SourceMapGcResult, type SourceMapStorage, type Span, type StorageSummary, type TagSummary, type TagValueCount, 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, type UserReport, ValidationError };
package/dist/index.d.ts CHANGED
@@ -256,6 +256,7 @@ interface ListProjectsOptions {
256
256
  page?: number;
257
257
  per_page?: number;
258
258
  order?: SortOrder;
259
+ stats_period?: string;
259
260
  }
260
261
  interface ListTransactionsOptions {
261
262
  page?: number;
@@ -272,6 +273,12 @@ interface ListLogsOptions {
272
273
  level?: string;
273
274
  trace_id?: string;
274
275
  }
276
+ interface ReleaseHealthStatsOptions {
277
+ page?: number;
278
+ per_page?: number;
279
+ period?: string;
280
+ release?: string;
281
+ }
275
282
 
276
283
  declare const eventSchema: z.ZodObject<{
277
284
  id: z.ZodString;
@@ -560,6 +567,19 @@ type ProjectRole = z.infer<typeof projectRoleSchema>;
560
567
  type ProjectMember = z.infer<typeof projectMemberSchema>;
561
568
  type UpsertProjectMember = z.infer<typeof upsertProjectMemberSchema>;
562
569
 
570
+ declare const projectListStatsSchema: z.ZodObject<{
571
+ trend: z.ZodArray<z.ZodNumber>;
572
+ events: z.ZodObject<{
573
+ current: z.ZodNumber;
574
+ previous: z.ZodNullable<z.ZodNumber>;
575
+ }, z.core.$strip>;
576
+ new_issues: z.ZodObject<{
577
+ current: z.ZodNumber;
578
+ previous: z.ZodNullable<z.ZodNumber>;
579
+ }, z.core.$strip>;
580
+ open_issues: z.ZodNumber;
581
+ fatal_issues: z.ZodNumber;
582
+ }, z.core.$strip>;
563
583
  declare const projectSchema: z.ZodObject<{
564
584
  id: z.ZodNumber;
565
585
  name: z.ZodString;
@@ -571,17 +591,33 @@ declare const projectSchema: z.ZodObject<{
571
591
  created_at: z.ZodString;
572
592
  updated_at: z.ZodString;
573
593
  platform: z.ZodNullable<z.ZodString>;
594
+ stats: z.ZodOptional<z.ZodObject<{
595
+ trend: z.ZodArray<z.ZodNumber>;
596
+ events: z.ZodObject<{
597
+ current: z.ZodNumber;
598
+ previous: z.ZodNullable<z.ZodNumber>;
599
+ }, z.core.$strip>;
600
+ new_issues: z.ZodObject<{
601
+ current: z.ZodNumber;
602
+ previous: z.ZodNullable<z.ZodNumber>;
603
+ }, z.core.$strip>;
604
+ open_issues: z.ZodNumber;
605
+ fatal_issues: z.ZodNumber;
606
+ }, z.core.$strip>>;
574
607
  }, z.core.$strip>;
575
608
  declare const createProjectSchema: z.ZodObject<{
576
609
  name: z.ZodString;
577
610
  slug: z.ZodOptional<z.ZodString>;
611
+ platform: z.ZodOptional<z.ZodString>;
578
612
  }, z.core.$strip>;
579
613
  declare const updateProjectSchema: z.ZodObject<{
580
614
  name: z.ZodOptional<z.ZodString>;
581
615
  platform: z.ZodOptional<z.ZodString>;
616
+ slug: z.ZodOptional<z.ZodString>;
582
617
  }, z.core.$strip>;
583
618
 
584
619
  type Project = z.infer<typeof projectSchema>;
620
+ type ProjectListStats = z.infer<typeof projectListStatsSchema>;
585
621
  type CreateProject = z.infer<typeof createProjectSchema>;
586
622
  type UpdateProject = z.infer<typeof updateProjectSchema>;
587
623
 
@@ -596,17 +632,6 @@ declare const releaseHealthRowSchema: z.ZodObject<{
596
632
  crash_free_sessions_rate: z.ZodNullable<z.ZodNumber>;
597
633
  crash_free_users_rate: z.ZodNullable<z.ZodNumber>;
598
634
  }, z.core.$strip>;
599
- declare const releaseHealthSchema: z.ZodArray<z.ZodObject<{
600
- release: z.ZodString;
601
- environment: z.ZodString;
602
- total: z.ZodNumber;
603
- errored: z.ZodNumber;
604
- crashed: z.ZodNumber;
605
- abnormal: z.ZodNumber;
606
- healthy: z.ZodNumber;
607
- crash_free_sessions_rate: z.ZodNullable<z.ZodNumber>;
608
- crash_free_users_rate: z.ZodNullable<z.ZodNumber>;
609
- }, z.core.$strip>>;
610
635
  declare const sessionSummarySchema: z.ZodObject<{
611
636
  total: z.ZodNumber;
612
637
  errored: z.ZodNumber;
@@ -630,7 +655,6 @@ declare const sessionTimeseriesSchema: z.ZodArray<z.ZodObject<{
630
655
  }, z.core.$strip>>;
631
656
 
632
657
  type ReleaseHealthRow = z.infer<typeof releaseHealthRowSchema>;
633
- type ReleaseHealth = z.infer<typeof releaseHealthSchema>;
634
658
  type SessionSummary = z.infer<typeof sessionSummarySchema>;
635
659
  type SessionTimeseriesPoint = z.infer<typeof sessionTimeseriesPointSchema>;
636
660
  type SessionTimeseries = z.infer<typeof sessionTimeseriesSchema>;
@@ -676,6 +700,44 @@ interface AssembleInput {
676
700
  projects: string[];
677
701
  }
678
702
 
703
+ declare const eventTimeseriesPointSchema: z.ZodObject<{
704
+ bucket: z.ZodString;
705
+ total: z.ZodNumber;
706
+ fatal: z.ZodNumber;
707
+ error: z.ZodNumber;
708
+ warning: z.ZodNumber;
709
+ info: z.ZodNumber;
710
+ }, z.core.$strip>;
711
+ declare const eventTimeseriesSchema: z.ZodArray<z.ZodObject<{
712
+ bucket: z.ZodString;
713
+ total: z.ZodNumber;
714
+ fatal: z.ZodNumber;
715
+ error: z.ZodNumber;
716
+ warning: z.ZodNumber;
717
+ info: z.ZodNumber;
718
+ }, z.core.$strip>>;
719
+ declare const metricDeltaSchema: z.ZodObject<{
720
+ current: z.ZodNumber;
721
+ previous: z.ZodNullable<z.ZodNumber>;
722
+ }, z.core.$strip>;
723
+ declare const projectStatsSummarySchema: z.ZodObject<{
724
+ period_hours: z.ZodNullable<z.ZodNumber>;
725
+ events: z.ZodObject<{
726
+ current: z.ZodNumber;
727
+ previous: z.ZodNullable<z.ZodNumber>;
728
+ }, z.core.$strip>;
729
+ new_issues: z.ZodObject<{
730
+ current: z.ZodNumber;
731
+ previous: z.ZodNullable<z.ZodNumber>;
732
+ }, z.core.$strip>;
733
+ open_issues: z.ZodNumber;
734
+ }, z.core.$strip>;
735
+
736
+ type EventTimeseriesPoint = z.infer<typeof eventTimeseriesPointSchema>;
737
+ type EventTimeseries = z.infer<typeof eventTimeseriesSchema>;
738
+ type MetricDelta = z.infer<typeof metricDeltaSchema>;
739
+ type ProjectStatsSummary = z.infer<typeof projectStatsSummarySchema>;
740
+
679
741
  declare const sourceMapStorageSchema: z.ZodObject<{
680
742
  chunk_bytes: z.ZodNumber;
681
743
  source_file_bytes: z.ZodNumber;
@@ -1013,7 +1075,7 @@ declare class ReleasesResource extends BaseResource {
1013
1075
  }
1014
1076
 
1015
1077
  declare class SessionsResource extends BaseResource {
1016
- stats(projectId: number, period?: string, release?: string): Promise<ReleaseHealth>;
1078
+ stats(projectId: number, options?: ReleaseHealthStatsOptions): Promise<OffsetPaginatedResponse<ReleaseHealthRow>>;
1017
1079
  summary(projectId: number, period?: string): Promise<SessionSummary>;
1018
1080
  timeseries(projectId: number, period?: string, interval?: number): Promise<SessionTimeseries>;
1019
1081
  }
@@ -1032,6 +1094,11 @@ declare class SpansResource extends BaseResource {
1032
1094
  list(projectId: number, options?: ListSpansOptions): Promise<OffsetPaginatedResponse<Span>>;
1033
1095
  }
1034
1096
 
1097
+ declare class StatsResource extends BaseResource {
1098
+ timeseries(projectId: number, period?: string, interval?: number): Promise<EventTimeseries>;
1099
+ summary(projectId: number, period?: string): Promise<ProjectStatsSummary>;
1100
+ }
1101
+
1035
1102
  declare class StorageResource extends BaseResource {
1036
1103
  getSummary(): Promise<StorageSummary>;
1037
1104
  getProjects(): Promise<ProjectStorage[]>;
@@ -1084,6 +1151,7 @@ declare class RustrakClient {
1084
1151
  readonly logs: LogsResource;
1085
1152
  readonly spans: SpansResource;
1086
1153
  readonly agents: AgentsResource;
1154
+ readonly stats: StatsResource;
1087
1155
  readonly storage: StorageResource;
1088
1156
  readonly health: HealthResource;
1089
1157
  constructor(config: ClientConfig);
@@ -1129,4 +1197,4 @@ declare class ValidationError extends RustrakError {
1129
1197
  getValidationDetails(): string;
1130
1198
  }
1131
1199
 
1132
- export { type AcceptInvitation, type ActivityEntry, type AgentBreakdownOptions, type AgentDurationPoint, type AgentTimeseriesOptions, type AgentTimeseriesPoint, type AgentTraceSummary, type AgentTracesOptions, 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 BulkDeleteIssues, type BulkUpdateIssues, type ChannelType, type ChunkUploadCapability, type CleanupCounts, type CleanupOptions, type ClientConfig, type CreateAlertIntegration, type CreateAlertRule, type CreateAuthToken, type CreateComment, type CreateInvitation, type CreateNotificationChannel, type CreateProject, type CreateUserReport, type Event, type EventDetail, type GenAiBreakdownRow, type GlobalRole, type Invitation, type InvitationInfo, type Issue, type IssueAggregates, type IssueFilter, type IssueHash, type IssuePriority, type IssueSort, type IssueStats, type IssueStatsWindow, type IssueStatus, type IssueTagValue, type ListAlertHistoryOptions, type ListEventsOptions, type ListIssuesOptions, type ListLogsOptions, type ListProjectsOptions, type ListSourceMapsResponse, type ListSpansOptions, type ListTransactionsOptions, type Log, 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 SessionSummary, type SessionTimeseries, type SessionTimeseriesPoint, type SortOrder, type SourceMapFile, type SourceMapGcResult, type SourceMapStorage, type Span, type StorageSummary, type TagSummary, type TagValueCount, 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, type UserReport, ValidationError };
1200
+ export { type AcceptInvitation, type ActivityEntry, type AgentBreakdownOptions, type AgentDurationPoint, type AgentTimeseriesOptions, type AgentTimeseriesPoint, type AgentTraceSummary, type AgentTracesOptions, 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 BulkDeleteIssues, type BulkUpdateIssues, type ChannelType, type ChunkUploadCapability, type CleanupCounts, type CleanupOptions, type ClientConfig, type CreateAlertIntegration, type CreateAlertRule, type CreateAuthToken, type CreateComment, type CreateInvitation, type CreateNotificationChannel, type CreateProject, type CreateUserReport, type Event, type EventDetail, type EventTimeseries, type EventTimeseriesPoint, type GenAiBreakdownRow, type GlobalRole, type Invitation, type InvitationInfo, type Issue, type IssueAggregates, type IssueFilter, type IssueHash, type IssuePriority, type IssueSort, type IssueStats, type IssueStatsWindow, type IssueStatus, type IssueTagValue, type ListAlertHistoryOptions, type ListEventsOptions, type ListIssuesOptions, type ListLogsOptions, type ListProjectsOptions, type ListSourceMapsResponse, type ListSpansOptions, type ListTransactionsOptions, type Log, type LoginRequest, type LoginResult, type MetricDelta, NetworkError, NotFoundError, type NotificationChannel, type OffsetPaginatedResponse, type PaginatedResponse, type Project, type ProjectListStats, type ProjectMember, type ProjectRole, type ProjectStatsSummary, type ProjectStorage, type ProviderType, RateLimitError, type RegisterRequest, type ReleaseHealthRow, type ReleaseHealthStatsOptions, type RoutingOverride, RustrakClient, RustrakError, ServerError, type ServerVersion, type SessionSummary, type SessionTimeseries, type SessionTimeseriesPoint, type SortOrder, type SourceMapFile, type SourceMapGcResult, type SourceMapStorage, type Span, type StorageSummary, type TagSummary, type TagValueCount, 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, type UserReport, ValidationError };
package/dist/index.js CHANGED
@@ -357,6 +357,28 @@ var upsertProjectMemberSchema = z.object({
357
357
  user_id: z.number().int(),
358
358
  role: projectRoleSchema
359
359
  });
360
+ var metricDeltaSchema = z.object({
361
+ current: z.number().int(),
362
+ /**
363
+ * The same window immediately before this one. Null only for all-time
364
+ * requests, where a `0` would render as a misleading "+100%".
365
+ */
366
+ previous: z.number().int().nullable()
367
+ });
368
+ var projectListStatsSchema = z.object({
369
+ /**
370
+ * Distinct issues active in each bucket, oldest first. A shape, not a
371
+ * total: an issue firing all day appears in every bucket it touched.
372
+ */
373
+ trend: z.array(z.number().int()),
374
+ events: metricDeltaSchema,
375
+ /** Issues first seen in the window. Drives the "getting worse" signal. */
376
+ new_issues: metricDeltaSchema,
377
+ /** Unresolved issues right now, independent of the window. */
378
+ open_issues: z.number().int(),
379
+ /** The subset of `open_issues` at `fatal` level. */
380
+ fatal_issues: z.number().int()
381
+ });
360
382
  var projectSchema = z.object({
361
383
  id: z.number().int(),
362
384
  name: z.string(),
@@ -367,15 +389,31 @@ var projectSchema = z.object({
367
389
  digested_event_count: z.number().int(),
368
390
  created_at: dateTimeSchema,
369
391
  updated_at: dateTimeSchema,
370
- platform: z.string().nullable()
392
+ platform: z.string().nullable(),
393
+ stats: projectListStatsSchema.optional()
371
394
  });
372
395
  var createProjectSchema = z.object({
373
396
  name: z.string().min(1),
374
- slug: z.string().optional()
397
+ /**
398
+ * Slugified server-side. Supplying it means the user chose it, so a taken
399
+ * slug is a 409. Omitting it derives one from the name and silently
400
+ * de-duplicates, since nobody chose that value.
401
+ */
402
+ slug: z.string().min(1).optional(),
403
+ /**
404
+ * Validated server-side against SELECTABLE_PLATFORMS. Omitting it leaves the
405
+ * project eligible for platform auto-detection from its first event.
406
+ */
407
+ platform: z.string().min(1).optional()
375
408
  });
376
409
  var updateProjectSchema = z.object({
377
410
  name: z.string().min(1).optional(),
378
- platform: z.string().min(1).optional()
411
+ platform: z.string().min(1).optional(),
412
+ /**
413
+ * Slugified server-side. Unlike on create, a taken slug is a 409 rather than
414
+ * being silently de-duplicated.
415
+ */
416
+ slug: z.string().min(1).optional()
379
417
  });
380
418
  var releaseHealthRowSchema = z.object({
381
419
  release: z.string(),
@@ -388,7 +426,6 @@ var releaseHealthRowSchema = z.object({
388
426
  crash_free_sessions_rate: z.number().nullable(),
389
427
  crash_free_users_rate: z.number().nullable()
390
428
  });
391
- var releaseHealthSchema = z.array(releaseHealthRowSchema);
392
429
  var sessionSummarySchema = z.object({
393
430
  total: z.number().int(),
394
431
  errored: z.number().int(),
@@ -429,6 +466,27 @@ var sourceMapFileSchema = z.object({
429
466
  var listSourceMapsResponseSchema = z.object({
430
467
  data: z.array(sourceMapFileSchema)
431
468
  });
469
+ var eventTimeseriesPointSchema = z.object({
470
+ bucket: dateTimeSchema,
471
+ total: z.number().int(),
472
+ fatal: z.number().int(),
473
+ error: z.number().int(),
474
+ warning: z.number().int(),
475
+ info: z.number().int()
476
+ });
477
+ var eventTimeseriesSchema = z.array(eventTimeseriesPointSchema);
478
+ var metricDeltaSchema2 = z.object({
479
+ current: z.number().int(),
480
+ previous: z.number().int().nullable()
481
+ });
482
+ var projectStatsSummarySchema = z.object({
483
+ /** Resolved window in hours, or `null` for all time. */
484
+ period_hours: z.number().int().nullable(),
485
+ events: metricDeltaSchema2,
486
+ new_issues: metricDeltaSchema2,
487
+ /** Currently unresolved issues, independent of the window. */
488
+ open_issues: z.number().int()
489
+ });
432
490
  var sourceMapStorageSchema = z.object({
433
491
  chunk_bytes: z.number(),
434
492
  source_file_bytes: z.number(),
@@ -1274,6 +1332,9 @@ var ProjectsResource = class extends BaseResource {
1274
1332
  if (options?.order) {
1275
1333
  searchParams.set("order", options.order);
1276
1334
  }
1335
+ if (options?.stats_period) {
1336
+ searchParams.set("stats_period", options.stats_period);
1337
+ }
1277
1338
  const query = searchParams.toString();
1278
1339
  const url = query ? `api/projects?${query}` : "api/projects";
1279
1340
  const data = await this.http.get(url).json();
@@ -1333,22 +1394,30 @@ var ReleasesResource = class extends BaseResource {
1333
1394
  // src/resources/sessions.ts
1334
1395
  var SessionsResource = class extends BaseResource {
1335
1396
  /**
1336
- * Get per-release health stats for a project.
1397
+ * Get per-release health stats for a project, one offset-based page of
1398
+ * (release, environment) rows at a time, ordered by session volume.
1337
1399
  * @param projectId - Project ID
1338
- * @param period - Time window (e.g. '24h', '7d'). Defaults to '24h'.
1339
- * @param release - Scope to a single release (all environments), computed
1340
- * server-side. Omit to get every release in the project.
1400
+ * @param options - Time window, release scoping and pagination.
1341
1401
  */
1342
- async stats(projectId, period, release) {
1402
+ async stats(projectId, options) {
1343
1403
  const searchParams = {};
1344
- if (period) {
1345
- searchParams.period = period;
1404
+ if (options?.period) {
1405
+ searchParams.period = options.period;
1346
1406
  }
1347
- if (release) {
1348
- searchParams.release = release;
1407
+ if (options?.release) {
1408
+ searchParams.release = options.release;
1409
+ }
1410
+ if (options?.page) {
1411
+ searchParams.page = String(options.page);
1412
+ }
1413
+ if (options?.per_page) {
1414
+ searchParams.per_page = String(options.per_page);
1349
1415
  }
1350
1416
  const data = await this.http.get(`api/projects/${projectId}/sessions/stats`, { searchParams }).json();
1351
- return this.validate(data, releaseHealthSchema);
1417
+ return this.validate(
1418
+ data,
1419
+ offsetPaginatedResponseSchema(releaseHealthRowSchema)
1420
+ );
1352
1421
  }
1353
1422
  /**
1354
1423
  * Get project-wide session health, aggregated across all releases and environments.
@@ -1465,6 +1534,48 @@ var SpansResource = class extends BaseResource {
1465
1534
  return this.validate(data, offsetPaginatedResponseSchema(spanSchema));
1466
1535
  }
1467
1536
  };
1537
+
1538
+ // src/resources/stats.ts
1539
+ var StatsResource = class extends BaseResource {
1540
+ /**
1541
+ * Get time-bucketed error-event volume for a project, split by severity.
1542
+ *
1543
+ * Buckets are zero-filled across the window, so a quiet hour comes back as a
1544
+ * point with `total: 0` rather than being absent. All-time requests (no
1545
+ * `period`) are sparse: there is no lower bound to fill from.
1546
+ *
1547
+ * @param projectId - Project ID
1548
+ * @param period - Time window (e.g. '24h', '7d'). Omit for all time.
1549
+ * @param interval - Bucket width in hours (default: 1, max: 24).
1550
+ */
1551
+ async timeseries(projectId, period, interval) {
1552
+ const searchParams = {};
1553
+ if (period) {
1554
+ searchParams.period = period;
1555
+ }
1556
+ if (interval !== void 0) {
1557
+ searchParams.interval = interval.toString();
1558
+ }
1559
+ const data = await this.http.get(`api/projects/${projectId}/events/stats`, { searchParams }).json();
1560
+ return this.validate(data, eventTimeseriesSchema);
1561
+ }
1562
+ /**
1563
+ * Get project-wide counters for a window, each paired with the same counter
1564
+ * over the window immediately before it.
1565
+ *
1566
+ * @param projectId - Project ID
1567
+ * @param period - Time window (e.g. '24h', '7d'). Omit for all time, which
1568
+ * leaves every `previous` null.
1569
+ */
1570
+ async summary(projectId, period) {
1571
+ const searchParams = {};
1572
+ if (period) {
1573
+ searchParams.period = period;
1574
+ }
1575
+ const data = await this.http.get(`api/projects/${projectId}/stats/summary`, { searchParams }).json();
1576
+ return this.validate(data, projectStatsSummarySchema);
1577
+ }
1578
+ };
1468
1579
  var StorageResource = class extends BaseResource {
1469
1580
  /**
1470
1581
  * Get the instance-wide storage summary: row counts per data category, the
@@ -1672,7 +1783,8 @@ function transformHttpError(error) {
1672
1783
  let errorMessage = `HTTP ${status} error`;
1673
1784
  const body = error.data;
1674
1785
  if (body) {
1675
- errorMessage = body.error || body.message || errorMessage;
1786
+ const nested = typeof body.error === "object" ? body.error?.message : body.error;
1787
+ errorMessage = nested || body.message || errorMessage;
1676
1788
  }
1677
1789
  switch (status) {
1678
1790
  case 400:
@@ -1801,6 +1913,10 @@ var RustrakClient = class {
1801
1913
  * AI Agent Monitoring dashboard API resource
1802
1914
  */
1803
1915
  agents;
1916
+ /**
1917
+ * Stats API resource (project-wide overview aggregates)
1918
+ */
1919
+ stats;
1804
1920
  /**
1805
1921
  * Storage API resource (usage + retention cleanup, admin only)
1806
1922
  */
@@ -1833,6 +1949,7 @@ var RustrakClient = class {
1833
1949
  this.logs = new LogsResource(this.http);
1834
1950
  this.spans = new SpansResource(this.http);
1835
1951
  this.agents = new AgentsResource(this.http);
1952
+ this.stats = new StatsResource(this.http);
1836
1953
  this.storage = new StorageResource(this.http);
1837
1954
  this.health = new HealthResource(this.http);
1838
1955
  }