@rustrak/client 0.15.0-rc.3 → 0.15.1
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 +101 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +39 -1
- package/dist/index.d.ts +39 -1
- package/dist/index.js +101 -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,6 +1140,17 @@ 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>;
|
|
1133
1154
|
|
|
1134
1155
|
type User = z.infer<typeof userSchema>;
|
|
1135
1156
|
type UpdatePreferencesRequest = z.infer<typeof updatePreferencesRequestSchema>;
|
|
@@ -1137,6 +1158,9 @@ type AuthResponse = z.infer<typeof authResponseSchema>;
|
|
|
1137
1158
|
type LoginResult = z.infer<typeof loginResultSchema>;
|
|
1138
1159
|
type LoginRequest = z.infer<typeof loginRequestSchema>;
|
|
1139
1160
|
type RegisterRequest = z.infer<typeof registerRequestSchema>;
|
|
1161
|
+
type SsoConfig = z.infer<typeof ssoConfigSchema>;
|
|
1162
|
+
type SsoStart = z.infer<typeof ssoStartSchema>;
|
|
1163
|
+
type SsoLink = z.infer<typeof ssoLinkSchema>;
|
|
1140
1164
|
|
|
1141
1165
|
declare abstract class BaseResource {
|
|
1142
1166
|
protected readonly http: KyInstance;
|
|
@@ -1182,6 +1206,18 @@ declare class AlertRulesResource extends BaseResource {
|
|
|
1182
1206
|
}
|
|
1183
1207
|
|
|
1184
1208
|
declare class AuthResource extends BaseResource {
|
|
1209
|
+
getSsoConfig(): Promise<Result<SsoConfig, RustrakError>>;
|
|
1210
|
+
startSso(): Promise<Result<{
|
|
1211
|
+
authorizationUrl: string;
|
|
1212
|
+
cookies: string[];
|
|
1213
|
+
}, RustrakError>>;
|
|
1214
|
+
getSsoLink(): Promise<Result<SsoLink, RustrakError>>;
|
|
1215
|
+
confirmSsoLink(password: string): Promise<Result<LoginResult, RustrakError>>;
|
|
1216
|
+
completeSso(callback: {
|
|
1217
|
+
code?: string;
|
|
1218
|
+
state?: string;
|
|
1219
|
+
error?: string;
|
|
1220
|
+
}): Promise<Result<LoginResult, RustrakError>>;
|
|
1185
1221
|
register(credentials: RegisterRequest): Promise<Result<LoginResult, RustrakError>>;
|
|
1186
1222
|
login(credentials: LoginRequest): Promise<Result<LoginResult, RustrakError>>;
|
|
1187
1223
|
logout(): Promise<Result<string[], RustrakError>>;
|
|
@@ -1195,6 +1231,7 @@ declare class AuthResource extends BaseResource {
|
|
|
1195
1231
|
declare class EventsResource extends BaseResource {
|
|
1196
1232
|
list(projectId: number, issueId: string, options?: ListEventsOptions): Promise<Result<PaginatedResponse<Event>, RustrakError>>;
|
|
1197
1233
|
get(projectId: number, issueId: string, eventId: string): Promise<Result<EventDetail, RustrakError>>;
|
|
1234
|
+
getBySentryId(projectId: number, eventId: string): Promise<Result<EventDetail, RustrakError>>;
|
|
1198
1235
|
}
|
|
1199
1236
|
|
|
1200
1237
|
declare class HealthResource extends BaseResource {
|
|
@@ -1250,6 +1287,7 @@ declare class MembersResource extends BaseResource {
|
|
|
1250
1287
|
|
|
1251
1288
|
declare class ProjectsResource extends BaseResource {
|
|
1252
1289
|
list(options?: ListProjectsOptions): Promise<Result<OffsetPaginatedResponse<Project>, RustrakError>>;
|
|
1290
|
+
rateLimits(): Promise<Result<RateLimits, RustrakError>>;
|
|
1253
1291
|
get(id: number): Promise<Result<Project, RustrakError>>;
|
|
1254
1292
|
create(input: CreateProject): Promise<Result<Project, RustrakError>>;
|
|
1255
1293
|
update(id: number, input: UpdateProject): Promise<Result<Project, RustrakError>>;
|
|
@@ -1344,4 +1382,4 @@ declare class RustrakClient {
|
|
|
1344
1382
|
constructor(config: ClientConfig);
|
|
1345
1383
|
}
|
|
1346
1384
|
|
|
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 };
|
|
1385
|
+
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 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,6 +1140,17 @@ 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>;
|
|
1133
1154
|
|
|
1134
1155
|
type User = z.infer<typeof userSchema>;
|
|
1135
1156
|
type UpdatePreferencesRequest = z.infer<typeof updatePreferencesRequestSchema>;
|
|
@@ -1137,6 +1158,9 @@ type AuthResponse = z.infer<typeof authResponseSchema>;
|
|
|
1137
1158
|
type LoginResult = z.infer<typeof loginResultSchema>;
|
|
1138
1159
|
type LoginRequest = z.infer<typeof loginRequestSchema>;
|
|
1139
1160
|
type RegisterRequest = z.infer<typeof registerRequestSchema>;
|
|
1161
|
+
type SsoConfig = z.infer<typeof ssoConfigSchema>;
|
|
1162
|
+
type SsoStart = z.infer<typeof ssoStartSchema>;
|
|
1163
|
+
type SsoLink = z.infer<typeof ssoLinkSchema>;
|
|
1140
1164
|
|
|
1141
1165
|
declare abstract class BaseResource {
|
|
1142
1166
|
protected readonly http: KyInstance;
|
|
@@ -1182,6 +1206,18 @@ declare class AlertRulesResource extends BaseResource {
|
|
|
1182
1206
|
}
|
|
1183
1207
|
|
|
1184
1208
|
declare class AuthResource extends BaseResource {
|
|
1209
|
+
getSsoConfig(): Promise<Result<SsoConfig, RustrakError>>;
|
|
1210
|
+
startSso(): Promise<Result<{
|
|
1211
|
+
authorizationUrl: string;
|
|
1212
|
+
cookies: string[];
|
|
1213
|
+
}, RustrakError>>;
|
|
1214
|
+
getSsoLink(): Promise<Result<SsoLink, RustrakError>>;
|
|
1215
|
+
confirmSsoLink(password: string): Promise<Result<LoginResult, RustrakError>>;
|
|
1216
|
+
completeSso(callback: {
|
|
1217
|
+
code?: string;
|
|
1218
|
+
state?: string;
|
|
1219
|
+
error?: string;
|
|
1220
|
+
}): Promise<Result<LoginResult, RustrakError>>;
|
|
1185
1221
|
register(credentials: RegisterRequest): Promise<Result<LoginResult, RustrakError>>;
|
|
1186
1222
|
login(credentials: LoginRequest): Promise<Result<LoginResult, RustrakError>>;
|
|
1187
1223
|
logout(): Promise<Result<string[], RustrakError>>;
|
|
@@ -1195,6 +1231,7 @@ declare class AuthResource extends BaseResource {
|
|
|
1195
1231
|
declare class EventsResource extends BaseResource {
|
|
1196
1232
|
list(projectId: number, issueId: string, options?: ListEventsOptions): Promise<Result<PaginatedResponse<Event>, RustrakError>>;
|
|
1197
1233
|
get(projectId: number, issueId: string, eventId: string): Promise<Result<EventDetail, RustrakError>>;
|
|
1234
|
+
getBySentryId(projectId: number, eventId: string): Promise<Result<EventDetail, RustrakError>>;
|
|
1198
1235
|
}
|
|
1199
1236
|
|
|
1200
1237
|
declare class HealthResource extends BaseResource {
|
|
@@ -1250,6 +1287,7 @@ declare class MembersResource extends BaseResource {
|
|
|
1250
1287
|
|
|
1251
1288
|
declare class ProjectsResource extends BaseResource {
|
|
1252
1289
|
list(options?: ListProjectsOptions): Promise<Result<OffsetPaginatedResponse<Project>, RustrakError>>;
|
|
1290
|
+
rateLimits(): Promise<Result<RateLimits, RustrakError>>;
|
|
1253
1291
|
get(id: number): Promise<Result<Project, RustrakError>>;
|
|
1254
1292
|
create(input: CreateProject): Promise<Result<Project, RustrakError>>;
|
|
1255
1293
|
update(id: number, input: UpdateProject): Promise<Result<Project, RustrakError>>;
|
|
@@ -1344,4 +1382,4 @@ declare class RustrakClient {
|
|
|
1344
1382
|
constructor(config: ClientConfig);
|
|
1345
1383
|
}
|
|
1346
1384
|
|
|
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 };
|
|
1385
|
+
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 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,20 @@ 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
|
+
});
|
|
709
738
|
|
|
710
739
|
// src/errors.ts
|
|
711
740
|
var FIELD_ERROR_CODES = [
|
|
@@ -1378,6 +1407,59 @@ function readSetCookie(response) {
|
|
|
1378
1407
|
return folded === null ? [] : [folded];
|
|
1379
1408
|
}
|
|
1380
1409
|
var AuthResource = class extends BaseResource {
|
|
1410
|
+
/** Return the public SSO login configuration. */
|
|
1411
|
+
async getSsoConfig() {
|
|
1412
|
+
return this.request(
|
|
1413
|
+
() => this.http.get("auth/sso/config"),
|
|
1414
|
+
ssoConfigSchema
|
|
1415
|
+
);
|
|
1416
|
+
}
|
|
1417
|
+
/** Begin SSO and return the provider URL plus the encrypted state cookie. */
|
|
1418
|
+
async startSso() {
|
|
1419
|
+
return this.requestResponse(
|
|
1420
|
+
() => this.http.post("auth/sso/start"),
|
|
1421
|
+
async (response) => {
|
|
1422
|
+
const cookies = readSetCookie(response);
|
|
1423
|
+
const body = await this.readJson(response);
|
|
1424
|
+
if (!body.success) return body;
|
|
1425
|
+
const data = this.validate(body.data, ssoStartSchema);
|
|
1426
|
+
if (!data.success) return data;
|
|
1427
|
+
return Ok({
|
|
1428
|
+
authorizationUrl: data.data.authorization_url,
|
|
1429
|
+
cookies
|
|
1430
|
+
});
|
|
1431
|
+
}
|
|
1432
|
+
);
|
|
1433
|
+
}
|
|
1434
|
+
/** The account an SSO login is waiting to link, if any. */
|
|
1435
|
+
async getSsoLink() {
|
|
1436
|
+
return this.request(() => this.http.get("auth/sso/link"), ssoLinkSchema);
|
|
1437
|
+
}
|
|
1438
|
+
/** Link the pending SSO identity with the account's password and sign in. */
|
|
1439
|
+
async confirmSsoLink(password) {
|
|
1440
|
+
const validatedInput = this.validateInput(
|
|
1441
|
+
{ password },
|
|
1442
|
+
confirmSsoLinkRequestSchema
|
|
1443
|
+
);
|
|
1444
|
+
if (!validatedInput.success) {
|
|
1445
|
+
return validatedInput;
|
|
1446
|
+
}
|
|
1447
|
+
return this.requestResponse(
|
|
1448
|
+
() => this.http.post("auth/sso/link", { json: validatedInput.data }),
|
|
1449
|
+
(response) => this.readLoginResult(response)
|
|
1450
|
+
);
|
|
1451
|
+
}
|
|
1452
|
+
/** Complete an OIDC callback and return the normal Rustrak session cookie. */
|
|
1453
|
+
async completeSso(callback) {
|
|
1454
|
+
const searchParams = new URLSearchParams();
|
|
1455
|
+
if (callback.code) searchParams.set("code", callback.code);
|
|
1456
|
+
if (callback.state) searchParams.set("state", callback.state);
|
|
1457
|
+
if (callback.error) searchParams.set("error", callback.error);
|
|
1458
|
+
return this.requestResponse(
|
|
1459
|
+
() => this.http.get("auth/sso/callback", { searchParams }),
|
|
1460
|
+
(response) => this.readLoginResult(response)
|
|
1461
|
+
);
|
|
1462
|
+
}
|
|
1381
1463
|
/**
|
|
1382
1464
|
* Register a new user account
|
|
1383
1465
|
* Creates a new user and automatically logs them in (sets session cookie)
|
|
@@ -1539,6 +1621,15 @@ var EventsResource = class extends BaseResource {
|
|
|
1539
1621
|
eventDetailSchema
|
|
1540
1622
|
);
|
|
1541
1623
|
}
|
|
1624
|
+
/** Resolve the client-supplied Sentry event ID, including its owning issue. */
|
|
1625
|
+
async getBySentryId(projectId, eventId) {
|
|
1626
|
+
return this.request(
|
|
1627
|
+
() => this.http.get(
|
|
1628
|
+
`api/projects/${projectId}/events/sentry/${encodeURIComponent(eventId)}`
|
|
1629
|
+
),
|
|
1630
|
+
eventDetailSchema
|
|
1631
|
+
);
|
|
1632
|
+
}
|
|
1542
1633
|
};
|
|
1543
1634
|
var serverVersionSchema = z.object({
|
|
1544
1635
|
version: z.string()
|
|
@@ -1913,6 +2004,15 @@ var ProjectsResource = class extends BaseResource {
|
|
|
1913
2004
|
offsetPaginatedResponseSchema(projectSchema)
|
|
1914
2005
|
);
|
|
1915
2006
|
}
|
|
2007
|
+
/**
|
|
2008
|
+
* The server's per-project limits, which a project without its own follows
|
|
2009
|
+
*/
|
|
2010
|
+
async rateLimits() {
|
|
2011
|
+
return this.request(
|
|
2012
|
+
() => this.http.get("api/rate-limits"),
|
|
2013
|
+
rateLimitsSchema
|
|
2014
|
+
);
|
|
2015
|
+
}
|
|
1916
2016
|
/**
|
|
1917
2017
|
* Get a single project by ID
|
|
1918
2018
|
*/
|