@automate.ax/integration-contracts 0.126.0 → 0.127.0

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.
@@ -0,0 +1,580 @@
1
+ import { encodableSchema } from "@automate.ax/codec";
2
+ import * as z from "zod";
3
+ export const AXIOM_ID_SCHEMA = z.string().trim().min(1);
4
+ export const AXIOM_DEFAULT_EDGE_ORIGIN = "https://us-east-1.aws.edge.axiom.co";
5
+ export const AXIOM_EDGE_URL_SCHEMA = z
6
+ .url()
7
+ .refine((value) => {
8
+ const url = new URL(value);
9
+ return (url.protocol === "https:" &&
10
+ url.port === "" &&
11
+ url.hostname.endsWith(".edge.axiom.co") &&
12
+ !url.username &&
13
+ !url.password &&
14
+ url.pathname === "/" &&
15
+ !url.search &&
16
+ !url.hash);
17
+ }, "Use the HTTPS base origin of an Axiom edge deployment.")
18
+ .prefault(AXIOM_DEFAULT_EDGE_ORIGIN);
19
+ export const AXIOM_TIME_SCHEMA = z.string().trim().min(1);
20
+ export const AXIOM_DATASET_KIND_SCHEMA = z.enum([
21
+ "axiom:events:v1",
22
+ "otel:logs:v1",
23
+ "otel:metrics:v1",
24
+ "otel:traces:v1",
25
+ ]);
26
+ export const AXIOM_DATASET_FIELD_SCHEMA = z.object({
27
+ description: z.string().optional(),
28
+ hidden: z.boolean().optional(),
29
+ name: AXIOM_ID_SCHEMA,
30
+ type: z.string().min(1),
31
+ unit: z.string().optional(),
32
+ });
33
+ export const AXIOM_INGEST_STATUS_SCHEMA = z
34
+ .object({
35
+ blocksCreated: z.number().int().nonnegative(),
36
+ failed: z.number().int().nonnegative(),
37
+ failures: z
38
+ .object({
39
+ error: z.string(),
40
+ timestamp: z.string(),
41
+ })
42
+ .catchall(encodableSchema)
43
+ .array()
44
+ .optional(),
45
+ ingested: z.number().int().nonnegative(),
46
+ processedBytes: z.number().int().nonnegative(),
47
+ walLength: z.number().int().nonnegative(),
48
+ })
49
+ .catchall(encodableSchema);
50
+ export const AXIOM_QUERY_OPTIONS_SCHEMA = z.object({
51
+ disableCache: z.boolean().optional(),
52
+ disableStats: z.boolean().optional(),
53
+ disableTrace: z.boolean().optional(),
54
+ displayNull: z.enum(["", "auto", "null", "span", "zero"]).optional(),
55
+ maxDataPoints: z.number().int().positive().optional(),
56
+ maxSeries: z.number().int().positive().optional(),
57
+ noAggregation: z.boolean().optional(),
58
+ noFill: z.boolean().optional(),
59
+ noInterpolation: z.boolean().optional(),
60
+ priority: z.enum(["high", "low", "medium"]).optional(),
61
+ resolution: z.string().optional(),
62
+ shownColumns: z.string().max(10_000).optional(),
63
+ timeSeriesVariant: z.enum(["", "area", "bars", "line", "lines"]).optional(),
64
+ timeSeriesView: z
65
+ .enum(["", "charts", "charts|resultsTable", "resultsTable"])
66
+ .optional(),
67
+ });
68
+ export const AXIOM_APL_REQUEST_SCHEMA = z.object({
69
+ apl: z.string().trim().min(1),
70
+ cursor: z.string().optional(),
71
+ defaultLimit: z.number().int().positive().optional(),
72
+ defaultOrder: z
73
+ .object({ desc: z.boolean().optional(), field: z.string().min(1) })
74
+ .array()
75
+ .optional(),
76
+ endTime: AXIOM_TIME_SCHEMA.prefault("now"),
77
+ includeCursor: z.boolean().optional(),
78
+ includeCursorField: z.boolean().optional(),
79
+ libraries: AXIOM_ID_SCHEMA.array().optional(),
80
+ queryOptions: AXIOM_QUERY_OPTIONS_SCHEMA.optional(),
81
+ startTime: AXIOM_TIME_SCHEMA.prefault("now-30m"),
82
+ variables: z.record(z.string(), z.record(z.string(), z.json())).optional(),
83
+ });
84
+ const AXIOM_QUERY_MESSAGE_SCHEMA = z.object({
85
+ code: z.string().optional(),
86
+ count: z.number().int(),
87
+ msg: z.string(),
88
+ priority: z.string(),
89
+ });
90
+ export const AXIOM_QUERY_RESULT_SCHEMA = z
91
+ .object({
92
+ datasetNames: z.string().array(),
93
+ fieldsMetaMap: z
94
+ .record(z.string(), z
95
+ .object({
96
+ description: z.string().optional(),
97
+ hidden: z.boolean().optional(),
98
+ name: z.string(),
99
+ type: z.string(),
100
+ unit: z.string().optional(),
101
+ })
102
+ .catchall(encodableSchema)
103
+ .array())
104
+ .optional(),
105
+ format: z.literal("tabular"),
106
+ status: z
107
+ .object({
108
+ blocksExamined: z.number().int().nonnegative(),
109
+ cacheStatus: z.number().int().nonnegative(),
110
+ continuationToken: z.string().optional(),
111
+ elapsedTime: z.number().int().nonnegative(),
112
+ isEstimate: z.boolean().optional(),
113
+ isPartial: z.boolean(),
114
+ maxBlockTime: z.string(),
115
+ maxCursor: z.string().optional(),
116
+ messages: AXIOM_QUERY_MESSAGE_SCHEMA.array().optional(),
117
+ minBlockTime: z.string(),
118
+ minCursor: z.string().optional(),
119
+ numGroups: z.number().int().nonnegative(),
120
+ rowsExamined: z.number().int().nonnegative(),
121
+ rowsMatched: z.number().int().nonnegative(),
122
+ })
123
+ .catchall(encodableSchema),
124
+ tables: z
125
+ .object({
126
+ buckets: z
127
+ .object({
128
+ field: z.string(),
129
+ size: z.number(),
130
+ })
131
+ .optional(),
132
+ columns: z.json().array().array().optional(),
133
+ fields: z
134
+ .object({
135
+ agg: z.record(z.string(), encodableSchema).optional(),
136
+ name: z.string(),
137
+ type: z.string(),
138
+ })
139
+ .array(),
140
+ groups: z.object({ name: z.string().optional() }).array(),
141
+ name: z.string(),
142
+ order: z.object({ desc: z.boolean(), field: z.string() }).array(),
143
+ range: z
144
+ .object({
145
+ end: z.string(),
146
+ field: z.string(),
147
+ start: z.string(),
148
+ })
149
+ .optional(),
150
+ sources: z.object({ name: z.string() }).array(),
151
+ })
152
+ .catchall(encodableSchema)
153
+ .array(),
154
+ })
155
+ .catchall(encodableSchema);
156
+ export const AXIOM_METRICS_RESULT_SCHEMA = z.record(z.string(), z.json());
157
+ export const AXIOM_METRIC_INFO_SCHEMA = z.object({
158
+ temporality: z.string(),
159
+ type: z.string(),
160
+ unit: z.string().nullable(),
161
+ });
162
+ export const AXIOM_METRICS_INFO_SCHEMA = z.record(z.string(), AXIOM_METRIC_INFO_SCHEMA);
163
+ export const AXIOM_METRIC_DISCOVERY_SCHEMA = z.object({
164
+ datasetName: AXIOM_ID_SCHEMA,
165
+ edgeUrl: AXIOM_EDGE_URL_SCHEMA,
166
+ endTime: AXIOM_TIME_SCHEMA.prefault("now"),
167
+ startTime: AXIOM_TIME_SCHEMA.prefault("now-30m"),
168
+ });
169
+ export const AXIOM_METRIC_TAG_DISCOVERY_SCHEMA = AXIOM_METRIC_DISCOVERY_SCHEMA.extend({
170
+ metric: AXIOM_ID_SCHEMA,
171
+ });
172
+ export const AXIOM_DATASET_TAG_VALUE_DISCOVERY_SCHEMA = AXIOM_METRIC_DISCOVERY_SCHEMA.extend({
173
+ tag: AXIOM_ID_SCHEMA,
174
+ });
175
+ export const AXIOM_METRIC_TAG_VALUE_DISCOVERY_SCHEMA = AXIOM_METRIC_TAG_DISCOVERY_SCHEMA.extend({
176
+ tag: AXIOM_ID_SCHEMA,
177
+ });
178
+ export const AXIOM_DATASET_SCHEMA = z
179
+ .object({
180
+ canWrite: z.boolean().optional(),
181
+ created: z.string(),
182
+ description: z.string(),
183
+ edgeDeployment: z.string().optional(),
184
+ edgeDeploymentUrl: z.string().optional(),
185
+ id: AXIOM_ID_SCHEMA,
186
+ kind: AXIOM_DATASET_KIND_SCHEMA,
187
+ mapFields: z.string().array().optional(),
188
+ name: AXIOM_ID_SCHEMA,
189
+ retentionDays: z.number().int().nonnegative().optional(),
190
+ sharedByOrg: z.string().optional(),
191
+ updatedAt: z.string(),
192
+ useRetentionPeriod: z.boolean().optional(),
193
+ who: z.string(),
194
+ })
195
+ .catchall(encodableSchema);
196
+ export const AXIOM_ANNOTATION_SCHEMA = z.object({
197
+ datasets: AXIOM_ID_SCHEMA.array().min(1),
198
+ description: z.string().max(512).optional(),
199
+ endTime: z.string().nullable().optional(),
200
+ id: AXIOM_ID_SCHEMA,
201
+ time: z.string(),
202
+ title: z.string().max(256).optional(),
203
+ type: z
204
+ .string()
205
+ .regex(/^[a-z0-9-]+$/)
206
+ .max(256),
207
+ url: z.string().max(512).optional(),
208
+ });
209
+ export const AXIOM_MONITOR_TYPE_SCHEMA = z.enum([
210
+ "AnomalyDetection",
211
+ "MatchEvent",
212
+ "Threshold",
213
+ ]);
214
+ export const AXIOM_MONITOR_SCHEMA = z
215
+ .object({
216
+ alertOnNoData: z.boolean().optional(),
217
+ aplQuery: z.string().trim().min(1).optional(),
218
+ columnName: z.string().optional(),
219
+ compareDays: z.number().int().min(1).max(7).optional(),
220
+ description: z.string().optional(),
221
+ disabled: z.boolean().optional(),
222
+ disabledUntil: z.string().nullable().optional(),
223
+ intervalMinutes: z.number().int().positive(),
224
+ mplQuery: z.string().trim().min(1).optional(),
225
+ name: z.string().trim().min(1),
226
+ notifierIds: AXIOM_ID_SCHEMA.array().optional(),
227
+ notifyByGroup: z.boolean().optional(),
228
+ notifyEveryRun: z.boolean().optional(),
229
+ operator: z
230
+ .enum(["Above", "AboveOrBelow", "AboveOrEqual", "Below", "BelowOrEqual"])
231
+ .optional(),
232
+ rangeMinutes: z.number().int().positive(),
233
+ resolvable: z.boolean().optional(),
234
+ secondDelay: z.number().int().min(0).max(86_400).optional(),
235
+ skipResolved: z.boolean().optional(),
236
+ threshold: z.number().optional(),
237
+ tolerance: z.number().min(0).max(100).optional(),
238
+ triggerAfterNPositiveResults: z.number().int().positive().optional(),
239
+ triggerFromNRuns: z.number().int().positive().optional(),
240
+ type: AXIOM_MONITOR_TYPE_SCHEMA,
241
+ })
242
+ .refine(({ aplQuery, mplQuery }) => Boolean(aplQuery) !== Boolean(mplQuery), {
243
+ message: "Provide exactly one of aplQuery or mplQuery.",
244
+ });
245
+ export const AXIOM_MONITOR_WITH_ID_SCHEMA = AXIOM_MONITOR_SCHEMA.and(z
246
+ .object({
247
+ createdAt: z.string().optional(),
248
+ createdBy: z.string().optional(),
249
+ id: AXIOM_ID_SCHEMA,
250
+ updatedAt: z.string().optional(),
251
+ })
252
+ .catchall(encodableSchema));
253
+ export const AXIOM_ALERT_HISTORY_SCHEMA = z.object({
254
+ checkId: AXIOM_ID_SCHEMA,
255
+ name: z.string(),
256
+ state: z.enum(["closed", "open"]),
257
+ timestamp: z.string(),
258
+ });
259
+ const HEADER_MAP_SCHEMA = z.record(z.string().min(1), z.string());
260
+ export const AXIOM_NOTIFIER_PROPERTIES_SCHEMA = z.union([
261
+ z.object({ email: z.object({ emails: z.email().array().min(1) }) }),
262
+ z.object({ slack: z.object({ slackUrl: z.url() }) }),
263
+ z.object({ webhook: z.object({ url: z.url() }) }),
264
+ z.object({
265
+ customWebhook: z.object({
266
+ body: z.string().min(1),
267
+ headers: HEADER_MAP_SCHEMA.optional(),
268
+ secretHeaders: HEADER_MAP_SCHEMA.optional(),
269
+ url: z.url(),
270
+ }),
271
+ }),
272
+ z.object({
273
+ pagerduty: z.object({
274
+ routingKey: z.string().min(1).optional(),
275
+ token: z.string().min(1).optional(),
276
+ }),
277
+ }),
278
+ z.object({
279
+ opsgenie: z.object({
280
+ apiKey: z.string().min(1),
281
+ isEU: z.boolean().optional(),
282
+ }),
283
+ }),
284
+ z.object({
285
+ discord: z.object({
286
+ discordChannel: z.string().min(1),
287
+ discordToken: z.string().min(1),
288
+ }),
289
+ }),
290
+ z.object({ discordWebhook: z.object({ discordWebhookUrl: z.url() }) }),
291
+ z.object({ microsoftTeams: z.object({ microsoftTeamsUrl: z.url() }) }),
292
+ ]);
293
+ export const AXIOM_NOTIFIER_SCHEMA = z
294
+ .object({
295
+ createdAt: z.string().optional(),
296
+ createdBy: z.string().optional(),
297
+ disabledUntil: z.string().nullable().optional(),
298
+ id: AXIOM_ID_SCHEMA.optional(),
299
+ name: z.string().trim().min(1),
300
+ properties: AXIOM_NOTIFIER_PROPERTIES_SCHEMA,
301
+ updatedAt: z.string().optional(),
302
+ })
303
+ .catchall(encodableSchema);
304
+ export const AXIOM_NOTIFIER_WITH_ID_SCHEMA = AXIOM_NOTIFIER_SCHEMA.extend({
305
+ id: AXIOM_ID_SCHEMA,
306
+ });
307
+ export const AXIOM_SAVED_QUERY_SCHEMA = z.object({
308
+ dataset: z.string().optional(),
309
+ id: AXIOM_ID_SCHEMA.optional(),
310
+ kind: z.literal("apl"),
311
+ metadata: z.record(z.string(), z.string()),
312
+ name: z.string().trim().min(1),
313
+ query: AXIOM_APL_REQUEST_SCHEMA,
314
+ who: z.string(),
315
+ });
316
+ export const AXIOM_SAVED_QUERY_WITH_ID_SCHEMA = AXIOM_SAVED_QUERY_SCHEMA.extend({
317
+ id: AXIOM_ID_SCHEMA,
318
+ });
319
+ const AXIOM_CHART_QUERY_SCHEMA = z
320
+ .object({
321
+ apl: z.string().trim().min(1).optional(),
322
+ mpl: z.string().trim().min(1).optional(),
323
+ queryOptions: z.record(z.string(), encodableSchema).optional(),
324
+ })
325
+ .catchall(encodableSchema)
326
+ .refine(({ apl, mpl }) => Boolean(apl) !== Boolean(mpl), {
327
+ message: "Provide exactly one of query.apl or query.mpl.",
328
+ });
329
+ const AXIOM_DASHBOARD_CHART_FIELDS = {
330
+ id: AXIOM_ID_SCHEMA,
331
+ name: z.string().min(1).max(500).optional(),
332
+ sectionId: z.uuid().optional(),
333
+ };
334
+ const AXIOM_DASHBOARD_QUERY_CHART_FIELDS = {
335
+ ...AXIOM_DASHBOARD_CHART_FIELDS,
336
+ query: AXIOM_CHART_QUERY_SCHEMA,
337
+ };
338
+ const AXIOM_STATISTIC_COLOR_SCHEMA = z.string().max(200);
339
+ const AXIOM_STATISTIC_COLOR_PROPS_SCHEMA = z.object({
340
+ background: AXIOM_STATISTIC_COLOR_SCHEMA.optional(),
341
+ chartFillColor: AXIOM_STATISTIC_COLOR_SCHEMA.optional(),
342
+ labelColor: AXIOM_STATISTIC_COLOR_SCHEMA.optional(),
343
+ textColor: AXIOM_STATISTIC_COLOR_SCHEMA.optional(),
344
+ });
345
+ const AXIOM_STATISTIC_THRESHOLD_SCHEMA = z.enum([
346
+ "Above",
347
+ "AboveOrEqual",
348
+ "Below",
349
+ "BelowOrEqual",
350
+ "AboveOrBelow",
351
+ ]);
352
+ const AXIOM_SMART_FILTER_BASE_FIELDS = {
353
+ active: z.boolean().optional(),
354
+ id: z.string().max(200),
355
+ name: z.string().max(200),
356
+ };
357
+ const AXIOM_SMART_FILTER_SCHEMA = z.discriminatedUnion("type", [
358
+ z.object({
359
+ ...AXIOM_SMART_FILTER_BASE_FIELDS,
360
+ type: z.literal("search"),
361
+ }),
362
+ z
363
+ .object({
364
+ ...AXIOM_SMART_FILTER_BASE_FIELDS,
365
+ options: z.json().optional(),
366
+ query: z.record(z.string(), encodableSchema).optional(),
367
+ selectType: z.enum(["list", "query"]),
368
+ type: z.literal("select"),
369
+ })
370
+ .catchall(encodableSchema),
371
+ ]);
372
+ export const AXIOM_DASHBOARD_CHART_SCHEMA = z.discriminatedUnion("type", [
373
+ z
374
+ .object({
375
+ ...AXIOM_DASHBOARD_QUERY_CHART_FIELDS,
376
+ type: z.literal("TimeSeries"),
377
+ })
378
+ .catchall(encodableSchema),
379
+ z
380
+ .object({
381
+ ...AXIOM_DASHBOARD_QUERY_CHART_FIELDS,
382
+ type: z.literal("Heatmap"),
383
+ })
384
+ .catchall(encodableSchema),
385
+ z
386
+ .object({
387
+ ...AXIOM_DASHBOARD_QUERY_CHART_FIELDS,
388
+ type: z.literal("LogStream"),
389
+ })
390
+ .catchall(encodableSchema),
391
+ z
392
+ .object({
393
+ ...AXIOM_DASHBOARD_QUERY_CHART_FIELDS,
394
+ type: z.literal("Pie"),
395
+ })
396
+ .catchall(encodableSchema),
397
+ z
398
+ .object({
399
+ ...AXIOM_DASHBOARD_QUERY_CHART_FIELDS,
400
+ type: z.literal("Scatter"),
401
+ })
402
+ .catchall(encodableSchema),
403
+ z
404
+ .object({
405
+ ...AXIOM_DASHBOARD_QUERY_CHART_FIELDS,
406
+ type: z.literal("Table"),
407
+ })
408
+ .catchall(encodableSchema),
409
+ z
410
+ .object({
411
+ ...AXIOM_DASHBOARD_QUERY_CHART_FIELDS,
412
+ type: z.literal("TopK"),
413
+ })
414
+ .catchall(encodableSchema),
415
+ z
416
+ .object({
417
+ ...AXIOM_DASHBOARD_QUERY_CHART_FIELDS,
418
+ background: AXIOM_STATISTIC_COLOR_SCHEMA.optional(),
419
+ chartFillColor: AXIOM_STATISTIC_COLOR_SCHEMA.optional(),
420
+ chartHeight: z.union([z.string().max(100), z.number()]).optional(),
421
+ colorScheme: z
422
+ .enum([
423
+ "Blue",
424
+ "Brown",
425
+ "Green",
426
+ "Grey",
427
+ "Orange",
428
+ "Pink",
429
+ "Purple",
430
+ "Red",
431
+ "Teal",
432
+ "Yellow",
433
+ ])
434
+ .optional(),
435
+ customUnits: z.string().max(200).optional(),
436
+ errorColorProps: AXIOM_STATISTIC_COLOR_PROPS_SCHEMA.optional(),
437
+ errorThreshold: AXIOM_STATISTIC_THRESHOLD_SCHEMA.optional(),
438
+ errorThresholdValue: z.string().max(100).optional(),
439
+ hideValue: z.boolean().optional(),
440
+ invertTheme: z.boolean().optional(),
441
+ labelColor: AXIOM_STATISTIC_COLOR_SCHEMA.optional(),
442
+ okColorProps: AXIOM_STATISTIC_COLOR_PROPS_SCHEMA.optional(),
443
+ showChart: z.union([z.boolean(), z.string()]).optional(),
444
+ textColor: AXIOM_STATISTIC_COLOR_SCHEMA.optional(),
445
+ type: z.literal("Statistic"),
446
+ warningColorProps: AXIOM_STATISTIC_COLOR_PROPS_SCHEMA.optional(),
447
+ warningThreshold: AXIOM_STATISTIC_THRESHOLD_SCHEMA.optional(),
448
+ warningThresholdValue: z.string().max(100).optional(),
449
+ })
450
+ .catchall(encodableSchema),
451
+ z
452
+ .object({
453
+ ...AXIOM_DASHBOARD_CHART_FIELDS,
454
+ text: z.string().min(1).max(100_000),
455
+ type: z.literal("Note"),
456
+ variant: z.literal("default").optional(),
457
+ })
458
+ .catchall(encodableSchema),
459
+ z
460
+ .object({
461
+ ...AXIOM_DASHBOARD_CHART_FIELDS,
462
+ columns: z.object({
463
+ dataset: z.boolean(),
464
+ history: z.boolean(),
465
+ notifiers: z.boolean(),
466
+ status: z.boolean(),
467
+ type: z.boolean(),
468
+ }),
469
+ selectedMonitors: z.string().min(1).max(200).array().min(1).max(200),
470
+ type: z.literal("MonitorList"),
471
+ })
472
+ .catchall(encodableSchema),
473
+ z
474
+ .object({
475
+ ...AXIOM_DASHBOARD_CHART_FIELDS,
476
+ filters: AXIOM_SMART_FILTER_SCHEMA.array().min(1).max(50),
477
+ logo: z.string().max(2_000).optional(),
478
+ logoDark: z.string().max(2_000).optional(),
479
+ type: z.literal("SmartFilter"),
480
+ })
481
+ .catchall(encodableSchema),
482
+ z
483
+ .object({
484
+ ...AXIOM_DASHBOARD_CHART_FIELDS,
485
+ type: z.literal("Spacer"),
486
+ })
487
+ .catchall(encodableSchema),
488
+ ]);
489
+ export const AXIOM_DASHBOARD_DOCUMENT_SCHEMA = z.object({
490
+ against: z
491
+ .enum([
492
+ "",
493
+ "-12h",
494
+ "-1d",
495
+ "-1h",
496
+ "-1w",
497
+ "-2w",
498
+ "-30d",
499
+ "-3d",
500
+ "-3h",
501
+ "-3w",
502
+ "-60d",
503
+ "-6h",
504
+ "-7d",
505
+ "-90d",
506
+ ])
507
+ .optional(),
508
+ againstTimestamp: z.string().max(100).optional(),
509
+ charts: AXIOM_DASHBOARD_CHART_SCHEMA.array().max(200),
510
+ description: z.string().max(1_000).optional(),
511
+ layout: z
512
+ .object({
513
+ h: z.number().int().min(1).max(100),
514
+ i: AXIOM_ID_SCHEMA,
515
+ maxH: z.number().int().min(1).max(100).optional(),
516
+ maxW: z.number().int().min(1).max(12).optional(),
517
+ minH: z.number().min(0.5).max(100).optional(),
518
+ minW: z.number().int().min(1).max(12).optional(),
519
+ static: z.boolean().optional(),
520
+ w: z.number().int().min(1).max(12),
521
+ x: z.number().int().min(0).max(11),
522
+ y: z.number().int().nonnegative().nullable(),
523
+ })
524
+ .array()
525
+ .max(200),
526
+ name: z.string().min(1).max(100),
527
+ owner: z.string().min(1),
528
+ refreshTime: z.union([z.literal(15), z.literal(60), z.literal(300)]),
529
+ schemaVersion: z.literal(2),
530
+ sections: z
531
+ .object({
532
+ defaultCollapsed: z.boolean().optional(),
533
+ id: z.uuid(),
534
+ title: z.string().min(1),
535
+ })
536
+ .array()
537
+ .optional(),
538
+ timeWindowEnd: z.string().min(1).max(100),
539
+ timeWindowStart: z.string().min(1).max(100),
540
+ uid: AXIOM_ID_SCHEMA.optional(),
541
+ });
542
+ export const AXIOM_DASHBOARD_RESOURCE_SCHEMA = z
543
+ .object({
544
+ createdAt: z.string(),
545
+ createdBy: z.string(),
546
+ dashboard: AXIOM_DASHBOARD_DOCUMENT_SCHEMA,
547
+ id: AXIOM_ID_SCHEMA,
548
+ uid: AXIOM_ID_SCHEMA,
549
+ updatedAt: z.string(),
550
+ updatedBy: z.string(),
551
+ version: z.number().int().positive(),
552
+ })
553
+ .catchall(encodableSchema);
554
+ export const AXIOM_DASHBOARD_WRITE_SCHEMA = z.object({
555
+ dashboard: AXIOM_DASHBOARD_RESOURCE_SCHEMA,
556
+ overwritten: z.boolean().optional(),
557
+ status: z.enum(["created", "updated"]),
558
+ });
559
+ export const AXIOM_MONITOR_NOTIFICATION_SCHEMA = z.object({
560
+ action: z.enum(["Closed", "Open"]),
561
+ event: z.object({
562
+ body: z.string(),
563
+ description: z.string(),
564
+ groupKeys: z.string().array().nullable(),
565
+ groupValues: z.json().array().nullable(),
566
+ matchedEvent: z.record(z.string(), z.json()).nullable(),
567
+ monitorId: AXIOM_ID_SCHEMA,
568
+ queryEndTime: z.string(),
569
+ queryStartTime: z.string(),
570
+ timestamp: z.string(),
571
+ title: z.string(),
572
+ value: z.number(),
573
+ }),
574
+ });
575
+ export const AXIOM_EMPTY_SCHEMA = z.union([
576
+ z.null(),
577
+ z.object({}).transform(() => null),
578
+ z.undefined().transform(() => null),
579
+ ]);
580
+ export const AXIOM_JSON_OBJECT_SCHEMA = z.record(z.string(), encodableSchema);
@@ -215,9 +215,9 @@ export declare const brevoTriggerContracts: {
215
215
  }, z.core.$strip>, z.ZodObject<{
216
216
  family: z.ZodLiteral<"contact">;
217
217
  type: z.ZodEnum<{
218
+ updated: "updated";
218
219
  deleted: "deleted";
219
220
  addedToList: "addedToList";
220
- updated: "updated";
221
221
  }>;
222
222
  bounceType: z.ZodOptional<z.ZodString>;
223
223
  campaignId: z.ZodOptional<z.ZodNumber>;
@@ -1610,9 +1610,9 @@ export declare const brevoTriggerContracts: {
1610
1610
  eventSchema: z.ZodObject<{
1611
1611
  family: z.ZodLiteral<"contact">;
1612
1612
  type: z.ZodEnum<{
1613
+ updated: "updated";
1613
1614
  deleted: "deleted";
1614
1615
  addedToList: "addedToList";
1615
- updated: "updated";
1616
1616
  }>;
1617
1617
  bounceType: z.ZodOptional<z.ZodString>;
1618
1618
  campaignId: z.ZodOptional<z.ZodNumber>;
@@ -219,9 +219,9 @@ export declare const BREVO_MARKETING_SMS_EVENT_SCHEMA: z.ZodObject<{
219
219
  export declare const BREVO_CONTACT_EVENT_SCHEMA: z.ZodObject<{
220
220
  family: z.ZodLiteral<"contact">;
221
221
  type: z.ZodEnum<{
222
+ updated: "updated";
222
223
  deleted: "deleted";
223
224
  addedToList: "addedToList";
224
- updated: "updated";
225
225
  }>;
226
226
  bounceType: z.ZodOptional<z.ZodString>;
227
227
  campaignId: z.ZodOptional<z.ZodNumber>;
@@ -474,9 +474,9 @@ export declare const BREVO_EVENT_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{
474
474
  }, z.core.$strip>, z.ZodObject<{
475
475
  family: z.ZodLiteral<"contact">;
476
476
  type: z.ZodEnum<{
477
+ updated: "updated";
477
478
  deleted: "deleted";
478
479
  addedToList: "addedToList";
479
- updated: "updated";
480
480
  }>;
481
481
  bounceType: z.ZodOptional<z.ZodString>;
482
482
  campaignId: z.ZodOptional<z.ZodNumber>;
@@ -744,7 +744,7 @@ export declare function normalizeBrevoEvent(value: unknown, webhookId?: number):
744
744
  userAgent?: string | undefined;
745
745
  } | {
746
746
  family: "contact";
747
- type: "deleted" | "addedToList" | "updated";
747
+ type: "updated" | "deleted" | "addedToList";
748
748
  event: Record<string, z.core.util.JSONType>;
749
749
  webhookId: number;
750
750
  bounceType?: string | undefined;