@rustrak/client 0.3.8 → 0.3.10

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
@@ -342,6 +342,12 @@ interface ListTransactionsOptions {
342
342
  environment?: string;
343
343
  release?: string;
344
344
  }
345
+ interface ListLogsOptions {
346
+ page?: number;
347
+ per_page?: number;
348
+ level?: string;
349
+ trace_id?: string;
350
+ }
345
351
 
346
352
  declare const eventSchema: z.ZodObject<{
347
353
  id: z.ZodString;
@@ -398,6 +404,20 @@ declare const updateIssueStateSchema: z.ZodObject<{
398
404
  type Issue = z.infer<typeof issueSchema>;
399
405
  type UpdateIssueState = z.infer<typeof updateIssueStateSchema>;
400
406
 
407
+ declare const logSchema: z.ZodObject<{
408
+ id: z.ZodString;
409
+ trace_id: z.ZodNullable<z.ZodString>;
410
+ span_id: z.ZodNullable<z.ZodString>;
411
+ level: z.ZodString;
412
+ severity_number: z.ZodNullable<z.ZodNumber>;
413
+ body: z.ZodString;
414
+ attributes: z.ZodRecord<z.ZodString, z.ZodAny>;
415
+ timestamp: z.ZodString;
416
+ ingested_at: z.ZodString;
417
+ }, z.core.$strip>;
418
+
419
+ type Log = z.infer<typeof logSchema>;
420
+
401
421
  declare const projectRoleSchema: z.ZodEnum<{
402
422
  admin: "admin";
403
423
  viewer: "viewer";
@@ -527,6 +547,7 @@ declare const storageSummarySchema: z.ZodObject<{
527
547
  events_count: z.ZodNumber;
528
548
  transactions_count: z.ZodNumber;
529
549
  spans_count: z.ZodNumber;
550
+ logs_count: z.ZodNumber;
530
551
  source_maps: z.ZodObject<{
531
552
  chunk_bytes: z.ZodNumber;
532
553
  source_file_bytes: z.ZodNumber;
@@ -540,6 +561,7 @@ declare const projectStorageSchema: z.ZodObject<{
540
561
  events_count: z.ZodNumber;
541
562
  transactions_count: z.ZodNumber;
542
563
  spans_count: z.ZodNumber;
564
+ logs_count: z.ZodNumber;
543
565
  source_maps_count: z.ZodNumber;
544
566
  estimated_bytes: z.ZodNumber;
545
567
  }, z.core.$strip>;
@@ -547,6 +569,7 @@ declare const cleanupCountsSchema: z.ZodObject<{
547
569
  events: z.ZodNumber;
548
570
  transactions: z.ZodNumber;
549
571
  spans: z.ZodNumber;
572
+ logs: z.ZodNumber;
550
573
  issues_removed: z.ZodNumber;
551
574
  }, z.core.$strip>;
552
575
  declare const sourceMapGcResultSchema: z.ZodObject<{
@@ -556,6 +579,9 @@ declare const sourceMapGcResultSchema: z.ZodObject<{
556
579
  declare const cleanupOptionsSchema: z.ZodObject<{
557
580
  older_than_days: z.ZodNumber;
558
581
  project_id: z.ZodOptional<z.ZodNumber>;
582
+ include_events: z.ZodOptional<z.ZodBoolean>;
583
+ include_transactions: z.ZodOptional<z.ZodBoolean>;
584
+ include_logs: z.ZodOptional<z.ZodBoolean>;
559
585
  }, z.core.$strip>;
560
586
 
561
587
  type SourceMapStorage = z.infer<typeof sourceMapStorageSchema>;
@@ -690,6 +716,10 @@ declare class IssuesResource extends BaseResource {
690
716
  delete(projectId: number, issueId: string): Promise<void>;
691
717
  }
692
718
 
719
+ declare class LogsResource extends BaseResource {
720
+ list(projectId: number, options?: ListLogsOptions): Promise<OffsetPaginatedResponse<Log>>;
721
+ }
722
+
693
723
  declare class MembersResource extends BaseResource {
694
724
  list(projectId: number): Promise<ProjectMember[]>;
695
725
  upsert(projectId: number, input: UpsertProjectMember): Promise<void>;
@@ -766,6 +796,7 @@ declare class RustrakClient {
766
796
  readonly members: MembersResource;
767
797
  readonly sessions: SessionsResource;
768
798
  readonly transactions: TransactionsResource;
799
+ readonly logs: LogsResource;
769
800
  readonly storage: StorageResource;
770
801
  readonly health: HealthResource;
771
802
  constructor(config: ClientConfig);
@@ -811,4 +842,4 @@ declare class ValidationError extends RustrakError {
811
842
  getValidationDetails(): string;
812
843
  }
813
844
 
814
- export { type AcceptInvitation, 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 ChannelType, type ChunkUploadCapability, type CleanupCounts, type CleanupOptions, type ClientConfig, type CreateAlertIntegration, type CreateAlertRule, type CreateAuthToken, type CreateInvitation, type CreateNotificationChannel, type CreateProject, type Event, type EventDetail, type GlobalRole, type Invitation, type InvitationInfo, type Issue, type IssueFilter, type IssueSort, type ListAlertHistoryOptions, type ListEventsOptions, type ListIssuesOptions, type ListProjectsOptions, type ListSourceMapsResponse, type ListTransactionsOptions, 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 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, ValidationError };
845
+ export { type AcceptInvitation, 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 ChannelType, type ChunkUploadCapability, type CleanupCounts, type CleanupOptions, type ClientConfig, type CreateAlertIntegration, type CreateAlertRule, type CreateAuthToken, type CreateInvitation, type CreateNotificationChannel, type CreateProject, type Event, type EventDetail, type GlobalRole, type Invitation, type InvitationInfo, type Issue, type IssueFilter, type IssueSort, 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 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, ValidationError };
package/dist/index.d.ts CHANGED
@@ -342,6 +342,12 @@ interface ListTransactionsOptions {
342
342
  environment?: string;
343
343
  release?: string;
344
344
  }
345
+ interface ListLogsOptions {
346
+ page?: number;
347
+ per_page?: number;
348
+ level?: string;
349
+ trace_id?: string;
350
+ }
345
351
 
346
352
  declare const eventSchema: z.ZodObject<{
347
353
  id: z.ZodString;
@@ -398,6 +404,20 @@ declare const updateIssueStateSchema: z.ZodObject<{
398
404
  type Issue = z.infer<typeof issueSchema>;
399
405
  type UpdateIssueState = z.infer<typeof updateIssueStateSchema>;
400
406
 
407
+ declare const logSchema: z.ZodObject<{
408
+ id: z.ZodString;
409
+ trace_id: z.ZodNullable<z.ZodString>;
410
+ span_id: z.ZodNullable<z.ZodString>;
411
+ level: z.ZodString;
412
+ severity_number: z.ZodNullable<z.ZodNumber>;
413
+ body: z.ZodString;
414
+ attributes: z.ZodRecord<z.ZodString, z.ZodAny>;
415
+ timestamp: z.ZodString;
416
+ ingested_at: z.ZodString;
417
+ }, z.core.$strip>;
418
+
419
+ type Log = z.infer<typeof logSchema>;
420
+
401
421
  declare const projectRoleSchema: z.ZodEnum<{
402
422
  admin: "admin";
403
423
  viewer: "viewer";
@@ -527,6 +547,7 @@ declare const storageSummarySchema: z.ZodObject<{
527
547
  events_count: z.ZodNumber;
528
548
  transactions_count: z.ZodNumber;
529
549
  spans_count: z.ZodNumber;
550
+ logs_count: z.ZodNumber;
530
551
  source_maps: z.ZodObject<{
531
552
  chunk_bytes: z.ZodNumber;
532
553
  source_file_bytes: z.ZodNumber;
@@ -540,6 +561,7 @@ declare const projectStorageSchema: z.ZodObject<{
540
561
  events_count: z.ZodNumber;
541
562
  transactions_count: z.ZodNumber;
542
563
  spans_count: z.ZodNumber;
564
+ logs_count: z.ZodNumber;
543
565
  source_maps_count: z.ZodNumber;
544
566
  estimated_bytes: z.ZodNumber;
545
567
  }, z.core.$strip>;
@@ -547,6 +569,7 @@ declare const cleanupCountsSchema: z.ZodObject<{
547
569
  events: z.ZodNumber;
548
570
  transactions: z.ZodNumber;
549
571
  spans: z.ZodNumber;
572
+ logs: z.ZodNumber;
550
573
  issues_removed: z.ZodNumber;
551
574
  }, z.core.$strip>;
552
575
  declare const sourceMapGcResultSchema: z.ZodObject<{
@@ -556,6 +579,9 @@ declare const sourceMapGcResultSchema: z.ZodObject<{
556
579
  declare const cleanupOptionsSchema: z.ZodObject<{
557
580
  older_than_days: z.ZodNumber;
558
581
  project_id: z.ZodOptional<z.ZodNumber>;
582
+ include_events: z.ZodOptional<z.ZodBoolean>;
583
+ include_transactions: z.ZodOptional<z.ZodBoolean>;
584
+ include_logs: z.ZodOptional<z.ZodBoolean>;
559
585
  }, z.core.$strip>;
560
586
 
561
587
  type SourceMapStorage = z.infer<typeof sourceMapStorageSchema>;
@@ -690,6 +716,10 @@ declare class IssuesResource extends BaseResource {
690
716
  delete(projectId: number, issueId: string): Promise<void>;
691
717
  }
692
718
 
719
+ declare class LogsResource extends BaseResource {
720
+ list(projectId: number, options?: ListLogsOptions): Promise<OffsetPaginatedResponse<Log>>;
721
+ }
722
+
693
723
  declare class MembersResource extends BaseResource {
694
724
  list(projectId: number): Promise<ProjectMember[]>;
695
725
  upsert(projectId: number, input: UpsertProjectMember): Promise<void>;
@@ -766,6 +796,7 @@ declare class RustrakClient {
766
796
  readonly members: MembersResource;
767
797
  readonly sessions: SessionsResource;
768
798
  readonly transactions: TransactionsResource;
799
+ readonly logs: LogsResource;
769
800
  readonly storage: StorageResource;
770
801
  readonly health: HealthResource;
771
802
  constructor(config: ClientConfig);
@@ -811,4 +842,4 @@ declare class ValidationError extends RustrakError {
811
842
  getValidationDetails(): string;
812
843
  }
813
844
 
814
- export { type AcceptInvitation, 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 ChannelType, type ChunkUploadCapability, type CleanupCounts, type CleanupOptions, type ClientConfig, type CreateAlertIntegration, type CreateAlertRule, type CreateAuthToken, type CreateInvitation, type CreateNotificationChannel, type CreateProject, type Event, type EventDetail, type GlobalRole, type Invitation, type InvitationInfo, type Issue, type IssueFilter, type IssueSort, type ListAlertHistoryOptions, type ListEventsOptions, type ListIssuesOptions, type ListProjectsOptions, type ListSourceMapsResponse, type ListTransactionsOptions, 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 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, ValidationError };
845
+ export { type AcceptInvitation, 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 ChannelType, type ChunkUploadCapability, type CleanupCounts, type CleanupOptions, type ClientConfig, type CreateAlertIntegration, type CreateAlertRule, type CreateAuthToken, type CreateInvitation, type CreateNotificationChannel, type CreateProject, type Event, type EventDetail, type GlobalRole, type Invitation, type InvitationInfo, type Issue, type IssueFilter, type IssueSort, 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 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, ValidationError };
package/dist/index.js CHANGED
@@ -537,6 +537,18 @@ var updateIssueStateSchema = z.object({
537
537
  is_resolved: z.boolean().optional(),
538
538
  is_muted: z.boolean().optional()
539
539
  });
540
+ var logSchema = z.object({
541
+ id: uuidSchema,
542
+ trace_id: z.string().nullable(),
543
+ span_id: z.string().nullable(),
544
+ level: z.string(),
545
+ /** OTel severity number (1=trace … 21=fatal). Null for unknown levels. */
546
+ severity_number: z.number().int().nullable(),
547
+ body: z.string(),
548
+ attributes: z.record(z.string(), z.any()),
549
+ timestamp: dateTimeSchema,
550
+ ingested_at: dateTimeSchema
551
+ });
540
552
  var projectRoleSchema = z.enum(["viewer", "editor", "admin"]);
541
553
  var projectMemberSchema = z.object({
542
554
  user_id: z.number().int(),
@@ -613,6 +625,7 @@ var storageSummarySchema = z.object({
613
625
  events_count: z.number(),
614
626
  transactions_count: z.number(),
615
627
  spans_count: z.number(),
628
+ logs_count: z.number(),
616
629
  source_maps: sourceMapStorageSchema
617
630
  });
618
631
  var projectStorageSchema = z.object({
@@ -621,6 +634,7 @@ var projectStorageSchema = z.object({
621
634
  events_count: z.number(),
622
635
  transactions_count: z.number(),
623
636
  spans_count: z.number(),
637
+ logs_count: z.number(),
624
638
  source_maps_count: z.number(),
625
639
  estimated_bytes: z.number()
626
640
  });
@@ -628,6 +642,7 @@ var cleanupCountsSchema = z.object({
628
642
  events: z.number(),
629
643
  transactions: z.number(),
630
644
  spans: z.number(),
645
+ logs: z.number(),
631
646
  issues_removed: z.number()
632
647
  });
633
648
  var sourceMapGcResultSchema = z.object({
@@ -636,7 +651,10 @@ var sourceMapGcResultSchema = z.object({
636
651
  });
637
652
  var cleanupOptionsSchema = z.object({
638
653
  older_than_days: z.number().int().min(1),
639
- project_id: z.number().int().optional()
654
+ project_id: z.number().int().optional(),
655
+ include_events: z.boolean().optional(),
656
+ include_transactions: z.boolean().optional(),
657
+ include_logs: z.boolean().optional()
640
658
  });
641
659
  var authTokenSchema = z.object({
642
660
  id: z.number().int(),
@@ -820,6 +838,31 @@ var IssuesResource = class extends BaseResource {
820
838
  }
821
839
  };
822
840
 
841
+ // src/resources/logs.ts
842
+ var LogsResource = class extends BaseResource {
843
+ /**
844
+ * List logs for a project with offset-based pagination (newest first by log
845
+ * timestamp), optionally filtered by level/trace_id.
846
+ */
847
+ async list(projectId, options) {
848
+ const searchParams = {};
849
+ if (options?.page) {
850
+ searchParams.page = String(options.page);
851
+ }
852
+ if (options?.per_page) {
853
+ searchParams.per_page = String(options.per_page);
854
+ }
855
+ if (options?.level) {
856
+ searchParams.level = options.level;
857
+ }
858
+ if (options?.trace_id) {
859
+ searchParams.trace_id = options.trace_id;
860
+ }
861
+ const data = await this.http.get(`api/projects/${projectId}/logs`, { searchParams }).json();
862
+ return this.validate(data, offsetPaginatedResponseSchema(logSchema));
863
+ }
864
+ };
865
+
823
866
  // src/resources/members.ts
824
867
  var MembersResource = class extends BaseResource {
825
868
  /**
@@ -1291,6 +1334,10 @@ var RustrakClient = class {
1291
1334
  * Transactions API resource (performance monitoring)
1292
1335
  */
1293
1336
  transactions;
1337
+ /**
1338
+ * Logs API resource (standalone logs)
1339
+ */
1340
+ logs;
1294
1341
  /**
1295
1342
  * Storage API resource (usage + retention cleanup, admin only)
1296
1343
  */
@@ -1319,6 +1366,7 @@ var RustrakClient = class {
1319
1366
  this.members = new MembersResource(this.http);
1320
1367
  this.sessions = new SessionsResource(this.http);
1321
1368
  this.transactions = new TransactionsResource(this.http);
1369
+ this.logs = new LogsResource(this.http);
1322
1370
  this.storage = new StorageResource(this.http);
1323
1371
  this.health = new HealthResource(this.http);
1324
1372
  }