@rustrak/client 0.14.11 → 0.14.13

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 CHANGED
@@ -93,7 +93,12 @@ var agentToolRowSchema = zod.z.object({
93
93
  avg_ms: zod.z.number(),
94
94
  p95_ms: zod.z.number()
95
95
  });
96
- var providerTypeSchema = zod.z.enum(["webhook", "email", "slack"]);
96
+ var providerTypeSchema = zod.z.enum([
97
+ "webhook",
98
+ "email",
99
+ "slack",
100
+ "custom_webhook"
101
+ ]);
97
102
  var alertTypeSchema = zod.z.enum(["new_issue", "regression", "unmute"]);
98
103
  var alertStatusSchema = zod.z.enum([
99
104
  "pending",
@@ -178,7 +183,20 @@ var alertHistorySchema = zod.z.object({
178
183
  });
179
184
  var testChannelResponseSchema = zod.z.object({
180
185
  success: zod.z.boolean(),
181
- message: zod.z.string()
186
+ message: zod.z.string(),
187
+ /**
188
+ * What the endpoint answered, when it answered anything.
189
+ *
190
+ * Delivery is judged by the HTTP status and the body is not interpreted, so
191
+ * the body is handed back instead: a group bot that refuses a message still
192
+ * answers 200 and explains itself here.
193
+ */
194
+ response_body: zod.z.string().nullish()
195
+ });
196
+ var previewTemplateResponseSchema = zod.z.object({
197
+ ok: zod.z.boolean(),
198
+ rendered: zod.z.string().nullish(),
199
+ error: zod.z.string().nullish()
182
200
  });
183
201
  var testIntegrationBodySchema = zod.z.object({
184
202
  routing_override: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
@@ -1269,6 +1287,22 @@ var AlertIntegrationsResource = class extends BaseResource {
1269
1287
  testChannelResponseSchema
1270
1288
  );
1271
1289
  }
1290
+ /**
1291
+ * Render a Custom Webhook template against a sample payload.
1292
+ *
1293
+ * Answers with the body that would be sent, or with why it would not
1294
+ * render. It goes to the server because the server owns the template
1295
+ * engine: a preview computed anywhere else would eventually disagree with
1296
+ * what a delivery actually sends.
1297
+ */
1298
+ async previewTemplate(template) {
1299
+ return this.request(
1300
+ () => this.http.post("api/integrations/preview-template", {
1301
+ json: { template }
1302
+ }),
1303
+ previewTemplateResponseSchema
1304
+ );
1305
+ }
1272
1306
  };
1273
1307
  var AlertRulesResource = class extends BaseResource {
1274
1308
  /**