@openstatus/sdk-node 0.1.2 → 0.1.3

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.
Files changed (26) hide show
  1. package/README.md +837 -453
  2. package/esm/gen/openstatus/notification/v1/notification_pb.d.ts +110 -0
  3. package/esm/gen/openstatus/notification/v1/notification_pb.d.ts.map +1 -0
  4. package/esm/gen/openstatus/notification/v1/notification_pb.js +19 -0
  5. package/esm/gen/openstatus/notification/v1/providers_pb.d.ts +504 -0
  6. package/esm/gen/openstatus/notification/v1/providers_pb.d.ts.map +1 -0
  7. package/esm/gen/openstatus/notification/v1/providers_pb.js +199 -0
  8. package/esm/gen/openstatus/notification/v1/service_pb.d.ts +403 -0
  9. package/esm/gen/openstatus/notification/v1/service_pb.d.ts.map +1 -0
  10. package/esm/gen/openstatus/notification/v1/service_pb.js +91 -0
  11. package/esm/mod.d.ts +25 -0
  12. package/esm/mod.d.ts.map +1 -1
  13. package/esm/mod.js +7 -0
  14. package/package.json +5 -2
  15. package/script/gen/openstatus/notification/v1/notification_pb.d.ts +110 -0
  16. package/script/gen/openstatus/notification/v1/notification_pb.d.ts.map +1 -0
  17. package/script/gen/openstatus/notification/v1/notification_pb.js +22 -0
  18. package/script/gen/openstatus/notification/v1/providers_pb.d.ts +504 -0
  19. package/script/gen/openstatus/notification/v1/providers_pb.d.ts.map +1 -0
  20. package/script/gen/openstatus/notification/v1/providers_pb.js +202 -0
  21. package/script/gen/openstatus/notification/v1/service_pb.d.ts +403 -0
  22. package/script/gen/openstatus/notification/v1/service_pb.d.ts.map +1 -0
  23. package/script/gen/openstatus/notification/v1/service_pb.js +94 -0
  24. package/script/mod.d.ts +25 -0
  25. package/script/mod.d.ts.map +1 -1
  26. package/script/mod.js +12 -3
package/README.md CHANGED
@@ -7,8 +7,36 @@
7
7
  Official Node.js SDK for [OpenStatus](https://openstatus.dev) - The open-source
8
8
  status page with uptime monitoring.
9
9
 
10
+ ## Table of Contents
11
+
12
+ - [Features](#features)
13
+ - [Installation](#installation)
14
+ - [Quick Start](#quick-start)
15
+ - [Authentication](#authentication)
16
+ - [SDK Reference](#sdk-reference)
17
+ - [Monitor Service](#monitor-service)
18
+ - [Health Service](#health-service)
19
+ - [Status Report Service](#status-report-service)
20
+ - [Status Page Service](#status-page-service)
21
+ - [Maintenance Service](#maintenance-service)
22
+ - [Notification Service](#notification-service)
23
+ - [Reference](#reference)
24
+ - [Monitor Options](#monitor-options)
25
+ - [Assertions](#assertions)
26
+ - [Regions](#regions)
27
+ - [Enums](#enums)
28
+ - [Error Handling](#error-handling)
29
+ - [Related](#related)
30
+
10
31
  ## Features
11
32
 
33
+ ### Monitoring
34
+
35
+ - **HTTP Monitoring** - Monitor websites and APIs with customizable assertions
36
+ - **TCP Monitoring** - Check database connections and other TCP services
37
+ - **DNS Monitoring** - Verify DNS records and resolution
38
+ - **Global Regions** - Monitor from 28 locations worldwide
39
+
12
40
  ### Status Page
13
41
 
14
42
  - **Status Pages** - Create and manage public status pages with custom domains
@@ -17,27 +45,30 @@ status page with uptime monitoring.
17
45
  - **Status Reports** - Manage incident reports with update timelines
18
46
  - **Maintenance Windows** - Schedule and manage planned maintenance periods
19
47
 
20
- ### Monitoring
48
+ ### Notifications
21
49
 
22
- - **HTTP Monitoring** - Monitor websites and APIs with customizable assertions
23
- - **TCP Monitoring** - Check database connections and other TCP services
24
- - **DNS Monitoring** - Verify DNS records and resolution
50
+ - **12 Providers** - Slack, Discord, Email, PagerDuty, Opsgenie, Telegram, and
51
+ more
52
+ - **Webhook Support** - Custom webhooks with headers for any integration
53
+ - **Monitor Alerts** - Get notified when monitors go down or recover
54
+
55
+ ### Developer Experience
25
56
 
26
- - **Global Regions** - Monitor from 28 locations worldwide
27
57
  - **Type-safe** - Full TypeScript support with generated types from protobuf
58
+ - **Multiple Runtimes** - Works with Node.js, Deno, and Bun
28
59
 
29
60
  ## Installation
30
61
 
31
- ### JSR
62
+ ### npm
32
63
 
33
64
  ```bash
34
- npx jsr add @openstatus/sdk-node
65
+ npm install @openstatus/sdk-node
35
66
  ```
36
67
 
37
- ### npm
68
+ ### JSR
38
69
 
39
70
  ```bash
40
- npm install @openstatus/sdk-node
71
+ npx jsr add @openstatus/sdk-node
41
72
  ```
42
73
 
43
74
  ### Deno
@@ -58,33 +89,32 @@ import {
58
89
  } from "@openstatus/sdk-node";
59
90
 
60
91
  const headers = {
61
- "x-openstatus-key": `${process.env.OPENSTATUS_API_KEY}`,
92
+ "x-openstatus-key": process.env.OPENSTATUS_API_KEY,
62
93
  };
63
94
 
64
95
  // Create a monitor
65
- const { monitor } = await openstatus.monitor.v1.MonitorService
66
- .createHTTPMonitor(
67
- {
68
- monitor: {
69
- name: "My API",
70
- url: "https://api.example.com/health",
71
- periodicity: Periodicity.PERIODICITY_1M,
72
- method: HTTPMethod.HTTP_METHOD_GET,
73
- regions: [Region.FLY_AMS, Region.FLY_IAD, Region.FLY_SYD],
74
- active: true,
75
- statusCodeAssertions: [
76
- { comparator: NumberComparator.EQUAL, target: BigInt(200) },
77
- ],
78
- },
96
+ const { monitor } = await openstatus.monitor.v1.MonitorService.createHTTPMonitor(
97
+ {
98
+ monitor: {
99
+ name: "My API",
100
+ url: "https://api.example.com/health",
101
+ periodicity: Periodicity.PERIODICITY_1M,
102
+ method: HTTPMethod.HTTP_METHOD_GET,
103
+ regions: [Region.FLY_AMS, Region.FLY_IAD, Region.FLY_SYD],
104
+ active: true,
105
+ statusCodeAssertions: [
106
+ { comparator: NumberComparator.EQUAL, target: BigInt(200) },
107
+ ],
79
108
  },
80
- { headers },
81
- );
109
+ },
110
+ { headers },
111
+ );
82
112
 
83
113
  console.log(`Monitor created: ${monitor?.id}`);
84
114
 
85
115
  // List all monitors
86
- const { httpMonitors, tcpMonitors, dnsMonitors, totalSize } = await openstatus
87
- .monitor.v1.MonitorService.listMonitors({}, { headers });
116
+ const { httpMonitors, tcpMonitors, dnsMonitors, totalSize } =
117
+ await openstatus.monitor.v1.MonitorService.listMonitors({}, { headers });
88
118
 
89
119
  console.log(`Found ${totalSize} monitors`);
90
120
  ```
@@ -96,24 +126,26 @@ All API requests require an API key. Get yours from the
96
126
 
97
127
  ```typescript
98
128
  const headers = {
99
- "x-openstatus-key": `${process.env.OPENSTATUS_API_KEY}`,
129
+ "x-openstatus-key": process.env.OPENSTATUS_API_KEY,
100
130
  };
101
131
 
102
132
  // Pass headers to any service method
103
133
  await openstatus.monitor.v1.MonitorService.listMonitors({}, { headers });
104
134
  ```
105
135
 
106
- ## Environment Variables
136
+ ### Environment Variables
107
137
 
108
138
  | Variable | Description | Default |
109
139
  | -------------------- | ----------------------- | -------------------------------- |
110
- | `OPENSTATUS_API_KEY` | Your OpenStatus API key | - |
140
+ | `OPENSTATUS_API_KEY` | Your OpenStatus API key | Required |
111
141
  | `OPENSTATUS_API_URL` | Custom API endpoint | `https://api.openstatus.dev/rpc` |
112
142
 
113
- ## API Reference
143
+ ## SDK Reference
114
144
 
115
145
  ### Monitor Service
116
146
 
147
+ Manage HTTP, TCP, and DNS monitors.
148
+
117
149
  #### `createHTTPMonitor(request, options)`
118
150
 
119
151
  Create an HTTP/HTTPS monitor.
@@ -121,20 +153,19 @@ Create an HTTP/HTTPS monitor.
121
153
  ```typescript
122
154
  import { HTTPMethod, Periodicity, Region } from "@openstatus/sdk-node";
123
155
 
124
- const { monitor } = await openstatus.monitor.v1.MonitorService
125
- .createHTTPMonitor(
126
- {
127
- monitor: {
128
- name: "My Website",
129
- url: "https://example.com",
130
- periodicity: Periodicity.PERIODICITY_1M,
131
- method: HTTPMethod.HTTP_METHOD_GET,
132
- regions: [Region.FLY_AMS, Region.FLY_IAD, Region.FLY_SYD],
133
- active: true,
134
- },
156
+ const { monitor } = await openstatus.monitor.v1.MonitorService.createHTTPMonitor(
157
+ {
158
+ monitor: {
159
+ name: "My Website",
160
+ url: "https://example.com",
161
+ periodicity: Periodicity.PERIODICITY_1M,
162
+ method: HTTPMethod.HTTP_METHOD_GET,
163
+ regions: [Region.FLY_AMS, Region.FLY_IAD, Region.FLY_SYD],
164
+ active: true,
135
165
  },
136
- { headers },
137
- );
166
+ },
167
+ { headers },
168
+ );
138
169
  ```
139
170
 
140
171
  #### `updateHTTPMonitor(request, options)`
@@ -142,17 +173,16 @@ const { monitor } = await openstatus.monitor.v1.MonitorService
142
173
  Update an existing HTTP monitor.
143
174
 
144
175
  ```typescript
145
- const { monitor } = await openstatus.monitor.v1.MonitorService
146
- .updateHTTPMonitor(
147
- {
148
- id: "mon_123",
149
- monitor: {
150
- name: "Updated Name",
151
- active: false,
152
- },
176
+ const { monitor } = await openstatus.monitor.v1.MonitorService.updateHTTPMonitor(
177
+ {
178
+ id: "mon_123",
179
+ monitor: {
180
+ name: "Updated Name",
181
+ active: false,
153
182
  },
154
- { headers },
155
- );
183
+ },
184
+ { headers },
185
+ );
156
186
  ```
157
187
 
158
188
  #### `createTCPMonitor(request, options)`
@@ -195,7 +225,7 @@ const { monitor } = await openstatus.monitor.v1.MonitorService.updateTCPMonitor(
195
225
  Create a DNS resolution monitor.
196
226
 
197
227
  ```typescript
198
- import { RecordComparator } from "@openstatus/sdk-node";
228
+ import { Periodicity, RecordComparator, Region } from "@openstatus/sdk-node";
199
229
 
200
230
  const { monitor } = await openstatus.monitor.v1.MonitorService.createDNSMonitor(
201
231
  {
@@ -275,15 +305,11 @@ Get the current status of a monitor across all configured regions.
275
305
  ```typescript
276
306
  import { MonitorStatus, Region } from "@openstatus/sdk-node";
277
307
 
278
- const { id, regions } = await openstatus.monitor.v1.MonitorService
279
- .getMonitorStatus(
280
- { id: "mon_123" },
281
- { headers },
282
- );
308
+ const { id, regions } = await openstatus.monitor.v1.MonitorService.getMonitorStatus(
309
+ { id: "mon_123" },
310
+ { headers },
311
+ );
283
312
 
284
- // regions is an array of { region, status }
285
- // region: Region enum value (e.g., Region.FLY_AMS)
286
- // status: MonitorStatus.ACTIVE, MonitorStatus.DEGRADED, or MonitorStatus.ERROR
287
313
  for (const { region, status } of regions) {
288
314
  console.log(`${Region[region]}: ${MonitorStatus[status]}`);
289
315
  }
@@ -299,7 +325,7 @@ import { TimeRange } from "@openstatus/sdk-node";
299
325
  const summary = await openstatus.monitor.v1.MonitorService.getMonitorSummary(
300
326
  {
301
327
  id: "mon_123",
302
- timeRange: TimeRange.TIME_RANGE_7D, // TIME_RANGE_1D, TIME_RANGE_7D, or TIME_RANGE_14D
328
+ timeRange: TimeRange.TIME_RANGE_7D,
303
329
  regions: [], // optional: filter by specific regions
304
330
  },
305
331
  { headers },
@@ -307,15 +333,14 @@ const summary = await openstatus.monitor.v1.MonitorService.getMonitorSummary(
307
333
 
308
334
  console.log(`Last ping: ${summary.lastPingAt}`);
309
335
  console.log(`Success: ${summary.totalSuccessful}`);
310
- console.log(`Degraded: ${summary.totalDegraded}`);
311
336
  console.log(`Failed: ${summary.totalFailed}`);
312
337
  console.log(`P50 latency: ${summary.p50}ms`);
313
- console.log(`P75 latency: ${summary.p75}ms`);
314
- console.log(`P90 latency: ${summary.p90}ms`);
315
338
  console.log(`P95 latency: ${summary.p95}ms`);
316
339
  console.log(`P99 latency: ${summary.p99}ms`);
317
340
  ```
318
341
 
342
+ ---
343
+
319
344
  ### Health Service
320
345
 
321
346
  Check API health status (no authentication required).
@@ -327,9 +352,11 @@ const { status } = await openstatus.health.v1.HealthService.check({});
327
352
  console.log(ServingStatus[status]); // "SERVING"
328
353
  ```
329
354
 
355
+ ---
356
+
330
357
  ### Status Report Service
331
358
 
332
- Manage incident and maintenance reports with update timelines.
359
+ Manage incident reports with update timelines.
333
360
 
334
361
  #### `createStatusReport(request, options)`
335
362
 
@@ -338,19 +365,18 @@ Create a new status report.
338
365
  ```typescript
339
366
  import { StatusReportStatus } from "@openstatus/sdk-node";
340
367
 
341
- const { statusReport } = await openstatus.statusReport.v1.StatusReportService
342
- .createStatusReport(
343
- {
344
- title: "API Degradation",
345
- status: StatusReportStatus.INVESTIGATING,
346
- message: "We are investigating reports of increased latency.",
347
- date: "2024-01-15T10:30:00",
348
- pageId: "page_123",
349
- pageComponentIds: ["comp_456"],
350
- notify: true,
351
- },
352
- { headers },
353
- );
368
+ const { statusReport } = await openstatus.statusReport.v1.StatusReportService.createStatusReport(
369
+ {
370
+ title: "API Degradation",
371
+ status: StatusReportStatus.INVESTIGATING,
372
+ message: "We are investigating reports of increased latency.",
373
+ date: "2024-01-15T10:30:00Z",
374
+ pageId: "page_123",
375
+ pageComponentIds: ["comp_456"],
376
+ notify: true,
377
+ },
378
+ { headers },
379
+ );
354
380
 
355
381
  console.log(`Status report created: ${statusReport?.id}`);
356
382
  ```
@@ -360,16 +386,16 @@ console.log(`Status report created: ${statusReport?.id}`);
360
386
  Get a status report by ID (includes full update timeline).
361
387
 
362
388
  ```typescript
363
- const { statusReport } = await openstatus.statusReport.v1.StatusReportService
364
- .getStatusReport(
365
- { id: "sr_123" },
366
- { headers },
367
- );
389
+ import { StatusReportStatus } from "@openstatus/sdk-node";
390
+
391
+ const { statusReport } = await openstatus.statusReport.v1.StatusReportService.getStatusReport(
392
+ { id: "sr_123" },
393
+ { headers },
394
+ );
368
395
 
369
396
  console.log(`Title: ${statusReport?.title}`);
370
397
  console.log(`Status: ${StatusReportStatus[statusReport?.status ?? 0]}`);
371
398
 
372
- // Access update timeline
373
399
  for (const update of statusReport?.updates ?? []) {
374
400
  console.log(`${update.date}: ${update.message}`);
375
401
  }
@@ -382,15 +408,12 @@ List all status reports with pagination and optional filtering.
382
408
  ```typescript
383
409
  import { StatusReportStatus } from "@openstatus/sdk-node";
384
410
 
385
- const { statusReports, totalSize } = await openstatus.statusReport.v1
386
- .StatusReportService.listStatusReports(
411
+ const { statusReports, totalSize } =
412
+ await openstatus.statusReport.v1.StatusReportService.listStatusReports(
387
413
  {
388
414
  limit: 10,
389
415
  offset: 0,
390
- statuses: [
391
- StatusReportStatus.INVESTIGATING,
392
- StatusReportStatus.IDENTIFIED,
393
- ],
416
+ statuses: [StatusReportStatus.INVESTIGATING, StatusReportStatus.IDENTIFIED],
394
417
  },
395
418
  { headers },
396
419
  );
@@ -400,18 +423,17 @@ console.log(`Found ${totalSize} status reports`);
400
423
 
401
424
  #### `updateStatusReport(request, options)`
402
425
 
403
- Update status report metadata (title, page components).
426
+ Update status report metadata.
404
427
 
405
428
  ```typescript
406
- const { statusReport } = await openstatus.statusReport.v1.StatusReportService
407
- .updateStatusReport(
408
- {
409
- id: "sr_123",
410
- title: "Updated Title",
411
- pageComponentIds: ["comp_456", "comp_789"],
412
- },
413
- { headers },
414
- );
429
+ const { statusReport } = await openstatus.statusReport.v1.StatusReportService.updateStatusReport(
430
+ {
431
+ id: "sr_123",
432
+ title: "Updated Title",
433
+ pageComponentIds: ["comp_456", "comp_789"],
434
+ },
435
+ { headers },
436
+ );
415
437
  ```
416
438
 
417
439
  #### `deleteStatusReport(request, options)`
@@ -419,11 +441,10 @@ const { statusReport } = await openstatus.statusReport.v1.StatusReportService
419
441
  Delete a status report and all its updates.
420
442
 
421
443
  ```typescript
422
- const { success } = await openstatus.statusReport.v1.StatusReportService
423
- .deleteStatusReport(
424
- { id: "sr_123" },
425
- { headers },
426
- );
444
+ const { success } = await openstatus.statusReport.v1.StatusReportService.deleteStatusReport(
445
+ { id: "sr_123" },
446
+ { headers },
447
+ );
427
448
  ```
428
449
 
429
450
  #### `addStatusReportUpdate(request, options)`
@@ -433,29 +454,19 @@ Add a new update to an existing status report timeline.
433
454
  ```typescript
434
455
  import { StatusReportStatus } from "@openstatus/sdk-node";
435
456
 
436
- const { statusReport } = await openstatus.statusReport.v1.StatusReportService
437
- .addStatusReportUpdate(
438
- {
439
- statusReportId: "sr_123",
440
- status: StatusReportStatus.IDENTIFIED,
441
- message:
442
- "The issue has been identified as a database connection problem.",
443
- date: "2024-01-15T11:00:00", // optional, defaults to current time
444
- notify: true,
445
- },
446
- { headers },
447
- );
457
+ const { statusReport } = await openstatus.statusReport.v1.StatusReportService.addStatusReportUpdate(
458
+ {
459
+ statusReportId: "sr_123",
460
+ status: StatusReportStatus.IDENTIFIED,
461
+ message: "The issue has been identified as a database connection problem.",
462
+ date: "2024-01-15T11:00:00Z", // optional, defaults to current time
463
+ notify: true,
464
+ },
465
+ { headers },
466
+ );
448
467
  ```
449
468
 
450
- ### Status Report Status
451
-
452
- | Enum Value | Description |
453
- | --------------- | -------------------------------- |
454
- | `UNSPECIFIED` | Default/unspecified status |
455
- | `INVESTIGATING` | Actively investigating the issue |
456
- | `IDENTIFIED` | Root cause has been identified |
457
- | `MONITORING` | Fix deployed, monitoring |
458
- | `RESOLVED` | Issue fully resolved |
469
+ ---
459
470
 
460
471
  ### Status Page Service
461
472
 
@@ -466,17 +477,16 @@ Manage status pages, components, and subscribers.
466
477
  Create a new status page.
467
478
 
468
479
  ```typescript
469
- const { statusPage } = await openstatus.statusPage.v1.StatusPageService
470
- .createStatusPage(
471
- {
472
- title: "My Service Status",
473
- slug: "my-service",
474
- description: "Status page for My Service",
475
- homepageUrl: "https://example.com",
476
- contactUrl: "https://example.com/contact",
477
- },
478
- { headers },
479
- );
480
+ const { statusPage } = await openstatus.statusPage.v1.StatusPageService.createStatusPage(
481
+ {
482
+ title: "My Service Status",
483
+ slug: "my-service",
484
+ description: "Status page for My Service",
485
+ homepageUrl: "https://example.com",
486
+ contactUrl: "https://example.com/contact",
487
+ },
488
+ { headers },
489
+ );
480
490
 
481
491
  console.log(`Status page created: ${statusPage?.id}`);
482
492
  ```
@@ -486,11 +496,10 @@ console.log(`Status page created: ${statusPage?.id}`);
486
496
  Get a status page by ID.
487
497
 
488
498
  ```typescript
489
- const { statusPage } = await openstatus.statusPage.v1.StatusPageService
490
- .getStatusPage(
491
- { id: "page_123" },
492
- { headers },
493
- );
499
+ const { statusPage } = await openstatus.statusPage.v1.StatusPageService.getStatusPage(
500
+ { id: "page_123" },
501
+ { headers },
502
+ );
494
503
  ```
495
504
 
496
505
  #### `listStatusPages(request, options)`
@@ -498,8 +507,8 @@ const { statusPage } = await openstatus.statusPage.v1.StatusPageService
498
507
  List all status pages with pagination.
499
508
 
500
509
  ```typescript
501
- const { statusPages, totalSize } = await openstatus.statusPage.v1
502
- .StatusPageService.listStatusPages(
510
+ const { statusPages, totalSize } =
511
+ await openstatus.statusPage.v1.StatusPageService.listStatusPages(
503
512
  { limit: 10, offset: 0 },
504
513
  { headers },
505
514
  );
@@ -512,15 +521,14 @@ console.log(`Found ${totalSize} status pages`);
512
521
  Update a status page.
513
522
 
514
523
  ```typescript
515
- const { statusPage } = await openstatus.statusPage.v1.StatusPageService
516
- .updateStatusPage(
517
- {
518
- id: "page_123",
519
- title: "Updated Title",
520
- description: "Updated description",
521
- },
522
- { headers },
523
- );
524
+ const { statusPage } = await openstatus.statusPage.v1.StatusPageService.updateStatusPage(
525
+ {
526
+ id: "page_123",
527
+ title: "Updated Title",
528
+ description: "Updated description",
529
+ },
530
+ { headers },
531
+ );
524
532
  ```
525
533
 
526
534
  #### `deleteStatusPage(request, options)`
@@ -528,11 +536,10 @@ const { statusPage } = await openstatus.statusPage.v1.StatusPageService
528
536
  Delete a status page.
529
537
 
530
538
  ```typescript
531
- const { success } = await openstatus.statusPage.v1.StatusPageService
532
- .deleteStatusPage(
533
- { id: "page_123" },
534
- { headers },
535
- );
539
+ const { success } = await openstatus.statusPage.v1.StatusPageService.deleteStatusPage(
540
+ { id: "page_123" },
541
+ { headers },
542
+ );
536
543
  ```
537
544
 
538
545
  #### `addMonitorComponent(request, options)`
@@ -540,17 +547,16 @@ const { success } = await openstatus.statusPage.v1.StatusPageService
540
547
  Add a monitor-based component to a status page.
541
548
 
542
549
  ```typescript
543
- const { component } = await openstatus.statusPage.v1.StatusPageService
544
- .addMonitorComponent(
545
- {
546
- pageId: "page_123",
547
- monitorId: "mon_456",
548
- name: "API Server",
549
- description: "Main API endpoint",
550
- order: 1,
551
- },
552
- { headers },
553
- );
550
+ const { component } = await openstatus.statusPage.v1.StatusPageService.addMonitorComponent(
551
+ {
552
+ pageId: "page_123",
553
+ monitorId: "mon_456",
554
+ name: "API Server",
555
+ description: "Main API endpoint",
556
+ order: 1,
557
+ },
558
+ { headers },
559
+ );
554
560
  ```
555
561
 
556
562
  #### `addStaticComponent(request, options)`
@@ -558,16 +564,15 @@ const { component } = await openstatus.statusPage.v1.StatusPageService
558
564
  Add a static component (not linked to a monitor).
559
565
 
560
566
  ```typescript
561
- const { component } = await openstatus.statusPage.v1.StatusPageService
562
- .addStaticComponent(
563
- {
564
- pageId: "page_123",
565
- name: "Third-party Service",
566
- description: "External dependency",
567
- order: 2,
568
- },
569
- { headers },
570
- );
567
+ const { component } = await openstatus.statusPage.v1.StatusPageService.addStaticComponent(
568
+ {
569
+ pageId: "page_123",
570
+ name: "Third-party Service",
571
+ description: "External dependency",
572
+ order: 2,
573
+ },
574
+ { headers },
575
+ );
571
576
  ```
572
577
 
573
578
  #### `updateComponent(request, options)`
@@ -575,15 +580,14 @@ const { component } = await openstatus.statusPage.v1.StatusPageService
575
580
  Update a component.
576
581
 
577
582
  ```typescript
578
- const { component } = await openstatus.statusPage.v1.StatusPageService
579
- .updateComponent(
580
- {
581
- id: "comp_123",
582
- name: "Updated Component Name",
583
- order: 3,
584
- },
585
- { headers },
586
- );
583
+ const { component } = await openstatus.statusPage.v1.StatusPageService.updateComponent(
584
+ {
585
+ id: "comp_123",
586
+ name: "Updated Component Name",
587
+ order: 3,
588
+ },
589
+ { headers },
590
+ );
587
591
  ```
588
592
 
589
593
  #### `removeComponent(request, options)`
@@ -591,11 +595,10 @@ const { component } = await openstatus.statusPage.v1.StatusPageService
591
595
  Remove a component from a status page.
592
596
 
593
597
  ```typescript
594
- const { success } = await openstatus.statusPage.v1.StatusPageService
595
- .removeComponent(
596
- { id: "comp_123" },
597
- { headers },
598
- );
598
+ const { success } = await openstatus.statusPage.v1.StatusPageService.removeComponent(
599
+ { id: "comp_123" },
600
+ { headers },
601
+ );
599
602
  ```
600
603
 
601
604
  #### `createComponentGroup(request, options)`
@@ -603,14 +606,13 @@ const { success } = await openstatus.statusPage.v1.StatusPageService
603
606
  Create a component group.
604
607
 
605
608
  ```typescript
606
- const { group } = await openstatus.statusPage.v1.StatusPageService
607
- .createComponentGroup(
608
- {
609
- pageId: "page_123",
610
- name: "Core Services",
611
- },
612
- { headers },
613
- );
609
+ const { group } = await openstatus.statusPage.v1.StatusPageService.createComponentGroup(
610
+ {
611
+ pageId: "page_123",
612
+ name: "Core Services",
613
+ },
614
+ { headers },
615
+ );
614
616
  ```
615
617
 
616
618
  #### `updateComponentGroup(request, options)`
@@ -618,14 +620,13 @@ const { group } = await openstatus.statusPage.v1.StatusPageService
618
620
  Update a component group.
619
621
 
620
622
  ```typescript
621
- const { group } = await openstatus.statusPage.v1.StatusPageService
622
- .updateComponentGroup(
623
- {
624
- id: "group_123",
625
- name: "Updated Group Name",
626
- },
627
- { headers },
628
- );
623
+ const { group } = await openstatus.statusPage.v1.StatusPageService.updateComponentGroup(
624
+ {
625
+ id: "group_123",
626
+ name: "Updated Group Name",
627
+ },
628
+ { headers },
629
+ );
629
630
  ```
630
631
 
631
632
  #### `deleteComponentGroup(request, options)`
@@ -633,11 +634,10 @@ const { group } = await openstatus.statusPage.v1.StatusPageService
633
634
  Delete a component group.
634
635
 
635
636
  ```typescript
636
- const { success } = await openstatus.statusPage.v1.StatusPageService
637
- .deleteComponentGroup(
638
- { id: "group_123" },
639
- { headers },
640
- );
637
+ const { success } = await openstatus.statusPage.v1.StatusPageService.deleteComponentGroup(
638
+ { id: "group_123" },
639
+ { headers },
640
+ );
641
641
  ```
642
642
 
643
643
  #### `subscribeToPage(request, options)`
@@ -645,14 +645,13 @@ const { success } = await openstatus.statusPage.v1.StatusPageService
645
645
  Subscribe an email to status page updates.
646
646
 
647
647
  ```typescript
648
- const { subscriber } = await openstatus.statusPage.v1.StatusPageService
649
- .subscribeToPage(
650
- {
651
- pageId: "page_123",
652
- email: "user@example.com",
653
- },
654
- { headers },
655
- );
648
+ const { subscriber } = await openstatus.statusPage.v1.StatusPageService.subscribeToPage(
649
+ {
650
+ pageId: "page_123",
651
+ email: "user@example.com",
652
+ },
653
+ { headers },
654
+ );
656
655
  ```
657
656
 
658
657
  #### `unsubscribeFromPage(request, options)`
@@ -661,24 +660,22 @@ Unsubscribe from a status page.
661
660
 
662
661
  ```typescript
663
662
  // By email
664
- const { success } = await openstatus.statusPage.v1.StatusPageService
665
- .unsubscribeFromPage(
666
- {
667
- pageId: "page_123",
668
- identifier: { case: "email", value: "user@example.com" },
669
- },
670
- { headers },
671
- );
663
+ const { success } = await openstatus.statusPage.v1.StatusPageService.unsubscribeFromPage(
664
+ {
665
+ pageId: "page_123",
666
+ identifier: { case: "email", value: "user@example.com" },
667
+ },
668
+ { headers },
669
+ );
672
670
 
673
671
  // Or by subscriber ID
674
- const { success: success2 } = await openstatus.statusPage.v1.StatusPageService
675
- .unsubscribeFromPage(
676
- {
677
- pageId: "page_123",
678
- identifier: { case: "id", value: "sub_456" },
679
- },
680
- { headers },
681
- );
672
+ const { success: success2 } = await openstatus.statusPage.v1.StatusPageService.unsubscribeFromPage(
673
+ {
674
+ pageId: "page_123",
675
+ identifier: { case: "id", value: "sub_456" },
676
+ },
677
+ { headers },
678
+ );
682
679
  ```
683
680
 
684
681
  #### `listSubscribers(request, options)`
@@ -686,8 +683,8 @@ const { success: success2 } = await openstatus.statusPage.v1.StatusPageService
686
683
  List all subscribers for a status page.
687
684
 
688
685
  ```typescript
689
- const { subscribers, totalSize } = await openstatus.statusPage.v1
690
- .StatusPageService.listSubscribers(
686
+ const { subscribers, totalSize } =
687
+ await openstatus.statusPage.v1.StatusPageService.listSubscribers(
691
688
  {
692
689
  pageId: "page_123",
693
690
  limit: 50,
@@ -703,11 +700,10 @@ const { subscribers, totalSize } = await openstatus.statusPage.v1
703
700
  Get full status page content including components, groups, and active reports.
704
701
 
705
702
  ```typescript
706
- const content = await openstatus.statusPage.v1.StatusPageService
707
- .getStatusPageContent(
708
- { identifier: { case: "slug", value: "my-service" } },
709
- { headers },
710
- );
703
+ const content = await openstatus.statusPage.v1.StatusPageService.getStatusPageContent(
704
+ { identifier: { case: "slug", value: "my-service" } },
705
+ { headers },
706
+ );
711
707
 
712
708
  console.log(`Page: ${content.statusPage?.title}`);
713
709
  console.log(`Components: ${content.components.length}`);
@@ -721,8 +717,8 @@ Get the aggregated status of a status page.
721
717
  ```typescript
722
718
  import { OverallStatus } from "@openstatus/sdk-node";
723
719
 
724
- const { overallStatus, componentStatuses } = await openstatus.statusPage.v1
725
- .StatusPageService.getOverallStatus(
720
+ const { overallStatus, componentStatuses } =
721
+ await openstatus.statusPage.v1.StatusPageService.getOverallStatus(
726
722
  { identifier: { case: "id", value: "page_123" } },
727
723
  { headers },
728
724
  );
@@ -733,6 +729,8 @@ for (const { componentId, status } of componentStatuses) {
733
729
  }
734
730
  ```
735
731
 
732
+ ---
733
+
736
734
  ### Maintenance Service
737
735
 
738
736
  Manage scheduled maintenance windows.
@@ -742,19 +740,18 @@ Manage scheduled maintenance windows.
742
740
  Create a new maintenance window.
743
741
 
744
742
  ```typescript
745
- const { maintenance } = await openstatus.maintenance.v1.MaintenanceService
746
- .createMaintenance(
747
- {
748
- title: "Database Upgrade",
749
- message: "We will be upgrading our database infrastructure.",
750
- from: "2024-01-20T02:00:00Z",
751
- to: "2024-01-20T04:00:00Z",
752
- pageId: "page_123",
753
- pageComponentIds: ["comp_456"],
754
- notify: true,
755
- },
756
- { headers },
757
- );
743
+ const { maintenance } = await openstatus.maintenance.v1.MaintenanceService.createMaintenance(
744
+ {
745
+ title: "Database Upgrade",
746
+ message: "We will be upgrading our database infrastructure.",
747
+ from: "2024-01-20T02:00:00Z",
748
+ to: "2024-01-20T04:00:00Z",
749
+ pageId: "page_123",
750
+ pageComponentIds: ["comp_456"],
751
+ notify: true,
752
+ },
753
+ { headers },
754
+ );
758
755
 
759
756
  console.log(`Maintenance created: ${maintenance?.id}`);
760
757
  ```
@@ -764,11 +761,10 @@ console.log(`Maintenance created: ${maintenance?.id}`);
764
761
  Get a maintenance window by ID.
765
762
 
766
763
  ```typescript
767
- const { maintenance } = await openstatus.maintenance.v1.MaintenanceService
768
- .getMaintenance(
769
- { id: "maint_123" },
770
- { headers },
771
- );
764
+ const { maintenance } = await openstatus.maintenance.v1.MaintenanceService.getMaintenance(
765
+ { id: "maint_123" },
766
+ { headers },
767
+ );
772
768
 
773
769
  console.log(`Title: ${maintenance?.title}`);
774
770
  console.log(`From: ${maintenance?.from}`);
@@ -780,8 +776,8 @@ console.log(`To: ${maintenance?.to}`);
780
776
  List all maintenance windows with pagination and optional filtering.
781
777
 
782
778
  ```typescript
783
- const { maintenances, totalSize } = await openstatus.maintenance.v1
784
- .MaintenanceService.listMaintenances(
779
+ const { maintenances, totalSize } =
780
+ await openstatus.maintenance.v1.MaintenanceService.listMaintenances(
785
781
  {
786
782
  limit: 10,
787
783
  offset: 0,
@@ -798,15 +794,14 @@ console.log(`Found ${totalSize} maintenance windows`);
798
794
  Update a maintenance window.
799
795
 
800
796
  ```typescript
801
- const { maintenance } = await openstatus.maintenance.v1.MaintenanceService
802
- .updateMaintenance(
803
- {
804
- id: "maint_123",
805
- title: "Extended Database Upgrade",
806
- to: "2024-01-20T06:00:00Z",
807
- },
808
- { headers },
809
- );
797
+ const { maintenance } = await openstatus.maintenance.v1.MaintenanceService.updateMaintenance(
798
+ {
799
+ id: "maint_123",
800
+ title: "Extended Database Upgrade",
801
+ to: "2024-01-20T06:00:00Z",
802
+ },
803
+ { headers },
804
+ );
810
805
  ```
811
806
 
812
807
  #### `deleteMaintenance(request, options)`
@@ -814,149 +809,424 @@ const { maintenance } = await openstatus.maintenance.v1.MaintenanceService
814
809
  Delete a maintenance window.
815
810
 
816
811
  ```typescript
817
- const { success } = await openstatus.maintenance.v1.MaintenanceService
818
- .deleteMaintenance(
819
- { id: "maint_123" },
820
- { headers },
821
- );
812
+ const { success } = await openstatus.maintenance.v1.MaintenanceService.deleteMaintenance(
813
+ { id: "maint_123" },
814
+ { headers },
815
+ );
822
816
  ```
823
817
 
824
- ### Status Page Options
818
+ ---
825
819
 
826
- | Option | Type | Required | Description |
827
- | ------------- | ------ | -------- | ---------------------------------------- |
828
- | `title` | string | Yes | Title of the status page (max 256 chars) |
829
- | `slug` | string | Yes | URL-friendly slug (lowercase, hyphens) |
830
- | `description` | string | No | Description (max 2048 chars) |
831
- | `homepageUrl` | string | No | Link to your homepage |
832
- | `contactUrl` | string | No | Link to your contact page |
820
+ ### Notification Service
833
821
 
834
- ### Page Access Type
822
+ Manage notification channels for monitor alerts. Supports 12 providers including
823
+ Slack, Discord, Email, PagerDuty, and custom webhooks.
835
824
 
836
- | Enum Value | Description |
837
- | -------------------- | ----------------------- |
838
- | `UNSPECIFIED` | Default/unspecified |
839
- | `PUBLIC` | Publicly accessible |
840
- | `PASSWORD_PROTECTED` | Requires password |
841
- | `AUTHENTICATED` | Requires authentication |
825
+ #### `createNotification(request, options)`
842
826
 
843
- ### Page Theme
827
+ Create a new notification channel.
844
828
 
845
- | Enum Value | Description |
846
- | ------------- | ------------------- |
847
- | `UNSPECIFIED` | Default/unspecified |
848
- | `SYSTEM` | Follow system theme |
849
- | `LIGHT` | Light theme |
850
- | `DARK` | Dark theme |
829
+ ```typescript
830
+ import { NotificationProvider } from "@openstatus/sdk-node";
851
831
 
852
- ### Overall Status
832
+ const { notification } = await openstatus.notification.v1.NotificationService.createNotification(
833
+ {
834
+ name: "Slack Alerts",
835
+ provider: NotificationProvider.SLACK,
836
+ data: {
837
+ data: {
838
+ case: "slack",
839
+ value: { webhookUrl: "https://hooks.slack.com/services/..." },
840
+ },
841
+ },
842
+ monitorIds: ["mon_123", "mon_456"],
843
+ },
844
+ { headers },
845
+ );
853
846
 
854
- | Enum Value | Description |
855
- | ---------------- | --------------------------- |
856
- | `UNSPECIFIED` | Default/unspecified |
857
- | `OPERATIONAL` | All systems operational |
858
- | `DEGRADED` | Performance is degraded |
859
- | `PARTIAL_OUTAGE` | Some systems are down |
860
- | `MAJOR_OUTAGE` | Major systems are down |
861
- | `MAINTENANCE` | Scheduled maintenance |
862
- | `UNKNOWN` | Status cannot be determined |
847
+ console.log(`Notification created: ${notification?.id}`);
848
+ ```
863
849
 
864
- ### Page Component Type
865
-
866
- | Enum Value | Description |
867
- | ------------- | ------------------------- |
868
- | `UNSPECIFIED` | Default/unspecified |
869
- | `MONITOR` | Linked to a monitor |
870
- | `STATIC` | Static component (manual) |
871
-
872
- ## Monitor Options
873
-
874
- ### HTTP Monitor
875
-
876
- | Option | Type | Required | Description |
877
- | ---------------------- | ------------------- | -------- | --------------------------------------------------- |
878
- | `name` | string | Yes | Monitor name (max 256 chars) |
879
- | `url` | string | Yes | URL to monitor (max 2048 chars) |
880
- | `periodicity` | Periodicity | Yes | Check interval (see [Periodicity](#periodicity)) |
881
- | `method` | HTTPMethod | No | HTTP method (see [HTTP Methods](#http-methods)) |
882
- | `body` | string | No | Request body |
883
- | `headers` | Headers[] | No | Custom headers (`{ key: string, value: string }[]`) |
884
- | `timeout` | bigint | No | Timeout in ms (default: 45000, max: 120000) |
885
- | `retry` | bigint | No | Retry attempts (default: 3, max: 10) |
886
- | `followRedirects` | boolean | No | Follow redirects (default: true) |
887
- | `regions` | Region[] | No | [Regions](#regions) for checks |
888
- | `active` | boolean | No | Enable monitoring (default: false) |
889
- | `public` | boolean | No | Public visibility (default: false) |
890
- | `degradedAt` | bigint | No | Latency threshold (ms) for degraded status |
891
- | `description` | string | No | Monitor description (max 1024 chars) |
892
- | `statusCodeAssertions` | array | No | [Status code assertions](#status-code-assertions) |
893
- | `bodyAssertions` | array | No | [Body assertions](#body-assertions) |
894
- | `headerAssertions` | array | No | [Header assertions](#header-assertions) |
895
- | `openTelemetry` | OpenTelemetryConfig | No | OpenTelemetry export configuration |
896
-
897
- ### TCP Monitor
898
-
899
- | Option | Type | Required | Description |
900
- | --------------- | ------------------- | -------- | ------------------------------------------------ |
901
- | `name` | string | Yes | Monitor name (max 256 chars) |
902
- | `uri` | string | Yes | `host:port` to monitor (max 2048 chars) |
903
- | `periodicity` | Periodicity | Yes | Check interval (see [Periodicity](#periodicity)) |
904
- | `timeout` | bigint | No | Timeout in ms (default: 45000, max: 120000) |
905
- | `retry` | bigint | No | Retry attempts (default: 3, max: 10) |
906
- | `regions` | Region[] | No | [Regions](#regions) for checks |
907
- | `active` | boolean | No | Enable monitoring (default: false) |
908
- | `public` | boolean | No | Public visibility (default: false) |
909
- | `degradedAt` | bigint | No | Latency threshold (ms) for degraded status |
910
- | `description` | string | No | Monitor description (max 1024 chars) |
911
- | `openTelemetry` | OpenTelemetryConfig | No | OpenTelemetry export configuration |
912
-
913
- ### DNS Monitor
914
-
915
- | Option | Type | Required | Description |
916
- | ------------------ | ------------------- | -------- | ------------------------------------------------ |
917
- | `name` | string | Yes | Monitor name (max 256 chars) |
918
- | `uri` | string | Yes | Domain to resolve (max 2048 chars) |
919
- | `periodicity` | Periodicity | Yes | Check interval (see [Periodicity](#periodicity)) |
920
- | `timeout` | bigint | No | Timeout in ms (default: 45000, max: 120000) |
921
- | `retry` | bigint | No | Retry attempts (default: 3, max: 10) |
922
- | `regions` | Region[] | No | [Regions](#regions) for checks |
923
- | `active` | boolean | No | Enable monitoring (default: false) |
924
- | `public` | boolean | No | Public visibility (default: false) |
925
- | `degradedAt` | bigint | No | Latency threshold (ms) for degraded status |
926
- | `description` | string | No | Monitor description (max 1024 chars) |
927
- | `recordAssertions` | array | No | [DNS record assertions](#dns-record-assertions) |
928
- | `openTelemetry` | OpenTelemetryConfig | No | OpenTelemetry export configuration |
929
-
930
- ### Periodicity
931
-
932
- | Enum Value | Description |
933
- | ----------------- | ----------- |
934
- | `PERIODICITY_30S` | Every 30s |
935
- | `PERIODICITY_1M` | Every 1m |
936
- | `PERIODICITY_5M` | Every 5m |
937
- | `PERIODICITY_10M` | Every 10m |
938
- | `PERIODICITY_30M` | Every 30m |
939
- | `PERIODICITY_1H` | Every 1h |
850
+ #### `getNotification(request, options)`
940
851
 
941
- ### HTTP Methods
852
+ Get a notification channel by ID.
942
853
 
943
- | Enum Value | Description |
944
- | --------------------- | ----------- |
945
- | `HTTP_METHOD_GET` | GET |
946
- | `HTTP_METHOD_POST` | POST |
947
- | `HTTP_METHOD_HEAD` | HEAD |
948
- | `HTTP_METHOD_PUT` | PUT |
949
- | `HTTP_METHOD_PATCH` | PATCH |
950
- | `HTTP_METHOD_DELETE` | DELETE |
951
- | `HTTP_METHOD_TRACE` | TRACE |
952
- | `HTTP_METHOD_CONNECT` | CONNECT |
953
- | `HTTP_METHOD_OPTIONS` | OPTIONS |
854
+ ```typescript
855
+ import { NotificationProvider } from "@openstatus/sdk-node";
856
+
857
+ const { notification } = await openstatus.notification.v1.NotificationService.getNotification(
858
+ { id: "notif_123" },
859
+ { headers },
860
+ );
861
+
862
+ console.log(`Name: ${notification?.name}`);
863
+ console.log(`Provider: ${NotificationProvider[notification?.provider ?? 0]}`);
864
+ ```
865
+
866
+ #### `listNotifications(request, options)`
867
+
868
+ List all notification channels with pagination.
869
+
870
+ ```typescript
871
+ const { notifications, totalSize } =
872
+ await openstatus.notification.v1.NotificationService.listNotifications(
873
+ { limit: 10, offset: 0 },
874
+ { headers },
875
+ );
876
+
877
+ console.log(`Found ${totalSize} notification channels`);
878
+ ```
879
+
880
+ #### `updateNotification(request, options)`
881
+
882
+ Update a notification channel.
883
+
884
+ ```typescript
885
+ const { notification } = await openstatus.notification.v1.NotificationService.updateNotification(
886
+ {
887
+ id: "notif_123",
888
+ name: "Updated Slack Alerts",
889
+ monitorIds: ["mon_123", "mon_456", "mon_789"],
890
+ },
891
+ { headers },
892
+ );
893
+ ```
894
+
895
+ #### `deleteNotification(request, options)`
896
+
897
+ Delete a notification channel.
898
+
899
+ ```typescript
900
+ const { success } = await openstatus.notification.v1.NotificationService.deleteNotification(
901
+ { id: "notif_123" },
902
+ { headers },
903
+ );
904
+ ```
905
+
906
+ #### `sendTestNotification(request, options)`
907
+
908
+ Send a test notification to verify configuration.
909
+
910
+ ```typescript
911
+ import { NotificationProvider } from "@openstatus/sdk-node";
912
+
913
+ const { success, errorMessage } =
914
+ await openstatus.notification.v1.NotificationService.sendTestNotification(
915
+ {
916
+ provider: NotificationProvider.SLACK,
917
+ data: {
918
+ data: {
919
+ case: "slack",
920
+ value: { webhookUrl: "https://hooks.slack.com/services/..." },
921
+ },
922
+ },
923
+ },
924
+ { headers },
925
+ );
926
+
927
+ if (success) {
928
+ console.log("Test notification sent successfully");
929
+ } else {
930
+ console.log(`Test failed: ${errorMessage}`);
931
+ }
932
+ ```
933
+
934
+ #### `checkNotificationLimit(request, options)`
935
+
936
+ Check if the workspace has reached its notification limit.
937
+
938
+ ```typescript
939
+ const { limitReached, currentCount, maxCount } =
940
+ await openstatus.notification.v1.NotificationService.checkNotificationLimit({}, { headers });
941
+
942
+ console.log(`${currentCount}/${maxCount} notification channels used`);
943
+ ```
944
+
945
+ #### Provider Configuration Examples
954
946
 
955
- ## Assertions
947
+ <details>
948
+ <summary><strong>Slack</strong></summary>
956
949
 
957
- All assertion comparators are exported as enums from the SDK.
950
+ ```typescript
951
+ {
952
+ provider: NotificationProvider.SLACK,
953
+ data: {
954
+ data: {
955
+ case: "slack",
956
+ value: { webhookUrl: "https://hooks.slack.com/services/..." }
957
+ }
958
+ }
959
+ }
960
+ ```
961
+
962
+ </details>
963
+
964
+ <details>
965
+ <summary><strong>Discord</strong></summary>
966
+
967
+ ```typescript
968
+ {
969
+ provider: NotificationProvider.DISCORD,
970
+ data: {
971
+ data: {
972
+ case: "discord",
973
+ value: { webhookUrl: "https://discord.com/api/webhooks/..." }
974
+ }
975
+ }
976
+ }
977
+ ```
978
+
979
+ </details>
980
+
981
+ <details>
982
+ <summary><strong>Email</strong></summary>
983
+
984
+ ```typescript
985
+ {
986
+ provider: NotificationProvider.EMAIL,
987
+ data: {
988
+ data: {
989
+ case: "email",
990
+ value: { email: "alerts@example.com" }
991
+ }
992
+ }
993
+ }
994
+ ```
995
+
996
+ </details>
997
+
998
+ <details>
999
+ <summary><strong>PagerDuty</strong></summary>
1000
+
1001
+ ```typescript
1002
+ {
1003
+ provider: NotificationProvider.PAGERDUTY,
1004
+ data: {
1005
+ data: {
1006
+ case: "pagerduty",
1007
+ value: { integrationKey: "your-integration-key" }
1008
+ }
1009
+ }
1010
+ }
1011
+ ```
1012
+
1013
+ </details>
1014
+
1015
+ <details>
1016
+ <summary><strong>Opsgenie</strong></summary>
1017
+
1018
+ ```typescript
1019
+ import { OpsgenieRegion } from "@openstatus/sdk-node";
1020
+
1021
+ {
1022
+ provider: NotificationProvider.OPSGENIE,
1023
+ data: {
1024
+ data: {
1025
+ case: "opsgenie",
1026
+ value: { apiKey: "your-api-key", region: OpsgenieRegion.US }
1027
+ }
1028
+ }
1029
+ }
1030
+ ```
1031
+
1032
+ </details>
1033
+
1034
+ <details>
1035
+ <summary><strong>Telegram</strong></summary>
1036
+
1037
+ ```typescript
1038
+ {
1039
+ provider: NotificationProvider.TELEGRAM,
1040
+ data: {
1041
+ data: {
1042
+ case: "telegram",
1043
+ value: { chatId: "123456789" }
1044
+ }
1045
+ }
1046
+ }
1047
+ ```
1048
+
1049
+ </details>
1050
+
1051
+ <details>
1052
+ <summary><strong>Google Chat</strong></summary>
1053
+
1054
+ ```typescript
1055
+ {
1056
+ provider: NotificationProvider.GOOGLE_CHAT,
1057
+ data: {
1058
+ data: {
1059
+ case: "googleChat",
1060
+ value: { webhookUrl: "https://chat.googleapis.com/v1/spaces/..." }
1061
+ }
1062
+ }
1063
+ }
1064
+ ```
958
1065
 
959
- ### Status Code Assertions
1066
+ </details>
1067
+
1068
+ <details>
1069
+ <summary><strong>Grafana OnCall</strong></summary>
1070
+
1071
+ ```typescript
1072
+ {
1073
+ provider: NotificationProvider.GRAFANA_ONCALL,
1074
+ data: {
1075
+ data: {
1076
+ case: "grafanaOncall",
1077
+ value: { webhookUrl: "https://oncall.example.com/..." }
1078
+ }
1079
+ }
1080
+ }
1081
+ ```
1082
+
1083
+ </details>
1084
+
1085
+ <details>
1086
+ <summary><strong>Ntfy</strong></summary>
1087
+
1088
+ ```typescript
1089
+ {
1090
+ provider: NotificationProvider.NTFY,
1091
+ data: {
1092
+ data: {
1093
+ case: "ntfy",
1094
+ value: {
1095
+ topic: "my-alerts",
1096
+ serverUrl: "https://ntfy.sh", // optional, defaults to ntfy.sh
1097
+ token: "tk_..." // optional auth token
1098
+ }
1099
+ }
1100
+ }
1101
+ }
1102
+ ```
1103
+
1104
+ </details>
1105
+
1106
+ <details>
1107
+ <summary><strong>SMS</strong></summary>
1108
+
1109
+ ```typescript
1110
+ {
1111
+ provider: NotificationProvider.SMS,
1112
+ data: {
1113
+ data: {
1114
+ case: "sms",
1115
+ value: { phoneNumber: "+1234567890" }
1116
+ }
1117
+ }
1118
+ }
1119
+ ```
1120
+
1121
+ </details>
1122
+
1123
+ <details>
1124
+ <summary><strong>WhatsApp</strong></summary>
1125
+
1126
+ ```typescript
1127
+ {
1128
+ provider: NotificationProvider.WHATSAPP,
1129
+ data: {
1130
+ data: {
1131
+ case: "whatsapp",
1132
+ value: { phoneNumber: "+1234567890" }
1133
+ }
1134
+ }
1135
+ }
1136
+ ```
1137
+
1138
+ </details>
1139
+
1140
+ <details>
1141
+ <summary><strong>Custom Webhook</strong></summary>
1142
+
1143
+ ```typescript
1144
+ {
1145
+ provider: NotificationProvider.WEBHOOK,
1146
+ data: {
1147
+ data: {
1148
+ case: "webhook",
1149
+ value: {
1150
+ endpoint: "https://api.example.com/webhook",
1151
+ headers: [
1152
+ { key: "Authorization", value: "Bearer token" },
1153
+ { key: "X-Custom-Header", value: "value" }
1154
+ ]
1155
+ }
1156
+ }
1157
+ }
1158
+ }
1159
+ ```
1160
+
1161
+ </details>
1162
+
1163
+ ---
1164
+
1165
+ ## Reference
1166
+
1167
+ ### Monitor Options
1168
+
1169
+ #### HTTP Monitor
1170
+
1171
+ | Option | Type | Required | Description |
1172
+ | ---------------------- | ------------------- | -------- | ------------------------------------------ |
1173
+ | `name` | string | Yes | Monitor name (max 256 chars) |
1174
+ | `url` | string | Yes | URL to monitor (max 2048 chars) |
1175
+ | `periodicity` | Periodicity | Yes | Check interval |
1176
+ | `method` | HTTPMethod | No | HTTP method (default: GET) |
1177
+ | `body` | string | No | Request body |
1178
+ | `headers` | Headers[] | No | Custom headers `{ key, value }[]` |
1179
+ | `timeout` | bigint | No | Timeout in ms (default: 45000, max: 120000)|
1180
+ | `retry` | bigint | No | Retry attempts (default: 3, max: 10) |
1181
+ | `followRedirects` | boolean | No | Follow redirects (default: true) |
1182
+ | `regions` | Region[] | No | Regions for checks |
1183
+ | `active` | boolean | No | Enable monitoring (default: false) |
1184
+ | `public` | boolean | No | Public visibility (default: false) |
1185
+ | `degradedAt` | bigint | No | Latency threshold (ms) for degraded status |
1186
+ | `description` | string | No | Monitor description (max 1024 chars) |
1187
+ | `statusCodeAssertions` | array | No | Status code assertions |
1188
+ | `bodyAssertions` | array | No | Body assertions |
1189
+ | `headerAssertions` | array | No | Header assertions |
1190
+ | `openTelemetry` | OpenTelemetryConfig | No | OpenTelemetry export configuration |
1191
+
1192
+ #### TCP Monitor
1193
+
1194
+ | Option | Type | Required | Description |
1195
+ | --------------- | ------------------- | -------- | ------------------------------------------ |
1196
+ | `name` | string | Yes | Monitor name (max 256 chars) |
1197
+ | `uri` | string | Yes | `host:port` to monitor (max 2048 chars) |
1198
+ | `periodicity` | Periodicity | Yes | Check interval |
1199
+ | `timeout` | bigint | No | Timeout in ms (default: 45000, max: 120000)|
1200
+ | `retry` | bigint | No | Retry attempts (default: 3, max: 10) |
1201
+ | `regions` | Region[] | No | Regions for checks |
1202
+ | `active` | boolean | No | Enable monitoring (default: false) |
1203
+ | `public` | boolean | No | Public visibility (default: false) |
1204
+ | `degradedAt` | bigint | No | Latency threshold (ms) for degraded status |
1205
+ | `description` | string | No | Monitor description (max 1024 chars) |
1206
+ | `openTelemetry` | OpenTelemetryConfig | No | OpenTelemetry export configuration |
1207
+
1208
+ #### DNS Monitor
1209
+
1210
+ | Option | Type | Required | Description |
1211
+ | ------------------ | ------------------- | -------- | ------------------------------------------ |
1212
+ | `name` | string | Yes | Monitor name (max 256 chars) |
1213
+ | `uri` | string | Yes | Domain to resolve (max 2048 chars) |
1214
+ | `periodicity` | Periodicity | Yes | Check interval |
1215
+ | `timeout` | bigint | No | Timeout in ms (default: 45000, max: 120000)|
1216
+ | `retry` | bigint | No | Retry attempts (default: 3, max: 10) |
1217
+ | `regions` | Region[] | No | Regions for checks |
1218
+ | `active` | boolean | No | Enable monitoring (default: false) |
1219
+ | `public` | boolean | No | Public visibility (default: false) |
1220
+ | `degradedAt` | bigint | No | Latency threshold (ms) for degraded status |
1221
+ | `description` | string | No | Monitor description (max 1024 chars) |
1222
+ | `recordAssertions` | array | No | DNS record assertions |
1223
+ | `openTelemetry` | OpenTelemetryConfig | No | OpenTelemetry export configuration |
1224
+
1225
+ ---
1226
+
1227
+ ### Assertions
1228
+
1229
+ #### Status Code Assertions
960
1230
 
961
1231
  Validate HTTP response status codes using `NumberComparator`.
962
1232
 
@@ -971,18 +1241,7 @@ import { NumberComparator } from "@openstatus/sdk-node";
971
1241
  }
972
1242
  ```
973
1243
 
974
- **NumberComparator values:**
975
-
976
- | Enum Value | Description |
977
- | ----------------------- | --------------------- |
978
- | `EQUAL` | Equal to target |
979
- | `NOT_EQUAL` | Not equal to target |
980
- | `GREATER_THAN` | Greater than target |
981
- | `GREATER_THAN_OR_EQUAL` | Greater than or equal |
982
- | `LESS_THAN` | Less than target |
983
- | `LESS_THAN_OR_EQUAL` | Less than or equal |
984
-
985
- ### Body Assertions
1244
+ #### Body Assertions
986
1245
 
987
1246
  Validate response body content using `StringComparator`.
988
1247
 
@@ -997,22 +1256,7 @@ import { StringComparator } from "@openstatus/sdk-node";
997
1256
  }
998
1257
  ```
999
1258
 
1000
- **StringComparator values:**
1001
-
1002
- | Enum Value | Description |
1003
- | ----------------------- | --------------------------- |
1004
- | `CONTAINS` | Contains target string |
1005
- | `NOT_CONTAINS` | Does not contain target |
1006
- | `EQUAL` | Equal to target |
1007
- | `NOT_EQUAL` | Not equal to target |
1008
- | `EMPTY` | Body is empty |
1009
- | `NOT_EMPTY` | Body is not empty |
1010
- | `GREATER_THAN` | Lexicographically greater |
1011
- | `GREATER_THAN_OR_EQUAL` | Lexicographically >= target |
1012
- | `LESS_THAN` | Lexicographically less |
1013
- | `LESS_THAN_OR_EQUAL` | Lexicographically <= target |
1014
-
1015
- ### Header Assertions
1259
+ #### Header Assertions
1016
1260
 
1017
1261
  Validate response headers using `StringComparator`.
1018
1262
 
@@ -1030,7 +1274,7 @@ import { StringComparator } from "@openstatus/sdk-node";
1030
1274
  }
1031
1275
  ```
1032
1276
 
1033
- ### DNS Record Assertions
1277
+ #### DNS Record Assertions
1034
1278
 
1035
1279
  Validate DNS records using `RecordComparator`.
1036
1280
 
@@ -1049,30 +1293,21 @@ import { RecordComparator } from "@openstatus/sdk-node";
1049
1293
  }
1050
1294
  ```
1051
1295
 
1052
- **RecordComparator values:**
1053
-
1054
- | Enum Value | Description |
1055
- | -------------- | ----------------------- |
1056
- | `EQUAL` | Equal to target |
1057
- | `NOT_EQUAL` | Not equal to target |
1058
- | `CONTAINS` | Contains target string |
1059
- | `NOT_CONTAINS` | Does not contain target |
1060
-
1061
1296
  **Supported record types:** `A`, `AAAA`, `CNAME`, `MX`, `TXT`
1062
1297
 
1063
- ## Regions
1298
+ ---
1299
+
1300
+ ### Regions
1064
1301
 
1065
- Monitor from 28 global locations across multiple providers. Use the `Region`
1066
- enum:
1302
+ Monitor from 28 global locations across multiple providers.
1067
1303
 
1068
1304
  ```typescript
1069
1305
  import { Region } from "@openstatus/sdk-node";
1070
1306
 
1071
- // Example: Use specific regions
1072
1307
  regions: [Region.FLY_AMS, Region.FLY_IAD, Region.KOYEB_FRA];
1073
1308
  ```
1074
1309
 
1075
- ### Fly.io Regions
1310
+ #### Fly.io Regions (18)
1076
1311
 
1077
1312
  | Enum Value | Location |
1078
1313
  | ---------- | --------------- |
@@ -1095,7 +1330,7 @@ regions: [Region.FLY_AMS, Region.FLY_IAD, Region.KOYEB_FRA];
1095
1330
  | `FLY_SYD` | Sydney |
1096
1331
  | `FLY_YYZ` | Toronto |
1097
1332
 
1098
- ### Koyeb Regions
1333
+ #### Koyeb Regions (6)
1099
1334
 
1100
1335
  | Enum Value | Location |
1101
1336
  | ----------- | ------------- |
@@ -1106,7 +1341,7 @@ regions: [Region.FLY_AMS, Region.FLY_IAD, Region.KOYEB_FRA];
1106
1341
  | `KOYEB_TYO` | Tokyo |
1107
1342
  | `KOYEB_WAS` | Washington |
1108
1343
 
1109
- ### Railway Regions
1344
+ #### Railway Regions (4)
1110
1345
 
1111
1346
  | Enum Value | Location |
1112
1347
  | ------------------------- | -------------- |
@@ -1115,6 +1350,155 @@ regions: [Region.FLY_AMS, Region.FLY_IAD, Region.KOYEB_FRA];
1115
1350
  | `RAILWAY_EUROPE_WEST4` | Europe West |
1116
1351
  | `RAILWAY_ASIA_SOUTHEAST1` | Asia Southeast |
1117
1352
 
1353
+ ---
1354
+
1355
+ ### Enums
1356
+
1357
+ #### Periodicity
1358
+
1359
+ | Value | Description |
1360
+ | ----------------- | ----------- |
1361
+ | `PERIODICITY_30S` | Every 30s |
1362
+ | `PERIODICITY_1M` | Every 1m |
1363
+ | `PERIODICITY_5M` | Every 5m |
1364
+ | `PERIODICITY_10M` | Every 10m |
1365
+ | `PERIODICITY_30M` | Every 30m |
1366
+ | `PERIODICITY_1H` | Every 1h |
1367
+
1368
+ #### HTTPMethod
1369
+
1370
+ | Value | Description |
1371
+ | --------------------- | ----------- |
1372
+ | `HTTP_METHOD_GET` | GET |
1373
+ | `HTTP_METHOD_POST` | POST |
1374
+ | `HTTP_METHOD_HEAD` | HEAD |
1375
+ | `HTTP_METHOD_PUT` | PUT |
1376
+ | `HTTP_METHOD_PATCH` | PATCH |
1377
+ | `HTTP_METHOD_DELETE` | DELETE |
1378
+ | `HTTP_METHOD_TRACE` | TRACE |
1379
+ | `HTTP_METHOD_CONNECT` | CONNECT |
1380
+ | `HTTP_METHOD_OPTIONS` | OPTIONS |
1381
+
1382
+ #### MonitorStatus
1383
+
1384
+ | Value | Description |
1385
+ | ---------- | ------------------------ |
1386
+ | `ACTIVE` | Monitor is healthy |
1387
+ | `DEGRADED` | Latency threshold exceeded |
1388
+ | `ERROR` | Monitor is failing |
1389
+
1390
+ #### TimeRange
1391
+
1392
+ | Value | Description |
1393
+ | ----------------- | ----------- |
1394
+ | `TIME_RANGE_1D` | Last 1 day |
1395
+ | `TIME_RANGE_7D` | Last 7 days |
1396
+ | `TIME_RANGE_14D` | Last 14 days|
1397
+
1398
+ #### StatusReportStatus
1399
+
1400
+ | Value | Description |
1401
+ | --------------- | -------------------------------- |
1402
+ | `INVESTIGATING` | Actively investigating the issue |
1403
+ | `IDENTIFIED` | Root cause has been identified |
1404
+ | `MONITORING` | Fix deployed, monitoring |
1405
+ | `RESOLVED` | Issue fully resolved |
1406
+
1407
+ #### OverallStatus
1408
+
1409
+ | Value | Description |
1410
+ | ---------------- | --------------------------- |
1411
+ | `OPERATIONAL` | All systems operational |
1412
+ | `DEGRADED` | Performance is degraded |
1413
+ | `PARTIAL_OUTAGE` | Some systems are down |
1414
+ | `MAJOR_OUTAGE` | Major systems are down |
1415
+ | `MAINTENANCE` | Scheduled maintenance |
1416
+ | `UNKNOWN` | Status cannot be determined |
1417
+
1418
+ #### NotificationProvider
1419
+
1420
+ | Value | Description |
1421
+ | ---------------- | ------------------- |
1422
+ | `DISCORD` | Discord webhook |
1423
+ | `EMAIL` | Email notification |
1424
+ | `GOOGLE_CHAT` | Google Chat webhook |
1425
+ | `GRAFANA_ONCALL` | Grafana OnCall |
1426
+ | `NTFY` | Ntfy push service |
1427
+ | `PAGERDUTY` | PagerDuty |
1428
+ | `OPSGENIE` | Opsgenie |
1429
+ | `SLACK` | Slack webhook |
1430
+ | `SMS` | SMS notification |
1431
+ | `TELEGRAM` | Telegram bot |
1432
+ | `WEBHOOK` | Custom webhook |
1433
+ | `WHATSAPP` | WhatsApp |
1434
+
1435
+ #### OpsgenieRegion
1436
+
1437
+ | Value | Description |
1438
+ | ----- | ----------- |
1439
+ | `US` | US region |
1440
+ | `EU` | EU region |
1441
+
1442
+ #### PageAccessType
1443
+
1444
+ | Value | Description |
1445
+ | -------------------- | ----------------------- |
1446
+ | `PUBLIC` | Publicly accessible |
1447
+ | `PASSWORD_PROTECTED` | Requires password |
1448
+ | `AUTHENTICATED` | Requires authentication |
1449
+
1450
+ #### PageTheme
1451
+
1452
+ | Value | Description |
1453
+ | -------- | ------------------- |
1454
+ | `SYSTEM` | Follow system theme |
1455
+ | `LIGHT` | Light theme |
1456
+ | `DARK` | Dark theme |
1457
+
1458
+ #### PageComponentType
1459
+
1460
+ | Value | Description |
1461
+ | --------- | ------------------------- |
1462
+ | `MONITOR` | Linked to a monitor |
1463
+ | `STATIC` | Static component (manual) |
1464
+
1465
+ #### NumberComparator
1466
+
1467
+ | Value | Description |
1468
+ | ----------------------- | --------------------- |
1469
+ | `EQUAL` | Equal to target |
1470
+ | `NOT_EQUAL` | Not equal to target |
1471
+ | `GREATER_THAN` | Greater than target |
1472
+ | `GREATER_THAN_OR_EQUAL` | Greater than or equal |
1473
+ | `LESS_THAN` | Less than target |
1474
+ | `LESS_THAN_OR_EQUAL` | Less than or equal |
1475
+
1476
+ #### StringComparator
1477
+
1478
+ | Value | Description |
1479
+ | ----------------------- | --------------------------- |
1480
+ | `CONTAINS` | Contains target string |
1481
+ | `NOT_CONTAINS` | Does not contain target |
1482
+ | `EQUAL` | Equal to target |
1483
+ | `NOT_EQUAL` | Not equal to target |
1484
+ | `EMPTY` | Value is empty |
1485
+ | `NOT_EMPTY` | Value is not empty |
1486
+ | `GREATER_THAN` | Lexicographically greater |
1487
+ | `GREATER_THAN_OR_EQUAL` | Lexicographically >= target |
1488
+ | `LESS_THAN` | Lexicographically less |
1489
+ | `LESS_THAN_OR_EQUAL` | Lexicographically <= target |
1490
+
1491
+ #### RecordComparator
1492
+
1493
+ | Value | Description |
1494
+ | -------------- | ----------------------- |
1495
+ | `EQUAL` | Equal to target |
1496
+ | `NOT_EQUAL` | Not equal to target |
1497
+ | `CONTAINS` | Contains target string |
1498
+ | `NOT_CONTAINS` | Does not contain target |
1499
+
1500
+ ---
1501
+
1118
1502
  ## Error Handling
1119
1503
 
1120
1504
  The SDK uses Connect RPC. Errors include a `code` and `message`: