@rustrak/client 0.3.12 → 0.3.14

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.ts CHANGED
@@ -9,6 +9,50 @@ interface ClientConfig {
9
9
  headers?: Record<string, string>;
10
10
  }
11
11
 
12
+ declare const serverVersionSchema: z.ZodObject<{
13
+ version: z.ZodString;
14
+ }, z.core.$strip>;
15
+ type ServerVersion = z.infer<typeof serverVersionSchema>;
16
+
17
+ declare const agentTimeseriesPointSchema: z.ZodObject<{
18
+ bucket: z.ZodString;
19
+ value: z.ZodNumber;
20
+ }, z.core.$strip>;
21
+ declare const agentDurationPointSchema: z.ZodObject<{
22
+ bucket: z.ZodString;
23
+ avg_ms: z.ZodNumber;
24
+ p95_ms: z.ZodNumber;
25
+ }, z.core.$strip>;
26
+ declare const genAiBreakdownRowSchema: z.ZodObject<{
27
+ label: z.ZodString;
28
+ value: z.ZodNumber;
29
+ }, z.core.$strip>;
30
+ declare const agentTraceSummarySchema: z.ZodObject<{
31
+ trace_id: z.ZodString;
32
+ agent_names: z.ZodArray<z.ZodString>;
33
+ duration_ms: z.ZodNullable<z.ZodNumber>;
34
+ total_tokens: z.ZodNumber;
35
+ tool_call_count: z.ZodNumber;
36
+ started_at: z.ZodString;
37
+ }, z.core.$strip>;
38
+
39
+ type AgentTimeseriesPoint = z.infer<typeof agentTimeseriesPointSchema>;
40
+ type AgentDurationPoint = z.infer<typeof agentDurationPointSchema>;
41
+ type GenAiBreakdownRow = z.infer<typeof genAiBreakdownRowSchema>;
42
+ type AgentTraceSummary = z.infer<typeof agentTraceSummarySchema>;
43
+ interface AgentTimeseriesOptions {
44
+ period_hours?: number;
45
+ interval_hours?: number;
46
+ }
47
+ interface AgentBreakdownOptions {
48
+ period_hours?: number;
49
+ limit?: number;
50
+ }
51
+ interface AgentTracesOptions {
52
+ page?: number;
53
+ per_page?: number;
54
+ }
55
+
12
56
  declare const providerTypeSchema: z.ZodEnum<{
13
57
  webhook: "webhook";
14
58
  email: "email";
@@ -160,128 +204,6 @@ interface ListAlertHistoryOptions {
160
204
  limit?: number;
161
205
  }
162
206
 
163
- declare abstract class BaseResource {
164
- protected readonly http: KyInstance;
165
- constructor(http: KyInstance);
166
- protected validate<T>(data: unknown, schema: ZodSchema<T>): T;
167
- }
168
-
169
- declare class AlertIntegrationsResource extends BaseResource {
170
- list(): Promise<AlertIntegration[]>;
171
- get(id: number): Promise<AlertIntegration>;
172
- create(input: CreateAlertIntegration): Promise<AlertIntegration>;
173
- update(id: number, input: UpdateAlertIntegration): Promise<AlertIntegration>;
174
- delete(id: number): Promise<void>;
175
- test(id: number, routingOverride?: RoutingOverride): Promise<TestChannelResponse>;
176
- }
177
-
178
- declare class AlertRulesResource extends BaseResource {
179
- list(projectId: number): Promise<AlertRule[]>;
180
- get(projectId: number, ruleId: number): Promise<AlertRule>;
181
- create(projectId: number, input: CreateAlertRule): Promise<AlertRule>;
182
- update(projectId: number, ruleId: number, input: UpdateAlertRule): Promise<AlertRule>;
183
- delete(projectId: number, ruleId: number): Promise<void>;
184
- listHistory(projectId: number, options?: ListAlertHistoryOptions): Promise<AlertHistory[]>;
185
- }
186
-
187
- declare const invitationSchema: z.ZodObject<{
188
- token: z.ZodString;
189
- email: z.ZodString;
190
- role: z.ZodEnum<{
191
- admin: "admin";
192
- member: "member";
193
- }>;
194
- status: z.ZodString;
195
- expires_at: z.ZodString;
196
- created_at: z.ZodString;
197
- }, z.core.$strip>;
198
- declare const invitationInfoSchema: z.ZodObject<{
199
- email: z.ZodString;
200
- role: z.ZodEnum<{
201
- admin: "admin";
202
- member: "member";
203
- }>;
204
- status: z.ZodString;
205
- expires_at: z.ZodString;
206
- }, z.core.$strip>;
207
- declare const createInvitationSchema: z.ZodObject<{
208
- email: z.ZodString;
209
- role: z.ZodEnum<{
210
- admin: "admin";
211
- member: "member";
212
- }>;
213
- }, z.core.$strip>;
214
- declare const acceptInvitationSchema: z.ZodObject<{
215
- token: z.ZodString;
216
- password: z.ZodString;
217
- }, z.core.$strip>;
218
-
219
- type Invitation = z.infer<typeof invitationSchema>;
220
- type InvitationInfo = z.infer<typeof invitationInfoSchema>;
221
- type CreateInvitation = z.infer<typeof createInvitationSchema>;
222
- type AcceptInvitation = z.infer<typeof acceptInvitationSchema>;
223
-
224
- declare const userSchema: z.ZodObject<{
225
- id: z.ZodNumber;
226
- email: z.ZodString;
227
- role: z.ZodEnum<{
228
- admin: "admin";
229
- member: "member";
230
- }>;
231
- is_admin: z.ZodBoolean;
232
- }, z.core.$strip>;
233
- declare const authResponseSchema: z.ZodObject<{
234
- user: z.ZodObject<{
235
- id: z.ZodNumber;
236
- email: z.ZodString;
237
- role: z.ZodEnum<{
238
- admin: "admin";
239
- member: "member";
240
- }>;
241
- is_admin: z.ZodBoolean;
242
- }, z.core.$strip>;
243
- }, z.core.$strip>;
244
- declare const loginResultSchema: z.ZodObject<{
245
- user: z.ZodObject<{
246
- id: z.ZodNumber;
247
- email: z.ZodString;
248
- role: z.ZodEnum<{
249
- admin: "admin";
250
- member: "member";
251
- }>;
252
- is_admin: z.ZodBoolean;
253
- }, z.core.$strip>;
254
- cookies: z.ZodArray<z.ZodString>;
255
- }, z.core.$strip>;
256
- declare const loginRequestSchema: z.ZodObject<{
257
- email: z.ZodString;
258
- password: z.ZodString;
259
- }, z.core.$strip>;
260
- declare const registerRequestSchema: z.ZodObject<{
261
- email: z.ZodString;
262
- password: z.ZodString;
263
- }, z.core.$strip>;
264
-
265
- type User = z.infer<typeof userSchema>;
266
- type AuthResponse = z.infer<typeof authResponseSchema>;
267
- type LoginResult = z.infer<typeof loginResultSchema>;
268
- type LoginRequest = z.infer<typeof loginRequestSchema>;
269
- type RegisterRequest = z.infer<typeof registerRequestSchema>;
270
-
271
- declare class AuthResource extends BaseResource {
272
- register(credentials: RegisterRequest): Promise<LoginResult>;
273
- login(credentials: LoginRequest): Promise<LoginResult>;
274
- logout(): Promise<string[]>;
275
- getCurrentUser(): Promise<User>;
276
- getInvitation(token: string): Promise<InvitationInfo>;
277
- acceptInvitation(input: AcceptInvitation): Promise<LoginResult>;
278
- }
279
-
280
- declare const serverVersionSchema: z.ZodObject<{
281
- version: z.ZodString;
282
- }, z.core.$strip>;
283
- type ServerVersion = z.infer<typeof serverVersionSchema>;
284
-
285
207
  declare const sortOrderSchema: z.ZodEnum<{
286
208
  asc: "asc";
287
209
  desc: "desc";
@@ -384,6 +306,43 @@ declare const eventDetailSchema: z.ZodObject<{
384
306
  type Event = z.infer<typeof eventSchema>;
385
307
  type EventDetail = z.infer<typeof eventDetailSchema>;
386
308
 
309
+ declare const invitationSchema: z.ZodObject<{
310
+ token: z.ZodString;
311
+ email: z.ZodString;
312
+ role: z.ZodEnum<{
313
+ admin: "admin";
314
+ member: "member";
315
+ }>;
316
+ status: z.ZodString;
317
+ expires_at: z.ZodString;
318
+ created_at: z.ZodString;
319
+ }, z.core.$strip>;
320
+ declare const invitationInfoSchema: z.ZodObject<{
321
+ email: z.ZodString;
322
+ role: z.ZodEnum<{
323
+ admin: "admin";
324
+ member: "member";
325
+ }>;
326
+ status: z.ZodString;
327
+ expires_at: z.ZodString;
328
+ }, z.core.$strip>;
329
+ declare const createInvitationSchema: z.ZodObject<{
330
+ email: z.ZodString;
331
+ role: z.ZodEnum<{
332
+ admin: "admin";
333
+ member: "member";
334
+ }>;
335
+ }, z.core.$strip>;
336
+ declare const acceptInvitationSchema: z.ZodObject<{
337
+ token: z.ZodString;
338
+ password: z.ZodString;
339
+ }, z.core.$strip>;
340
+
341
+ type Invitation = z.infer<typeof invitationSchema>;
342
+ type InvitationInfo = z.infer<typeof invitationInfoSchema>;
343
+ type CreateInvitation = z.infer<typeof createInvitationSchema>;
344
+ type AcceptInvitation = z.infer<typeof acceptInvitationSchema>;
345
+
387
346
  declare const issueStatusSchema: z.ZodEnum<{
388
347
  resolved: "resolved";
389
348
  unresolved: "unresolved";
@@ -850,6 +809,7 @@ declare const transactionDetailSchema: z.ZodObject<{
850
809
  }, z.core.$strip>;
851
810
  declare const spanSchema: z.ZodObject<{
852
811
  id: z.ZodString;
812
+ transaction_id: z.ZodNullable<z.ZodString>;
853
813
  span_id: z.ZodNullable<z.ZodString>;
854
814
  trace_id: z.ZodNullable<z.ZodString>;
855
815
  parent_span_id: z.ZodNullable<z.ZodString>;
@@ -862,6 +822,18 @@ declare const spanSchema: z.ZodObject<{
862
822
  exclusive_time_ms: z.ZodNullable<z.ZodNumber>;
863
823
  is_segment: z.ZodBoolean;
864
824
  segment_id: z.ZodNullable<z.ZodString>;
825
+ platform: z.ZodNullable<z.ZodString>;
826
+ release: z.ZodNullable<z.ZodString>;
827
+ environment: z.ZodNullable<z.ZodString>;
828
+ gen_ai_operation_type: z.ZodNullable<z.ZodString>;
829
+ gen_ai_agent_name: z.ZodNullable<z.ZodString>;
830
+ gen_ai_request_model: z.ZodNullable<z.ZodString>;
831
+ gen_ai_response_model: z.ZodNullable<z.ZodString>;
832
+ gen_ai_tool_name: z.ZodNullable<z.ZodString>;
833
+ gen_ai_conversation_id: z.ZodNullable<z.ZodString>;
834
+ gen_ai_usage_input_tokens: z.ZodNullable<z.ZodNumber>;
835
+ gen_ai_usage_output_tokens: z.ZodNullable<z.ZodNumber>;
836
+ gen_ai_usage_total_tokens: z.ZodNullable<z.ZodNumber>;
865
837
  }, z.core.$strip>;
866
838
  declare const transactionStatsSchema: z.ZodObject<{
867
839
  transaction_name: z.ZodString;
@@ -877,6 +849,103 @@ type Transaction = z.infer<typeof transactionSchema>;
877
849
  type TransactionDetail = z.infer<typeof transactionDetailSchema>;
878
850
  type Span = z.infer<typeof spanSchema>;
879
851
  type TransactionStats = z.infer<typeof transactionStatsSchema>;
852
+ interface ListSpansOptions {
853
+ page?: number;
854
+ per_page?: number;
855
+ op?: string;
856
+ status?: string;
857
+ trace_id?: string;
858
+ operation_type?: string;
859
+ }
860
+
861
+ declare const userSchema: z.ZodObject<{
862
+ id: z.ZodNumber;
863
+ email: z.ZodString;
864
+ role: z.ZodEnum<{
865
+ admin: "admin";
866
+ member: "member";
867
+ }>;
868
+ is_admin: z.ZodBoolean;
869
+ }, z.core.$strip>;
870
+ declare const authResponseSchema: z.ZodObject<{
871
+ user: z.ZodObject<{
872
+ id: z.ZodNumber;
873
+ email: z.ZodString;
874
+ role: z.ZodEnum<{
875
+ admin: "admin";
876
+ member: "member";
877
+ }>;
878
+ is_admin: z.ZodBoolean;
879
+ }, z.core.$strip>;
880
+ }, z.core.$strip>;
881
+ declare const loginResultSchema: z.ZodObject<{
882
+ user: z.ZodObject<{
883
+ id: z.ZodNumber;
884
+ email: z.ZodString;
885
+ role: z.ZodEnum<{
886
+ admin: "admin";
887
+ member: "member";
888
+ }>;
889
+ is_admin: z.ZodBoolean;
890
+ }, z.core.$strip>;
891
+ cookies: z.ZodArray<z.ZodString>;
892
+ }, z.core.$strip>;
893
+ declare const loginRequestSchema: z.ZodObject<{
894
+ email: z.ZodString;
895
+ password: z.ZodString;
896
+ }, z.core.$strip>;
897
+ declare const registerRequestSchema: z.ZodObject<{
898
+ email: z.ZodString;
899
+ password: z.ZodString;
900
+ }, z.core.$strip>;
901
+
902
+ type User = z.infer<typeof userSchema>;
903
+ type AuthResponse = z.infer<typeof authResponseSchema>;
904
+ type LoginResult = z.infer<typeof loginResultSchema>;
905
+ type LoginRequest = z.infer<typeof loginRequestSchema>;
906
+ type RegisterRequest = z.infer<typeof registerRequestSchema>;
907
+
908
+ declare abstract class BaseResource {
909
+ protected readonly http: KyInstance;
910
+ constructor(http: KyInstance);
911
+ protected validate<T>(data: unknown, schema: ZodSchema<T>): T;
912
+ }
913
+
914
+ declare class AgentsResource extends BaseResource {
915
+ getRuns(projectId: number, options?: AgentTimeseriesOptions): Promise<AgentTimeseriesPoint[]>;
916
+ getDuration(projectId: number, options?: AgentTimeseriesOptions): Promise<AgentDurationPoint[]>;
917
+ getModelsByCalls(projectId: number, options?: AgentBreakdownOptions): Promise<GenAiBreakdownRow[]>;
918
+ getModelsByTokens(projectId: number, options?: AgentBreakdownOptions): Promise<GenAiBreakdownRow[]>;
919
+ getTools(projectId: number, options?: AgentBreakdownOptions): Promise<GenAiBreakdownRow[]>;
920
+ getTraces(projectId: number, options?: AgentTracesOptions): Promise<OffsetPaginatedResponse<AgentTraceSummary>>;
921
+ }
922
+
923
+ declare class AlertIntegrationsResource extends BaseResource {
924
+ list(): Promise<AlertIntegration[]>;
925
+ get(id: number): Promise<AlertIntegration>;
926
+ create(input: CreateAlertIntegration): Promise<AlertIntegration>;
927
+ update(id: number, input: UpdateAlertIntegration): Promise<AlertIntegration>;
928
+ delete(id: number): Promise<void>;
929
+ test(id: number, routingOverride?: RoutingOverride): Promise<TestChannelResponse>;
930
+ }
931
+
932
+ declare class AlertRulesResource extends BaseResource {
933
+ list(projectId: number): Promise<AlertRule[]>;
934
+ get(projectId: number, ruleId: number): Promise<AlertRule>;
935
+ create(projectId: number, input: CreateAlertRule): Promise<AlertRule>;
936
+ update(projectId: number, ruleId: number, input: UpdateAlertRule): Promise<AlertRule>;
937
+ delete(projectId: number, ruleId: number): Promise<void>;
938
+ listHistory(projectId: number, options?: ListAlertHistoryOptions): Promise<AlertHistory[]>;
939
+ }
940
+
941
+ declare class AuthResource extends BaseResource {
942
+ register(credentials: RegisterRequest): Promise<LoginResult>;
943
+ login(credentials: LoginRequest): Promise<LoginResult>;
944
+ logout(): Promise<string[]>;
945
+ getCurrentUser(): Promise<User>;
946
+ getInvitation(token: string): Promise<InvitationInfo>;
947
+ acceptInvitation(input: AcceptInvitation): Promise<LoginResult>;
948
+ }
880
949
 
881
950
  declare class EventsResource extends BaseResource {
882
951
  list(projectId: number, issueId: string, options?: ListEventsOptions): Promise<PaginatedResponse<Event>>;
@@ -966,6 +1035,10 @@ declare class SourceMapsResource extends BaseResource {
966
1035
  list(orgSlug: string, projectSlug: string): Promise<ListSourceMapsResponse>;
967
1036
  }
968
1037
 
1038
+ declare class SpansResource extends BaseResource {
1039
+ list(projectId: number, options?: ListSpansOptions): Promise<OffsetPaginatedResponse<Span>>;
1040
+ }
1041
+
969
1042
  declare class StorageResource extends BaseResource {
970
1043
  getSummary(): Promise<StorageSummary>;
971
1044
  getProjects(): Promise<ProjectStorage[]>;
@@ -1016,6 +1089,8 @@ declare class RustrakClient {
1016
1089
  readonly releases: ReleasesResource;
1017
1090
  readonly transactions: TransactionsResource;
1018
1091
  readonly logs: LogsResource;
1092
+ readonly spans: SpansResource;
1093
+ readonly agents: AgentsResource;
1019
1094
  readonly storage: StorageResource;
1020
1095
  readonly health: HealthResource;
1021
1096
  constructor(config: ClientConfig);
@@ -1061,4 +1136,4 @@ declare class ValidationError extends RustrakError {
1061
1136
  getValidationDetails(): string;
1062
1137
  }
1063
1138
 
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 };
1139
+ 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 CreateDeploy, 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 };