@rustrak/client 0.14.12 → 0.14.14
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 +36 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +36 -2
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.d.cts
CHANGED
|
@@ -182,6 +182,7 @@ declare const providerTypeSchema: z.ZodEnum<{
|
|
|
182
182
|
webhook: "webhook";
|
|
183
183
|
email: "email";
|
|
184
184
|
slack: "slack";
|
|
185
|
+
custom_webhook: "custom_webhook";
|
|
185
186
|
}>;
|
|
186
187
|
declare const alertTypeSchema: z.ZodEnum<{
|
|
187
188
|
new_issue: "new_issue";
|
|
@@ -201,6 +202,7 @@ declare const alertIntegrationSchema: z.ZodObject<{
|
|
|
201
202
|
webhook: "webhook";
|
|
202
203
|
email: "email";
|
|
203
204
|
slack: "slack";
|
|
205
|
+
custom_webhook: "custom_webhook";
|
|
204
206
|
}>;
|
|
205
207
|
credentials: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
206
208
|
is_enabled: z.ZodBoolean;
|
|
@@ -217,6 +219,7 @@ declare const createAlertIntegrationSchema: z.ZodObject<{
|
|
|
217
219
|
webhook: "webhook";
|
|
218
220
|
email: "email";
|
|
219
221
|
slack: "slack";
|
|
222
|
+
custom_webhook: "custom_webhook";
|
|
220
223
|
}>;
|
|
221
224
|
credentials: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
222
225
|
is_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -302,6 +305,12 @@ declare const alertHistorySchema: z.ZodObject<{
|
|
|
302
305
|
declare const testChannelResponseSchema: z.ZodObject<{
|
|
303
306
|
success: z.ZodBoolean;
|
|
304
307
|
message: z.ZodString;
|
|
308
|
+
response_body: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
309
|
+
}, z.core.$strip>;
|
|
310
|
+
declare const previewTemplateResponseSchema: z.ZodObject<{
|
|
311
|
+
ok: z.ZodBoolean;
|
|
312
|
+
rendered: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
313
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
305
314
|
}, z.core.$strip>;
|
|
306
315
|
declare const testIntegrationBodySchema: z.ZodObject<{
|
|
307
316
|
routing_override: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -320,6 +329,7 @@ type CreateAlertRule = z.infer<typeof createAlertRuleSchema>;
|
|
|
320
329
|
type UpdateAlertRule = z.infer<typeof updateAlertRuleSchema>;
|
|
321
330
|
type AlertHistory = z.infer<typeof alertHistorySchema>;
|
|
322
331
|
type TestChannelResponse = z.infer<typeof testChannelResponseSchema>;
|
|
332
|
+
type PreviewTemplateResponse = z.infer<typeof previewTemplateResponseSchema>;
|
|
323
333
|
type TestIntegrationBody = z.infer<typeof testIntegrationBodySchema>;
|
|
324
334
|
interface ListAlertHistoryOptions {
|
|
325
335
|
limit?: number;
|
|
@@ -1159,6 +1169,7 @@ declare class AlertIntegrationsResource extends BaseResource {
|
|
|
1159
1169
|
update(id: number, input: UpdateAlertIntegration): Promise<Result<AlertIntegration, RustrakError>>;
|
|
1160
1170
|
delete(id: number): Promise<Result<void, RustrakError>>;
|
|
1161
1171
|
test(id: number, routingOverride?: RoutingOverride): Promise<Result<TestChannelResponse, RustrakError>>;
|
|
1172
|
+
previewTemplate(template: string): Promise<Result<PreviewTemplateResponse, RustrakError>>;
|
|
1162
1173
|
}
|
|
1163
1174
|
|
|
1164
1175
|
declare class AlertRulesResource extends BaseResource {
|
|
@@ -1333,4 +1344,4 @@ declare class RustrakClient {
|
|
|
1333
1344
|
constructor(config: ClientConfig);
|
|
1334
1345
|
}
|
|
1335
1346
|
|
|
1336
|
-
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 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 };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -182,6 +182,7 @@ declare const providerTypeSchema: z.ZodEnum<{
|
|
|
182
182
|
webhook: "webhook";
|
|
183
183
|
email: "email";
|
|
184
184
|
slack: "slack";
|
|
185
|
+
custom_webhook: "custom_webhook";
|
|
185
186
|
}>;
|
|
186
187
|
declare const alertTypeSchema: z.ZodEnum<{
|
|
187
188
|
new_issue: "new_issue";
|
|
@@ -201,6 +202,7 @@ declare const alertIntegrationSchema: z.ZodObject<{
|
|
|
201
202
|
webhook: "webhook";
|
|
202
203
|
email: "email";
|
|
203
204
|
slack: "slack";
|
|
205
|
+
custom_webhook: "custom_webhook";
|
|
204
206
|
}>;
|
|
205
207
|
credentials: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
206
208
|
is_enabled: z.ZodBoolean;
|
|
@@ -217,6 +219,7 @@ declare const createAlertIntegrationSchema: z.ZodObject<{
|
|
|
217
219
|
webhook: "webhook";
|
|
218
220
|
email: "email";
|
|
219
221
|
slack: "slack";
|
|
222
|
+
custom_webhook: "custom_webhook";
|
|
220
223
|
}>;
|
|
221
224
|
credentials: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
222
225
|
is_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -302,6 +305,12 @@ declare const alertHistorySchema: z.ZodObject<{
|
|
|
302
305
|
declare const testChannelResponseSchema: z.ZodObject<{
|
|
303
306
|
success: z.ZodBoolean;
|
|
304
307
|
message: z.ZodString;
|
|
308
|
+
response_body: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
309
|
+
}, z.core.$strip>;
|
|
310
|
+
declare const previewTemplateResponseSchema: z.ZodObject<{
|
|
311
|
+
ok: z.ZodBoolean;
|
|
312
|
+
rendered: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
313
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
305
314
|
}, z.core.$strip>;
|
|
306
315
|
declare const testIntegrationBodySchema: z.ZodObject<{
|
|
307
316
|
routing_override: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -320,6 +329,7 @@ type CreateAlertRule = z.infer<typeof createAlertRuleSchema>;
|
|
|
320
329
|
type UpdateAlertRule = z.infer<typeof updateAlertRuleSchema>;
|
|
321
330
|
type AlertHistory = z.infer<typeof alertHistorySchema>;
|
|
322
331
|
type TestChannelResponse = z.infer<typeof testChannelResponseSchema>;
|
|
332
|
+
type PreviewTemplateResponse = z.infer<typeof previewTemplateResponseSchema>;
|
|
323
333
|
type TestIntegrationBody = z.infer<typeof testIntegrationBodySchema>;
|
|
324
334
|
interface ListAlertHistoryOptions {
|
|
325
335
|
limit?: number;
|
|
@@ -1159,6 +1169,7 @@ declare class AlertIntegrationsResource extends BaseResource {
|
|
|
1159
1169
|
update(id: number, input: UpdateAlertIntegration): Promise<Result<AlertIntegration, RustrakError>>;
|
|
1160
1170
|
delete(id: number): Promise<Result<void, RustrakError>>;
|
|
1161
1171
|
test(id: number, routingOverride?: RoutingOverride): Promise<Result<TestChannelResponse, RustrakError>>;
|
|
1172
|
+
previewTemplate(template: string): Promise<Result<PreviewTemplateResponse, RustrakError>>;
|
|
1162
1173
|
}
|
|
1163
1174
|
|
|
1164
1175
|
declare class AlertRulesResource extends BaseResource {
|
|
@@ -1333,4 +1344,4 @@ declare class RustrakClient {
|
|
|
1333
1344
|
constructor(config: ClientConfig);
|
|
1334
1345
|
}
|
|
1335
1346
|
|
|
1336
|
-
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 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 };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -87,7 +87,12 @@ var agentToolRowSchema = z.object({
|
|
|
87
87
|
avg_ms: z.number(),
|
|
88
88
|
p95_ms: z.number()
|
|
89
89
|
});
|
|
90
|
-
var providerTypeSchema = z.enum([
|
|
90
|
+
var providerTypeSchema = z.enum([
|
|
91
|
+
"webhook",
|
|
92
|
+
"email",
|
|
93
|
+
"slack",
|
|
94
|
+
"custom_webhook"
|
|
95
|
+
]);
|
|
91
96
|
var alertTypeSchema = z.enum(["new_issue", "regression", "unmute"]);
|
|
92
97
|
var alertStatusSchema = z.enum([
|
|
93
98
|
"pending",
|
|
@@ -172,7 +177,20 @@ var alertHistorySchema = z.object({
|
|
|
172
177
|
});
|
|
173
178
|
var testChannelResponseSchema = z.object({
|
|
174
179
|
success: z.boolean(),
|
|
175
|
-
message: z.string()
|
|
180
|
+
message: z.string(),
|
|
181
|
+
/**
|
|
182
|
+
* What the endpoint answered, when it answered anything.
|
|
183
|
+
*
|
|
184
|
+
* Delivery is judged by the HTTP status and the body is not interpreted, so
|
|
185
|
+
* the body is handed back instead: a group bot that refuses a message still
|
|
186
|
+
* answers 200 and explains itself here.
|
|
187
|
+
*/
|
|
188
|
+
response_body: z.string().nullish()
|
|
189
|
+
});
|
|
190
|
+
var previewTemplateResponseSchema = z.object({
|
|
191
|
+
ok: z.boolean(),
|
|
192
|
+
rendered: z.string().nullish(),
|
|
193
|
+
error: z.string().nullish()
|
|
176
194
|
});
|
|
177
195
|
var testIntegrationBodySchema = z.object({
|
|
178
196
|
routing_override: z.record(z.string(), z.unknown()).optional()
|
|
@@ -1263,6 +1281,22 @@ var AlertIntegrationsResource = class extends BaseResource {
|
|
|
1263
1281
|
testChannelResponseSchema
|
|
1264
1282
|
);
|
|
1265
1283
|
}
|
|
1284
|
+
/**
|
|
1285
|
+
* Render a Custom Webhook template against a sample payload.
|
|
1286
|
+
*
|
|
1287
|
+
* Answers with the body that would be sent, or with why it would not
|
|
1288
|
+
* render. It goes to the server because the server owns the template
|
|
1289
|
+
* engine: a preview computed anywhere else would eventually disagree with
|
|
1290
|
+
* what a delivery actually sends.
|
|
1291
|
+
*/
|
|
1292
|
+
async previewTemplate(template) {
|
|
1293
|
+
return this.request(
|
|
1294
|
+
() => this.http.post("api/integrations/preview-template", {
|
|
1295
|
+
json: { template }
|
|
1296
|
+
}),
|
|
1297
|
+
previewTemplateResponseSchema
|
|
1298
|
+
);
|
|
1299
|
+
}
|
|
1266
1300
|
};
|
|
1267
1301
|
var AlertRulesResource = class extends BaseResource {
|
|
1268
1302
|
/**
|