@rustrak/client 0.3.13 → 0.3.15

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
@@ -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";
@@ -540,9 +499,6 @@ declare const bulkUpdateIssuesSchema: z.ZodObject<{
540
499
  declare const bulkDeleteIssuesSchema: z.ZodObject<{
541
500
  ids: z.ZodArray<z.ZodString>;
542
501
  }, z.core.$strip>;
543
- declare const createDeploySchema: z.ZodObject<{
544
- version: z.ZodString;
545
- }, z.core.$strip>;
546
502
 
547
503
  type Issue = z.infer<typeof issueSchema>;
548
504
  type IssueStatus = z.infer<typeof issueStatusSchema>;
@@ -560,7 +516,6 @@ type CreateComment = z.infer<typeof createCommentSchema>;
560
516
  type CreateUserReport = z.infer<typeof createUserReportSchema>;
561
517
  type BulkUpdateIssues = z.infer<typeof bulkUpdateIssuesSchema>;
562
518
  type BulkDeleteIssues = z.infer<typeof bulkDeleteIssuesSchema>;
563
- type CreateDeploy = z.infer<typeof createDeploySchema>;
564
519
  type IssueStatsWindow = z.infer<typeof issueStatsWindowSchema>;
565
520
 
566
521
  declare const logSchema: z.ZodObject<{
@@ -850,6 +805,7 @@ declare const transactionDetailSchema: z.ZodObject<{
850
805
  }, z.core.$strip>;
851
806
  declare const spanSchema: z.ZodObject<{
852
807
  id: z.ZodString;
808
+ transaction_id: z.ZodNullable<z.ZodString>;
853
809
  span_id: z.ZodNullable<z.ZodString>;
854
810
  trace_id: z.ZodNullable<z.ZodString>;
855
811
  parent_span_id: z.ZodNullable<z.ZodString>;
@@ -862,6 +818,18 @@ declare const spanSchema: z.ZodObject<{
862
818
  exclusive_time_ms: z.ZodNullable<z.ZodNumber>;
863
819
  is_segment: z.ZodBoolean;
864
820
  segment_id: z.ZodNullable<z.ZodString>;
821
+ platform: z.ZodNullable<z.ZodString>;
822
+ release: z.ZodNullable<z.ZodString>;
823
+ environment: z.ZodNullable<z.ZodString>;
824
+ gen_ai_operation_type: z.ZodNullable<z.ZodString>;
825
+ gen_ai_agent_name: z.ZodNullable<z.ZodString>;
826
+ gen_ai_request_model: z.ZodNullable<z.ZodString>;
827
+ gen_ai_response_model: z.ZodNullable<z.ZodString>;
828
+ gen_ai_tool_name: z.ZodNullable<z.ZodString>;
829
+ gen_ai_conversation_id: z.ZodNullable<z.ZodString>;
830
+ gen_ai_usage_input_tokens: z.ZodNullable<z.ZodNumber>;
831
+ gen_ai_usage_output_tokens: z.ZodNullable<z.ZodNumber>;
832
+ gen_ai_usage_total_tokens: z.ZodNullable<z.ZodNumber>;
865
833
  }, z.core.$strip>;
866
834
  declare const transactionStatsSchema: z.ZodObject<{
867
835
  transaction_name: z.ZodString;
@@ -877,6 +845,103 @@ type Transaction = z.infer<typeof transactionSchema>;
877
845
  type TransactionDetail = z.infer<typeof transactionDetailSchema>;
878
846
  type Span = z.infer<typeof spanSchema>;
879
847
  type TransactionStats = z.infer<typeof transactionStatsSchema>;
848
+ interface ListSpansOptions {
849
+ page?: number;
850
+ per_page?: number;
851
+ op?: string;
852
+ status?: string;
853
+ trace_id?: string;
854
+ operation_type?: string;
855
+ }
856
+
857
+ declare const userSchema: z.ZodObject<{
858
+ id: z.ZodNumber;
859
+ email: z.ZodString;
860
+ role: z.ZodEnum<{
861
+ admin: "admin";
862
+ member: "member";
863
+ }>;
864
+ is_admin: z.ZodBoolean;
865
+ }, z.core.$strip>;
866
+ declare const authResponseSchema: z.ZodObject<{
867
+ user: z.ZodObject<{
868
+ id: z.ZodNumber;
869
+ email: z.ZodString;
870
+ role: z.ZodEnum<{
871
+ admin: "admin";
872
+ member: "member";
873
+ }>;
874
+ is_admin: z.ZodBoolean;
875
+ }, z.core.$strip>;
876
+ }, z.core.$strip>;
877
+ declare const loginResultSchema: z.ZodObject<{
878
+ user: z.ZodObject<{
879
+ id: z.ZodNumber;
880
+ email: z.ZodString;
881
+ role: z.ZodEnum<{
882
+ admin: "admin";
883
+ member: "member";
884
+ }>;
885
+ is_admin: z.ZodBoolean;
886
+ }, z.core.$strip>;
887
+ cookies: z.ZodArray<z.ZodString>;
888
+ }, z.core.$strip>;
889
+ declare const loginRequestSchema: z.ZodObject<{
890
+ email: z.ZodString;
891
+ password: z.ZodString;
892
+ }, z.core.$strip>;
893
+ declare const registerRequestSchema: z.ZodObject<{
894
+ email: z.ZodString;
895
+ password: z.ZodString;
896
+ }, z.core.$strip>;
897
+
898
+ type User = z.infer<typeof userSchema>;
899
+ type AuthResponse = z.infer<typeof authResponseSchema>;
900
+ type LoginResult = z.infer<typeof loginResultSchema>;
901
+ type LoginRequest = z.infer<typeof loginRequestSchema>;
902
+ type RegisterRequest = z.infer<typeof registerRequestSchema>;
903
+
904
+ declare abstract class BaseResource {
905
+ protected readonly http: KyInstance;
906
+ constructor(http: KyInstance);
907
+ protected validate<T>(data: unknown, schema: ZodSchema<T>): T;
908
+ }
909
+
910
+ declare class AgentsResource extends BaseResource {
911
+ getRuns(projectId: number, options?: AgentTimeseriesOptions): Promise<AgentTimeseriesPoint[]>;
912
+ getDuration(projectId: number, options?: AgentTimeseriesOptions): Promise<AgentDurationPoint[]>;
913
+ getModelsByCalls(projectId: number, options?: AgentBreakdownOptions): Promise<GenAiBreakdownRow[]>;
914
+ getModelsByTokens(projectId: number, options?: AgentBreakdownOptions): Promise<GenAiBreakdownRow[]>;
915
+ getTools(projectId: number, options?: AgentBreakdownOptions): Promise<GenAiBreakdownRow[]>;
916
+ getTraces(projectId: number, options?: AgentTracesOptions): Promise<OffsetPaginatedResponse<AgentTraceSummary>>;
917
+ }
918
+
919
+ declare class AlertIntegrationsResource extends BaseResource {
920
+ list(): Promise<AlertIntegration[]>;
921
+ get(id: number): Promise<AlertIntegration>;
922
+ create(input: CreateAlertIntegration): Promise<AlertIntegration>;
923
+ update(id: number, input: UpdateAlertIntegration): Promise<AlertIntegration>;
924
+ delete(id: number): Promise<void>;
925
+ test(id: number, routingOverride?: RoutingOverride): Promise<TestChannelResponse>;
926
+ }
927
+
928
+ declare class AlertRulesResource extends BaseResource {
929
+ list(projectId: number): Promise<AlertRule[]>;
930
+ get(projectId: number, ruleId: number): Promise<AlertRule>;
931
+ create(projectId: number, input: CreateAlertRule): Promise<AlertRule>;
932
+ update(projectId: number, ruleId: number, input: UpdateAlertRule): Promise<AlertRule>;
933
+ delete(projectId: number, ruleId: number): Promise<void>;
934
+ listHistory(projectId: number, options?: ListAlertHistoryOptions): Promise<AlertHistory[]>;
935
+ }
936
+
937
+ declare class AuthResource extends BaseResource {
938
+ register(credentials: RegisterRequest): Promise<LoginResult>;
939
+ login(credentials: LoginRequest): Promise<LoginResult>;
940
+ logout(): Promise<string[]>;
941
+ getCurrentUser(): Promise<User>;
942
+ getInvitation(token: string): Promise<InvitationInfo>;
943
+ acceptInvitation(input: AcceptInvitation): Promise<LoginResult>;
944
+ }
880
945
 
881
946
  declare class EventsResource extends BaseResource {
882
947
  list(projectId: number, issueId: string, options?: ListEventsOptions): Promise<PaginatedResponse<Event>>;
@@ -922,10 +987,6 @@ declare class IssuesResource extends BaseResource {
922
987
  }>;
923
988
  listUserReports(projectId: number, issueId: string): Promise<UserReport[]>;
924
989
  createUserReport(projectId: number, issueId: string, input: CreateUserReport): Promise<UserReport>;
925
- createDeploy(projectId: number, input: CreateDeploy): Promise<{
926
- version: string;
927
- finalized: number;
928
- }>;
929
990
  }
930
991
 
931
992
  declare class LogsResource extends BaseResource {
@@ -966,6 +1027,10 @@ declare class SourceMapsResource extends BaseResource {
966
1027
  list(orgSlug: string, projectSlug: string): Promise<ListSourceMapsResponse>;
967
1028
  }
968
1029
 
1030
+ declare class SpansResource extends BaseResource {
1031
+ list(projectId: number, options?: ListSpansOptions): Promise<OffsetPaginatedResponse<Span>>;
1032
+ }
1033
+
969
1034
  declare class StorageResource extends BaseResource {
970
1035
  getSummary(): Promise<StorageSummary>;
971
1036
  getProjects(): Promise<ProjectStorage[]>;
@@ -1016,6 +1081,8 @@ declare class RustrakClient {
1016
1081
  readonly releases: ReleasesResource;
1017
1082
  readonly transactions: TransactionsResource;
1018
1083
  readonly logs: LogsResource;
1084
+ readonly spans: SpansResource;
1085
+ readonly agents: AgentsResource;
1019
1086
  readonly storage: StorageResource;
1020
1087
  readonly health: HealthResource;
1021
1088
  constructor(config: ClientConfig);
@@ -1061,4 +1128,4 @@ declare class ValidationError extends RustrakError {
1061
1128
  getValidationDetails(): string;
1062
1129
  }
1063
1130
 
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 };
1131
+ 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 };