@rustrak/client 0.15.0 → 0.15.2
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/README.md +4 -2
- package/dist/index.cjs +119 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +45 -1
- package/dist/index.d.ts +45 -1
- package/dist/index.js +119 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -719,6 +719,9 @@ declare const projectSchema: z.ZodObject<{
|
|
|
719
719
|
dsn: z.ZodString;
|
|
720
720
|
stored_event_count: z.ZodNumber;
|
|
721
721
|
digested_event_count: z.ZodNumber;
|
|
722
|
+
rate_limited_event_count: z.ZodNumber;
|
|
723
|
+
rate_limit_per_minute: z.ZodNullable<z.ZodNumber>;
|
|
724
|
+
rate_limit_per_hour: z.ZodNullable<z.ZodNumber>;
|
|
722
725
|
created_at: z.ZodString;
|
|
723
726
|
updated_at: z.ZodString;
|
|
724
727
|
platform: z.ZodNullable<z.ZodString>;
|
|
@@ -745,12 +748,19 @@ declare const updateProjectSchema: z.ZodObject<{
|
|
|
745
748
|
name: z.ZodOptional<z.ZodString>;
|
|
746
749
|
platform: z.ZodOptional<z.ZodString>;
|
|
747
750
|
slug: z.ZodOptional<z.ZodString>;
|
|
751
|
+
rate_limit_per_minute: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
752
|
+
rate_limit_per_hour: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
753
|
+
}, z.core.$strip>;
|
|
754
|
+
declare const rateLimitsSchema: z.ZodObject<{
|
|
755
|
+
project_per_minute: z.ZodNumber;
|
|
756
|
+
project_per_hour: z.ZodNumber;
|
|
748
757
|
}, z.core.$strip>;
|
|
749
758
|
|
|
750
759
|
type Project = z.infer<typeof projectSchema>;
|
|
751
760
|
type ProjectListStats = z.infer<typeof projectListStatsSchema>;
|
|
752
761
|
type CreateProject = z.infer<typeof createProjectSchema>;
|
|
753
762
|
type UpdateProject = z.infer<typeof updateProjectSchema>;
|
|
763
|
+
type RateLimits = z.infer<typeof rateLimitsSchema>;
|
|
754
764
|
|
|
755
765
|
declare const releaseHealthRowSchema: z.ZodObject<{
|
|
756
766
|
release: z.ZodString;
|
|
@@ -1130,13 +1140,32 @@ declare const registerRequestSchema: z.ZodObject<{
|
|
|
1130
1140
|
email: z.ZodString;
|
|
1131
1141
|
password: z.ZodString;
|
|
1132
1142
|
}, z.core.$strip>;
|
|
1143
|
+
declare const ssoConfigSchema: z.ZodObject<{
|
|
1144
|
+
enabled: z.ZodBoolean;
|
|
1145
|
+
provider_name: z.ZodNullable<z.ZodString>;
|
|
1146
|
+
}, z.core.$strip>;
|
|
1147
|
+
declare const ssoStartSchema: z.ZodObject<{
|
|
1148
|
+
authorization_url: z.ZodString;
|
|
1149
|
+
}, z.core.$strip>;
|
|
1150
|
+
declare const ssoLinkSchema: z.ZodObject<{
|
|
1151
|
+
email: z.ZodString;
|
|
1152
|
+
provider_name: z.ZodString;
|
|
1153
|
+
}, z.core.$strip>;
|
|
1154
|
+
declare const changePasswordRequestSchema: z.ZodObject<{
|
|
1155
|
+
current_password: z.ZodString;
|
|
1156
|
+
new_password: z.ZodString;
|
|
1157
|
+
}, z.core.$strip>;
|
|
1133
1158
|
|
|
1134
1159
|
type User = z.infer<typeof userSchema>;
|
|
1135
1160
|
type UpdatePreferencesRequest = z.infer<typeof updatePreferencesRequestSchema>;
|
|
1161
|
+
type ChangePasswordRequest = z.infer<typeof changePasswordRequestSchema>;
|
|
1136
1162
|
type AuthResponse = z.infer<typeof authResponseSchema>;
|
|
1137
1163
|
type LoginResult = z.infer<typeof loginResultSchema>;
|
|
1138
1164
|
type LoginRequest = z.infer<typeof loginRequestSchema>;
|
|
1139
1165
|
type RegisterRequest = z.infer<typeof registerRequestSchema>;
|
|
1166
|
+
type SsoConfig = z.infer<typeof ssoConfigSchema>;
|
|
1167
|
+
type SsoStart = z.infer<typeof ssoStartSchema>;
|
|
1168
|
+
type SsoLink = z.infer<typeof ssoLinkSchema>;
|
|
1140
1169
|
|
|
1141
1170
|
declare abstract class BaseResource {
|
|
1142
1171
|
protected readonly http: KyInstance;
|
|
@@ -1182,11 +1211,24 @@ declare class AlertRulesResource extends BaseResource {
|
|
|
1182
1211
|
}
|
|
1183
1212
|
|
|
1184
1213
|
declare class AuthResource extends BaseResource {
|
|
1214
|
+
getSsoConfig(): Promise<Result<SsoConfig, RustrakError>>;
|
|
1215
|
+
startSso(): Promise<Result<{
|
|
1216
|
+
authorizationUrl: string;
|
|
1217
|
+
cookies: string[];
|
|
1218
|
+
}, RustrakError>>;
|
|
1219
|
+
getSsoLink(): Promise<Result<SsoLink, RustrakError>>;
|
|
1220
|
+
confirmSsoLink(password: string): Promise<Result<LoginResult, RustrakError>>;
|
|
1221
|
+
completeSso(callback: {
|
|
1222
|
+
code?: string;
|
|
1223
|
+
state?: string;
|
|
1224
|
+
error?: string;
|
|
1225
|
+
}): Promise<Result<LoginResult, RustrakError>>;
|
|
1185
1226
|
register(credentials: RegisterRequest): Promise<Result<LoginResult, RustrakError>>;
|
|
1186
1227
|
login(credentials: LoginRequest): Promise<Result<LoginResult, RustrakError>>;
|
|
1187
1228
|
logout(): Promise<Result<string[], RustrakError>>;
|
|
1188
1229
|
getCurrentUser(): Promise<Result<User, RustrakError>>;
|
|
1189
1230
|
updatePreferences(preferences: UpdatePreferencesRequest): Promise<Result<User, RustrakError>>;
|
|
1231
|
+
changePassword(request: ChangePasswordRequest): Promise<Result<void, RustrakError>>;
|
|
1190
1232
|
getInvitation(token: string): Promise<Result<InvitationInfo, RustrakError>>;
|
|
1191
1233
|
acceptInvitation(input: AcceptInvitation): Promise<Result<LoginResult, RustrakError>>;
|
|
1192
1234
|
private readLoginResult;
|
|
@@ -1195,6 +1237,7 @@ declare class AuthResource extends BaseResource {
|
|
|
1195
1237
|
declare class EventsResource extends BaseResource {
|
|
1196
1238
|
list(projectId: number, issueId: string, options?: ListEventsOptions): Promise<Result<PaginatedResponse<Event>, RustrakError>>;
|
|
1197
1239
|
get(projectId: number, issueId: string, eventId: string): Promise<Result<EventDetail, RustrakError>>;
|
|
1240
|
+
getBySentryId(projectId: number, eventId: string): Promise<Result<EventDetail, RustrakError>>;
|
|
1198
1241
|
}
|
|
1199
1242
|
|
|
1200
1243
|
declare class HealthResource extends BaseResource {
|
|
@@ -1250,6 +1293,7 @@ declare class MembersResource extends BaseResource {
|
|
|
1250
1293
|
|
|
1251
1294
|
declare class ProjectsResource extends BaseResource {
|
|
1252
1295
|
list(options?: ListProjectsOptions): Promise<Result<OffsetPaginatedResponse<Project>, RustrakError>>;
|
|
1296
|
+
rateLimits(): Promise<Result<RateLimits, RustrakError>>;
|
|
1253
1297
|
get(id: number): Promise<Result<Project, RustrakError>>;
|
|
1254
1298
|
create(input: CreateProject): Promise<Result<Project, RustrakError>>;
|
|
1255
1299
|
update(id: number, input: UpdateProject): Promise<Result<Project, RustrakError>>;
|
|
@@ -1344,4 +1388,4 @@ declare class RustrakClient {
|
|
|
1344
1388
|
constructor(config: ClientConfig);
|
|
1345
1389
|
}
|
|
1346
1390
|
|
|
1347
|
-
export { type AcceptInvitation, type ActivityEntry, type AgentBreakdownOptions, type AgentDurationPoint, type AgentModelRow, type AgentSummary, type AgentTimeseriesOptions, type AgentTimeseriesPoint, type AgentToolRow, 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, type BulkDeleteIssues, type BulkUpdateIssues, type ChunkUploadCapability, type CleanupCounts, type CleanupOptions, type ClientConfig, type CreateAlertIntegration, type CreateAlertRule, type CreateAuthToken, type CreateComment, type CreateInvitation, type CreateProject, type CreateUserReport, Err, type Event, type EventDetail, type EventTimeseries, type EventTimeseriesPoint, FIELD_ERROR_CODES, type FieldError, type FieldErrorCode, 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, type MetricDelta, NETWORK_ERROR_MESSAGE, type OffsetPaginatedResponse, Ok, type PaginatedResponse, type PreviewTemplateResponse, type Project, type ProjectListStats, type ProjectMember, type ProjectRole, type ProjectStatsSummary, type ProjectStorage, type ProviderType, type RegisterRequest, type ReleaseHealthRow, type ReleaseHealthStatsOptions, type Result, type RoutingOverride, RustrakClient, type RustrakError, type RustrakErrorKind, SERVER_ERROR_MESSAGE, type ServerVersion, type SessionSummary, type SessionTimeseries, type SessionTimeseriesPoint, type SortOrder, type SourceMapFile, type SourceMapGcResult, type SourceMapStorage, type Span, type SpanDetail, type StorageSummary, TIMEOUT_ERROR_MESSAGE, type TagSummary, type TagValueCount, type TeamMember, type TestChannelResponse, type TestIntegrationBody, type Transaction, type TransactionDetail, type TransactionStats, type UpdateAlertIntegration, type UpdateAlertRule, type UpdateIssueState, type UpdateProject, type UpdateUserRole, type UpsertProjectMember, type User, type UserReport, isRetryable, mapResult, unwrap, unwrapOr };
|
|
1391
|
+
export { type AcceptInvitation, type ActivityEntry, type AgentBreakdownOptions, type AgentDurationPoint, type AgentModelRow, type AgentSummary, type AgentTimeseriesOptions, type AgentTimeseriesPoint, type AgentToolRow, 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, type BulkDeleteIssues, type BulkUpdateIssues, type ChangePasswordRequest, type ChunkUploadCapability, type CleanupCounts, type CleanupOptions, type ClientConfig, type CreateAlertIntegration, type CreateAlertRule, type CreateAuthToken, type CreateComment, type CreateInvitation, type CreateProject, type CreateUserReport, Err, type Event, type EventDetail, type EventTimeseries, type EventTimeseriesPoint, FIELD_ERROR_CODES, type FieldError, type FieldErrorCode, 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, type MetricDelta, NETWORK_ERROR_MESSAGE, type OffsetPaginatedResponse, Ok, type PaginatedResponse, type PreviewTemplateResponse, type Project, type ProjectListStats, type ProjectMember, type ProjectRole, type ProjectStatsSummary, type ProjectStorage, type ProviderType, type RateLimits, type RegisterRequest, type ReleaseHealthRow, type ReleaseHealthStatsOptions, type Result, type RoutingOverride, RustrakClient, type RustrakError, type RustrakErrorKind, SERVER_ERROR_MESSAGE, type ServerVersion, type SessionSummary, type SessionTimeseries, type SessionTimeseriesPoint, type SortOrder, type SourceMapFile, type SourceMapGcResult, type SourceMapStorage, type Span, type SpanDetail, type SsoConfig, type SsoLink, type SsoStart, type StorageSummary, TIMEOUT_ERROR_MESSAGE, type TagSummary, type TagValueCount, type TeamMember, type TestChannelResponse, type TestIntegrationBody, type Transaction, type TransactionDetail, type TransactionStats, type UpdateAlertIntegration, type UpdateAlertRule, type UpdateIssueState, type UpdateProject, type UpdateUserRole, type UpsertProjectMember, type User, type UserReport, isRetryable, mapResult, unwrap, unwrapOr };
|
package/dist/index.d.ts
CHANGED
|
@@ -719,6 +719,9 @@ declare const projectSchema: z.ZodObject<{
|
|
|
719
719
|
dsn: z.ZodString;
|
|
720
720
|
stored_event_count: z.ZodNumber;
|
|
721
721
|
digested_event_count: z.ZodNumber;
|
|
722
|
+
rate_limited_event_count: z.ZodNumber;
|
|
723
|
+
rate_limit_per_minute: z.ZodNullable<z.ZodNumber>;
|
|
724
|
+
rate_limit_per_hour: z.ZodNullable<z.ZodNumber>;
|
|
722
725
|
created_at: z.ZodString;
|
|
723
726
|
updated_at: z.ZodString;
|
|
724
727
|
platform: z.ZodNullable<z.ZodString>;
|
|
@@ -745,12 +748,19 @@ declare const updateProjectSchema: z.ZodObject<{
|
|
|
745
748
|
name: z.ZodOptional<z.ZodString>;
|
|
746
749
|
platform: z.ZodOptional<z.ZodString>;
|
|
747
750
|
slug: z.ZodOptional<z.ZodString>;
|
|
751
|
+
rate_limit_per_minute: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
752
|
+
rate_limit_per_hour: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
753
|
+
}, z.core.$strip>;
|
|
754
|
+
declare const rateLimitsSchema: z.ZodObject<{
|
|
755
|
+
project_per_minute: z.ZodNumber;
|
|
756
|
+
project_per_hour: z.ZodNumber;
|
|
748
757
|
}, z.core.$strip>;
|
|
749
758
|
|
|
750
759
|
type Project = z.infer<typeof projectSchema>;
|
|
751
760
|
type ProjectListStats = z.infer<typeof projectListStatsSchema>;
|
|
752
761
|
type CreateProject = z.infer<typeof createProjectSchema>;
|
|
753
762
|
type UpdateProject = z.infer<typeof updateProjectSchema>;
|
|
763
|
+
type RateLimits = z.infer<typeof rateLimitsSchema>;
|
|
754
764
|
|
|
755
765
|
declare const releaseHealthRowSchema: z.ZodObject<{
|
|
756
766
|
release: z.ZodString;
|
|
@@ -1130,13 +1140,32 @@ declare const registerRequestSchema: z.ZodObject<{
|
|
|
1130
1140
|
email: z.ZodString;
|
|
1131
1141
|
password: z.ZodString;
|
|
1132
1142
|
}, z.core.$strip>;
|
|
1143
|
+
declare const ssoConfigSchema: z.ZodObject<{
|
|
1144
|
+
enabled: z.ZodBoolean;
|
|
1145
|
+
provider_name: z.ZodNullable<z.ZodString>;
|
|
1146
|
+
}, z.core.$strip>;
|
|
1147
|
+
declare const ssoStartSchema: z.ZodObject<{
|
|
1148
|
+
authorization_url: z.ZodString;
|
|
1149
|
+
}, z.core.$strip>;
|
|
1150
|
+
declare const ssoLinkSchema: z.ZodObject<{
|
|
1151
|
+
email: z.ZodString;
|
|
1152
|
+
provider_name: z.ZodString;
|
|
1153
|
+
}, z.core.$strip>;
|
|
1154
|
+
declare const changePasswordRequestSchema: z.ZodObject<{
|
|
1155
|
+
current_password: z.ZodString;
|
|
1156
|
+
new_password: z.ZodString;
|
|
1157
|
+
}, z.core.$strip>;
|
|
1133
1158
|
|
|
1134
1159
|
type User = z.infer<typeof userSchema>;
|
|
1135
1160
|
type UpdatePreferencesRequest = z.infer<typeof updatePreferencesRequestSchema>;
|
|
1161
|
+
type ChangePasswordRequest = z.infer<typeof changePasswordRequestSchema>;
|
|
1136
1162
|
type AuthResponse = z.infer<typeof authResponseSchema>;
|
|
1137
1163
|
type LoginResult = z.infer<typeof loginResultSchema>;
|
|
1138
1164
|
type LoginRequest = z.infer<typeof loginRequestSchema>;
|
|
1139
1165
|
type RegisterRequest = z.infer<typeof registerRequestSchema>;
|
|
1166
|
+
type SsoConfig = z.infer<typeof ssoConfigSchema>;
|
|
1167
|
+
type SsoStart = z.infer<typeof ssoStartSchema>;
|
|
1168
|
+
type SsoLink = z.infer<typeof ssoLinkSchema>;
|
|
1140
1169
|
|
|
1141
1170
|
declare abstract class BaseResource {
|
|
1142
1171
|
protected readonly http: KyInstance;
|
|
@@ -1182,11 +1211,24 @@ declare class AlertRulesResource extends BaseResource {
|
|
|
1182
1211
|
}
|
|
1183
1212
|
|
|
1184
1213
|
declare class AuthResource extends BaseResource {
|
|
1214
|
+
getSsoConfig(): Promise<Result<SsoConfig, RustrakError>>;
|
|
1215
|
+
startSso(): Promise<Result<{
|
|
1216
|
+
authorizationUrl: string;
|
|
1217
|
+
cookies: string[];
|
|
1218
|
+
}, RustrakError>>;
|
|
1219
|
+
getSsoLink(): Promise<Result<SsoLink, RustrakError>>;
|
|
1220
|
+
confirmSsoLink(password: string): Promise<Result<LoginResult, RustrakError>>;
|
|
1221
|
+
completeSso(callback: {
|
|
1222
|
+
code?: string;
|
|
1223
|
+
state?: string;
|
|
1224
|
+
error?: string;
|
|
1225
|
+
}): Promise<Result<LoginResult, RustrakError>>;
|
|
1185
1226
|
register(credentials: RegisterRequest): Promise<Result<LoginResult, RustrakError>>;
|
|
1186
1227
|
login(credentials: LoginRequest): Promise<Result<LoginResult, RustrakError>>;
|
|
1187
1228
|
logout(): Promise<Result<string[], RustrakError>>;
|
|
1188
1229
|
getCurrentUser(): Promise<Result<User, RustrakError>>;
|
|
1189
1230
|
updatePreferences(preferences: UpdatePreferencesRequest): Promise<Result<User, RustrakError>>;
|
|
1231
|
+
changePassword(request: ChangePasswordRequest): Promise<Result<void, RustrakError>>;
|
|
1190
1232
|
getInvitation(token: string): Promise<Result<InvitationInfo, RustrakError>>;
|
|
1191
1233
|
acceptInvitation(input: AcceptInvitation): Promise<Result<LoginResult, RustrakError>>;
|
|
1192
1234
|
private readLoginResult;
|
|
@@ -1195,6 +1237,7 @@ declare class AuthResource extends BaseResource {
|
|
|
1195
1237
|
declare class EventsResource extends BaseResource {
|
|
1196
1238
|
list(projectId: number, issueId: string, options?: ListEventsOptions): Promise<Result<PaginatedResponse<Event>, RustrakError>>;
|
|
1197
1239
|
get(projectId: number, issueId: string, eventId: string): Promise<Result<EventDetail, RustrakError>>;
|
|
1240
|
+
getBySentryId(projectId: number, eventId: string): Promise<Result<EventDetail, RustrakError>>;
|
|
1198
1241
|
}
|
|
1199
1242
|
|
|
1200
1243
|
declare class HealthResource extends BaseResource {
|
|
@@ -1250,6 +1293,7 @@ declare class MembersResource extends BaseResource {
|
|
|
1250
1293
|
|
|
1251
1294
|
declare class ProjectsResource extends BaseResource {
|
|
1252
1295
|
list(options?: ListProjectsOptions): Promise<Result<OffsetPaginatedResponse<Project>, RustrakError>>;
|
|
1296
|
+
rateLimits(): Promise<Result<RateLimits, RustrakError>>;
|
|
1253
1297
|
get(id: number): Promise<Result<Project, RustrakError>>;
|
|
1254
1298
|
create(input: CreateProject): Promise<Result<Project, RustrakError>>;
|
|
1255
1299
|
update(id: number, input: UpdateProject): Promise<Result<Project, RustrakError>>;
|
|
@@ -1344,4 +1388,4 @@ declare class RustrakClient {
|
|
|
1344
1388
|
constructor(config: ClientConfig);
|
|
1345
1389
|
}
|
|
1346
1390
|
|
|
1347
|
-
export { type AcceptInvitation, type ActivityEntry, type AgentBreakdownOptions, type AgentDurationPoint, type AgentModelRow, type AgentSummary, type AgentTimeseriesOptions, type AgentTimeseriesPoint, type AgentToolRow, 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, type BulkDeleteIssues, type BulkUpdateIssues, type ChunkUploadCapability, type CleanupCounts, type CleanupOptions, type ClientConfig, type CreateAlertIntegration, type CreateAlertRule, type CreateAuthToken, type CreateComment, type CreateInvitation, type CreateProject, type CreateUserReport, Err, type Event, type EventDetail, type EventTimeseries, type EventTimeseriesPoint, FIELD_ERROR_CODES, type FieldError, type FieldErrorCode, 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, type MetricDelta, NETWORK_ERROR_MESSAGE, type OffsetPaginatedResponse, Ok, type PaginatedResponse, type PreviewTemplateResponse, type Project, type ProjectListStats, type ProjectMember, type ProjectRole, type ProjectStatsSummary, type ProjectStorage, type ProviderType, type RegisterRequest, type ReleaseHealthRow, type ReleaseHealthStatsOptions, type Result, type RoutingOverride, RustrakClient, type RustrakError, type RustrakErrorKind, SERVER_ERROR_MESSAGE, type ServerVersion, type SessionSummary, type SessionTimeseries, type SessionTimeseriesPoint, type SortOrder, type SourceMapFile, type SourceMapGcResult, type SourceMapStorage, type Span, type SpanDetail, type StorageSummary, TIMEOUT_ERROR_MESSAGE, type TagSummary, type TagValueCount, type TeamMember, type TestChannelResponse, type TestIntegrationBody, type Transaction, type TransactionDetail, type TransactionStats, type UpdateAlertIntegration, type UpdateAlertRule, type UpdateIssueState, type UpdateProject, type UpdateUserRole, type UpsertProjectMember, type User, type UserReport, isRetryable, mapResult, unwrap, unwrapOr };
|
|
1391
|
+
export { type AcceptInvitation, type ActivityEntry, type AgentBreakdownOptions, type AgentDurationPoint, type AgentModelRow, type AgentSummary, type AgentTimeseriesOptions, type AgentTimeseriesPoint, type AgentToolRow, 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, type BulkDeleteIssues, type BulkUpdateIssues, type ChangePasswordRequest, type ChunkUploadCapability, type CleanupCounts, type CleanupOptions, type ClientConfig, type CreateAlertIntegration, type CreateAlertRule, type CreateAuthToken, type CreateComment, type CreateInvitation, type CreateProject, type CreateUserReport, Err, type Event, type EventDetail, type EventTimeseries, type EventTimeseriesPoint, FIELD_ERROR_CODES, type FieldError, type FieldErrorCode, 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, type MetricDelta, NETWORK_ERROR_MESSAGE, type OffsetPaginatedResponse, Ok, type PaginatedResponse, type PreviewTemplateResponse, type Project, type ProjectListStats, type ProjectMember, type ProjectRole, type ProjectStatsSummary, type ProjectStorage, type ProviderType, type RateLimits, type RegisterRequest, type ReleaseHealthRow, type ReleaseHealthStatsOptions, type Result, type RoutingOverride, RustrakClient, type RustrakError, type RustrakErrorKind, SERVER_ERROR_MESSAGE, type ServerVersion, type SessionSummary, type SessionTimeseries, type SessionTimeseriesPoint, type SortOrder, type SourceMapFile, type SourceMapGcResult, type SourceMapStorage, type Span, type SpanDetail, type SsoConfig, type SsoLink, type SsoStart, type StorageSummary, TIMEOUT_ERROR_MESSAGE, type TagSummary, type TagValueCount, type TeamMember, type TestChannelResponse, type TestIntegrationBody, type Transaction, type TransactionDetail, type TransactionStats, type UpdateAlertIntegration, type UpdateAlertRule, type UpdateIssueState, type UpdateProject, type UpdateUserRole, type UpsertProjectMember, type User, type UserReport, isRetryable, mapResult, unwrap, unwrapOr };
|
package/dist/index.js
CHANGED
|
@@ -437,6 +437,14 @@ var projectSchema = z.object({
|
|
|
437
437
|
dsn: z.string(),
|
|
438
438
|
stored_event_count: z.number().int(),
|
|
439
439
|
digested_event_count: z.number().int(),
|
|
440
|
+
/** Accepted events the quota dropped instead of storing. */
|
|
441
|
+
rate_limited_event_count: z.number().int(),
|
|
442
|
+
/**
|
|
443
|
+
* The project's own limits, or null where it follows the server's. They can
|
|
444
|
+
* only tighten `MAX_EVENTS_PER_PROJECT_*`, never raise it.
|
|
445
|
+
*/
|
|
446
|
+
rate_limit_per_minute: z.number().int().nullable(),
|
|
447
|
+
rate_limit_per_hour: z.number().int().nullable(),
|
|
440
448
|
created_at: dateTimeSchema,
|
|
441
449
|
updated_at: dateTimeSchema,
|
|
442
450
|
platform: z.string().nullable(),
|
|
@@ -463,7 +471,14 @@ var updateProjectSchema = z.object({
|
|
|
463
471
|
* Slugified server-side. Unlike on create, a taken slug is a 409 rather than
|
|
464
472
|
* being silently de-duplicated.
|
|
465
473
|
*/
|
|
466
|
-
slug: z.string().min(1).optional()
|
|
474
|
+
slug: z.string().min(1).optional(),
|
|
475
|
+
/** A number sets the project's own limit; null removes it. */
|
|
476
|
+
rate_limit_per_minute: z.number().int().min(1).nullable().optional(),
|
|
477
|
+
rate_limit_per_hour: z.number().int().min(1).nullable().optional()
|
|
478
|
+
});
|
|
479
|
+
var rateLimitsSchema = z.object({
|
|
480
|
+
project_per_minute: z.number().int(),
|
|
481
|
+
project_per_hour: z.number().int()
|
|
467
482
|
});
|
|
468
483
|
var releaseHealthRowSchema = z.object({
|
|
469
484
|
release: z.string(),
|
|
@@ -706,6 +721,24 @@ var registerRequestSchema = z.object({
|
|
|
706
721
|
email: z.string().email(),
|
|
707
722
|
password: z.string().min(1)
|
|
708
723
|
});
|
|
724
|
+
var ssoConfigSchema = z.object({
|
|
725
|
+
enabled: z.boolean(),
|
|
726
|
+
provider_name: z.string().nullable()
|
|
727
|
+
});
|
|
728
|
+
var ssoStartSchema = z.object({
|
|
729
|
+
authorization_url: z.string().url()
|
|
730
|
+
});
|
|
731
|
+
var ssoLinkSchema = z.object({
|
|
732
|
+
email: z.string(),
|
|
733
|
+
provider_name: z.string()
|
|
734
|
+
});
|
|
735
|
+
var confirmSsoLinkRequestSchema = z.object({
|
|
736
|
+
password: z.string().min(1)
|
|
737
|
+
});
|
|
738
|
+
var changePasswordRequestSchema = z.object({
|
|
739
|
+
current_password: z.string().min(1),
|
|
740
|
+
new_password: z.string().min(1)
|
|
741
|
+
});
|
|
709
742
|
|
|
710
743
|
// src/errors.ts
|
|
711
744
|
var FIELD_ERROR_CODES = [
|
|
@@ -1378,6 +1411,59 @@ function readSetCookie(response) {
|
|
|
1378
1411
|
return folded === null ? [] : [folded];
|
|
1379
1412
|
}
|
|
1380
1413
|
var AuthResource = class extends BaseResource {
|
|
1414
|
+
/** Return the public SSO login configuration. */
|
|
1415
|
+
async getSsoConfig() {
|
|
1416
|
+
return this.request(
|
|
1417
|
+
() => this.http.get("auth/sso/config"),
|
|
1418
|
+
ssoConfigSchema
|
|
1419
|
+
);
|
|
1420
|
+
}
|
|
1421
|
+
/** Begin SSO and return the provider URL plus the encrypted state cookie. */
|
|
1422
|
+
async startSso() {
|
|
1423
|
+
return this.requestResponse(
|
|
1424
|
+
() => this.http.post("auth/sso/start"),
|
|
1425
|
+
async (response) => {
|
|
1426
|
+
const cookies = readSetCookie(response);
|
|
1427
|
+
const body = await this.readJson(response);
|
|
1428
|
+
if (!body.success) return body;
|
|
1429
|
+
const data = this.validate(body.data, ssoStartSchema);
|
|
1430
|
+
if (!data.success) return data;
|
|
1431
|
+
return Ok({
|
|
1432
|
+
authorizationUrl: data.data.authorization_url,
|
|
1433
|
+
cookies
|
|
1434
|
+
});
|
|
1435
|
+
}
|
|
1436
|
+
);
|
|
1437
|
+
}
|
|
1438
|
+
/** The account an SSO login is waiting to link, if any. */
|
|
1439
|
+
async getSsoLink() {
|
|
1440
|
+
return this.request(() => this.http.get("auth/sso/link"), ssoLinkSchema);
|
|
1441
|
+
}
|
|
1442
|
+
/** Link the pending SSO identity with the account's password and sign in. */
|
|
1443
|
+
async confirmSsoLink(password) {
|
|
1444
|
+
const validatedInput = this.validateInput(
|
|
1445
|
+
{ password },
|
|
1446
|
+
confirmSsoLinkRequestSchema
|
|
1447
|
+
);
|
|
1448
|
+
if (!validatedInput.success) {
|
|
1449
|
+
return validatedInput;
|
|
1450
|
+
}
|
|
1451
|
+
return this.requestResponse(
|
|
1452
|
+
() => this.http.post("auth/sso/link", { json: validatedInput.data }),
|
|
1453
|
+
(response) => this.readLoginResult(response)
|
|
1454
|
+
);
|
|
1455
|
+
}
|
|
1456
|
+
/** Complete an OIDC callback and return the normal Rustrak session cookie. */
|
|
1457
|
+
async completeSso(callback) {
|
|
1458
|
+
const searchParams = new URLSearchParams();
|
|
1459
|
+
if (callback.code) searchParams.set("code", callback.code);
|
|
1460
|
+
if (callback.state) searchParams.set("state", callback.state);
|
|
1461
|
+
if (callback.error) searchParams.set("error", callback.error);
|
|
1462
|
+
return this.requestResponse(
|
|
1463
|
+
() => this.http.get("auth/sso/callback", { searchParams }),
|
|
1464
|
+
(response) => this.readLoginResult(response)
|
|
1465
|
+
);
|
|
1466
|
+
}
|
|
1381
1467
|
/**
|
|
1382
1468
|
* Register a new user account
|
|
1383
1469
|
* Creates a new user and automatically logs them in (sets session cookie)
|
|
@@ -1460,6 +1546,20 @@ var AuthResource = class extends BaseResource {
|
|
|
1460
1546
|
userSchema
|
|
1461
1547
|
);
|
|
1462
1548
|
}
|
|
1549
|
+
/** Replaces the signed-in user's password, given the current one. */
|
|
1550
|
+
async changePassword(request) {
|
|
1551
|
+
const validatedInput = this.validateInput(
|
|
1552
|
+
request,
|
|
1553
|
+
changePasswordRequestSchema
|
|
1554
|
+
);
|
|
1555
|
+
if (!validatedInput.success) return validatedInput;
|
|
1556
|
+
return this.requestVoid(
|
|
1557
|
+
() => this.http.post("auth/me/password", {
|
|
1558
|
+
json: validatedInput.data,
|
|
1559
|
+
retry: 0
|
|
1560
|
+
})
|
|
1561
|
+
);
|
|
1562
|
+
}
|
|
1463
1563
|
/**
|
|
1464
1564
|
* Get the details of a pending invitation by its token (public endpoint)
|
|
1465
1565
|
* Used by the accept-invitation page before the user has an account
|
|
@@ -1539,6 +1639,15 @@ var EventsResource = class extends BaseResource {
|
|
|
1539
1639
|
eventDetailSchema
|
|
1540
1640
|
);
|
|
1541
1641
|
}
|
|
1642
|
+
/** Resolve the client-supplied Sentry event ID, including its owning issue. */
|
|
1643
|
+
async getBySentryId(projectId, eventId) {
|
|
1644
|
+
return this.request(
|
|
1645
|
+
() => this.http.get(
|
|
1646
|
+
`api/projects/${projectId}/events/sentry/${encodeURIComponent(eventId)}`
|
|
1647
|
+
),
|
|
1648
|
+
eventDetailSchema
|
|
1649
|
+
);
|
|
1650
|
+
}
|
|
1542
1651
|
};
|
|
1543
1652
|
var serverVersionSchema = z.object({
|
|
1544
1653
|
version: z.string()
|
|
@@ -1913,6 +2022,15 @@ var ProjectsResource = class extends BaseResource {
|
|
|
1913
2022
|
offsetPaginatedResponseSchema(projectSchema)
|
|
1914
2023
|
);
|
|
1915
2024
|
}
|
|
2025
|
+
/**
|
|
2026
|
+
* The server's per-project limits, which a project without its own follows
|
|
2027
|
+
*/
|
|
2028
|
+
async rateLimits() {
|
|
2029
|
+
return this.request(
|
|
2030
|
+
() => this.http.get("api/rate-limits"),
|
|
2031
|
+
rateLimitsSchema
|
|
2032
|
+
);
|
|
2033
|
+
}
|
|
1916
2034
|
/**
|
|
1917
2035
|
* Get a single project by ID
|
|
1918
2036
|
*/
|