@honeyhive/control-plane-sdk 1.0.0-rc.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.
@@ -0,0 +1,672 @@
1
+ export interface paths {
2
+ '/v1/projects/{project_id}/alerts': {
3
+ parameters: {
4
+ query?: never;
5
+ header?: never;
6
+ path?: never;
7
+ cookie?: never;
8
+ };
9
+ /**
10
+ * List alerts
11
+ * @description List the alerts in a project. The project is identified by the `project_id` path parameter
12
+ * alone; the `x-hh-project-id` header does not participate. Supports offset pagination, an
13
+ * optional status filter, and sorting (defaults to most recently created first).
14
+ */
15
+ get: operations['listAlerts'];
16
+ put?: never;
17
+ /**
18
+ * Create an alert
19
+ * @description Create an alert in a project. The project is identified by the `project_id` path parameter
20
+ * alone; the `x-hh-project-id` header does not participate. The alert's `filters` and
21
+ * `projections` (metrics) are mapped against the project's logged-event schema; if no schema
22
+ * data matches them — e.g. no events have been logged to the project yet — the request fails
23
+ * with a 400.
24
+ */
25
+ post: operations['createAlert'];
26
+ delete?: never;
27
+ options?: never;
28
+ head?: never;
29
+ patch?: never;
30
+ trace?: never;
31
+ };
32
+ '/v1/projects/{project_id}/alerts/{alert_id}': {
33
+ parameters: {
34
+ query?: never;
35
+ header?: never;
36
+ path?: never;
37
+ cookie?: never;
38
+ };
39
+ /**
40
+ * Get an alert
41
+ * @description Retrieve a single alert by id, including its thresholds, triggers, and notification
42
+ * configuration. The alert's project is identified by the `project_id` path parameter alone;
43
+ * the `x-hh-project-id` header does not participate.
44
+ */
45
+ get: operations['getAlert'];
46
+ put?: never;
47
+ post?: never;
48
+ delete?: never;
49
+ options?: never;
50
+ head?: never;
51
+ patch?: never;
52
+ trace?: never;
53
+ };
54
+ '/v1/workspaces/{workspace_id}/projects': {
55
+ parameters: {
56
+ query?: never;
57
+ header?: never;
58
+ path?: never;
59
+ cookie?: never;
60
+ };
61
+ get?: never;
62
+ put?: never;
63
+ /**
64
+ * Create a project
65
+ * @description Create a project in a workspace. The parent workspace is identified by the `workspace_id`
66
+ * path parameter alone; the `x-hh-workspace-id` header does not participate.
67
+ *
68
+ * The optional `project_creator` field names the user (by email) who receives the
69
+ * project-creator membership on the new project. The named user must already be a member of
70
+ * the workspace. When omitted, the project is created without any membership. The field is
71
+ * only accepted on API-key-initiated requests — user-initiated creation always makes the
72
+ * calling user the creator and rejects the field with a 400.
73
+ */
74
+ post: operations['createProject'];
75
+ delete?: never;
76
+ options?: never;
77
+ head?: never;
78
+ patch?: never;
79
+ trace?: never;
80
+ };
81
+ '/v1/projects/{project_id}': {
82
+ parameters: {
83
+ query?: never;
84
+ header?: never;
85
+ path?: never;
86
+ cookie?: never;
87
+ };
88
+ /**
89
+ * Get a project
90
+ * @description Retrieve a single project by id. The project is identified by the `project_id` path
91
+ * parameter alone; the `x-hh-project-id` header does not participate.
92
+ */
93
+ get: operations['getProject'];
94
+ /**
95
+ * Update a project
96
+ * @description Update a project's display name and/or description. The project is identified by the
97
+ * `project_id` path parameter alone; the `x-hh-project-id` header does not participate.
98
+ * Only fields included in the request body are modified.
99
+ */
100
+ put: operations['updateProject'];
101
+ post?: never;
102
+ /**
103
+ * Delete a project
104
+ * @description Delete a project. The project is soft-deleted (archived) and no longer appears in reads;
105
+ * the response returns the archived project. The project is identified by the `project_id`
106
+ * path parameter alone; the `x-hh-project-id` header does not participate.
107
+ */
108
+ delete: operations['deleteProject'];
109
+ options?: never;
110
+ head?: never;
111
+ patch?: never;
112
+ trace?: never;
113
+ };
114
+ }
115
+ export type webhooks = Record<string, never>;
116
+ export interface components {
117
+ schemas: {
118
+ /** @description Alert object */
119
+ AlertItem: {
120
+ id: string;
121
+ name: string;
122
+ description?: string | null;
123
+ /** @enum {string} */
124
+ status: 'ACTIVE' | 'TRIGGERED' | 'PAUSED' | 'RESOLVED';
125
+ /** @enum {string} */
126
+ frequency: 'HOURLY' | 'DAILY' | 'WEEKLY' | 'MONTHLY';
127
+ minimum_sample_size: number;
128
+ /** @enum {string} */
129
+ alert_type: 'DRIFT' | 'AGGREGATE' | 'PER_EVENT';
130
+ aggregation: string;
131
+ event_filters: components['schemas']['AlertEventFilter'][];
132
+ event_metrics: components['schemas']['AlertEventMetric'][];
133
+ thresholds: components['schemas']['AlertItemThresholds'];
134
+ last_run_at?: string | null;
135
+ last_result?: ({
136
+ current_bucket_score?: number | boolean;
137
+ previous_bucket_score?: number | boolean;
138
+ last_triggered_baseline?: number | boolean;
139
+ drift_percentage?: number;
140
+ thresholds?: components['schemas']['AlertItemLastResultThresholds'];
141
+ event_filters?: unknown[];
142
+ event_metrics?: unknown[];
143
+ aggregation?: string;
144
+ } & {
145
+ [key: string]: unknown;
146
+ }) | null;
147
+ trigger_error?: string | null;
148
+ is_active: boolean;
149
+ is_muted: boolean;
150
+ created_at: string;
151
+ updated_at?: string | null;
152
+ last_trigger_id?: string | null;
153
+ scope_type: string;
154
+ scope_id: string;
155
+ created_by?: string | null;
156
+ last_trigger?: components['schemas']['AlertTrigger'];
157
+ triggers?: components['schemas']['AlertTrigger'][];
158
+ notifications?: components['schemas']['AlertNotification'][];
159
+ };
160
+ AlertEventFilter: {
161
+ filter: components['schemas']['SingleFilter'];
162
+ /** @enum {string} */
163
+ type: 'float' | 'numeric' | 'boolean' | 'string' | 'null';
164
+ };
165
+ SingleFilter: {
166
+ field: string;
167
+ /** @enum {string} */
168
+ operator: 'exists' | 'not exists' | 'is' | 'is not' | 'contains' | 'not contains' | 'greater than' | 'less than' | 'after' | 'before';
169
+ value: string | number | boolean | null;
170
+ /** @enum {string} */
171
+ type: 'string' | 'number' | 'boolean' | 'datetime';
172
+ };
173
+ AlertEventMetric: {
174
+ /** @description Projected field or metric for this entry */
175
+ projection: string;
176
+ /** @enum {string} */
177
+ type: 'float' | 'numeric' | 'boolean' | 'string' | 'null';
178
+ };
179
+ AlertTrigger: {
180
+ id: string;
181
+ alert_id: string;
182
+ result: components['schemas']['AlertTriggerResult'];
183
+ muted: boolean;
184
+ notification_sent: boolean;
185
+ triggered_time: string;
186
+ resolved_time: string | null;
187
+ resolved_by: string | null;
188
+ created_at: string;
189
+ updated_at: string;
190
+ };
191
+ AlertNotification: {
192
+ id: string;
193
+ alert_id: string;
194
+ /** @enum {string} */
195
+ stage: 'CRITICAL' | 'RESOLUTION';
196
+ /** @enum {string} */
197
+ channel: 'EMAIL' | 'SLACK' | 'WEBHOOK';
198
+ /** @enum {string} */
199
+ scope: 'ALL_PROJECT_MEMBERS' | 'SPECIFIC_MEMBER';
200
+ membership_id?: string | null;
201
+ metadata?: {
202
+ [key: string]: unknown;
203
+ } | null;
204
+ last_sent_at?: string | null;
205
+ created_at: string;
206
+ membership?: {
207
+ user: components['schemas']['AlertNotificationMembershipUser'];
208
+ } | null;
209
+ };
210
+ PostAlertRequest: {
211
+ name: string;
212
+ description?: string;
213
+ /** @enum {string} */
214
+ frequency: 'HOURLY' | 'DAILY' | 'WEEKLY' | 'MONTHLY';
215
+ /** @default 0 */
216
+ minimum_sample_size?: number;
217
+ /**
218
+ * @default AGGREGATE
219
+ * @enum {string}
220
+ */
221
+ alert_type?: 'DRIFT' | 'AGGREGATE' | 'PER_EVENT';
222
+ /**
223
+ * @default AVERAGE
224
+ * @enum {string}
225
+ */
226
+ aggregation?: 'AVERAGE' | 'COUNT' | 'SUM' | 'MIN' | 'MAX' | 'P90' | 'P95' | 'P99' | 'MEDIAN';
227
+ thresholds: components['schemas']['PostAlertRequestThresholds'];
228
+ filters: components['schemas']['SingleFilter'][];
229
+ projections: string[];
230
+ notification_details: components['schemas']['PostAlertRequestNotificationDetails'];
231
+ /** @enum {string} */
232
+ status?: 'ACTIVE' | 'TRIGGERED' | 'PAUSED' | 'RESOLVED';
233
+ };
234
+ /** @description A single alert */
235
+ GetAlertResponse: {
236
+ /** @enum {boolean} */
237
+ success: true;
238
+ data: components['schemas']['AlertItem'];
239
+ };
240
+ /** @description A paginated list of alerts */
241
+ GetAlertsResponse: {
242
+ /** @enum {boolean} */
243
+ success: true;
244
+ data: components['schemas']['AlertItem'][];
245
+ pagination: components['schemas']['Pagination'];
246
+ };
247
+ Pagination: {
248
+ page: number;
249
+ limit: number;
250
+ total: number;
251
+ total_unfiltered: number;
252
+ total_pages: number;
253
+ has_next: boolean;
254
+ has_prev: boolean;
255
+ };
256
+ /** @description The created alert */
257
+ CreateAlertResponse: {
258
+ /** @enum {boolean} */
259
+ success: true;
260
+ data: components['schemas']['AlertItem'];
261
+ };
262
+ /** @description Project object */
263
+ ProjectItem: {
264
+ id: string;
265
+ /** @description Project display name */
266
+ name: string;
267
+ /** @description Project description */
268
+ description: string;
269
+ created_at: string;
270
+ updated_at?: string | null;
271
+ };
272
+ /** @description Request body for creating a project */
273
+ PostProjectRequest: {
274
+ /** @description Project display name */
275
+ name: string;
276
+ /** @description Project description */
277
+ description?: string;
278
+ /**
279
+ * Format: email
280
+ * @description Email of the user to grant the project-creator membership to (API key actors only)
281
+ */
282
+ project_creator?: string;
283
+ };
284
+ /** @description Request body for updating a project */
285
+ PutProjectRequest: {
286
+ /** @description Project display name */
287
+ name?: string;
288
+ /** @description Project description */
289
+ description?: string;
290
+ };
291
+ /** @description The created project */
292
+ CreateProjectResponse: {
293
+ success: boolean;
294
+ data: components['schemas']['ProjectItem'];
295
+ };
296
+ /** @description The updated project */
297
+ UpdateProjectResponse: {
298
+ success: boolean;
299
+ data: components['schemas']['ProjectItem'];
300
+ };
301
+ /** @description A single project */
302
+ GetProjectResponse: {
303
+ success: boolean;
304
+ data: components['schemas']['ProjectItem'];
305
+ };
306
+ /** @description The deleted (archived) project */
307
+ DeleteProjectResponse: {
308
+ success: boolean;
309
+ data: components['schemas']['ProjectItem'];
310
+ };
311
+ AlertItemThresholdsCritical: {
312
+ /** @enum {string} */
313
+ operator: 'greater_than' | 'less_than' | 'equal_to';
314
+ value: number;
315
+ };
316
+ AlertItemThresholdsResolved: {
317
+ /** @enum {string} */
318
+ operator: 'greater_than' | 'less_than' | 'equal_to';
319
+ value: number;
320
+ };
321
+ AlertItemThresholds: {
322
+ critical: components['schemas']['AlertItemThresholdsCritical'];
323
+ resolved: components['schemas']['AlertItemThresholdsResolved'];
324
+ };
325
+ AlertItemLastResultThresholdsCritical: {
326
+ /** @enum {string} */
327
+ operator: 'greater_than' | 'less_than' | 'equal_to';
328
+ value: number;
329
+ };
330
+ AlertItemLastResultThresholdsResolved: {
331
+ /** @enum {string} */
332
+ operator: 'greater_than' | 'less_than' | 'equal_to';
333
+ value: number;
334
+ };
335
+ AlertItemLastResultThresholds: {
336
+ critical: components['schemas']['AlertItemLastResultThresholdsCritical'];
337
+ resolved: components['schemas']['AlertItemLastResultThresholdsResolved'];
338
+ };
339
+ AlertTriggerResultThresholdsCritical: {
340
+ /** @enum {string} */
341
+ operator: 'greater_than' | 'less_than' | 'equal_to';
342
+ value: number;
343
+ };
344
+ AlertTriggerResultThresholdsResolved: {
345
+ /** @enum {string} */
346
+ operator: 'greater_than' | 'less_than' | 'equal_to';
347
+ value: number;
348
+ };
349
+ AlertTriggerResultThresholds: {
350
+ critical: components['schemas']['AlertTriggerResultThresholdsCritical'];
351
+ resolved: components['schemas']['AlertTriggerResultThresholdsResolved'];
352
+ };
353
+ AlertTriggerResult: {
354
+ current_bucket_score?: number | boolean;
355
+ previous_bucket_score?: number | boolean;
356
+ last_triggered_baseline?: number | boolean;
357
+ drift_percentage?: number;
358
+ thresholds?: components['schemas']['AlertTriggerResultThresholds'];
359
+ event_filters?: unknown[];
360
+ event_metrics?: unknown[];
361
+ aggregation?: string;
362
+ } & {
363
+ [key: string]: unknown;
364
+ };
365
+ AlertNotificationMembershipUser: {
366
+ id: string;
367
+ };
368
+ PostAlertRequestThresholdsCritical: {
369
+ /** @enum {string} */
370
+ operator: 'greater_than' | 'less_than' | 'equal_to';
371
+ value: number;
372
+ };
373
+ PostAlertRequestThresholdsResolved: {
374
+ /** @enum {string} */
375
+ operator: 'greater_than' | 'less_than' | 'equal_to';
376
+ value: number;
377
+ };
378
+ PostAlertRequestThresholds: {
379
+ critical: components['schemas']['PostAlertRequestThresholdsCritical'];
380
+ resolved: components['schemas']['PostAlertRequestThresholdsResolved'];
381
+ };
382
+ PostAlertRequestNotificationDetailsCritical: {
383
+ /** @enum {string} */
384
+ channel: 'EMAIL' | 'SLACK' | 'WEBHOOK';
385
+ /** @enum {string} */
386
+ scope: 'ALL_PROJECT_MEMBERS' | 'SPECIFIC_MEMBER';
387
+ user_ids?: string[];
388
+ metadata: {
389
+ [key: string]: unknown;
390
+ };
391
+ };
392
+ PostAlertRequestNotificationDetailsResolved: {
393
+ /** @enum {string} */
394
+ channel: 'EMAIL' | 'SLACK' | 'WEBHOOK';
395
+ /** @enum {string} */
396
+ scope: 'ALL_PROJECT_MEMBERS' | 'SPECIFIC_MEMBER';
397
+ user_ids?: string[];
398
+ metadata: {
399
+ [key: string]: unknown;
400
+ };
401
+ };
402
+ PostAlertRequestNotificationDetails: {
403
+ critical: components['schemas']['PostAlertRequestNotificationDetailsCritical'];
404
+ resolved: components['schemas']['PostAlertRequestNotificationDetailsResolved'];
405
+ };
406
+ };
407
+ responses: never;
408
+ parameters: never;
409
+ requestBodies: never;
410
+ headers: never;
411
+ pathItems: never;
412
+ }
413
+ export type $defs = Record<string, never>;
414
+ export interface operations {
415
+ listAlerts: {
416
+ parameters: {
417
+ query?: {
418
+ /** @description 1-indexed page number */
419
+ page?: number;
420
+ /** @description Number of alerts to return per page */
421
+ limit?: number;
422
+ /** @description Only return alerts in this status */
423
+ status?: 'ACTIVE' | 'TRIGGERED' | 'PAUSED' | 'RESOLVED';
424
+ /** @description Field to sort results by */
425
+ sort_by?: 'created_at' | 'updated_at' | 'name' | 'status' | 'frequency' | 'last_triggered';
426
+ /** @description Sort order */
427
+ sort_order?: 'asc' | 'desc';
428
+ };
429
+ header?: never;
430
+ path: {
431
+ /** @description The unique identifier of the project whose alerts are listed */
432
+ project_id: string;
433
+ };
434
+ cookie?: never;
435
+ };
436
+ requestBody?: never;
437
+ responses: {
438
+ /** @description Alerts retrieved successfully */
439
+ 200: {
440
+ headers: {
441
+ [name: string]: unknown;
442
+ };
443
+ content: {
444
+ 'application/json': components['schemas']['GetAlertsResponse'];
445
+ };
446
+ };
447
+ /** @description Invalid pagination or filter parameters */
448
+ 400: {
449
+ headers: {
450
+ [name: string]: unknown;
451
+ };
452
+ content?: never;
453
+ };
454
+ };
455
+ };
456
+ createAlert: {
457
+ parameters: {
458
+ query?: never;
459
+ header?: never;
460
+ path: {
461
+ /** @description The unique identifier of the project the alert is created in */
462
+ project_id: string;
463
+ };
464
+ cookie?: never;
465
+ };
466
+ requestBody: {
467
+ content: {
468
+ 'application/json': components['schemas']['PostAlertRequest'];
469
+ };
470
+ };
471
+ responses: {
472
+ /** @description Alert created successfully */
473
+ 200: {
474
+ headers: {
475
+ [name: string]: unknown;
476
+ };
477
+ content: {
478
+ 'application/json': components['schemas']['CreateAlertResponse'];
479
+ };
480
+ };
481
+ /** @description Invalid request body, or no schema data matches the selected filters/metrics */
482
+ 400: {
483
+ headers: {
484
+ [name: string]: unknown;
485
+ };
486
+ content?: never;
487
+ };
488
+ /** @description Project not found */
489
+ 404: {
490
+ headers: {
491
+ [name: string]: unknown;
492
+ };
493
+ content?: never;
494
+ };
495
+ };
496
+ };
497
+ getAlert: {
498
+ parameters: {
499
+ query?: never;
500
+ header?: never;
501
+ path: {
502
+ /** @description The unique identifier of the project the alert belongs to */
503
+ project_id: string;
504
+ /** @description The unique identifier of the alert to retrieve */
505
+ alert_id: string;
506
+ };
507
+ cookie?: never;
508
+ };
509
+ requestBody?: never;
510
+ responses: {
511
+ /** @description Alert retrieved successfully */
512
+ 200: {
513
+ headers: {
514
+ [name: string]: unknown;
515
+ };
516
+ content: {
517
+ 'application/json': components['schemas']['GetAlertResponse'];
518
+ };
519
+ };
520
+ /** @description Alert not found */
521
+ 404: {
522
+ headers: {
523
+ [name: string]: unknown;
524
+ };
525
+ content?: never;
526
+ };
527
+ };
528
+ };
529
+ createProject: {
530
+ parameters: {
531
+ query?: never;
532
+ header?: never;
533
+ path: {
534
+ /** @description The unique identifier of the workspace the project is created in */
535
+ workspace_id: string;
536
+ };
537
+ cookie?: never;
538
+ };
539
+ requestBody: {
540
+ content: {
541
+ 'application/json': components['schemas']['PostProjectRequest'];
542
+ };
543
+ };
544
+ responses: {
545
+ /** @description Project created successfully */
546
+ 200: {
547
+ headers: {
548
+ [name: string]: unknown;
549
+ };
550
+ content: {
551
+ 'application/json': components['schemas']['CreateProjectResponse'];
552
+ };
553
+ };
554
+ /** @description Invalid request body, or an unknown/ineligible `project_creator` */
555
+ 400: {
556
+ headers: {
557
+ [name: string]: unknown;
558
+ };
559
+ content?: never;
560
+ };
561
+ /** @description Workspace not found */
562
+ 404: {
563
+ headers: {
564
+ [name: string]: unknown;
565
+ };
566
+ content?: never;
567
+ };
568
+ };
569
+ };
570
+ getProject: {
571
+ parameters: {
572
+ query?: never;
573
+ header?: never;
574
+ path: {
575
+ /** @description The unique identifier of the project to retrieve */
576
+ project_id: string;
577
+ };
578
+ cookie?: never;
579
+ };
580
+ requestBody?: never;
581
+ responses: {
582
+ /** @description Project retrieved successfully */
583
+ 200: {
584
+ headers: {
585
+ [name: string]: unknown;
586
+ };
587
+ content: {
588
+ 'application/json': components['schemas']['GetProjectResponse'];
589
+ };
590
+ };
591
+ /** @description Project not found */
592
+ 404: {
593
+ headers: {
594
+ [name: string]: unknown;
595
+ };
596
+ content?: never;
597
+ };
598
+ };
599
+ };
600
+ updateProject: {
601
+ parameters: {
602
+ query?: never;
603
+ header?: never;
604
+ path: {
605
+ /** @description The unique identifier of the project to update */
606
+ project_id: string;
607
+ };
608
+ cookie?: never;
609
+ };
610
+ requestBody: {
611
+ content: {
612
+ 'application/json': components['schemas']['PutProjectRequest'];
613
+ };
614
+ };
615
+ responses: {
616
+ /** @description Project updated successfully */
617
+ 200: {
618
+ headers: {
619
+ [name: string]: unknown;
620
+ };
621
+ content: {
622
+ 'application/json': components['schemas']['UpdateProjectResponse'];
623
+ };
624
+ };
625
+ /** @description Invalid request body */
626
+ 400: {
627
+ headers: {
628
+ [name: string]: unknown;
629
+ };
630
+ content?: never;
631
+ };
632
+ /** @description Project not found */
633
+ 404: {
634
+ headers: {
635
+ [name: string]: unknown;
636
+ };
637
+ content?: never;
638
+ };
639
+ };
640
+ };
641
+ deleteProject: {
642
+ parameters: {
643
+ query?: never;
644
+ header?: never;
645
+ path: {
646
+ /** @description The unique identifier of the project to delete */
647
+ project_id: string;
648
+ };
649
+ cookie?: never;
650
+ };
651
+ requestBody?: never;
652
+ responses: {
653
+ /** @description Project deleted successfully */
654
+ 200: {
655
+ headers: {
656
+ [name: string]: unknown;
657
+ };
658
+ content: {
659
+ 'application/json': components['schemas']['DeleteProjectResponse'];
660
+ };
661
+ };
662
+ /** @description Project not found */
663
+ 404: {
664
+ headers: {
665
+ [name: string]: unknown;
666
+ };
667
+ content?: never;
668
+ };
669
+ };
670
+ };
671
+ }
672
+ //# sourceMappingURL=types.d.ts.map