@rustrak/client 0.12.2 → 0.12.3
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.cjs +86 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +52 -14
- package/dist/index.d.ts +52 -14
- package/dist/index.js +86 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -272,6 +272,12 @@ interface ListLogsOptions {
|
|
|
272
272
|
level?: string;
|
|
273
273
|
trace_id?: string;
|
|
274
274
|
}
|
|
275
|
+
interface ReleaseHealthStatsOptions {
|
|
276
|
+
page?: number;
|
|
277
|
+
per_page?: number;
|
|
278
|
+
period?: string;
|
|
279
|
+
release?: string;
|
|
280
|
+
}
|
|
275
281
|
|
|
276
282
|
declare const eventSchema: z.ZodObject<{
|
|
277
283
|
id: z.ZodString;
|
|
@@ -596,17 +602,6 @@ declare const releaseHealthRowSchema: z.ZodObject<{
|
|
|
596
602
|
crash_free_sessions_rate: z.ZodNullable<z.ZodNumber>;
|
|
597
603
|
crash_free_users_rate: z.ZodNullable<z.ZodNumber>;
|
|
598
604
|
}, 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
605
|
declare const sessionSummarySchema: z.ZodObject<{
|
|
611
606
|
total: z.ZodNumber;
|
|
612
607
|
errored: z.ZodNumber;
|
|
@@ -630,7 +625,6 @@ declare const sessionTimeseriesSchema: z.ZodArray<z.ZodObject<{
|
|
|
630
625
|
}, z.core.$strip>>;
|
|
631
626
|
|
|
632
627
|
type ReleaseHealthRow = z.infer<typeof releaseHealthRowSchema>;
|
|
633
|
-
type ReleaseHealth = z.infer<typeof releaseHealthSchema>;
|
|
634
628
|
type SessionSummary = z.infer<typeof sessionSummarySchema>;
|
|
635
629
|
type SessionTimeseriesPoint = z.infer<typeof sessionTimeseriesPointSchema>;
|
|
636
630
|
type SessionTimeseries = z.infer<typeof sessionTimeseriesSchema>;
|
|
@@ -676,6 +670,44 @@ interface AssembleInput {
|
|
|
676
670
|
projects: string[];
|
|
677
671
|
}
|
|
678
672
|
|
|
673
|
+
declare const eventTimeseriesPointSchema: z.ZodObject<{
|
|
674
|
+
bucket: z.ZodString;
|
|
675
|
+
total: z.ZodNumber;
|
|
676
|
+
fatal: z.ZodNumber;
|
|
677
|
+
error: z.ZodNumber;
|
|
678
|
+
warning: z.ZodNumber;
|
|
679
|
+
info: z.ZodNumber;
|
|
680
|
+
}, z.core.$strip>;
|
|
681
|
+
declare const eventTimeseriesSchema: z.ZodArray<z.ZodObject<{
|
|
682
|
+
bucket: z.ZodString;
|
|
683
|
+
total: z.ZodNumber;
|
|
684
|
+
fatal: z.ZodNumber;
|
|
685
|
+
error: z.ZodNumber;
|
|
686
|
+
warning: z.ZodNumber;
|
|
687
|
+
info: z.ZodNumber;
|
|
688
|
+
}, z.core.$strip>>;
|
|
689
|
+
declare const metricDeltaSchema: z.ZodObject<{
|
|
690
|
+
current: z.ZodNumber;
|
|
691
|
+
previous: z.ZodNullable<z.ZodNumber>;
|
|
692
|
+
}, z.core.$strip>;
|
|
693
|
+
declare const projectStatsSummarySchema: z.ZodObject<{
|
|
694
|
+
period_hours: z.ZodNullable<z.ZodNumber>;
|
|
695
|
+
events: z.ZodObject<{
|
|
696
|
+
current: z.ZodNumber;
|
|
697
|
+
previous: z.ZodNullable<z.ZodNumber>;
|
|
698
|
+
}, z.core.$strip>;
|
|
699
|
+
new_issues: z.ZodObject<{
|
|
700
|
+
current: z.ZodNumber;
|
|
701
|
+
previous: z.ZodNullable<z.ZodNumber>;
|
|
702
|
+
}, z.core.$strip>;
|
|
703
|
+
open_issues: z.ZodNumber;
|
|
704
|
+
}, z.core.$strip>;
|
|
705
|
+
|
|
706
|
+
type EventTimeseriesPoint = z.infer<typeof eventTimeseriesPointSchema>;
|
|
707
|
+
type EventTimeseries = z.infer<typeof eventTimeseriesSchema>;
|
|
708
|
+
type MetricDelta = z.infer<typeof metricDeltaSchema>;
|
|
709
|
+
type ProjectStatsSummary = z.infer<typeof projectStatsSummarySchema>;
|
|
710
|
+
|
|
679
711
|
declare const sourceMapStorageSchema: z.ZodObject<{
|
|
680
712
|
chunk_bytes: z.ZodNumber;
|
|
681
713
|
source_file_bytes: z.ZodNumber;
|
|
@@ -1013,7 +1045,7 @@ declare class ReleasesResource extends BaseResource {
|
|
|
1013
1045
|
}
|
|
1014
1046
|
|
|
1015
1047
|
declare class SessionsResource extends BaseResource {
|
|
1016
|
-
stats(projectId: number,
|
|
1048
|
+
stats(projectId: number, options?: ReleaseHealthStatsOptions): Promise<OffsetPaginatedResponse<ReleaseHealthRow>>;
|
|
1017
1049
|
summary(projectId: number, period?: string): Promise<SessionSummary>;
|
|
1018
1050
|
timeseries(projectId: number, period?: string, interval?: number): Promise<SessionTimeseries>;
|
|
1019
1051
|
}
|
|
@@ -1032,6 +1064,11 @@ declare class SpansResource extends BaseResource {
|
|
|
1032
1064
|
list(projectId: number, options?: ListSpansOptions): Promise<OffsetPaginatedResponse<Span>>;
|
|
1033
1065
|
}
|
|
1034
1066
|
|
|
1067
|
+
declare class StatsResource extends BaseResource {
|
|
1068
|
+
timeseries(projectId: number, period?: string, interval?: number): Promise<EventTimeseries>;
|
|
1069
|
+
summary(projectId: number, period?: string): Promise<ProjectStatsSummary>;
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1035
1072
|
declare class StorageResource extends BaseResource {
|
|
1036
1073
|
getSummary(): Promise<StorageSummary>;
|
|
1037
1074
|
getProjects(): Promise<ProjectStorage[]>;
|
|
@@ -1084,6 +1121,7 @@ declare class RustrakClient {
|
|
|
1084
1121
|
readonly logs: LogsResource;
|
|
1085
1122
|
readonly spans: SpansResource;
|
|
1086
1123
|
readonly agents: AgentsResource;
|
|
1124
|
+
readonly stats: StatsResource;
|
|
1087
1125
|
readonly storage: StorageResource;
|
|
1088
1126
|
readonly health: HealthResource;
|
|
1089
1127
|
constructor(config: ClientConfig);
|
|
@@ -1129,4 +1167,4 @@ declare class ValidationError extends RustrakError {
|
|
|
1129
1167
|
getValidationDetails(): string;
|
|
1130
1168
|
}
|
|
1131
1169
|
|
|
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
|
|
1170
|
+
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 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
|
@@ -272,6 +272,12 @@ interface ListLogsOptions {
|
|
|
272
272
|
level?: string;
|
|
273
273
|
trace_id?: string;
|
|
274
274
|
}
|
|
275
|
+
interface ReleaseHealthStatsOptions {
|
|
276
|
+
page?: number;
|
|
277
|
+
per_page?: number;
|
|
278
|
+
period?: string;
|
|
279
|
+
release?: string;
|
|
280
|
+
}
|
|
275
281
|
|
|
276
282
|
declare const eventSchema: z.ZodObject<{
|
|
277
283
|
id: z.ZodString;
|
|
@@ -596,17 +602,6 @@ declare const releaseHealthRowSchema: z.ZodObject<{
|
|
|
596
602
|
crash_free_sessions_rate: z.ZodNullable<z.ZodNumber>;
|
|
597
603
|
crash_free_users_rate: z.ZodNullable<z.ZodNumber>;
|
|
598
604
|
}, 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
605
|
declare const sessionSummarySchema: z.ZodObject<{
|
|
611
606
|
total: z.ZodNumber;
|
|
612
607
|
errored: z.ZodNumber;
|
|
@@ -630,7 +625,6 @@ declare const sessionTimeseriesSchema: z.ZodArray<z.ZodObject<{
|
|
|
630
625
|
}, z.core.$strip>>;
|
|
631
626
|
|
|
632
627
|
type ReleaseHealthRow = z.infer<typeof releaseHealthRowSchema>;
|
|
633
|
-
type ReleaseHealth = z.infer<typeof releaseHealthSchema>;
|
|
634
628
|
type SessionSummary = z.infer<typeof sessionSummarySchema>;
|
|
635
629
|
type SessionTimeseriesPoint = z.infer<typeof sessionTimeseriesPointSchema>;
|
|
636
630
|
type SessionTimeseries = z.infer<typeof sessionTimeseriesSchema>;
|
|
@@ -676,6 +670,44 @@ interface AssembleInput {
|
|
|
676
670
|
projects: string[];
|
|
677
671
|
}
|
|
678
672
|
|
|
673
|
+
declare const eventTimeseriesPointSchema: z.ZodObject<{
|
|
674
|
+
bucket: z.ZodString;
|
|
675
|
+
total: z.ZodNumber;
|
|
676
|
+
fatal: z.ZodNumber;
|
|
677
|
+
error: z.ZodNumber;
|
|
678
|
+
warning: z.ZodNumber;
|
|
679
|
+
info: z.ZodNumber;
|
|
680
|
+
}, z.core.$strip>;
|
|
681
|
+
declare const eventTimeseriesSchema: z.ZodArray<z.ZodObject<{
|
|
682
|
+
bucket: z.ZodString;
|
|
683
|
+
total: z.ZodNumber;
|
|
684
|
+
fatal: z.ZodNumber;
|
|
685
|
+
error: z.ZodNumber;
|
|
686
|
+
warning: z.ZodNumber;
|
|
687
|
+
info: z.ZodNumber;
|
|
688
|
+
}, z.core.$strip>>;
|
|
689
|
+
declare const metricDeltaSchema: z.ZodObject<{
|
|
690
|
+
current: z.ZodNumber;
|
|
691
|
+
previous: z.ZodNullable<z.ZodNumber>;
|
|
692
|
+
}, z.core.$strip>;
|
|
693
|
+
declare const projectStatsSummarySchema: z.ZodObject<{
|
|
694
|
+
period_hours: z.ZodNullable<z.ZodNumber>;
|
|
695
|
+
events: z.ZodObject<{
|
|
696
|
+
current: z.ZodNumber;
|
|
697
|
+
previous: z.ZodNullable<z.ZodNumber>;
|
|
698
|
+
}, z.core.$strip>;
|
|
699
|
+
new_issues: z.ZodObject<{
|
|
700
|
+
current: z.ZodNumber;
|
|
701
|
+
previous: z.ZodNullable<z.ZodNumber>;
|
|
702
|
+
}, z.core.$strip>;
|
|
703
|
+
open_issues: z.ZodNumber;
|
|
704
|
+
}, z.core.$strip>;
|
|
705
|
+
|
|
706
|
+
type EventTimeseriesPoint = z.infer<typeof eventTimeseriesPointSchema>;
|
|
707
|
+
type EventTimeseries = z.infer<typeof eventTimeseriesSchema>;
|
|
708
|
+
type MetricDelta = z.infer<typeof metricDeltaSchema>;
|
|
709
|
+
type ProjectStatsSummary = z.infer<typeof projectStatsSummarySchema>;
|
|
710
|
+
|
|
679
711
|
declare const sourceMapStorageSchema: z.ZodObject<{
|
|
680
712
|
chunk_bytes: z.ZodNumber;
|
|
681
713
|
source_file_bytes: z.ZodNumber;
|
|
@@ -1013,7 +1045,7 @@ declare class ReleasesResource extends BaseResource {
|
|
|
1013
1045
|
}
|
|
1014
1046
|
|
|
1015
1047
|
declare class SessionsResource extends BaseResource {
|
|
1016
|
-
stats(projectId: number,
|
|
1048
|
+
stats(projectId: number, options?: ReleaseHealthStatsOptions): Promise<OffsetPaginatedResponse<ReleaseHealthRow>>;
|
|
1017
1049
|
summary(projectId: number, period?: string): Promise<SessionSummary>;
|
|
1018
1050
|
timeseries(projectId: number, period?: string, interval?: number): Promise<SessionTimeseries>;
|
|
1019
1051
|
}
|
|
@@ -1032,6 +1064,11 @@ declare class SpansResource extends BaseResource {
|
|
|
1032
1064
|
list(projectId: number, options?: ListSpansOptions): Promise<OffsetPaginatedResponse<Span>>;
|
|
1033
1065
|
}
|
|
1034
1066
|
|
|
1067
|
+
declare class StatsResource extends BaseResource {
|
|
1068
|
+
timeseries(projectId: number, period?: string, interval?: number): Promise<EventTimeseries>;
|
|
1069
|
+
summary(projectId: number, period?: string): Promise<ProjectStatsSummary>;
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1035
1072
|
declare class StorageResource extends BaseResource {
|
|
1036
1073
|
getSummary(): Promise<StorageSummary>;
|
|
1037
1074
|
getProjects(): Promise<ProjectStorage[]>;
|
|
@@ -1084,6 +1121,7 @@ declare class RustrakClient {
|
|
|
1084
1121
|
readonly logs: LogsResource;
|
|
1085
1122
|
readonly spans: SpansResource;
|
|
1086
1123
|
readonly agents: AgentsResource;
|
|
1124
|
+
readonly stats: StatsResource;
|
|
1087
1125
|
readonly storage: StorageResource;
|
|
1088
1126
|
readonly health: HealthResource;
|
|
1089
1127
|
constructor(config: ClientConfig);
|
|
@@ -1129,4 +1167,4 @@ declare class ValidationError extends RustrakError {
|
|
|
1129
1167
|
getValidationDetails(): string;
|
|
1130
1168
|
}
|
|
1131
1169
|
|
|
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
|
|
1170
|
+
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 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
|
@@ -388,7 +388,6 @@ var releaseHealthRowSchema = z.object({
|
|
|
388
388
|
crash_free_sessions_rate: z.number().nullable(),
|
|
389
389
|
crash_free_users_rate: z.number().nullable()
|
|
390
390
|
});
|
|
391
|
-
var releaseHealthSchema = z.array(releaseHealthRowSchema);
|
|
392
391
|
var sessionSummarySchema = z.object({
|
|
393
392
|
total: z.number().int(),
|
|
394
393
|
errored: z.number().int(),
|
|
@@ -429,6 +428,27 @@ var sourceMapFileSchema = z.object({
|
|
|
429
428
|
var listSourceMapsResponseSchema = z.object({
|
|
430
429
|
data: z.array(sourceMapFileSchema)
|
|
431
430
|
});
|
|
431
|
+
var eventTimeseriesPointSchema = z.object({
|
|
432
|
+
bucket: dateTimeSchema,
|
|
433
|
+
total: z.number().int(),
|
|
434
|
+
fatal: z.number().int(),
|
|
435
|
+
error: z.number().int(),
|
|
436
|
+
warning: z.number().int(),
|
|
437
|
+
info: z.number().int()
|
|
438
|
+
});
|
|
439
|
+
var eventTimeseriesSchema = z.array(eventTimeseriesPointSchema);
|
|
440
|
+
var metricDeltaSchema = z.object({
|
|
441
|
+
current: z.number().int(),
|
|
442
|
+
previous: z.number().int().nullable()
|
|
443
|
+
});
|
|
444
|
+
var projectStatsSummarySchema = z.object({
|
|
445
|
+
/** Resolved window in hours, or `null` for all time. */
|
|
446
|
+
period_hours: z.number().int().nullable(),
|
|
447
|
+
events: metricDeltaSchema,
|
|
448
|
+
new_issues: metricDeltaSchema,
|
|
449
|
+
/** Currently unresolved issues, independent of the window. */
|
|
450
|
+
open_issues: z.number().int()
|
|
451
|
+
});
|
|
432
452
|
var sourceMapStorageSchema = z.object({
|
|
433
453
|
chunk_bytes: z.number(),
|
|
434
454
|
source_file_bytes: z.number(),
|
|
@@ -1333,22 +1353,30 @@ var ReleasesResource = class extends BaseResource {
|
|
|
1333
1353
|
// src/resources/sessions.ts
|
|
1334
1354
|
var SessionsResource = class extends BaseResource {
|
|
1335
1355
|
/**
|
|
1336
|
-
* Get per-release health stats for a project
|
|
1356
|
+
* Get per-release health stats for a project, one offset-based page of
|
|
1357
|
+
* (release, environment) rows at a time, ordered by session volume.
|
|
1337
1358
|
* @param projectId - Project ID
|
|
1338
|
-
* @param
|
|
1339
|
-
* @param release - Scope to a single release (all environments), computed
|
|
1340
|
-
* server-side. Omit to get every release in the project.
|
|
1359
|
+
* @param options - Time window, release scoping and pagination.
|
|
1341
1360
|
*/
|
|
1342
|
-
async stats(projectId,
|
|
1361
|
+
async stats(projectId, options) {
|
|
1343
1362
|
const searchParams = {};
|
|
1344
|
-
if (period) {
|
|
1345
|
-
searchParams.period = period;
|
|
1363
|
+
if (options?.period) {
|
|
1364
|
+
searchParams.period = options.period;
|
|
1346
1365
|
}
|
|
1347
|
-
if (release) {
|
|
1348
|
-
searchParams.release = release;
|
|
1366
|
+
if (options?.release) {
|
|
1367
|
+
searchParams.release = options.release;
|
|
1368
|
+
}
|
|
1369
|
+
if (options?.page) {
|
|
1370
|
+
searchParams.page = String(options.page);
|
|
1371
|
+
}
|
|
1372
|
+
if (options?.per_page) {
|
|
1373
|
+
searchParams.per_page = String(options.per_page);
|
|
1349
1374
|
}
|
|
1350
1375
|
const data = await this.http.get(`api/projects/${projectId}/sessions/stats`, { searchParams }).json();
|
|
1351
|
-
return this.validate(
|
|
1376
|
+
return this.validate(
|
|
1377
|
+
data,
|
|
1378
|
+
offsetPaginatedResponseSchema(releaseHealthRowSchema)
|
|
1379
|
+
);
|
|
1352
1380
|
}
|
|
1353
1381
|
/**
|
|
1354
1382
|
* Get project-wide session health, aggregated across all releases and environments.
|
|
@@ -1465,6 +1493,48 @@ var SpansResource = class extends BaseResource {
|
|
|
1465
1493
|
return this.validate(data, offsetPaginatedResponseSchema(spanSchema));
|
|
1466
1494
|
}
|
|
1467
1495
|
};
|
|
1496
|
+
|
|
1497
|
+
// src/resources/stats.ts
|
|
1498
|
+
var StatsResource = class extends BaseResource {
|
|
1499
|
+
/**
|
|
1500
|
+
* Get time-bucketed error-event volume for a project, split by severity.
|
|
1501
|
+
*
|
|
1502
|
+
* Buckets are zero-filled across the window, so a quiet hour comes back as a
|
|
1503
|
+
* point with `total: 0` rather than being absent. All-time requests (no
|
|
1504
|
+
* `period`) are sparse: there is no lower bound to fill from.
|
|
1505
|
+
*
|
|
1506
|
+
* @param projectId - Project ID
|
|
1507
|
+
* @param period - Time window (e.g. '24h', '7d'). Omit for all time.
|
|
1508
|
+
* @param interval - Bucket width in hours (default: 1, max: 24).
|
|
1509
|
+
*/
|
|
1510
|
+
async timeseries(projectId, period, interval) {
|
|
1511
|
+
const searchParams = {};
|
|
1512
|
+
if (period) {
|
|
1513
|
+
searchParams.period = period;
|
|
1514
|
+
}
|
|
1515
|
+
if (interval !== void 0) {
|
|
1516
|
+
searchParams.interval = interval.toString();
|
|
1517
|
+
}
|
|
1518
|
+
const data = await this.http.get(`api/projects/${projectId}/events/stats`, { searchParams }).json();
|
|
1519
|
+
return this.validate(data, eventTimeseriesSchema);
|
|
1520
|
+
}
|
|
1521
|
+
/**
|
|
1522
|
+
* Get project-wide counters for a window, each paired with the same counter
|
|
1523
|
+
* over the window immediately before it.
|
|
1524
|
+
*
|
|
1525
|
+
* @param projectId - Project ID
|
|
1526
|
+
* @param period - Time window (e.g. '24h', '7d'). Omit for all time, which
|
|
1527
|
+
* leaves every `previous` null.
|
|
1528
|
+
*/
|
|
1529
|
+
async summary(projectId, period) {
|
|
1530
|
+
const searchParams = {};
|
|
1531
|
+
if (period) {
|
|
1532
|
+
searchParams.period = period;
|
|
1533
|
+
}
|
|
1534
|
+
const data = await this.http.get(`api/projects/${projectId}/stats/summary`, { searchParams }).json();
|
|
1535
|
+
return this.validate(data, projectStatsSummarySchema);
|
|
1536
|
+
}
|
|
1537
|
+
};
|
|
1468
1538
|
var StorageResource = class extends BaseResource {
|
|
1469
1539
|
/**
|
|
1470
1540
|
* Get the instance-wide storage summary: row counts per data category, the
|
|
@@ -1801,6 +1871,10 @@ var RustrakClient = class {
|
|
|
1801
1871
|
* AI Agent Monitoring dashboard API resource
|
|
1802
1872
|
*/
|
|
1803
1873
|
agents;
|
|
1874
|
+
/**
|
|
1875
|
+
* Stats API resource (project-wide overview aggregates)
|
|
1876
|
+
*/
|
|
1877
|
+
stats;
|
|
1804
1878
|
/**
|
|
1805
1879
|
* Storage API resource (usage + retention cleanup, admin only)
|
|
1806
1880
|
*/
|
|
@@ -1833,6 +1907,7 @@ var RustrakClient = class {
|
|
|
1833
1907
|
this.logs = new LogsResource(this.http);
|
|
1834
1908
|
this.spans = new SpansResource(this.http);
|
|
1835
1909
|
this.agents = new AgentsResource(this.http);
|
|
1910
|
+
this.stats = new StatsResource(this.http);
|
|
1836
1911
|
this.storage = new StorageResource(this.http);
|
|
1837
1912
|
this.health = new HealthResource(this.http);
|
|
1838
1913
|
}
|