@rustrak/client 0.3.8 → 0.3.9
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 +45 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -1
- package/dist/index.d.ts +29 -1
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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<{
|
|
@@ -690,6 +713,10 @@ declare class IssuesResource extends BaseResource {
|
|
|
690
713
|
delete(projectId: number, issueId: string): Promise<void>;
|
|
691
714
|
}
|
|
692
715
|
|
|
716
|
+
declare class LogsResource extends BaseResource {
|
|
717
|
+
list(projectId: number, options?: ListLogsOptions): Promise<OffsetPaginatedResponse<Log>>;
|
|
718
|
+
}
|
|
719
|
+
|
|
693
720
|
declare class MembersResource extends BaseResource {
|
|
694
721
|
list(projectId: number): Promise<ProjectMember[]>;
|
|
695
722
|
upsert(projectId: number, input: UpsertProjectMember): Promise<void>;
|
|
@@ -766,6 +793,7 @@ declare class RustrakClient {
|
|
|
766
793
|
readonly members: MembersResource;
|
|
767
794
|
readonly sessions: SessionsResource;
|
|
768
795
|
readonly transactions: TransactionsResource;
|
|
796
|
+
readonly logs: LogsResource;
|
|
769
797
|
readonly storage: StorageResource;
|
|
770
798
|
readonly health: HealthResource;
|
|
771
799
|
constructor(config: ClientConfig);
|
|
@@ -811,4 +839,4 @@ declare class ValidationError extends RustrakError {
|
|
|
811
839
|
getValidationDetails(): string;
|
|
812
840
|
}
|
|
813
841
|
|
|
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 };
|
|
842
|
+
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<{
|
|
@@ -690,6 +713,10 @@ declare class IssuesResource extends BaseResource {
|
|
|
690
713
|
delete(projectId: number, issueId: string): Promise<void>;
|
|
691
714
|
}
|
|
692
715
|
|
|
716
|
+
declare class LogsResource extends BaseResource {
|
|
717
|
+
list(projectId: number, options?: ListLogsOptions): Promise<OffsetPaginatedResponse<Log>>;
|
|
718
|
+
}
|
|
719
|
+
|
|
693
720
|
declare class MembersResource extends BaseResource {
|
|
694
721
|
list(projectId: number): Promise<ProjectMember[]>;
|
|
695
722
|
upsert(projectId: number, input: UpsertProjectMember): Promise<void>;
|
|
@@ -766,6 +793,7 @@ declare class RustrakClient {
|
|
|
766
793
|
readonly members: MembersResource;
|
|
767
794
|
readonly sessions: SessionsResource;
|
|
768
795
|
readonly transactions: TransactionsResource;
|
|
796
|
+
readonly logs: LogsResource;
|
|
769
797
|
readonly storage: StorageResource;
|
|
770
798
|
readonly health: HealthResource;
|
|
771
799
|
constructor(config: ClientConfig);
|
|
@@ -811,4 +839,4 @@ declare class ValidationError extends RustrakError {
|
|
|
811
839
|
getValidationDetails(): string;
|
|
812
840
|
}
|
|
813
841
|
|
|
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 };
|
|
842
|
+
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({
|
|
@@ -820,6 +835,31 @@ var IssuesResource = class extends BaseResource {
|
|
|
820
835
|
}
|
|
821
836
|
};
|
|
822
837
|
|
|
838
|
+
// src/resources/logs.ts
|
|
839
|
+
var LogsResource = class extends BaseResource {
|
|
840
|
+
/**
|
|
841
|
+
* List logs for a project with offset-based pagination (newest first by log
|
|
842
|
+
* timestamp), optionally filtered by level/trace_id.
|
|
843
|
+
*/
|
|
844
|
+
async list(projectId, options) {
|
|
845
|
+
const searchParams = {};
|
|
846
|
+
if (options?.page) {
|
|
847
|
+
searchParams.page = String(options.page);
|
|
848
|
+
}
|
|
849
|
+
if (options?.per_page) {
|
|
850
|
+
searchParams.per_page = String(options.per_page);
|
|
851
|
+
}
|
|
852
|
+
if (options?.level) {
|
|
853
|
+
searchParams.level = options.level;
|
|
854
|
+
}
|
|
855
|
+
if (options?.trace_id) {
|
|
856
|
+
searchParams.trace_id = options.trace_id;
|
|
857
|
+
}
|
|
858
|
+
const data = await this.http.get(`api/projects/${projectId}/logs`, { searchParams }).json();
|
|
859
|
+
return this.validate(data, offsetPaginatedResponseSchema(logSchema));
|
|
860
|
+
}
|
|
861
|
+
};
|
|
862
|
+
|
|
823
863
|
// src/resources/members.ts
|
|
824
864
|
var MembersResource = class extends BaseResource {
|
|
825
865
|
/**
|
|
@@ -1291,6 +1331,10 @@ var RustrakClient = class {
|
|
|
1291
1331
|
* Transactions API resource (performance monitoring)
|
|
1292
1332
|
*/
|
|
1293
1333
|
transactions;
|
|
1334
|
+
/**
|
|
1335
|
+
* Logs API resource (standalone logs)
|
|
1336
|
+
*/
|
|
1337
|
+
logs;
|
|
1294
1338
|
/**
|
|
1295
1339
|
* Storage API resource (usage + retention cleanup, admin only)
|
|
1296
1340
|
*/
|
|
@@ -1319,6 +1363,7 @@ var RustrakClient = class {
|
|
|
1319
1363
|
this.members = new MembersResource(this.http);
|
|
1320
1364
|
this.sessions = new SessionsResource(this.http);
|
|
1321
1365
|
this.transactions = new TransactionsResource(this.http);
|
|
1366
|
+
this.logs = new LogsResource(this.http);
|
|
1322
1367
|
this.storage = new StorageResource(this.http);
|
|
1323
1368
|
this.health = new HealthResource(this.http);
|
|
1324
1369
|
}
|