@rustrak/client 0.3.11 → 0.3.12
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 +85 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +35 -2
- package/dist/index.d.ts +35 -2
- package/dist/index.js +85 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -289,6 +289,7 @@ declare const sortOrderSchema: z.ZodEnum<{
|
|
|
289
289
|
declare const issueSortSchema: z.ZodEnum<{
|
|
290
290
|
digest_order: "digest_order";
|
|
291
291
|
last_seen: "last_seen";
|
|
292
|
+
event_count: "event_count";
|
|
292
293
|
}>;
|
|
293
294
|
declare const issueFilterSchema: z.ZodEnum<{
|
|
294
295
|
open: "open";
|
|
@@ -614,6 +615,7 @@ declare const projectSchema: z.ZodObject<{
|
|
|
614
615
|
digested_event_count: z.ZodNumber;
|
|
615
616
|
created_at: z.ZodString;
|
|
616
617
|
updated_at: z.ZodString;
|
|
618
|
+
platform: z.ZodNullable<z.ZodString>;
|
|
617
619
|
}, z.core.$strip>;
|
|
618
620
|
declare const createProjectSchema: z.ZodObject<{
|
|
619
621
|
name: z.ZodString;
|
|
@@ -649,9 +651,33 @@ declare const releaseHealthSchema: z.ZodArray<z.ZodObject<{
|
|
|
649
651
|
crash_free_sessions_rate: z.ZodNullable<z.ZodNumber>;
|
|
650
652
|
crash_free_users_rate: z.ZodNullable<z.ZodNumber>;
|
|
651
653
|
}, z.core.$strip>>;
|
|
654
|
+
declare const sessionSummarySchema: z.ZodObject<{
|
|
655
|
+
total: z.ZodNumber;
|
|
656
|
+
errored: z.ZodNumber;
|
|
657
|
+
crashed: z.ZodNumber;
|
|
658
|
+
abnormal: z.ZodNumber;
|
|
659
|
+
crash_free_sessions_rate: z.ZodNullable<z.ZodNumber>;
|
|
660
|
+
crash_free_users_rate: z.ZodNullable<z.ZodNumber>;
|
|
661
|
+
active_releases: z.ZodNumber;
|
|
662
|
+
}, z.core.$strip>;
|
|
663
|
+
declare const sessionTimeseriesPointSchema: z.ZodObject<{
|
|
664
|
+
bucket: z.ZodString;
|
|
665
|
+
total: z.ZodNumber;
|
|
666
|
+
crashed: z.ZodNumber;
|
|
667
|
+
crash_free_sessions_rate: z.ZodNullable<z.ZodNumber>;
|
|
668
|
+
}, z.core.$strip>;
|
|
669
|
+
declare const sessionTimeseriesSchema: z.ZodArray<z.ZodObject<{
|
|
670
|
+
bucket: z.ZodString;
|
|
671
|
+
total: z.ZodNumber;
|
|
672
|
+
crashed: z.ZodNumber;
|
|
673
|
+
crash_free_sessions_rate: z.ZodNullable<z.ZodNumber>;
|
|
674
|
+
}, z.core.$strip>>;
|
|
652
675
|
|
|
653
676
|
type ReleaseHealthRow = z.infer<typeof releaseHealthRowSchema>;
|
|
654
677
|
type ReleaseHealth = z.infer<typeof releaseHealthSchema>;
|
|
678
|
+
type SessionSummary = z.infer<typeof sessionSummarySchema>;
|
|
679
|
+
type SessionTimeseriesPoint = z.infer<typeof sessionTimeseriesPointSchema>;
|
|
680
|
+
type SessionTimeseries = z.infer<typeof sessionTimeseriesSchema>;
|
|
655
681
|
|
|
656
682
|
declare const chunkUploadCapabilitySchema: z.ZodObject<{
|
|
657
683
|
url: z.ZodString;
|
|
@@ -920,8 +946,14 @@ declare class ProjectsResource extends BaseResource {
|
|
|
920
946
|
delete(id: number): Promise<void>;
|
|
921
947
|
}
|
|
922
948
|
|
|
949
|
+
declare class ReleasesResource extends BaseResource {
|
|
950
|
+
newIssues(projectId: number, release: string, limit?: number): Promise<Issue[]>;
|
|
951
|
+
}
|
|
952
|
+
|
|
923
953
|
declare class SessionsResource extends BaseResource {
|
|
924
|
-
stats(projectId: number, period?: string): Promise<ReleaseHealth>;
|
|
954
|
+
stats(projectId: number, period?: string, release?: string): Promise<ReleaseHealth>;
|
|
955
|
+
summary(projectId: number, period?: string): Promise<SessionSummary>;
|
|
956
|
+
timeseries(projectId: number, period?: string, interval?: number): Promise<SessionTimeseries>;
|
|
925
957
|
}
|
|
926
958
|
|
|
927
959
|
declare class SourceMapsResource extends BaseResource {
|
|
@@ -981,6 +1013,7 @@ declare class RustrakClient {
|
|
|
981
1013
|
readonly invitations: InvitationsResource;
|
|
982
1014
|
readonly members: MembersResource;
|
|
983
1015
|
readonly sessions: SessionsResource;
|
|
1016
|
+
readonly releases: ReleasesResource;
|
|
984
1017
|
readonly transactions: TransactionsResource;
|
|
985
1018
|
readonly logs: LogsResource;
|
|
986
1019
|
readonly storage: StorageResource;
|
|
@@ -1028,4 +1061,4 @@ declare class ValidationError extends RustrakError {
|
|
|
1028
1061
|
getValidationDetails(): string;
|
|
1029
1062
|
}
|
|
1030
1063
|
|
|
1031
|
-
export { type AcceptInvitation, type ActivityEntry, 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 CreateDeploy, type CreateInvitation, type CreateNotificationChannel, type CreateProject, type CreateUserReport, type Event, type EventDetail, 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 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 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 };
|
|
1064
|
+
export { type AcceptInvitation, type ActivityEntry, 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 CreateDeploy, type CreateInvitation, type CreateNotificationChannel, type CreateProject, type CreateUserReport, type Event, type EventDetail, 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 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -289,6 +289,7 @@ declare const sortOrderSchema: z.ZodEnum<{
|
|
|
289
289
|
declare const issueSortSchema: z.ZodEnum<{
|
|
290
290
|
digest_order: "digest_order";
|
|
291
291
|
last_seen: "last_seen";
|
|
292
|
+
event_count: "event_count";
|
|
292
293
|
}>;
|
|
293
294
|
declare const issueFilterSchema: z.ZodEnum<{
|
|
294
295
|
open: "open";
|
|
@@ -614,6 +615,7 @@ declare const projectSchema: z.ZodObject<{
|
|
|
614
615
|
digested_event_count: z.ZodNumber;
|
|
615
616
|
created_at: z.ZodString;
|
|
616
617
|
updated_at: z.ZodString;
|
|
618
|
+
platform: z.ZodNullable<z.ZodString>;
|
|
617
619
|
}, z.core.$strip>;
|
|
618
620
|
declare const createProjectSchema: z.ZodObject<{
|
|
619
621
|
name: z.ZodString;
|
|
@@ -649,9 +651,33 @@ declare const releaseHealthSchema: z.ZodArray<z.ZodObject<{
|
|
|
649
651
|
crash_free_sessions_rate: z.ZodNullable<z.ZodNumber>;
|
|
650
652
|
crash_free_users_rate: z.ZodNullable<z.ZodNumber>;
|
|
651
653
|
}, z.core.$strip>>;
|
|
654
|
+
declare const sessionSummarySchema: z.ZodObject<{
|
|
655
|
+
total: z.ZodNumber;
|
|
656
|
+
errored: z.ZodNumber;
|
|
657
|
+
crashed: z.ZodNumber;
|
|
658
|
+
abnormal: z.ZodNumber;
|
|
659
|
+
crash_free_sessions_rate: z.ZodNullable<z.ZodNumber>;
|
|
660
|
+
crash_free_users_rate: z.ZodNullable<z.ZodNumber>;
|
|
661
|
+
active_releases: z.ZodNumber;
|
|
662
|
+
}, z.core.$strip>;
|
|
663
|
+
declare const sessionTimeseriesPointSchema: z.ZodObject<{
|
|
664
|
+
bucket: z.ZodString;
|
|
665
|
+
total: z.ZodNumber;
|
|
666
|
+
crashed: z.ZodNumber;
|
|
667
|
+
crash_free_sessions_rate: z.ZodNullable<z.ZodNumber>;
|
|
668
|
+
}, z.core.$strip>;
|
|
669
|
+
declare const sessionTimeseriesSchema: z.ZodArray<z.ZodObject<{
|
|
670
|
+
bucket: z.ZodString;
|
|
671
|
+
total: z.ZodNumber;
|
|
672
|
+
crashed: z.ZodNumber;
|
|
673
|
+
crash_free_sessions_rate: z.ZodNullable<z.ZodNumber>;
|
|
674
|
+
}, z.core.$strip>>;
|
|
652
675
|
|
|
653
676
|
type ReleaseHealthRow = z.infer<typeof releaseHealthRowSchema>;
|
|
654
677
|
type ReleaseHealth = z.infer<typeof releaseHealthSchema>;
|
|
678
|
+
type SessionSummary = z.infer<typeof sessionSummarySchema>;
|
|
679
|
+
type SessionTimeseriesPoint = z.infer<typeof sessionTimeseriesPointSchema>;
|
|
680
|
+
type SessionTimeseries = z.infer<typeof sessionTimeseriesSchema>;
|
|
655
681
|
|
|
656
682
|
declare const chunkUploadCapabilitySchema: z.ZodObject<{
|
|
657
683
|
url: z.ZodString;
|
|
@@ -920,8 +946,14 @@ declare class ProjectsResource extends BaseResource {
|
|
|
920
946
|
delete(id: number): Promise<void>;
|
|
921
947
|
}
|
|
922
948
|
|
|
949
|
+
declare class ReleasesResource extends BaseResource {
|
|
950
|
+
newIssues(projectId: number, release: string, limit?: number): Promise<Issue[]>;
|
|
951
|
+
}
|
|
952
|
+
|
|
923
953
|
declare class SessionsResource extends BaseResource {
|
|
924
|
-
stats(projectId: number, period?: string): Promise<ReleaseHealth>;
|
|
954
|
+
stats(projectId: number, period?: string, release?: string): Promise<ReleaseHealth>;
|
|
955
|
+
summary(projectId: number, period?: string): Promise<SessionSummary>;
|
|
956
|
+
timeseries(projectId: number, period?: string, interval?: number): Promise<SessionTimeseries>;
|
|
925
957
|
}
|
|
926
958
|
|
|
927
959
|
declare class SourceMapsResource extends BaseResource {
|
|
@@ -981,6 +1013,7 @@ declare class RustrakClient {
|
|
|
981
1013
|
readonly invitations: InvitationsResource;
|
|
982
1014
|
readonly members: MembersResource;
|
|
983
1015
|
readonly sessions: SessionsResource;
|
|
1016
|
+
readonly releases: ReleasesResource;
|
|
984
1017
|
readonly transactions: TransactionsResource;
|
|
985
1018
|
readonly logs: LogsResource;
|
|
986
1019
|
readonly storage: StorageResource;
|
|
@@ -1028,4 +1061,4 @@ declare class ValidationError extends RustrakError {
|
|
|
1028
1061
|
getValidationDetails(): string;
|
|
1029
1062
|
}
|
|
1030
1063
|
|
|
1031
|
-
export { type AcceptInvitation, type ActivityEntry, 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 CreateDeploy, type CreateInvitation, type CreateNotificationChannel, type CreateProject, type CreateUserReport, type Event, type EventDetail, 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 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 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 };
|
|
1064
|
+
export { type AcceptInvitation, type ActivityEntry, 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 CreateDeploy, type CreateInvitation, type CreateNotificationChannel, type CreateProject, type CreateUserReport, type Event, type EventDetail, 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 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 };
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,11 @@ var offsetPaginatedResponseSchema = (itemSchema) => z.object({
|
|
|
15
15
|
total_pages: z.number().int()
|
|
16
16
|
});
|
|
17
17
|
z.enum(["asc", "desc"]);
|
|
18
|
-
z.enum([
|
|
18
|
+
z.enum([
|
|
19
|
+
"digest_order",
|
|
20
|
+
"last_seen",
|
|
21
|
+
"event_count"
|
|
22
|
+
]);
|
|
19
23
|
z.enum(["open", "resolved", "muted", "all"]);
|
|
20
24
|
var dateTimeSchema = z.string().datetime();
|
|
21
25
|
var uuidSchema = z.string().uuid();
|
|
@@ -674,7 +678,8 @@ var projectSchema = z.object({
|
|
|
674
678
|
stored_event_count: z.number().int(),
|
|
675
679
|
digested_event_count: z.number().int(),
|
|
676
680
|
created_at: dateTimeSchema,
|
|
677
|
-
updated_at: dateTimeSchema
|
|
681
|
+
updated_at: dateTimeSchema,
|
|
682
|
+
platform: z.string().nullable()
|
|
678
683
|
});
|
|
679
684
|
var createProjectSchema = z.object({
|
|
680
685
|
name: z.string().min(1),
|
|
@@ -695,6 +700,22 @@ var releaseHealthRowSchema = z.object({
|
|
|
695
700
|
crash_free_users_rate: z.number().nullable()
|
|
696
701
|
});
|
|
697
702
|
var releaseHealthSchema = z.array(releaseHealthRowSchema);
|
|
703
|
+
var sessionSummarySchema = z.object({
|
|
704
|
+
total: z.number().int(),
|
|
705
|
+
errored: z.number().int(),
|
|
706
|
+
crashed: z.number().int(),
|
|
707
|
+
abnormal: z.number().int(),
|
|
708
|
+
crash_free_sessions_rate: z.number().nullable(),
|
|
709
|
+
crash_free_users_rate: z.number().nullable(),
|
|
710
|
+
active_releases: z.number().int()
|
|
711
|
+
});
|
|
712
|
+
var sessionTimeseriesPointSchema = z.object({
|
|
713
|
+
bucket: dateTimeSchema,
|
|
714
|
+
total: z.number().int(),
|
|
715
|
+
crashed: z.number().int(),
|
|
716
|
+
crash_free_sessions_rate: z.number().nullable()
|
|
717
|
+
});
|
|
718
|
+
var sessionTimeseriesSchema = z.array(sessionTimeseriesPointSchema);
|
|
698
719
|
var chunkUploadCapabilitySchema = z.object({
|
|
699
720
|
url: z.string(),
|
|
700
721
|
chunkSize: z.number().int(),
|
|
@@ -1178,6 +1199,26 @@ var ProjectsResource = class extends BaseResource {
|
|
|
1178
1199
|
await this.http.delete(`api/projects/${id}`);
|
|
1179
1200
|
}
|
|
1180
1201
|
};
|
|
1202
|
+
var ReleasesResource = class extends BaseResource {
|
|
1203
|
+
/**
|
|
1204
|
+
* Get issues first seen in a given release, most recently introduced first.
|
|
1205
|
+
*
|
|
1206
|
+
* @param projectId - Project ID
|
|
1207
|
+
* @param release - Release version
|
|
1208
|
+
* @param limit - Max issues to return (default: 10, max: 50)
|
|
1209
|
+
*/
|
|
1210
|
+
async newIssues(projectId, release, limit) {
|
|
1211
|
+
const searchParams = {};
|
|
1212
|
+
if (limit !== void 0) {
|
|
1213
|
+
searchParams.limit = limit.toString();
|
|
1214
|
+
}
|
|
1215
|
+
const data = await this.http.get(
|
|
1216
|
+
`api/projects/${projectId}/releases/${encodeURIComponent(release)}/new-issues`,
|
|
1217
|
+
{ searchParams }
|
|
1218
|
+
).json();
|
|
1219
|
+
return this.validate(data, z.array(issueSchema));
|
|
1220
|
+
}
|
|
1221
|
+
};
|
|
1181
1222
|
|
|
1182
1223
|
// src/resources/sessions.ts
|
|
1183
1224
|
var SessionsResource = class extends BaseResource {
|
|
@@ -1185,15 +1226,51 @@ var SessionsResource = class extends BaseResource {
|
|
|
1185
1226
|
* Get per-release health stats for a project.
|
|
1186
1227
|
* @param projectId - Project ID
|
|
1187
1228
|
* @param period - Time window (e.g. '24h', '7d'). Defaults to '24h'.
|
|
1229
|
+
* @param release - Scope to a single release (all environments), computed
|
|
1230
|
+
* server-side. Omit to get every release in the project.
|
|
1188
1231
|
*/
|
|
1189
|
-
async stats(projectId, period) {
|
|
1232
|
+
async stats(projectId, period, release) {
|
|
1190
1233
|
const searchParams = {};
|
|
1191
1234
|
if (period) {
|
|
1192
1235
|
searchParams.period = period;
|
|
1193
1236
|
}
|
|
1237
|
+
if (release) {
|
|
1238
|
+
searchParams.release = release;
|
|
1239
|
+
}
|
|
1194
1240
|
const data = await this.http.get(`api/projects/${projectId}/sessions/stats`, { searchParams }).json();
|
|
1195
1241
|
return this.validate(data, releaseHealthSchema);
|
|
1196
1242
|
}
|
|
1243
|
+
/**
|
|
1244
|
+
* Get project-wide session health, aggregated across all releases and environments.
|
|
1245
|
+
* @param projectId - Project ID
|
|
1246
|
+
* @param period - Time window (e.g. '24h', '7d'). Defaults to '24h'.
|
|
1247
|
+
*/
|
|
1248
|
+
async summary(projectId, period) {
|
|
1249
|
+
const searchParams = {};
|
|
1250
|
+
if (period) {
|
|
1251
|
+
searchParams.period = period;
|
|
1252
|
+
}
|
|
1253
|
+
const data = await this.http.get(`api/projects/${projectId}/sessions/summary`, { searchParams }).json();
|
|
1254
|
+
return this.validate(data, sessionSummarySchema);
|
|
1255
|
+
}
|
|
1256
|
+
/**
|
|
1257
|
+
* Get a time-bucketed session trend for a project, aggregated across all
|
|
1258
|
+
* releases and environments.
|
|
1259
|
+
* @param projectId - Project ID
|
|
1260
|
+
* @param period - Time window (e.g. '24h', '7d'). Defaults to '24h'.
|
|
1261
|
+
* @param interval - Bucket width in hours (default: 1, max: 24).
|
|
1262
|
+
*/
|
|
1263
|
+
async timeseries(projectId, period, interval) {
|
|
1264
|
+
const searchParams = {};
|
|
1265
|
+
if (period) {
|
|
1266
|
+
searchParams.period = period;
|
|
1267
|
+
}
|
|
1268
|
+
if (interval !== void 0) {
|
|
1269
|
+
searchParams.interval = interval.toString();
|
|
1270
|
+
}
|
|
1271
|
+
const data = await this.http.get(`api/projects/${projectId}/sessions/timeseries`, { searchParams }).json();
|
|
1272
|
+
return this.validate(data, sessionTimeseriesSchema);
|
|
1273
|
+
}
|
|
1197
1274
|
};
|
|
1198
1275
|
|
|
1199
1276
|
// src/resources/sourcemaps.ts
|
|
@@ -1563,6 +1640,10 @@ var RustrakClient = class {
|
|
|
1563
1640
|
* Sessions API resource (release health)
|
|
1564
1641
|
*/
|
|
1565
1642
|
sessions;
|
|
1643
|
+
/**
|
|
1644
|
+
* Releases API resource (data scoped to a specific release)
|
|
1645
|
+
*/
|
|
1646
|
+
releases;
|
|
1566
1647
|
/**
|
|
1567
1648
|
* Transactions API resource (performance monitoring)
|
|
1568
1649
|
*/
|
|
@@ -1598,6 +1679,7 @@ var RustrakClient = class {
|
|
|
1598
1679
|
this.invitations = new InvitationsResource(this.http);
|
|
1599
1680
|
this.members = new MembersResource(this.http);
|
|
1600
1681
|
this.sessions = new SessionsResource(this.http);
|
|
1682
|
+
this.releases = new ReleasesResource(this.http);
|
|
1601
1683
|
this.transactions = new TransactionsResource(this.http);
|
|
1602
1684
|
this.logs = new LogsResource(this.http);
|
|
1603
1685
|
this.storage = new StorageResource(this.http);
|