watchfor 0.8.0 → 0.9.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.
package/README.md CHANGED
@@ -97,5 +97,5 @@ npx watchfor report --period 30d
97
97
  ## Links
98
98
 
99
99
  - API docs: https://watchfor.io/docs/api
100
- - MCP server for AI agents (48 tools): https://watchfor.io/docs/api/mcp
100
+ - MCP server for AI agents (54 tools): https://watchfor.io/docs/api/mcp
101
101
  - Create an API key: dashboard → Settings → API keys (`read` or `read+write` scope)
package/dist/client.d.ts CHANGED
@@ -136,6 +136,8 @@ export declare class WatchFor {
136
136
  }) => Promise<CheckList>;
137
137
  };
138
138
  readonly alertRules: {
139
+ /** One probe run in full, redacted server-side — run_id from checks(). */
140
+ checkDetail: (id: string, runId: string) => Promise<Record<string, unknown>>;
139
141
  list: (monitorId: string) => Promise<List<AlertRule>>;
140
142
  get: (monitorId: string, ruleId: string) => Promise<AlertRule>;
141
143
  create: (monitorId: string, body: Record<string, unknown>, idempotencyKey?: string) => Promise<AlertRule>;
@@ -165,6 +167,27 @@ export declare class WatchFor {
165
167
  /** Undo `exclude` — the incident counts as downtime again. */
166
168
  include: (id: number) => Promise<Incident>;
167
169
  };
170
+ readonly statusPages: {
171
+ list: (q?: {
172
+ limit?: number;
173
+ cursor?: string;
174
+ }) => Promise<List<StatusPage>>;
175
+ get: (id: string) => Promise<StatusPage>;
176
+ announcements: (id: string, q?: {
177
+ limit?: number;
178
+ cursor?: string;
179
+ }) => Promise<List<Record<string, unknown>>>;
180
+ };
181
+ readonly onCall: {
182
+ get: () => Promise<Record<string, unknown>>;
183
+ };
184
+ readonly notificationChannels: {
185
+ list: (q?: {
186
+ limit?: number;
187
+ cursor?: string;
188
+ }) => Promise<List<Record<string, unknown>>>;
189
+ get: (id: string) => Promise<Record<string, unknown>>;
190
+ };
168
191
  readonly hosts: {
169
192
  list: (q?: {
170
193
  limit?: number;
package/dist/client.js CHANGED
@@ -138,6 +138,8 @@ export class WatchFor {
138
138
  };
139
139
  // ── Alert rules ───────────────────────────────────────────────
140
140
  alertRules = {
141
+ /** One probe run in full, redacted server-side — run_id from checks(). */
142
+ checkDetail: (id, runId) => this.request("GET", `/monitors/${id}/checks/${runId}`),
141
143
  list: (monitorId) => this.request("GET", `/monitors/${monitorId}/alert-rules`),
142
144
  get: (monitorId, ruleId) => this.request("GET", `/monitors/${monitorId}/alert-rules/${ruleId}`),
143
145
  create: (monitorId, body, idempotencyKey) => this.request("POST", `/monitors/${monitorId}/alert-rules`, {
@@ -163,6 +165,19 @@ export class WatchFor {
163
165
  /** Undo `exclude` — the incident counts as downtime again. */
164
166
  include: (id) => this.request("POST", `/incidents/${id}/include`),
165
167
  };
168
+ // ── Status pages, on-call, channels ──────────────────────────
169
+ statusPages = {
170
+ list: (q) => this.request("GET", "/status-pages", { query: q }),
171
+ get: (id) => this.request("GET", `/status-pages/${id}`),
172
+ announcements: (id, q) => this.request("GET", `/status-pages/${id}/announcements`, { query: q }),
173
+ };
174
+ onCall = {
175
+ get: () => this.request("GET", "/on-call"),
176
+ };
177
+ notificationChannels = {
178
+ list: (q) => this.request("GET", "/notification-channels", { query: q }),
179
+ get: (id) => this.request("GET", `/notification-channels/${id}`),
180
+ };
166
181
  // ── Hosts (servers running watchfor-agent) ───────────────────
167
182
  hosts = {
168
183
  list: (q) => this.request("GET", "/hosts", { query: q }),
package/dist/schema.d.ts CHANGED
@@ -294,6 +294,23 @@ export interface paths {
294
294
  patch?: never;
295
295
  trace?: never;
296
296
  };
297
+ "/monitors/{id}/checks/{run_id}": {
298
+ parameters: {
299
+ query?: never;
300
+ header?: never;
301
+ path?: never;
302
+ cookie?: never;
303
+ };
304
+ /** One check in detail — the list row plus the stored result, redacted server-side exactly as the dashboard shows it */
305
+ get: operations["getCheckDetail"];
306
+ put?: never;
307
+ post?: never;
308
+ delete?: never;
309
+ options?: never;
310
+ head?: never;
311
+ patch?: never;
312
+ trace?: never;
313
+ };
297
314
  "/monitors/{id}/alert-rules": {
298
315
  parameters: {
299
316
  query?: never;
@@ -524,6 +541,40 @@ export interface paths {
524
541
  patch?: never;
525
542
  trace?: never;
526
543
  };
544
+ "/notification-channels": {
545
+ parameters: {
546
+ query?: never;
547
+ header?: never;
548
+ path?: never;
549
+ cookie?: never;
550
+ };
551
+ /** List notification channels (created_at desc; secrets masked) */
552
+ get: operations["listNotificationChannels"];
553
+ put?: never;
554
+ post?: never;
555
+ delete?: never;
556
+ options?: never;
557
+ head?: never;
558
+ patch?: never;
559
+ trace?: never;
560
+ };
561
+ "/notification-channels/{id}": {
562
+ parameters: {
563
+ query?: never;
564
+ header?: never;
565
+ path?: never;
566
+ cookie?: never;
567
+ };
568
+ /** Get a notification channel (secrets masked) */
569
+ get: operations["getNotificationChannel"];
570
+ put?: never;
571
+ post?: never;
572
+ delete?: never;
573
+ options?: never;
574
+ head?: never;
575
+ patch?: never;
576
+ trace?: never;
577
+ };
527
578
  "/maintenance-windows": {
528
579
  parameters: {
529
580
  query?: never;
@@ -1204,6 +1255,30 @@ export interface components {
1204
1255
  /** @enum {string} */
1205
1256
  scheduling_strategy?: "roundrobin" | "random" | "parallel";
1206
1257
  locations?: string[];
1258
+ /**
1259
+ * @description Why `status` is what it is: critical_incident = a confirmed critical incident is open (the only way to be down); warning_incident = an open warning incident; failed_check = the latest check failed, not yet confirmed (degraded); paused; no_data = nothing reported yet (unknown); ok. Present on GET/POST/PATCH/pause/resume responses.
1260
+ * @enum {string}
1261
+ */
1262
+ status_reason?:
1263
+ | "critical_incident"
1264
+ | "warning_incident"
1265
+ | "failed_check"
1266
+ | "paused"
1267
+ | "no_data"
1268
+ | "ok";
1269
+ /**
1270
+ * Format: date-time
1271
+ * @description When the open incident behind a critical_incident / warning_incident started; null otherwise.
1272
+ */
1273
+ status_since?: string | null;
1274
+ /** @description The open (firing or acknowledged) incident, or null. When several are open: the critical one, then the earliest started. */
1275
+ current_incident?: components["schemas"]["MonitorCurrentIncident"] | null;
1276
+ /** @description A silence (dashboard Mute) suppresses notifications; incidents still open and close and checks continue. */
1277
+ alerts_muted?: boolean;
1278
+ /** Format: date-time */
1279
+ alerts_muted_until?: string | null;
1280
+ /** @description true when an alert rule is routed to a contact group or the monitor has its own notification groups; false = the dashboard's silent-monitor warning: an incident here would reach nobody. */
1281
+ has_notification_route?: boolean;
1207
1282
  tags?: string[];
1208
1283
  /** @description Type-specific config; secret values are [redacted] */
1209
1284
  config?: Record<string, never>;
@@ -1217,8 +1292,82 @@ export interface components {
1217
1292
  /** Format: date-time */
1218
1293
  updated_at?: string;
1219
1294
  };
1295
+ MonitorCurrentIncident: {
1296
+ id: number;
1297
+ /** @enum {string} */
1298
+ severity: "critical" | "warning";
1299
+ /** @enum {string} */
1300
+ status: "firing" | "acknowledged";
1301
+ /** Format: date-time */
1302
+ started_at: string;
1303
+ /** @description Humanised like GET /incidents. */
1304
+ message: string | null;
1305
+ };
1220
1306
  /** @description A monitor plus `available_metrics` — the alert metrics valid for its type (GET /monitors/{id} only) */
1221
1307
  MonitorDetail: components["schemas"]["Monitor"] & {
1308
+ /** @description The monitor has produced at least one check (within a year); while false, uptime and SLA figures are meaningless. */
1309
+ has_probe_data?: boolean;
1310
+ /** @description The most recent check; null when there is none or the analytics store could not be reached (best effort). */
1311
+ last_check?: {
1312
+ /** Format: date-time */
1313
+ at: string;
1314
+ success: boolean;
1315
+ duration_ms: number;
1316
+ /** @description Location name; the prober's name when it is not a listed location. */
1317
+ location: string;
1318
+ error: string | null;
1319
+ /** @description http and api monitors only. */
1320
+ status_code?: number;
1321
+ } | null;
1322
+ /**
1323
+ * Format: date-time
1324
+ * @description last_check.at + interval_seconds — an estimate that can sit in the past when checks stall. null for heartbeat, paused, or no check.
1325
+ */
1326
+ next_check_estimate_at?: string | null;
1327
+ /** @description The monitor's own notification groups (config.notificationGroupIds), in config order. */
1328
+ notification_groups?: {
1329
+ /** Format: uuid */
1330
+ id: string;
1331
+ name: string;
1332
+ }[];
1333
+ /** @description The `locations` ids resolved, in the monitor's order. */
1334
+ locations_detail?: {
1335
+ /** Format: uuid */
1336
+ id: string;
1337
+ name: string;
1338
+ city: string | null;
1339
+ region: string;
1340
+ country_code: string;
1341
+ }[];
1342
+ /** @description Type-aware summary of the monitor page's top card; null for other types. */
1343
+ latest?:
1344
+ | {
1345
+ days_until_expiry?: number | null;
1346
+ /** Format: date-time */
1347
+ not_after?: string | null;
1348
+ issuer?: string | null;
1349
+ protocol?: string | null;
1350
+ valid?: boolean | null;
1351
+ }
1352
+ | {
1353
+ /** Format: date-time */
1354
+ expires_at?: string | null;
1355
+ days_until_expiry?: number | null;
1356
+ registrar?: string | null;
1357
+ nameservers?: string[];
1358
+ }
1359
+ | {
1360
+ /** Format: date-time */
1361
+ last_ping_at?: string | null;
1362
+ /**
1363
+ * Format: date-time
1364
+ * @description Period schedules only; null for cron.
1365
+ */
1366
+ next_expected_at?: string | null;
1367
+ missed?: boolean;
1368
+ last_exit_code?: number | null;
1369
+ }
1370
+ | null;
1222
1371
  available_metrics: components["schemas"]["CatalogAlertMetric"][];
1223
1372
  };
1224
1373
  MonitorCreate: {
@@ -1321,16 +1470,94 @@ export interface components {
1321
1470
  uptime_24h?: number | null;
1322
1471
  uptime_7d?: number | null;
1323
1472
  uptime_30d?: number | null;
1473
+ /** @description Incidents that overlapped the period (false positives excluded) */
1474
+ incident_count?: number;
1475
+ /** @description The outages behind the number: each incident that overlapped the period with the downtime it contributed inside the window (maintenance not subtracted here; it is in downtime_ms). */
1476
+ incidents?: {
1477
+ id?: number | null;
1478
+ severity?: string | null;
1479
+ status?: string;
1480
+ /** Format: date-time */
1481
+ started_at?: string;
1482
+ /** Format: date-time */
1483
+ resolved_at?: string | null;
1484
+ downtime_ms?: number;
1485
+ }[];
1324
1486
  };
1487
+ /** @description One probe run. Type-specific fields appear only when the probe recorded them (packet loss for ICMP, rcode and answer count for DNS, connect / TLS handshake times for TCP, relay and PTR checks for SMTP, sitemap counts). */
1325
1488
  Check: {
1326
1489
  /** @constant */
1327
1490
  object?: "check";
1491
+ /** @description Addresses this exact probe run */
1492
+ run_id?: string;
1328
1493
  timestamp?: string;
1329
1494
  success?: boolean;
1330
1495
  duration_ms?: number;
1331
1496
  location?: string;
1497
+ target?: string;
1498
+ error?: string | null;
1499
+ status_code?: number;
1500
+ body_bytes?: number;
1501
+ rtt_avg_ms?: number;
1502
+ packet_loss_pct?: number;
1503
+ dns_query_type?: string;
1504
+ dns_rcode?: string;
1505
+ dns_answers_count?: number;
1506
+ dns_lookup_ms?: number;
1507
+ tcp_connect_ms?: number;
1508
+ tcp_tls_handshake_ms?: number;
1509
+ tcp_match?: boolean;
1510
+ smtp_connect_ms?: number;
1511
+ smtp_tls_supported?: boolean;
1512
+ smtp_open_relay?: boolean;
1513
+ smtp_ptr_valid?: boolean;
1514
+ sitemap_found?: boolean;
1515
+ sitemap_url_count?: number;
1516
+ sitemap_broken_urls?: number;
1517
+ sitemap_broken_percent?: number;
1518
+ };
1519
+ /** @description One probe run in detail: the Check row plus the stored result. Sensitive values (passwords, tokens, cookies, Authorization headers, credentials in URLs, well-known key shapes) are redacted on the server before the response is built — the raw payload is never returned. Type-specific fields appear only when the probe recorded them. */
1520
+ CheckDetail: {
1521
+ /** @constant */
1522
+ object?: "check_detail";
1523
+ run_id?: string;
1524
+ /** Format: uuid */
1525
+ monitor_id?: string;
1526
+ timestamp?: string;
1527
+ location?: string;
1528
+ target?: string;
1529
+ success?: boolean;
1530
+ duration_ms?: number;
1332
1531
  error?: string | null;
1333
1532
  status_code?: number;
1533
+ body_bytes?: number;
1534
+ rtt_avg_ms?: number;
1535
+ packet_loss_pct?: number;
1536
+ dns_query_type?: string;
1537
+ dns_rcode?: string;
1538
+ dns_answers_count?: number;
1539
+ dns_lookup_ms?: number;
1540
+ tcp_connect_ms?: number;
1541
+ tcp_tls_handshake_ms?: number;
1542
+ tcp_match?: boolean;
1543
+ smtp_connect_ms?: number;
1544
+ smtp_tls_supported?: boolean;
1545
+ smtp_open_relay?: boolean;
1546
+ smtp_ptr_valid?: boolean;
1547
+ sitemap_found?: boolean;
1548
+ sitemap_url_count?: number;
1549
+ sitemap_broken_urls?: number;
1550
+ sitemap_broken_percent?: number;
1551
+ /** @description The stored output, redacted: a JSON object whose shape depends on the monitor type; a string when the probe recorded plain text; null when stored is false */
1552
+ result?: Record<string, never> | string | null;
1553
+ /** @description Size of the stored output before redaction (0 when nothing is stored) */
1554
+ result_bytes?: number;
1555
+ /** @description How many values were redacted in result */
1556
+ redacted_count?: number;
1557
+ /** @description true when the probe stopped capturing the body at its size cap — result holds the part it kept */
1558
+ truncated?: boolean;
1559
+ /** @description false when the check is known but no result body is stored for it (result is null); the metadata fields are still filled in */
1560
+ stored?: boolean;
1334
1561
  };
1335
1562
  BulkResult: {
1336
1563
  /** @constant */
@@ -1426,6 +1653,45 @@ export interface components {
1426
1653
  started_at?: string;
1427
1654
  acknowledged_at?: string | null;
1428
1655
  resolved_at?: string | null;
1656
+ /** @description Expected vs detected, in words — the incident page's root-cause block. `detected` is the observed value or condition when the incident opened (e.g. 'HTTP Status Code = 404'). null only when no rule snapshot exists. */
1657
+ root_cause?: {
1658
+ title?: string;
1659
+ summary?: string;
1660
+ expected?: string;
1661
+ detected?: string;
1662
+ metric_failure?: boolean;
1663
+ } | null;
1664
+ /** @description The fire-time snapshot the alerting engine stored: the metrics the probe reported (http.status_code, response_time_ms, ssl.days_until_expiry, …), an optional response excerpt, the rule expression, the failure threshold, which prober fired and which probers confirmed. Values under sensitive keys are redacted. */
1665
+ trigger?: {
1666
+ metrics?: {
1667
+ [key: string]: unknown;
1668
+ } | null;
1669
+ response?: {
1670
+ [key: string]: unknown;
1671
+ } | null;
1672
+ expression?: string | null;
1673
+ failure_threshold?: number | null;
1674
+ min_failed_probes?: number | null;
1675
+ prober?: string | null;
1676
+ run_id?: string | null;
1677
+ confirmations?: {
1678
+ prober?: string;
1679
+ run_id?: string;
1680
+ }[];
1681
+ } | null;
1682
+ /** @description Evaluations that fired before and during the incident */
1683
+ fire_count?: number;
1684
+ flapping?: boolean;
1685
+ /** @description Only on GET /incidents/{id}: the incident's events in order (opened, notified, acknowledged, resolved, …). */
1686
+ timeline?: {
1687
+ /** Format: date-time */
1688
+ at?: string;
1689
+ type?: string;
1690
+ source?: string | null;
1691
+ detail?: {
1692
+ [key: string]: unknown;
1693
+ } | null;
1694
+ }[];
1429
1695
  /** @description started_at → resolved_at in seconds; null while open */
1430
1696
  duration_seconds?: number | null;
1431
1697
  /** @description The incident's active span overlapped a maintenance window for its monitor (the dashboard's Maintenance badge): planned work — it did not notify and does not dent uptime */
@@ -1518,6 +1784,34 @@ export interface components {
1518
1784
  points?: number[][];
1519
1785
  }[];
1520
1786
  };
1787
+ /** @description Read-only. Tokens, API/integration keys, passwords, incoming-webhook URLs, the generic-webhook delivery url and phone numbers are returned as "__redacted__". Channels are created and edited in the dashboard. */
1788
+ NotificationChannel: {
1789
+ id?: number;
1790
+ /** @constant */
1791
+ object?: "notification_channel";
1792
+ name?: string;
1793
+ /** @description Channel kind as shown in the dashboard: slack, discord, teams, googlechat, mattermost, rocketchat, telegram, email, webhook, zapier, pagerduty, opsgenie, pushover, pushbullet, ntfy, gotify, … */
1794
+ type?: string;
1795
+ enabled?: boolean;
1796
+ is_default?: boolean;
1797
+ severity_filter?: string[];
1798
+ /** @description Channel settings with secrets masked as "__redacted__" */
1799
+ config?: {
1800
+ [key: string]: unknown;
1801
+ };
1802
+ /** @description Contact groups that deliver through this channel (only groups that still exist) */
1803
+ routes?: {
1804
+ contact_group?: {
1805
+ /** Format: uuid */
1806
+ id?: string;
1807
+ name?: string;
1808
+ };
1809
+ }[];
1810
+ /** Format: date-time */
1811
+ created_at?: string;
1812
+ /** Format: date-time */
1813
+ updated_at?: string;
1814
+ };
1521
1815
  MaintenanceWindow: {
1522
1816
  /** Format: uuid */
1523
1817
  id?: string;
@@ -1537,6 +1831,21 @@ export interface components {
1537
1831
  suppress_alerts?: boolean;
1538
1832
  exclude_from_sla?: boolean;
1539
1833
  enabled?: boolean;
1834
+ mark_maintenance?: boolean;
1835
+ auto_publish?: boolean;
1836
+ status_page_ids?: string[];
1837
+ /**
1838
+ * @description active = an occurrence is running now (alerts muted); upcoming = a future occurrence is scheduled; ended = nothing left to run; disabled = enabled:false and not currently running
1839
+ * @enum {string}
1840
+ */
1841
+ state?: "active" | "upcoming" | "ended" | "disabled";
1842
+ /**
1843
+ * Format: date-time
1844
+ * @description Start of the next occurrence (the running one while active); null for ended and disabled
1845
+ */
1846
+ next_run_at?: string | null;
1847
+ /** Format: date-time */
1848
+ updated_at?: string;
1540
1849
  /** Format: date-time */
1541
1850
  created_at?: string;
1542
1851
  };
@@ -1749,6 +2058,18 @@ export interface components {
1749
2058
  /** @enum {string} */
1750
2059
  theme?: "light" | "dark" | "auto";
1751
2060
  url?: string;
2061
+ /**
2062
+ * @description The public page banner, GET /status-pages/{id} only (the same render visitors see, cached up to 60 s). Third-party components never tip it. null if the live status could not be computed
2063
+ * @enum {string|null}
2064
+ */
2065
+ overall_status?:
2066
+ | "operational"
2067
+ | "degraded"
2068
+ | "major_outage"
2069
+ | "maintenance"
2070
+ | null;
2071
+ /** @description Announcements on the page (incident and maintenance notices), removed ones excluded — GET /status-pages/{id} only */
2072
+ incident_count?: number;
1752
2073
  component_count?: number;
1753
2074
  components?: components["schemas"]["StatusPageComponent"][];
1754
2075
  /** Format: date-time */
@@ -1764,9 +2085,34 @@ export interface components {
1764
2085
  name?: string;
1765
2086
  description?: string | null;
1766
2087
  position?: number;
1767
- display_mode?: string;
2088
+ /** @enum {string} */
2089
+ display_mode?: "rolled_up" | "expanded" | "collapsible_group";
1768
2090
  monitor_ids?: string[];
1769
2091
  monitor_tags?: string[];
2092
+ /**
2093
+ * @description Rolled-up status as rendered on the public page; GET /status-pages/{id} only
2094
+ * @enum {string|null}
2095
+ */
2096
+ status?:
2097
+ | "up"
2098
+ | "degraded"
2099
+ | "down"
2100
+ | "maintenance"
2101
+ | "paused"
2102
+ | "unknown"
2103
+ | null;
2104
+ /** @description Monitors the component resolves to right now (monitor_ids ∪ monitors carrying any monitor_tags), alphabetical; empty for third-party components; GET /status-pages/{id} only */
2105
+ monitors?: {
2106
+ /** Format: uuid */
2107
+ id?: string;
2108
+ name?: string;
2109
+ type?: string;
2110
+ }[];
2111
+ /** @description Set when the component mirrors an external provider's status page; components empty = the whole service */
2112
+ third_party?: {
2113
+ service_slug?: string;
2114
+ components?: string[];
2115
+ } | null;
1770
2116
  };
1771
2117
  Announcement: {
1772
2118
  /** Format: uuid */
@@ -1782,6 +2128,30 @@ export interface components {
1782
2128
  /** @enum {string} */
1783
2129
  severity?: "minor" | "major" | "critical";
1784
2130
  affected_component_ids?: string[];
2131
+ /** @description Narrows impact to specific monitors inside the affected components; empty = all of them */
2132
+ affected_monitor_ids?: string[];
2133
+ /**
2134
+ * Format: date-time
2135
+ * @description Maintenance-type notices only
2136
+ */
2137
+ scheduled_start?: string | null;
2138
+ /**
2139
+ * Format: date-time
2140
+ * @description Maintenance-type notices only
2141
+ */
2142
+ scheduled_end?: string | null;
2143
+ /** @description The internal incident an auto-published notice came from */
2144
+ source_incident_id?: number | null;
2145
+ /** @description Public timeline, oldest first; the opening body is the first entry */
2146
+ updates?: {
2147
+ /** Format: uuid */
2148
+ id?: string;
2149
+ body?: string;
2150
+ /** @enum {string} */
2151
+ status?: "investigating" | "identified" | "monitoring" | "resolved";
2152
+ /** Format: date-time */
2153
+ created_at?: string;
2154
+ }[];
1785
2155
  resolved_at?: string | null;
1786
2156
  /** Format: date-time */
1787
2157
  created_at?: string;
@@ -1942,6 +2312,8 @@ export interface components {
1942
2312
  down?: number;
1943
2313
  paused?: number;
1944
2314
  unknown?: number;
2315
+ /** @description up + down + degraded — the health_score denominator */
2316
+ active?: number;
1945
2317
  health_score?: number;
1946
2318
  };
1947
2319
  /** @description Open incident counts (firing, split by severity, and acknowledged) plus incidents started in the last 24h */
@@ -1953,6 +2325,27 @@ export interface components {
1953
2325
  started_24h?: number;
1954
2326
  };
1955
2327
  open_maintenance_windows?: number;
2328
+ /** @description Servers running the agent (revoked ones excluded) by liveness — the same rule as GET /hosts: online = reported within 90 s, stale = 90 s–10 min, offline = longer, never = has not reported yet */
2329
+ hosts?: {
2330
+ total?: number;
2331
+ online?: number;
2332
+ stale?: number;
2333
+ offline?: number;
2334
+ never?: number;
2335
+ };
2336
+ /** @description The dashboard's hero number: (monitors_up + hosts_online) / (monitors_active + hosts_counted), 100 when nothing is counted. Stale and offline hosts count against it; hosts that never reported do not */
2337
+ fleet?: {
2338
+ health_score?: number;
2339
+ monitors_up?: number;
2340
+ monitors_active?: number;
2341
+ hosts_online?: number;
2342
+ hosts_counted?: number;
2343
+ };
2344
+ /** @description The dashboard's setup callout */
2345
+ attention?: {
2346
+ /** @description Active monitors whose alerts would reach nobody (no alert rule with a contact group and no notification group) */
2347
+ silent_monitors?: number;
2348
+ };
1956
2349
  };
1957
2350
  IncidentStats: {
1958
2351
  /** @constant */
@@ -2040,6 +2433,12 @@ export interface components {
2040
2433
  /** @description Insights withheld beyond the plan's cap (0 on advanced depth) */
2041
2434
  gatedInsightCount?: number;
2042
2435
  };
2436
+ /** @description name/email are null for a member who has since left the organization */
2437
+ OncallPerson: {
2438
+ id?: string;
2439
+ name?: string | null;
2440
+ email?: string | null;
2441
+ };
2043
2442
  OncallSchedule: {
2044
2443
  id?: number;
2045
2444
  /** @constant */
@@ -2048,11 +2447,66 @@ export interface components {
2048
2447
  timezone?: string;
2049
2448
  enabled?: boolean;
2050
2449
  layer_count?: number;
2450
+ /** @description null when the schedule is disabled or nobody is on shift right now */
2051
2451
  current_on_call?: {
2052
2452
  user_id?: string;
2053
2453
  name?: string | null;
2054
- email?: string;
2454
+ email?: string | null;
2455
+ /**
2456
+ * Format: date-time
2457
+ * @description End of the current block — the next handoff or the end of the covering override
2458
+ */
2459
+ until?: string | null;
2460
+ /** @description Has at least one enabled contact method; contact details are never exposed */
2461
+ reachable?: boolean;
2055
2462
  } | null;
2463
+ /** @description The next five staffed blocks after the current one, in order; gaps where nobody is on call are skipped */
2464
+ upcoming_shifts?: {
2465
+ user?: components["schemas"]["OncallPerson"];
2466
+ /** Format: date-time */
2467
+ from?: string;
2468
+ /** Format: date-time */
2469
+ until?: string;
2470
+ /** @description The rotation layer staffing the block; null for an override */
2471
+ layer?: {
2472
+ id?: number;
2473
+ position?: number;
2474
+ } | null;
2475
+ override?: boolean;
2476
+ }[];
2477
+ /** @description Rotation layers, lowest position first; a higher position wins where two cover the same time */
2478
+ layers?: {
2479
+ id?: number;
2480
+ position?: number;
2481
+ /** @enum {string} */
2482
+ rotation?: "daily" | "weekly" | "custom";
2483
+ /** @description Meaningful for custom; daily = 1, weekly = 7 */
2484
+ interval_days?: number;
2485
+ /** @description HH:MM in the schedule's time zone */
2486
+ handoff_time?: string;
2487
+ /** @description YYYY-MM-DD the rotation counts from */
2488
+ anchor_date?: string;
2489
+ /** @description In rotation order */
2490
+ participants?: (components["schemas"]["OncallPerson"] & {
2491
+ reachable?: boolean;
2492
+ })[];
2493
+ /** @description Part-of-week coverage; null = always. days are ISO weekdays 1 = Monday … 7 = Sunday, empty = every day */
2494
+ restrictions?: {
2495
+ start?: string | null;
2496
+ end?: string | null;
2497
+ days?: number[];
2498
+ } | null;
2499
+ }[];
2500
+ /** @description Overrides that are running or still ahead; past ones are not listed */
2501
+ overrides?: {
2502
+ id?: number;
2503
+ user?: components["schemas"]["OncallPerson"];
2504
+ /** Format: date-time */
2505
+ from?: string;
2506
+ /** Format: date-time */
2507
+ until?: string;
2508
+ active?: boolean;
2509
+ }[];
2056
2510
  };
2057
2511
  MonitorTypeList: {
2058
2512
  /** @constant */
@@ -2118,6 +2572,13 @@ export interface components {
2118
2572
  has_more: boolean;
2119
2573
  next_cursor?: string | null;
2120
2574
  };
2575
+ NotificationChannelList: {
2576
+ /** @constant */
2577
+ object: "list";
2578
+ data: components["schemas"]["NotificationChannel"][];
2579
+ has_more: boolean;
2580
+ next_cursor?: string | null;
2581
+ };
2121
2582
  MaintenanceWindowList: {
2122
2583
  /** @constant */
2123
2584
  object: "list";
@@ -2995,6 +3456,40 @@ export interface operations {
2995
3456
  };
2996
3457
  };
2997
3458
  };
3459
+ getCheckDetail: {
3460
+ parameters: {
3461
+ query?: never;
3462
+ header?: never;
3463
+ path: {
3464
+ /** @description Resource id (UUID) */
3465
+ id: string;
3466
+ /** @description The check's run_id as listed by GET /monitors/{id}/checks (opaque; malformed → 400, unknown for this monitor → 404) */
3467
+ run_id: string;
3468
+ };
3469
+ cookie?: never;
3470
+ };
3471
+ requestBody?: never;
3472
+ responses: {
3473
+ /** @description OK */
3474
+ 200: {
3475
+ headers: {
3476
+ [name: string]: unknown;
3477
+ };
3478
+ content: {
3479
+ "application/json": components["schemas"]["CheckDetail"];
3480
+ };
3481
+ };
3482
+ /** @description Error */
3483
+ default: {
3484
+ headers: {
3485
+ [name: string]: unknown;
3486
+ };
3487
+ content: {
3488
+ "application/json": components["schemas"]["Error"];
3489
+ };
3490
+ };
3491
+ };
3492
+ };
2998
3493
  listAlertRules: {
2999
3494
  parameters: {
3000
3495
  query?: never;
@@ -3586,6 +4081,72 @@ export interface operations {
3586
4081
  };
3587
4082
  };
3588
4083
  };
4084
+ listNotificationChannels: {
4085
+ parameters: {
4086
+ query?: {
4087
+ /** @description Page size, 1–100 (default 50). Any other value — 0, negative, non-integer — returns 400. A `sort` query parameter is not supported and returns 400 naming the fixed order. */
4088
+ limit?: number;
4089
+ /** @description Opaque cursor from the previous page's next_cursor. It encodes the last row's position (sort key + id), so paging continues correctly even if that row is deleted meanwhile. A malformed cursor is 400 'Malformed cursor'; a legacy id-only cursor whose row no longer exists is 400 'Cursor no longer valid' — restart from the first page. */
4090
+ cursor?: string;
4091
+ };
4092
+ header?: never;
4093
+ path?: never;
4094
+ cookie?: never;
4095
+ };
4096
+ requestBody?: never;
4097
+ responses: {
4098
+ /** @description OK */
4099
+ 200: {
4100
+ headers: {
4101
+ [name: string]: unknown;
4102
+ };
4103
+ content: {
4104
+ "application/json": components["schemas"]["NotificationChannelList"];
4105
+ };
4106
+ };
4107
+ /** @description Error */
4108
+ default: {
4109
+ headers: {
4110
+ [name: string]: unknown;
4111
+ };
4112
+ content: {
4113
+ "application/json": components["schemas"]["Error"];
4114
+ };
4115
+ };
4116
+ };
4117
+ };
4118
+ getNotificationChannel: {
4119
+ parameters: {
4120
+ query?: never;
4121
+ header?: never;
4122
+ path: {
4123
+ /** @description Notification channel id (integer) */
4124
+ id: number;
4125
+ };
4126
+ cookie?: never;
4127
+ };
4128
+ requestBody?: never;
4129
+ responses: {
4130
+ /** @description OK */
4131
+ 200: {
4132
+ headers: {
4133
+ [name: string]: unknown;
4134
+ };
4135
+ content: {
4136
+ "application/json": components["schemas"]["NotificationChannel"];
4137
+ };
4138
+ };
4139
+ /** @description Error */
4140
+ default: {
4141
+ headers: {
4142
+ [name: string]: unknown;
4143
+ };
4144
+ content: {
4145
+ "application/json": components["schemas"]["Error"];
4146
+ };
4147
+ };
4148
+ };
4149
+ };
3589
4150
  listMaintenanceWindows: {
3590
4151
  parameters: {
3591
4152
  query?: {
@@ -3593,6 +4154,8 @@ export interface operations {
3593
4154
  limit?: number;
3594
4155
  /** @description Opaque cursor from the previous page's next_cursor. It encodes the last row's position (sort key + id), so paging continues correctly even if that row is deleted meanwhile. A malformed cursor is 400 'Malformed cursor'; a legacy id-only cursor whose row no longer exists is 400 'Cursor no longer valid' — restart from the first page. */
3595
4156
  cursor?: string;
4157
+ /** @description Only live windows. Evaluated over all of the organization's windows before paging, so has_more and next_cursor describe the filtered set. ended/disabled are not filterable — read state off each row. */
4158
+ state?: "active" | "upcoming";
3596
4159
  };
3597
4160
  header?: never;
3598
4161
  path?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "watchfor",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Official TypeScript SDK + CLI for WatchFor — uptime & infrastructure monitoring (monitors, alert rules, incidents, maintenance windows) over the REST API.",
5
5
  "keywords": [
6
6
  "watchfor",