Openstatus sdk www.openstatus.dev

Notification (#9)

* notification

* improve readme

authored by

Thibault Le Ouay and committed by
GitHub
bdeecf0b 3294c4f5

+2189 -440
+1
.github/workflows/publish.yml
··· 47 47 run: npm publish --access public --provenance 48 48 env: 49 49 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 50 + NPM_CONFIG_PROVENANCE: true
+824 -440
README.md
··· 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 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 25 54 26 - - **Global Regions** - Monitor from 28 locations worldwide 55 + ### Developer Experience 56 + 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 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 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 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 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 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 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 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 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 ``` 341 + 342 + --- 318 343 319 344 ### Health Service 320 345 ··· 326 351 const { status } = await openstatus.health.v1.HealthService.check({}); 327 352 console.log(ServingStatus[status]); // "SERVING" 328 353 ``` 354 + 355 + --- 329 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 729 } 734 730 ``` 735 731 732 + --- 733 + 736 734 ### Maintenance Service 737 735 738 736 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 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 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 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", 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 + ); 805 + ``` 806 + 807 + #### `deleteMaintenance(request, options)` 808 + 809 + Delete a maintenance window. 810 + 811 + ```typescript 812 + const { success } = await openstatus.maintenance.v1.MaintenanceService.deleteMaintenance( 813 + { id: "maint_123" }, 814 + { headers }, 815 + ); 816 + ``` 817 + 818 + --- 819 + 820 + ### Notification Service 821 + 822 + Manage notification channels for monitor alerts. Supports 12 providers including 823 + Slack, Discord, Email, PagerDuty, and custom webhooks. 824 + 825 + #### `createNotification(request, options)` 826 + 827 + Create a new notification channel. 828 + 829 + ```typescript 830 + import { NotificationProvider } from "@openstatus/sdk-node"; 831 + 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 + }, 807 841 }, 842 + monitorIds: ["mon_123", "mon_456"], 843 + }, 844 + { headers }, 845 + ); 846 + 847 + console.log(`Notification created: ${notification?.id}`); 848 + ``` 849 + 850 + #### `getNotification(request, options)` 851 + 852 + Get a notification channel by ID. 853 + 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 }, 808 874 { headers }, 809 875 ); 876 + 877 + console.log(`Found ${totalSize} notification channels`); 810 878 ``` 811 879 812 - #### `deleteMaintenance(request, options)` 880 + #### `updateNotification(request, options)` 813 881 814 - Delete a maintenance window. 882 + Update a notification channel. 815 883 816 884 ```typescript 817 - const { success } = await openstatus.maintenance.v1.MaintenanceService 818 - .deleteMaintenance( 819 - { id: "maint_123" }, 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 + }, 820 924 { headers }, 821 925 ); 926 + 927 + if (success) { 928 + console.log("Test notification sent successfully"); 929 + } else { 930 + console.log(`Test failed: ${errorMessage}`); 931 + } 822 932 ``` 823 933 824 - ### Status Page Options 934 + #### `checkNotificationLimit(request, options)` 825 935 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 | 936 + Check if the workspace has reached its notification limit. 833 937 834 - ### Page Access Type 938 + ```typescript 939 + const { limitReached, currentCount, maxCount } = 940 + await openstatus.notification.v1.NotificationService.checkNotificationLimit({}, { headers }); 835 941 836 - | Enum Value | Description | 837 - | -------------------- | ----------------------- | 838 - | `UNSPECIFIED` | Default/unspecified | 839 - | `PUBLIC` | Publicly accessible | 840 - | `PASSWORD_PROTECTED` | Requires password | 841 - | `AUTHENTICATED` | Requires authentication | 942 + console.log(`${currentCount}/${maxCount} notification channels used`); 943 + ``` 842 944 843 - ### Page Theme 945 + #### Provider Configuration Examples 844 946 845 - | Enum Value | Description | 846 - | ------------- | ------------------- | 847 - | `UNSPECIFIED` | Default/unspecified | 848 - | `SYSTEM` | Follow system theme | 849 - | `LIGHT` | Light theme | 850 - | `DARK` | Dark theme | 947 + <details> 948 + <summary><strong>Slack</strong></summary> 851 949 852 - ### Overall Status 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 + ``` 853 961 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 | 962 + </details> 863 963 864 - ### Page Component Type 964 + <details> 965 + <summary><strong>Discord</strong></summary> 865 966 866 - | Enum Value | Description | 867 - | ------------- | ------------------------- | 868 - | `UNSPECIFIED` | Default/unspecified | 869 - | `MONITOR` | Linked to a monitor | 870 - | `STATIC` | Static component (manual) | 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 + ``` 871 978 872 - ## Monitor Options 979 + </details> 873 980 874 - ### HTTP Monitor 981 + <details> 982 + <summary><strong>Email</strong></summary> 875 983 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 | 984 + ```typescript 985 + { 986 + provider: NotificationProvider.EMAIL, 987 + data: { 988 + data: { 989 + case: "email", 990 + value: { email: "alerts@example.com" } 991 + } 992 + } 993 + } 994 + ``` 896 995 897 - ### TCP Monitor 996 + </details> 898 997 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 | 998 + <details> 999 + <summary><strong>PagerDuty</strong></summary> 912 1000 913 - ### DNS Monitor 1001 + ```typescript 1002 + { 1003 + provider: NotificationProvider.PAGERDUTY, 1004 + data: { 1005 + data: { 1006 + case: "pagerduty", 1007 + value: { integrationKey: "your-integration-key" } 1008 + } 1009 + } 1010 + } 1011 + ``` 914 1012 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 | 1013 + </details> 929 1014 930 - ### Periodicity 1015 + <details> 1016 + <summary><strong>Opsgenie</strong></summary> 931 1017 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 | 1018 + ```typescript 1019 + import { OpsgenieRegion } from "@openstatus/sdk-node"; 940 1020 941 - ### HTTP Methods 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 + ``` 942 1031 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 | 1032 + </details> 954 1033 955 - ## Assertions 1034 + <details> 1035 + <summary><strong>Telegram</strong></summary> 956 1036 957 - All assertion comparators are exported as enums from the SDK. 1037 + ```typescript 1038 + { 1039 + provider: NotificationProvider.TELEGRAM, 1040 + data: { 1041 + data: { 1042 + case: "telegram", 1043 + value: { chatId: "123456789" } 1044 + } 1045 + } 1046 + } 1047 + ``` 958 1048 959 - ### Status Code Assertions 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 + ``` 1065 + 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 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 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 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 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 + --- 1064 1299 1065 - Monitor from 28 global locations across multiple providers. Use the `Region` 1066 - enum: 1300 + ### Regions 1301 + 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 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 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 | ------------------------- | -------------- | ··· 1114 1349 | `RAILWAY_US_EAST4` | US East | 1115 1350 | `RAILWAY_EUROPE_WEST4` | Europe West | 1116 1351 | `RAILWAY_ASIA_SOUTHEAST1` | Asia Southeast | 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 + --- 1117 1501 1118 1502 ## Error Handling 1119 1503
+4
scripts/build_npm.ts
··· 22 22 bugs: { 23 23 url: "https://github.com/openstatushq/sdk-node/issues", 24 24 }, 25 + publishConfig: { 26 + access: "public", 27 + provenance: true, 28 + }, 25 29 }, 26 30 postBuild() { 27 31 // steps to run after building and before running the tests
+144
src/gen/openstatus/notification/v1/notification_pb.ts
··· 1 + // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=ts" 2 + // @generated from file openstatus/notification/v1/notification.proto (package openstatus.notification.v1, syntax proto3) 3 + /* eslint-disable */ 4 + 5 + import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2"; 6 + import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; 7 + import type { NotificationData, NotificationProvider } from "./providers_pb.ts"; 8 + import { file_openstatus_notification_v1_providers } from "./providers_pb.ts"; 9 + import type { Message } from "@bufbuild/protobuf"; 10 + 11 + /** 12 + * Describes the file openstatus/notification/v1/notification.proto. 13 + */ 14 + export const file_openstatus_notification_v1_notification: 15 + GenFile = /*@__PURE__*/ 16 + fileDesc( 17 + "Ci1vcGVuc3RhdHVzL25vdGlmaWNhdGlvbi92MS9ub3RpZmljYXRpb24ucHJvdG8SGm9wZW5zdGF0dXMubm90aWZpY2F0aW9uLnYxIuUBCgxOb3RpZmljYXRpb24SCgoCaWQYASABKAkSDAoEbmFtZRgCIAEoCRJCCghwcm92aWRlchgDIAEoDjIwLm9wZW5zdGF0dXMubm90aWZpY2F0aW9uLnYxLk5vdGlmaWNhdGlvblByb3ZpZGVyEjoKBGRhdGEYBCABKAsyLC5vcGVuc3RhdHVzLm5vdGlmaWNhdGlvbi52MS5Ob3RpZmljYXRpb25EYXRhEhMKC21vbml0b3JfaWRzGAUgAygJEhIKCmNyZWF0ZWRfYXQYBiABKAkSEgoKdXBkYXRlZF9hdBgHIAEoCSKyAQoTTm90aWZpY2F0aW9uU3VtbWFyeRIKCgJpZBgBIAEoCRIMCgRuYW1lGAIgASgJEkIKCHByb3ZpZGVyGAMgASgOMjAub3BlbnN0YXR1cy5ub3RpZmljYXRpb24udjEuTm90aWZpY2F0aW9uUHJvdmlkZXISFQoNbW9uaXRvcl9jb3VudBgEIAEoBRISCgpjcmVhdGVkX2F0GAUgASgJEhIKCnVwZGF0ZWRfYXQYBiABKAlCXVpbZ2l0aHViLmNvbS9vcGVuc3RhdHVzaHEvb3BlbnN0YXR1cy9wYWNrYWdlcy9wcm90by9vcGVuc3RhdHVzL25vdGlmaWNhdGlvbi92MTtub3RpZmljYXRpb252MWIGcHJvdG8z", 18 + [file_openstatus_notification_v1_providers], 19 + ); 20 + 21 + /** 22 + * Notification represents a notification channel with full details. 23 + * 24 + * @generated from message openstatus.notification.v1.Notification 25 + */ 26 + export type Notification = 27 + & Message<"openstatus.notification.v1.Notification"> 28 + & { 29 + /** 30 + * Unique identifier for the notification. 31 + * 32 + * @generated from field: string id = 1; 33 + */ 34 + id: string; 35 + 36 + /** 37 + * Display name for the notification channel. 38 + * 39 + * @generated from field: string name = 2; 40 + */ 41 + name: string; 42 + 43 + /** 44 + * Provider type. 45 + * 46 + * @generated from field: openstatus.notification.v1.NotificationProvider provider = 3; 47 + */ 48 + provider: NotificationProvider; 49 + 50 + /** 51 + * Provider-specific configuration. 52 + * 53 + * @generated from field: openstatus.notification.v1.NotificationData data = 4; 54 + */ 55 + data?: NotificationData; 56 + 57 + /** 58 + * IDs of monitors associated with this notification. 59 + * 60 + * @generated from field: repeated string monitor_ids = 5; 61 + */ 62 + monitorIds: string[]; 63 + 64 + /** 65 + * Timestamp when the notification was created (RFC 3339). 66 + * 67 + * @generated from field: string created_at = 6; 68 + */ 69 + createdAt: string; 70 + 71 + /** 72 + * Timestamp when the notification was last updated (RFC 3339). 73 + * 74 + * @generated from field: string updated_at = 7; 75 + */ 76 + updatedAt: string; 77 + }; 78 + 79 + /** 80 + * Describes the message openstatus.notification.v1.Notification. 81 + * Use `create(NotificationSchema)` to create a new message. 82 + */ 83 + export const NotificationSchema: GenMessage<Notification> = /*@__PURE__*/ 84 + messageDesc(file_openstatus_notification_v1_notification, 0); 85 + 86 + /** 87 + * NotificationSummary represents a notification channel summary for list responses. 88 + * 89 + * @generated from message openstatus.notification.v1.NotificationSummary 90 + */ 91 + export type NotificationSummary = 92 + & Message<"openstatus.notification.v1.NotificationSummary"> 93 + & { 94 + /** 95 + * Unique identifier for the notification. 96 + * 97 + * @generated from field: string id = 1; 98 + */ 99 + id: string; 100 + 101 + /** 102 + * Display name for the notification channel. 103 + * 104 + * @generated from field: string name = 2; 105 + */ 106 + name: string; 107 + 108 + /** 109 + * Provider type. 110 + * 111 + * @generated from field: openstatus.notification.v1.NotificationProvider provider = 3; 112 + */ 113 + provider: NotificationProvider; 114 + 115 + /** 116 + * Number of monitors associated with this notification. 117 + * 118 + * @generated from field: int32 monitor_count = 4; 119 + */ 120 + monitorCount: number; 121 + 122 + /** 123 + * Timestamp when the notification was created (RFC 3339). 124 + * 125 + * @generated from field: string created_at = 5; 126 + */ 127 + createdAt: string; 128 + 129 + /** 130 + * Timestamp when the notification was last updated (RFC 3339). 131 + * 132 + * @generated from field: string updated_at = 6; 133 + */ 134 + updatedAt: string; 135 + }; 136 + 137 + /** 138 + * Describes the message openstatus.notification.v1.NotificationSummary. 139 + * Use `create(NotificationSummarySchema)` to create a new message. 140 + */ 141 + export const NotificationSummarySchema: GenMessage< 142 + NotificationSummary 143 + > = /*@__PURE__*/ 144 + messageDesc(file_openstatus_notification_v1_notification, 1);
+604
src/gen/openstatus/notification/v1/providers_pb.ts
··· 1 + // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=ts" 2 + // @generated from file openstatus/notification/v1/providers.proto (package openstatus.notification.v1, syntax proto3) 3 + /* eslint-disable */ 4 + 5 + import type { 6 + GenEnum, 7 + GenFile, 8 + GenMessage, 9 + } from "@bufbuild/protobuf/codegenv2"; 10 + import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; 11 + import { file_buf_validate_validate } from "../../../buf/validate/validate_pb.ts"; 12 + import type { Message } from "@bufbuild/protobuf"; 13 + 14 + /** 15 + * Describes the file openstatus/notification/v1/providers.proto. 16 + */ 17 + export const file_openstatus_notification_v1_providers: GenFile = /*@__PURE__*/ 18 + fileDesc( 19 + "CipvcGVuc3RhdHVzL25vdGlmaWNhdGlvbi92MS9wcm92aWRlcnMucHJvdG8SGm9wZW5zdGF0dXMubm90aWZpY2F0aW9uLnYxIiwKC0Rpc2NvcmREYXRhEh0KC3dlYmhvb2tfdXJsGAEgASgJQgi6SAVyA4gBASIjCglFbWFpbERhdGESFgoFZW1haWwYASABKAlCB7pIBHICYAEiLwoOR29vZ2xlQ2hhdERhdGESHQoLd2ViaG9va191cmwYASABKAlCCLpIBXIDiAEBIjIKEUdyYWZhbmFPbmNhbGxEYXRhEh0KC3dlYmhvb2tfdXJsGAEgASgJQgi6SAVyA4gBASJUCghOdGZ5RGF0YRIWCgV0b3BpYxgBIAEoCUIHukgEcgIQARISCgpzZXJ2ZXJfdXJsGAIgASgJEhIKBXRva2VuGAMgASgJSACIAQFCCAoGX3Rva2VuIjEKDVBhZ2VyRHV0eURhdGESIAoPaW50ZWdyYXRpb25fa2V5GAEgASgJQge6SARyAhABIm4KDE9wc2dlbmllRGF0YRIYCgdhcGlfa2V5GAEgASgJQge6SARyAhABEkQKBnJlZ2lvbhgCIAEoDjIqLm9wZW5zdGF0dXMubm90aWZpY2F0aW9uLnYxLk9wc2dlbmllUmVnaW9uQgi6SAWCAQIQASIqCglTbGFja0RhdGESHQoLd2ViaG9va191cmwYASABKAlCCLpIBXIDiAEBIigKB1Ntc0RhdGESHQoMcGhvbmVfbnVtYmVyGAEgASgJQge6SARyAhABIigKDFRlbGVncmFtRGF0YRIYCgdjaGF0X2lkGAEgASgJQge6SARyAhABIjQKDVdlYmhvb2tIZWFkZXISFAoDa2V5GAEgASgJQge6SARyAhABEg0KBXZhbHVlGAIgASgJImUKC1dlYmhvb2tEYXRhEhoKCGVuZHBvaW50GAEgASgJQgi6SAVyA4gBARI6CgdoZWFkZXJzGAIgAygLMikub3BlbnN0YXR1cy5ub3RpZmljYXRpb24udjEuV2ViaG9va0hlYWRlciItCgxXaGF0c2FwcERhdGESHQoMcGhvbmVfbnVtYmVyGAEgASgJQge6SARyAhABIvIFChBOb3RpZmljYXRpb25EYXRhEjoKB2Rpc2NvcmQYASABKAsyJy5vcGVuc3RhdHVzLm5vdGlmaWNhdGlvbi52MS5EaXNjb3JkRGF0YUgAEjYKBWVtYWlsGAIgASgLMiUub3BlbnN0YXR1cy5ub3RpZmljYXRpb24udjEuRW1haWxEYXRhSAASQQoLZ29vZ2xlX2NoYXQYAyABKAsyKi5vcGVuc3RhdHVzLm5vdGlmaWNhdGlvbi52MS5Hb29nbGVDaGF0RGF0YUgAEkcKDmdyYWZhbmFfb25jYWxsGAQgASgLMi0ub3BlbnN0YXR1cy5ub3RpZmljYXRpb24udjEuR3JhZmFuYU9uY2FsbERhdGFIABI0CgRudGZ5GAUgASgLMiQub3BlbnN0YXR1cy5ub3RpZmljYXRpb24udjEuTnRmeURhdGFIABI+CglwYWdlcmR1dHkYBiABKAsyKS5vcGVuc3RhdHVzLm5vdGlmaWNhdGlvbi52MS5QYWdlckR1dHlEYXRhSAASPAoIb3BzZ2VuaWUYByABKAsyKC5vcGVuc3RhdHVzLm5vdGlmaWNhdGlvbi52MS5PcHNnZW5pZURhdGFIABI2CgVzbGFjaxgIIAEoCzIlLm9wZW5zdGF0dXMubm90aWZpY2F0aW9uLnYxLlNsYWNrRGF0YUgAEjIKA3NtcxgJIAEoCzIjLm9wZW5zdGF0dXMubm90aWZpY2F0aW9uLnYxLlNtc0RhdGFIABI8Cgh0ZWxlZ3JhbRgKIAEoCzIoLm9wZW5zdGF0dXMubm90aWZpY2F0aW9uLnYxLlRlbGVncmFtRGF0YUgAEjoKB3dlYmhvb2sYCyABKAsyJy5vcGVuc3RhdHVzLm5vdGlmaWNhdGlvbi52MS5XZWJob29rRGF0YUgAEjwKCHdoYXRzYXBwGAwgASgLMigub3BlbnN0YXR1cy5ub3RpZmljYXRpb24udjEuV2hhdHNhcHBEYXRhSABCBgoEZGF0YSrmAwoUTm90aWZpY2F0aW9uUHJvdmlkZXISJQohTk9USUZJQ0FUSU9OX1BST1ZJREVSX1VOU1BFQ0lGSUVEEAASIQodTk9USUZJQ0FUSU9OX1BST1ZJREVSX0RJU0NPUkQQARIfChtOT1RJRklDQVRJT05fUFJPVklERVJfRU1BSUwQAhIlCiFOT1RJRklDQVRJT05fUFJPVklERVJfR09PR0xFX0NIQVQQAxIoCiROT1RJRklDQVRJT05fUFJPVklERVJfR1JBRkFOQV9PTkNBTEwQBBIeChpOT1RJRklDQVRJT05fUFJPVklERVJfTlRGWRAFEiMKH05PVElGSUNBVElPTl9QUk9WSURFUl9QQUdFUkRVVFkQBhIiCh5OT1RJRklDQVRJT05fUFJPVklERVJfT1BTR0VOSUUQBxIfChtOT1RJRklDQVRJT05fUFJPVklERVJfU0xBQ0sQCBIdChlOT1RJRklDQVRJT05fUFJPVklERVJfU01TEAkSIgoeTk9USUZJQ0FUSU9OX1BST1ZJREVSX1RFTEVHUkFNEAoSIQodTk9USUZJQ0FUSU9OX1BST1ZJREVSX1dFQkhPT0sQCxIiCh5OT1RJRklDQVRJT05fUFJPVklERVJfV0hBVFNBUFAQDCphCg5PcHNnZW5pZVJlZ2lvbhIfChtPUFNHRU5JRV9SRUdJT05fVU5TUEVDSUZJRUQQABIWChJPUFNHRU5JRV9SRUdJT05fVVMQARIWChJPUFNHRU5JRV9SRUdJT05fRVUQAkJdWltnaXRodWIuY29tL29wZW5zdGF0dXNocS9vcGVuc3RhdHVzL3BhY2thZ2VzL3Byb3RvL29wZW5zdGF0dXMvbm90aWZpY2F0aW9uL3YxO25vdGlmaWNhdGlvbnYxYgZwcm90bzM", 20 + [file_buf_validate_validate], 21 + ); 22 + 23 + /** 24 + * DiscordData contains configuration for Discord notifications. 25 + * 26 + * @generated from message openstatus.notification.v1.DiscordData 27 + */ 28 + export type DiscordData = Message<"openstatus.notification.v1.DiscordData"> & { 29 + /** 30 + * Discord webhook URL. 31 + * 32 + * @generated from field: string webhook_url = 1; 33 + */ 34 + webhookUrl: string; 35 + }; 36 + 37 + /** 38 + * Describes the message openstatus.notification.v1.DiscordData. 39 + * Use `create(DiscordDataSchema)` to create a new message. 40 + */ 41 + export const DiscordDataSchema: GenMessage<DiscordData> = /*@__PURE__*/ 42 + messageDesc(file_openstatus_notification_v1_providers, 0); 43 + 44 + /** 45 + * EmailData contains configuration for email notifications. 46 + * 47 + * @generated from message openstatus.notification.v1.EmailData 48 + */ 49 + export type EmailData = Message<"openstatus.notification.v1.EmailData"> & { 50 + /** 51 + * Email address to send notifications to. 52 + * 53 + * @generated from field: string email = 1; 54 + */ 55 + email: string; 56 + }; 57 + 58 + /** 59 + * Describes the message openstatus.notification.v1.EmailData. 60 + * Use `create(EmailDataSchema)` to create a new message. 61 + */ 62 + export const EmailDataSchema: GenMessage<EmailData> = /*@__PURE__*/ 63 + messageDesc(file_openstatus_notification_v1_providers, 1); 64 + 65 + /** 66 + * GoogleChatData contains configuration for Google Chat notifications. 67 + * 68 + * @generated from message openstatus.notification.v1.GoogleChatData 69 + */ 70 + export type GoogleChatData = 71 + & Message<"openstatus.notification.v1.GoogleChatData"> 72 + & { 73 + /** 74 + * Google Chat webhook URL. 75 + * 76 + * @generated from field: string webhook_url = 1; 77 + */ 78 + webhookUrl: string; 79 + }; 80 + 81 + /** 82 + * Describes the message openstatus.notification.v1.GoogleChatData. 83 + * Use `create(GoogleChatDataSchema)` to create a new message. 84 + */ 85 + export const GoogleChatDataSchema: GenMessage<GoogleChatData> = /*@__PURE__*/ 86 + messageDesc(file_openstatus_notification_v1_providers, 2); 87 + 88 + /** 89 + * GrafanaOncallData contains configuration for Grafana OnCall notifications. 90 + * 91 + * @generated from message openstatus.notification.v1.GrafanaOncallData 92 + */ 93 + export type GrafanaOncallData = 94 + & Message<"openstatus.notification.v1.GrafanaOncallData"> 95 + & { 96 + /** 97 + * Grafana OnCall webhook URL. 98 + * 99 + * @generated from field: string webhook_url = 1; 100 + */ 101 + webhookUrl: string; 102 + }; 103 + 104 + /** 105 + * Describes the message openstatus.notification.v1.GrafanaOncallData. 106 + * Use `create(GrafanaOncallDataSchema)` to create a new message. 107 + */ 108 + export const GrafanaOncallDataSchema: GenMessage< 109 + GrafanaOncallData 110 + > = /*@__PURE__*/ 111 + messageDesc(file_openstatus_notification_v1_providers, 3); 112 + 113 + /** 114 + * NtfyData contains configuration for Ntfy notifications. 115 + * 116 + * @generated from message openstatus.notification.v1.NtfyData 117 + */ 118 + export type NtfyData = Message<"openstatus.notification.v1.NtfyData"> & { 119 + /** 120 + * Ntfy topic to publish to. 121 + * 122 + * @generated from field: string topic = 1; 123 + */ 124 + topic: string; 125 + 126 + /** 127 + * Ntfy server URL (defaults to https://ntfy.sh). 128 + * 129 + * @generated from field: string server_url = 2; 130 + */ 131 + serverUrl: string; 132 + 133 + /** 134 + * Optional authentication token. 135 + * 136 + * @generated from field: optional string token = 3; 137 + */ 138 + token?: string; 139 + }; 140 + 141 + /** 142 + * Describes the message openstatus.notification.v1.NtfyData. 143 + * Use `create(NtfyDataSchema)` to create a new message. 144 + */ 145 + export const NtfyDataSchema: GenMessage<NtfyData> = /*@__PURE__*/ 146 + messageDesc(file_openstatus_notification_v1_providers, 4); 147 + 148 + /** 149 + * PagerDutyData contains configuration for PagerDuty notifications. 150 + * 151 + * @generated from message openstatus.notification.v1.PagerDutyData 152 + */ 153 + export type PagerDutyData = 154 + & Message<"openstatus.notification.v1.PagerDutyData"> 155 + & { 156 + /** 157 + * PagerDuty integration key. 158 + * 159 + * @generated from field: string integration_key = 1; 160 + */ 161 + integrationKey: string; 162 + }; 163 + 164 + /** 165 + * Describes the message openstatus.notification.v1.PagerDutyData. 166 + * Use `create(PagerDutyDataSchema)` to create a new message. 167 + */ 168 + export const PagerDutyDataSchema: GenMessage<PagerDutyData> = /*@__PURE__*/ 169 + messageDesc(file_openstatus_notification_v1_providers, 5); 170 + 171 + /** 172 + * OpsgenieData contains configuration for Opsgenie notifications. 173 + * 174 + * @generated from message openstatus.notification.v1.OpsgenieData 175 + */ 176 + export type OpsgenieData = 177 + & Message<"openstatus.notification.v1.OpsgenieData"> 178 + & { 179 + /** 180 + * Opsgenie API key. 181 + * 182 + * @generated from field: string api_key = 1; 183 + */ 184 + apiKey: string; 185 + 186 + /** 187 + * Opsgenie region. 188 + * 189 + * @generated from field: openstatus.notification.v1.OpsgenieRegion region = 2; 190 + */ 191 + region: OpsgenieRegion; 192 + }; 193 + 194 + /** 195 + * Describes the message openstatus.notification.v1.OpsgenieData. 196 + * Use `create(OpsgenieDataSchema)` to create a new message. 197 + */ 198 + export const OpsgenieDataSchema: GenMessage<OpsgenieData> = /*@__PURE__*/ 199 + messageDesc(file_openstatus_notification_v1_providers, 6); 200 + 201 + /** 202 + * SlackData contains configuration for Slack notifications. 203 + * 204 + * @generated from message openstatus.notification.v1.SlackData 205 + */ 206 + export type SlackData = Message<"openstatus.notification.v1.SlackData"> & { 207 + /** 208 + * Slack webhook URL. 209 + * 210 + * @generated from field: string webhook_url = 1; 211 + */ 212 + webhookUrl: string; 213 + }; 214 + 215 + /** 216 + * Describes the message openstatus.notification.v1.SlackData. 217 + * Use `create(SlackDataSchema)` to create a new message. 218 + */ 219 + export const SlackDataSchema: GenMessage<SlackData> = /*@__PURE__*/ 220 + messageDesc(file_openstatus_notification_v1_providers, 7); 221 + 222 + /** 223 + * SmsData contains configuration for SMS notifications. 224 + * 225 + * @generated from message openstatus.notification.v1.SmsData 226 + */ 227 + export type SmsData = Message<"openstatus.notification.v1.SmsData"> & { 228 + /** 229 + * Phone number to send SMS to. 230 + * 231 + * @generated from field: string phone_number = 1; 232 + */ 233 + phoneNumber: string; 234 + }; 235 + 236 + /** 237 + * Describes the message openstatus.notification.v1.SmsData. 238 + * Use `create(SmsDataSchema)` to create a new message. 239 + */ 240 + export const SmsDataSchema: GenMessage<SmsData> = /*@__PURE__*/ 241 + messageDesc(file_openstatus_notification_v1_providers, 8); 242 + 243 + /** 244 + * TelegramData contains configuration for Telegram notifications. 245 + * 246 + * @generated from message openstatus.notification.v1.TelegramData 247 + */ 248 + export type TelegramData = 249 + & Message<"openstatus.notification.v1.TelegramData"> 250 + & { 251 + /** 252 + * Telegram chat ID. 253 + * 254 + * @generated from field: string chat_id = 1; 255 + */ 256 + chatId: string; 257 + }; 258 + 259 + /** 260 + * Describes the message openstatus.notification.v1.TelegramData. 261 + * Use `create(TelegramDataSchema)` to create a new message. 262 + */ 263 + export const TelegramDataSchema: GenMessage<TelegramData> = /*@__PURE__*/ 264 + messageDesc(file_openstatus_notification_v1_providers, 9); 265 + 266 + /** 267 + * WebhookHeader represents a custom header for webhook requests. 268 + * 269 + * @generated from message openstatus.notification.v1.WebhookHeader 270 + */ 271 + export type WebhookHeader = 272 + & Message<"openstatus.notification.v1.WebhookHeader"> 273 + & { 274 + /** 275 + * Header name. 276 + * 277 + * @generated from field: string key = 1; 278 + */ 279 + key: string; 280 + 281 + /** 282 + * Header value. 283 + * 284 + * @generated from field: string value = 2; 285 + */ 286 + value: string; 287 + }; 288 + 289 + /** 290 + * Describes the message openstatus.notification.v1.WebhookHeader. 291 + * Use `create(WebhookHeaderSchema)` to create a new message. 292 + */ 293 + export const WebhookHeaderSchema: GenMessage<WebhookHeader> = /*@__PURE__*/ 294 + messageDesc(file_openstatus_notification_v1_providers, 10); 295 + 296 + /** 297 + * WebhookData contains configuration for custom webhook notifications. 298 + * 299 + * @generated from message openstatus.notification.v1.WebhookData 300 + */ 301 + export type WebhookData = Message<"openstatus.notification.v1.WebhookData"> & { 302 + /** 303 + * Webhook endpoint URL. 304 + * 305 + * @generated from field: string endpoint = 1; 306 + */ 307 + endpoint: string; 308 + 309 + /** 310 + * Optional custom headers. 311 + * 312 + * @generated from field: repeated openstatus.notification.v1.WebhookHeader headers = 2; 313 + */ 314 + headers: WebhookHeader[]; 315 + }; 316 + 317 + /** 318 + * Describes the message openstatus.notification.v1.WebhookData. 319 + * Use `create(WebhookDataSchema)` to create a new message. 320 + */ 321 + export const WebhookDataSchema: GenMessage<WebhookData> = /*@__PURE__*/ 322 + messageDesc(file_openstatus_notification_v1_providers, 11); 323 + 324 + /** 325 + * WhatsappData contains configuration for WhatsApp notifications. 326 + * 327 + * @generated from message openstatus.notification.v1.WhatsappData 328 + */ 329 + export type WhatsappData = 330 + & Message<"openstatus.notification.v1.WhatsappData"> 331 + & { 332 + /** 333 + * Phone number to send WhatsApp messages to. 334 + * 335 + * @generated from field: string phone_number = 1; 336 + */ 337 + phoneNumber: string; 338 + }; 339 + 340 + /** 341 + * Describes the message openstatus.notification.v1.WhatsappData. 342 + * Use `create(WhatsappDataSchema)` to create a new message. 343 + */ 344 + export const WhatsappDataSchema: GenMessage<WhatsappData> = /*@__PURE__*/ 345 + messageDesc(file_openstatus_notification_v1_providers, 12); 346 + 347 + /** 348 + * NotificationData is a union of provider-specific configuration. 349 + * 350 + * @generated from message openstatus.notification.v1.NotificationData 351 + */ 352 + export type NotificationData = 353 + & Message<"openstatus.notification.v1.NotificationData"> 354 + & { 355 + /** 356 + * @generated from oneof openstatus.notification.v1.NotificationData.data 357 + */ 358 + data: { 359 + /** 360 + * Discord configuration. 361 + * 362 + * @generated from field: openstatus.notification.v1.DiscordData discord = 1; 363 + */ 364 + value: DiscordData; 365 + case: "discord"; 366 + } | { 367 + /** 368 + * Email configuration. 369 + * 370 + * @generated from field: openstatus.notification.v1.EmailData email = 2; 371 + */ 372 + value: EmailData; 373 + case: "email"; 374 + } | { 375 + /** 376 + * Google Chat configuration. 377 + * 378 + * @generated from field: openstatus.notification.v1.GoogleChatData google_chat = 3; 379 + */ 380 + value: GoogleChatData; 381 + case: "googleChat"; 382 + } | { 383 + /** 384 + * Grafana OnCall configuration. 385 + * 386 + * @generated from field: openstatus.notification.v1.GrafanaOncallData grafana_oncall = 4; 387 + */ 388 + value: GrafanaOncallData; 389 + case: "grafanaOncall"; 390 + } | { 391 + /** 392 + * Ntfy configuration. 393 + * 394 + * @generated from field: openstatus.notification.v1.NtfyData ntfy = 5; 395 + */ 396 + value: NtfyData; 397 + case: "ntfy"; 398 + } | { 399 + /** 400 + * PagerDuty configuration. 401 + * 402 + * @generated from field: openstatus.notification.v1.PagerDutyData pagerduty = 6; 403 + */ 404 + value: PagerDutyData; 405 + case: "pagerduty"; 406 + } | { 407 + /** 408 + * Opsgenie configuration. 409 + * 410 + * @generated from field: openstatus.notification.v1.OpsgenieData opsgenie = 7; 411 + */ 412 + value: OpsgenieData; 413 + case: "opsgenie"; 414 + } | { 415 + /** 416 + * Slack configuration. 417 + * 418 + * @generated from field: openstatus.notification.v1.SlackData slack = 8; 419 + */ 420 + value: SlackData; 421 + case: "slack"; 422 + } | { 423 + /** 424 + * SMS configuration. 425 + * 426 + * @generated from field: openstatus.notification.v1.SmsData sms = 9; 427 + */ 428 + value: SmsData; 429 + case: "sms"; 430 + } | { 431 + /** 432 + * Telegram configuration. 433 + * 434 + * @generated from field: openstatus.notification.v1.TelegramData telegram = 10; 435 + */ 436 + value: TelegramData; 437 + case: "telegram"; 438 + } | { 439 + /** 440 + * Webhook configuration. 441 + * 442 + * @generated from field: openstatus.notification.v1.WebhookData webhook = 11; 443 + */ 444 + value: WebhookData; 445 + case: "webhook"; 446 + } | { 447 + /** 448 + * WhatsApp configuration. 449 + * 450 + * @generated from field: openstatus.notification.v1.WhatsappData whatsapp = 12; 451 + */ 452 + value: WhatsappData; 453 + case: "whatsapp"; 454 + } | { case: undefined; value?: undefined }; 455 + }; 456 + 457 + /** 458 + * Describes the message openstatus.notification.v1.NotificationData. 459 + * Use `create(NotificationDataSchema)` to create a new message. 460 + */ 461 + export const NotificationDataSchema: GenMessage< 462 + NotificationData 463 + > = /*@__PURE__*/ 464 + messageDesc(file_openstatus_notification_v1_providers, 13); 465 + 466 + /** 467 + * NotificationProvider represents the supported notification channel types. 468 + * 469 + * @generated from enum openstatus.notification.v1.NotificationProvider 470 + */ 471 + export enum NotificationProvider { 472 + /** 473 + * Unspecified provider. 474 + * 475 + * @generated from enum value: NOTIFICATION_PROVIDER_UNSPECIFIED = 0; 476 + */ 477 + UNSPECIFIED = 0, 478 + 479 + /** 480 + * Discord webhook. 481 + * 482 + * @generated from enum value: NOTIFICATION_PROVIDER_DISCORD = 1; 483 + */ 484 + DISCORD = 1, 485 + 486 + /** 487 + * Email notification. 488 + * 489 + * @generated from enum value: NOTIFICATION_PROVIDER_EMAIL = 2; 490 + */ 491 + EMAIL = 2, 492 + 493 + /** 494 + * Google Chat webhook. 495 + * 496 + * @generated from enum value: NOTIFICATION_PROVIDER_GOOGLE_CHAT = 3; 497 + */ 498 + GOOGLE_CHAT = 3, 499 + 500 + /** 501 + * Grafana OnCall webhook. 502 + * 503 + * @generated from enum value: NOTIFICATION_PROVIDER_GRAFANA_ONCALL = 4; 504 + */ 505 + GRAFANA_ONCALL = 4, 506 + 507 + /** 508 + * Ntfy notification service. 509 + * 510 + * @generated from enum value: NOTIFICATION_PROVIDER_NTFY = 5; 511 + */ 512 + NTFY = 5, 513 + 514 + /** 515 + * PagerDuty integration. 516 + * 517 + * @generated from enum value: NOTIFICATION_PROVIDER_PAGERDUTY = 6; 518 + */ 519 + PAGERDUTY = 6, 520 + 521 + /** 522 + * Opsgenie integration. 523 + * 524 + * @generated from enum value: NOTIFICATION_PROVIDER_OPSGENIE = 7; 525 + */ 526 + OPSGENIE = 7, 527 + 528 + /** 529 + * Slack webhook. 530 + * 531 + * @generated from enum value: NOTIFICATION_PROVIDER_SLACK = 8; 532 + */ 533 + SLACK = 8, 534 + 535 + /** 536 + * SMS notification. 537 + * 538 + * @generated from enum value: NOTIFICATION_PROVIDER_SMS = 9; 539 + */ 540 + SMS = 9, 541 + 542 + /** 543 + * Telegram bot. 544 + * 545 + * @generated from enum value: NOTIFICATION_PROVIDER_TELEGRAM = 10; 546 + */ 547 + TELEGRAM = 10, 548 + 549 + /** 550 + * Custom webhook. 551 + * 552 + * @generated from enum value: NOTIFICATION_PROVIDER_WEBHOOK = 11; 553 + */ 554 + WEBHOOK = 11, 555 + 556 + /** 557 + * WhatsApp notification. 558 + * 559 + * @generated from enum value: NOTIFICATION_PROVIDER_WHATSAPP = 12; 560 + */ 561 + WHATSAPP = 12, 562 + } 563 + 564 + /** 565 + * Describes the enum openstatus.notification.v1.NotificationProvider. 566 + */ 567 + export const NotificationProviderSchema: GenEnum< 568 + NotificationProvider 569 + > = /*@__PURE__*/ 570 + enumDesc(file_openstatus_notification_v1_providers, 0); 571 + 572 + /** 573 + * OpsgenieRegion represents the Opsgenie API region. 574 + * 575 + * @generated from enum openstatus.notification.v1.OpsgenieRegion 576 + */ 577 + export enum OpsgenieRegion { 578 + /** 579 + * Unspecified region. 580 + * 581 + * @generated from enum value: OPSGENIE_REGION_UNSPECIFIED = 0; 582 + */ 583 + UNSPECIFIED = 0, 584 + 585 + /** 586 + * US region. 587 + * 588 + * @generated from enum value: OPSGENIE_REGION_US = 1; 589 + */ 590 + US = 1, 591 + 592 + /** 593 + * EU region. 594 + * 595 + * @generated from enum value: OPSGENIE_REGION_EU = 2; 596 + */ 597 + EU = 2, 598 + } 599 + 600 + /** 601 + * Describes the enum openstatus.notification.v1.OpsgenieRegion. 602 + */ 603 + export const OpsgenieRegionSchema: GenEnum<OpsgenieRegion> = /*@__PURE__*/ 604 + enumDesc(file_openstatus_notification_v1_providers, 1);
+539
src/gen/openstatus/notification/v1/service_pb.ts
··· 1 + // @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=ts" 2 + // @generated from file openstatus/notification/v1/service.proto (package openstatus.notification.v1, syntax proto3) 3 + /* eslint-disable */ 4 + 5 + import type { 6 + GenFile, 7 + GenMessage, 8 + GenService, 9 + } from "@bufbuild/protobuf/codegenv2"; 10 + import { 11 + fileDesc, 12 + messageDesc, 13 + serviceDesc, 14 + } from "@bufbuild/protobuf/codegenv2"; 15 + import { file_buf_validate_validate } from "../../../buf/validate/validate_pb.ts"; 16 + import type { Notification, NotificationSummary } from "./notification_pb.ts"; 17 + import { file_openstatus_notification_v1_notification } from "./notification_pb.ts"; 18 + import type { NotificationData, NotificationProvider } from "./providers_pb.ts"; 19 + import { file_openstatus_notification_v1_providers } from "./providers_pb.ts"; 20 + import type { Message } from "@bufbuild/protobuf"; 21 + 22 + /** 23 + * Describes the file openstatus/notification/v1/service.proto. 24 + */ 25 + export const file_openstatus_notification_v1_service: GenFile = /*@__PURE__*/ 26 + fileDesc( 27 + "CihvcGVuc3RhdHVzL25vdGlmaWNhdGlvbi92MS9zZXJ2aWNlLnByb3RvEhpvcGVuc3RhdHVzLm5vdGlmaWNhdGlvbi52MSLbAQoZQ3JlYXRlTm90aWZpY2F0aW9uUmVxdWVzdBIVCgRuYW1lGAEgASgJQge6SARyAhABEk4KCHByb3ZpZGVyGAIgASgOMjAub3BlbnN0YXR1cy5ub3RpZmljYXRpb24udjEuTm90aWZpY2F0aW9uUHJvdmlkZXJCCrpIB4IBBBABIAASQgoEZGF0YRgDIAEoCzIsLm9wZW5zdGF0dXMubm90aWZpY2F0aW9uLnYxLk5vdGlmaWNhdGlvbkRhdGFCBrpIA8gBARITCgttb25pdG9yX2lkcxgEIAMoCSJcChpDcmVhdGVOb3RpZmljYXRpb25SZXNwb25zZRI+Cgxub3RpZmljYXRpb24YASABKAsyKC5vcGVuc3RhdHVzLm5vdGlmaWNhdGlvbi52MS5Ob3RpZmljYXRpb24iLQoWR2V0Tm90aWZpY2F0aW9uUmVxdWVzdBITCgJpZBgBIAEoCUIHukgEcgIQASJZChdHZXROb3RpZmljYXRpb25SZXNwb25zZRI+Cgxub3RpZmljYXRpb24YASABKAsyKC5vcGVuc3RhdHVzLm5vdGlmaWNhdGlvbi52MS5Ob3RpZmljYXRpb24ibAoYTGlzdE5vdGlmaWNhdGlvbnNSZXF1ZXN0Eh0KBWxpbWl0GAEgASgFQgm6SAYaBBhkKAFIAIgBARIcCgZvZmZzZXQYAiABKAVCB7pIBBoCKABIAYgBAUIICgZfbGltaXRCCQoHX29mZnNldCJ3ChlMaXN0Tm90aWZpY2F0aW9uc1Jlc3BvbnNlEkYKDW5vdGlmaWNhdGlvbnMYASADKAsyLy5vcGVuc3RhdHVzLm5vdGlmaWNhdGlvbi52MS5Ob3RpZmljYXRpb25TdW1tYXJ5EhIKCnRvdGFsX3NpemUYAiABKAUiqwEKGVVwZGF0ZU5vdGlmaWNhdGlvblJlcXVlc3QSEwoCaWQYASABKAlCB7pIBHICEAESEQoEbmFtZRgCIAEoCUgAiAEBEj8KBGRhdGEYAyABKAsyLC5vcGVuc3RhdHVzLm5vdGlmaWNhdGlvbi52MS5Ob3RpZmljYXRpb25EYXRhSAGIAQESEwoLbW9uaXRvcl9pZHMYBCADKAlCBwoFX25hbWVCBwoFX2RhdGEiXAoaVXBkYXRlTm90aWZpY2F0aW9uUmVzcG9uc2USPgoMbm90aWZpY2F0aW9uGAEgASgLMigub3BlbnN0YXR1cy5ub3RpZmljYXRpb24udjEuTm90aWZpY2F0aW9uIjAKGURlbGV0ZU5vdGlmaWNhdGlvblJlcXVlc3QSEwoCaWQYASABKAlCB7pIBHICEAEiLQoaRGVsZXRlTm90aWZpY2F0aW9uUmVzcG9uc2USDwoHc3VjY2VzcxgBIAEoCCKxAQobU2VuZFRlc3ROb3RpZmljYXRpb25SZXF1ZXN0Ek4KCHByb3ZpZGVyGAEgASgOMjAub3BlbnN0YXR1cy5ub3RpZmljYXRpb24udjEuTm90aWZpY2F0aW9uUHJvdmlkZXJCCrpIB4IBBBABIAASQgoEZGF0YRgCIAEoCzIsLm9wZW5zdGF0dXMubm90aWZpY2F0aW9uLnYxLk5vdGlmaWNhdGlvbkRhdGFCBrpIA8gBASJdChxTZW5kVGVzdE5vdGlmaWNhdGlvblJlc3BvbnNlEg8KB3N1Y2Nlc3MYASABKAgSGgoNZXJyb3JfbWVzc2FnZRgCIAEoCUgAiAEBQhAKDl9lcnJvcl9tZXNzYWdlIh8KHUNoZWNrTm90aWZpY2F0aW9uTGltaXRSZXF1ZXN0ImEKHkNoZWNrTm90aWZpY2F0aW9uTGltaXRSZXNwb25zZRIVCg1saW1pdF9yZWFjaGVkGAEgASgIEhUKDWN1cnJlbnRfY291bnQYAiABKAUSEQoJbWF4X2NvdW50GAMgASgFMsQHChNOb3RpZmljYXRpb25TZXJ2aWNlEoMBChJDcmVhdGVOb3RpZmljYXRpb24SNS5vcGVuc3RhdHVzLm5vdGlmaWNhdGlvbi52MS5DcmVhdGVOb3RpZmljYXRpb25SZXF1ZXN0GjYub3BlbnN0YXR1cy5ub3RpZmljYXRpb24udjEuQ3JlYXRlTm90aWZpY2F0aW9uUmVzcG9uc2USegoPR2V0Tm90aWZpY2F0aW9uEjIub3BlbnN0YXR1cy5ub3RpZmljYXRpb24udjEuR2V0Tm90aWZpY2F0aW9uUmVxdWVzdBozLm9wZW5zdGF0dXMubm90aWZpY2F0aW9uLnYxLkdldE5vdGlmaWNhdGlvblJlc3BvbnNlEoABChFMaXN0Tm90aWZpY2F0aW9ucxI0Lm9wZW5zdGF0dXMubm90aWZpY2F0aW9uLnYxLkxpc3ROb3RpZmljYXRpb25zUmVxdWVzdBo1Lm9wZW5zdGF0dXMubm90aWZpY2F0aW9uLnYxLkxpc3ROb3RpZmljYXRpb25zUmVzcG9uc2USgwEKElVwZGF0ZU5vdGlmaWNhdGlvbhI1Lm9wZW5zdGF0dXMubm90aWZpY2F0aW9uLnYxLlVwZGF0ZU5vdGlmaWNhdGlvblJlcXVlc3QaNi5vcGVuc3RhdHVzLm5vdGlmaWNhdGlvbi52MS5VcGRhdGVOb3RpZmljYXRpb25SZXNwb25zZRKDAQoSRGVsZXRlTm90aWZpY2F0aW9uEjUub3BlbnN0YXR1cy5ub3RpZmljYXRpb24udjEuRGVsZXRlTm90aWZpY2F0aW9uUmVxdWVzdBo2Lm9wZW5zdGF0dXMubm90aWZpY2F0aW9uLnYxLkRlbGV0ZU5vdGlmaWNhdGlvblJlc3BvbnNlEokBChRTZW5kVGVzdE5vdGlmaWNhdGlvbhI3Lm9wZW5zdGF0dXMubm90aWZpY2F0aW9uLnYxLlNlbmRUZXN0Tm90aWZpY2F0aW9uUmVxdWVzdBo4Lm9wZW5zdGF0dXMubm90aWZpY2F0aW9uLnYxLlNlbmRUZXN0Tm90aWZpY2F0aW9uUmVzcG9uc2USjwEKFkNoZWNrTm90aWZpY2F0aW9uTGltaXQSOS5vcGVuc3RhdHVzLm5vdGlmaWNhdGlvbi52MS5DaGVja05vdGlmaWNhdGlvbkxpbWl0UmVxdWVzdBo6Lm9wZW5zdGF0dXMubm90aWZpY2F0aW9uLnYxLkNoZWNrTm90aWZpY2F0aW9uTGltaXRSZXNwb25zZUJdWltnaXRodWIuY29tL29wZW5zdGF0dXNocS9vcGVuc3RhdHVzL3BhY2thZ2VzL3Byb3RvL29wZW5zdGF0dXMvbm90aWZpY2F0aW9uL3YxO25vdGlmaWNhdGlvbnYxYgZwcm90bzM", 28 + [ 29 + file_buf_validate_validate, 30 + file_openstatus_notification_v1_notification, 31 + file_openstatus_notification_v1_providers, 32 + ], 33 + ); 34 + 35 + /** 36 + * CreateNotificationRequest is the request to create a new notification channel. 37 + * 38 + * @generated from message openstatus.notification.v1.CreateNotificationRequest 39 + */ 40 + export type CreateNotificationRequest = 41 + & Message<"openstatus.notification.v1.CreateNotificationRequest"> 42 + & { 43 + /** 44 + * Display name for the notification channel. 45 + * 46 + * @generated from field: string name = 1; 47 + */ 48 + name: string; 49 + 50 + /** 51 + * Provider type. 52 + * 53 + * @generated from field: openstatus.notification.v1.NotificationProvider provider = 2; 54 + */ 55 + provider: NotificationProvider; 56 + 57 + /** 58 + * Provider-specific configuration. 59 + * 60 + * @generated from field: openstatus.notification.v1.NotificationData data = 3; 61 + */ 62 + data?: NotificationData; 63 + 64 + /** 65 + * IDs of monitors to associate with this notification. 66 + * 67 + * @generated from field: repeated string monitor_ids = 4; 68 + */ 69 + monitorIds: string[]; 70 + }; 71 + 72 + /** 73 + * Describes the message openstatus.notification.v1.CreateNotificationRequest. 74 + * Use `create(CreateNotificationRequestSchema)` to create a new message. 75 + */ 76 + export const CreateNotificationRequestSchema: GenMessage< 77 + CreateNotificationRequest 78 + > = /*@__PURE__*/ 79 + messageDesc(file_openstatus_notification_v1_service, 0); 80 + 81 + /** 82 + * CreateNotificationResponse is the response after creating a notification channel. 83 + * 84 + * @generated from message openstatus.notification.v1.CreateNotificationResponse 85 + */ 86 + export type CreateNotificationResponse = 87 + & Message<"openstatus.notification.v1.CreateNotificationResponse"> 88 + & { 89 + /** 90 + * The created notification channel. 91 + * 92 + * @generated from field: openstatus.notification.v1.Notification notification = 1; 93 + */ 94 + notification?: Notification; 95 + }; 96 + 97 + /** 98 + * Describes the message openstatus.notification.v1.CreateNotificationResponse. 99 + * Use `create(CreateNotificationResponseSchema)` to create a new message. 100 + */ 101 + export const CreateNotificationResponseSchema: GenMessage< 102 + CreateNotificationResponse 103 + > = /*@__PURE__*/ 104 + messageDesc(file_openstatus_notification_v1_service, 1); 105 + 106 + /** 107 + * GetNotificationRequest is the request to get a notification channel. 108 + * 109 + * @generated from message openstatus.notification.v1.GetNotificationRequest 110 + */ 111 + export type GetNotificationRequest = 112 + & Message<"openstatus.notification.v1.GetNotificationRequest"> 113 + & { 114 + /** 115 + * Notification ID to retrieve (required). 116 + * 117 + * @generated from field: string id = 1; 118 + */ 119 + id: string; 120 + }; 121 + 122 + /** 123 + * Describes the message openstatus.notification.v1.GetNotificationRequest. 124 + * Use `create(GetNotificationRequestSchema)` to create a new message. 125 + */ 126 + export const GetNotificationRequestSchema: GenMessage< 127 + GetNotificationRequest 128 + > = /*@__PURE__*/ 129 + messageDesc(file_openstatus_notification_v1_service, 2); 130 + 131 + /** 132 + * GetNotificationResponse is the response containing the notification channel. 133 + * 134 + * @generated from message openstatus.notification.v1.GetNotificationResponse 135 + */ 136 + export type GetNotificationResponse = 137 + & Message<"openstatus.notification.v1.GetNotificationResponse"> 138 + & { 139 + /** 140 + * The notification channel. 141 + * 142 + * @generated from field: openstatus.notification.v1.Notification notification = 1; 143 + */ 144 + notification?: Notification; 145 + }; 146 + 147 + /** 148 + * Describes the message openstatus.notification.v1.GetNotificationResponse. 149 + * Use `create(GetNotificationResponseSchema)` to create a new message. 150 + */ 151 + export const GetNotificationResponseSchema: GenMessage< 152 + GetNotificationResponse 153 + > = /*@__PURE__*/ 154 + messageDesc(file_openstatus_notification_v1_service, 3); 155 + 156 + /** 157 + * ListNotificationsRequest is the request to list notification channels. 158 + * 159 + * @generated from message openstatus.notification.v1.ListNotificationsRequest 160 + */ 161 + export type ListNotificationsRequest = 162 + & Message<"openstatus.notification.v1.ListNotificationsRequest"> 163 + & { 164 + /** 165 + * Maximum number of notifications to return (1-100, defaults to 50). 166 + * 167 + * @generated from field: optional int32 limit = 1; 168 + */ 169 + limit?: number; 170 + 171 + /** 172 + * Number of notifications to skip for pagination (defaults to 0). 173 + * 174 + * @generated from field: optional int32 offset = 2; 175 + */ 176 + offset?: number; 177 + }; 178 + 179 + /** 180 + * Describes the message openstatus.notification.v1.ListNotificationsRequest. 181 + * Use `create(ListNotificationsRequestSchema)` to create a new message. 182 + */ 183 + export const ListNotificationsRequestSchema: GenMessage< 184 + ListNotificationsRequest 185 + > = /*@__PURE__*/ 186 + messageDesc(file_openstatus_notification_v1_service, 4); 187 + 188 + /** 189 + * ListNotificationsResponse is the response containing notification channels. 190 + * 191 + * @generated from message openstatus.notification.v1.ListNotificationsResponse 192 + */ 193 + export type ListNotificationsResponse = 194 + & Message<"openstatus.notification.v1.ListNotificationsResponse"> 195 + & { 196 + /** 197 + * Notification channel summaries. 198 + * 199 + * @generated from field: repeated openstatus.notification.v1.NotificationSummary notifications = 1; 200 + */ 201 + notifications: NotificationSummary[]; 202 + 203 + /** 204 + * Total number of notification channels. 205 + * 206 + * @generated from field: int32 total_size = 2; 207 + */ 208 + totalSize: number; 209 + }; 210 + 211 + /** 212 + * Describes the message openstatus.notification.v1.ListNotificationsResponse. 213 + * Use `create(ListNotificationsResponseSchema)` to create a new message. 214 + */ 215 + export const ListNotificationsResponseSchema: GenMessage< 216 + ListNotificationsResponse 217 + > = /*@__PURE__*/ 218 + messageDesc(file_openstatus_notification_v1_service, 5); 219 + 220 + /** 221 + * UpdateNotificationRequest is the request to update a notification channel. 222 + * 223 + * @generated from message openstatus.notification.v1.UpdateNotificationRequest 224 + */ 225 + export type UpdateNotificationRequest = 226 + & Message<"openstatus.notification.v1.UpdateNotificationRequest"> 227 + & { 228 + /** 229 + * Notification ID to update (required). 230 + * 231 + * @generated from field: string id = 1; 232 + */ 233 + id: string; 234 + 235 + /** 236 + * Updated display name. 237 + * 238 + * @generated from field: optional string name = 2; 239 + */ 240 + name?: string; 241 + 242 + /** 243 + * Updated provider-specific configuration. 244 + * 245 + * @generated from field: optional openstatus.notification.v1.NotificationData data = 3; 246 + */ 247 + data?: NotificationData; 248 + 249 + /** 250 + * Updated monitor IDs to associate. 251 + * 252 + * @generated from field: repeated string monitor_ids = 4; 253 + */ 254 + monitorIds: string[]; 255 + }; 256 + 257 + /** 258 + * Describes the message openstatus.notification.v1.UpdateNotificationRequest. 259 + * Use `create(UpdateNotificationRequestSchema)` to create a new message. 260 + */ 261 + export const UpdateNotificationRequestSchema: GenMessage< 262 + UpdateNotificationRequest 263 + > = /*@__PURE__*/ 264 + messageDesc(file_openstatus_notification_v1_service, 6); 265 + 266 + /** 267 + * UpdateNotificationResponse is the response after updating a notification channel. 268 + * 269 + * @generated from message openstatus.notification.v1.UpdateNotificationResponse 270 + */ 271 + export type UpdateNotificationResponse = 272 + & Message<"openstatus.notification.v1.UpdateNotificationResponse"> 273 + & { 274 + /** 275 + * The updated notification channel. 276 + * 277 + * @generated from field: openstatus.notification.v1.Notification notification = 1; 278 + */ 279 + notification?: Notification; 280 + }; 281 + 282 + /** 283 + * Describes the message openstatus.notification.v1.UpdateNotificationResponse. 284 + * Use `create(UpdateNotificationResponseSchema)` to create a new message. 285 + */ 286 + export const UpdateNotificationResponseSchema: GenMessage< 287 + UpdateNotificationResponse 288 + > = /*@__PURE__*/ 289 + messageDesc(file_openstatus_notification_v1_service, 7); 290 + 291 + /** 292 + * DeleteNotificationRequest is the request to delete a notification channel. 293 + * 294 + * @generated from message openstatus.notification.v1.DeleteNotificationRequest 295 + */ 296 + export type DeleteNotificationRequest = 297 + & Message<"openstatus.notification.v1.DeleteNotificationRequest"> 298 + & { 299 + /** 300 + * Notification ID to delete (required). 301 + * 302 + * @generated from field: string id = 1; 303 + */ 304 + id: string; 305 + }; 306 + 307 + /** 308 + * Describes the message openstatus.notification.v1.DeleteNotificationRequest. 309 + * Use `create(DeleteNotificationRequestSchema)` to create a new message. 310 + */ 311 + export const DeleteNotificationRequestSchema: GenMessage< 312 + DeleteNotificationRequest 313 + > = /*@__PURE__*/ 314 + messageDesc(file_openstatus_notification_v1_service, 8); 315 + 316 + /** 317 + * DeleteNotificationResponse is the response after deleting a notification channel. 318 + * 319 + * @generated from message openstatus.notification.v1.DeleteNotificationResponse 320 + */ 321 + export type DeleteNotificationResponse = 322 + & Message<"openstatus.notification.v1.DeleteNotificationResponse"> 323 + & { 324 + /** 325 + * Whether the deletion was successful. 326 + * 327 + * @generated from field: bool success = 1; 328 + */ 329 + success: boolean; 330 + }; 331 + 332 + /** 333 + * Describes the message openstatus.notification.v1.DeleteNotificationResponse. 334 + * Use `create(DeleteNotificationResponseSchema)` to create a new message. 335 + */ 336 + export const DeleteNotificationResponseSchema: GenMessage< 337 + DeleteNotificationResponse 338 + > = /*@__PURE__*/ 339 + messageDesc(file_openstatus_notification_v1_service, 9); 340 + 341 + /** 342 + * SendTestNotificationRequest is the request to send a test notification. 343 + * 344 + * @generated from message openstatus.notification.v1.SendTestNotificationRequest 345 + */ 346 + export type SendTestNotificationRequest = 347 + & Message<"openstatus.notification.v1.SendTestNotificationRequest"> 348 + & { 349 + /** 350 + * Provider type. 351 + * 352 + * @generated from field: openstatus.notification.v1.NotificationProvider provider = 1; 353 + */ 354 + provider: NotificationProvider; 355 + 356 + /** 357 + * Provider-specific configuration. 358 + * 359 + * @generated from field: openstatus.notification.v1.NotificationData data = 2; 360 + */ 361 + data?: NotificationData; 362 + }; 363 + 364 + /** 365 + * Describes the message openstatus.notification.v1.SendTestNotificationRequest. 366 + * Use `create(SendTestNotificationRequestSchema)` to create a new message. 367 + */ 368 + export const SendTestNotificationRequestSchema: GenMessage< 369 + SendTestNotificationRequest 370 + > = /*@__PURE__*/ 371 + messageDesc(file_openstatus_notification_v1_service, 10); 372 + 373 + /** 374 + * SendTestNotificationResponse is the response after sending a test notification. 375 + * 376 + * @generated from message openstatus.notification.v1.SendTestNotificationResponse 377 + */ 378 + export type SendTestNotificationResponse = 379 + & Message<"openstatus.notification.v1.SendTestNotificationResponse"> 380 + & { 381 + /** 382 + * Whether the test was successful. 383 + * 384 + * @generated from field: bool success = 1; 385 + */ 386 + success: boolean; 387 + 388 + /** 389 + * Optional error message if the test failed. 390 + * 391 + * @generated from field: optional string error_message = 2; 392 + */ 393 + errorMessage?: string; 394 + }; 395 + 396 + /** 397 + * Describes the message openstatus.notification.v1.SendTestNotificationResponse. 398 + * Use `create(SendTestNotificationResponseSchema)` to create a new message. 399 + */ 400 + export const SendTestNotificationResponseSchema: GenMessage< 401 + SendTestNotificationResponse 402 + > = /*@__PURE__*/ 403 + messageDesc(file_openstatus_notification_v1_service, 11); 404 + 405 + /** 406 + * CheckNotificationLimitRequest is the request to check notification limits. 407 + * 408 + * @generated from message openstatus.notification.v1.CheckNotificationLimitRequest 409 + */ 410 + export type CheckNotificationLimitRequest = 411 + & Message<"openstatus.notification.v1.CheckNotificationLimitRequest"> 412 + & {}; 413 + 414 + /** 415 + * Describes the message openstatus.notification.v1.CheckNotificationLimitRequest. 416 + * Use `create(CheckNotificationLimitRequestSchema)` to create a new message. 417 + */ 418 + export const CheckNotificationLimitRequestSchema: GenMessage< 419 + CheckNotificationLimitRequest 420 + > = /*@__PURE__*/ 421 + messageDesc(file_openstatus_notification_v1_service, 12); 422 + 423 + /** 424 + * CheckNotificationLimitResponse is the response containing limit information. 425 + * 426 + * @generated from message openstatus.notification.v1.CheckNotificationLimitResponse 427 + */ 428 + export type CheckNotificationLimitResponse = 429 + & Message<"openstatus.notification.v1.CheckNotificationLimitResponse"> 430 + & { 431 + /** 432 + * Whether the workspace has reached its notification limit. 433 + * 434 + * @generated from field: bool limit_reached = 1; 435 + */ 436 + limitReached: boolean; 437 + 438 + /** 439 + * Current number of notification channels. 440 + * 441 + * @generated from field: int32 current_count = 2; 442 + */ 443 + currentCount: number; 444 + 445 + /** 446 + * Maximum allowed notification channels. 447 + * 448 + * @generated from field: int32 max_count = 3; 449 + */ 450 + maxCount: number; 451 + }; 452 + 453 + /** 454 + * Describes the message openstatus.notification.v1.CheckNotificationLimitResponse. 455 + * Use `create(CheckNotificationLimitResponseSchema)` to create a new message. 456 + */ 457 + export const CheckNotificationLimitResponseSchema: GenMessage< 458 + CheckNotificationLimitResponse 459 + > = /*@__PURE__*/ 460 + messageDesc(file_openstatus_notification_v1_service, 13); 461 + 462 + /** 463 + * NotificationService provides CRUD operations for notification channels. 464 + * 465 + * @generated from service openstatus.notification.v1.NotificationService 466 + */ 467 + export const NotificationService: GenService<{ 468 + /** 469 + * CreateNotification creates a new notification channel. 470 + * 471 + * @generated from rpc openstatus.notification.v1.NotificationService.CreateNotification 472 + */ 473 + createNotification: { 474 + methodKind: "unary"; 475 + input: typeof CreateNotificationRequestSchema; 476 + output: typeof CreateNotificationResponseSchema; 477 + }; 478 + /** 479 + * GetNotification retrieves a notification channel by ID. 480 + * 481 + * @generated from rpc openstatus.notification.v1.NotificationService.GetNotification 482 + */ 483 + getNotification: { 484 + methodKind: "unary"; 485 + input: typeof GetNotificationRequestSchema; 486 + output: typeof GetNotificationResponseSchema; 487 + }; 488 + /** 489 + * ListNotifications returns a list of notification channels. 490 + * 491 + * @generated from rpc openstatus.notification.v1.NotificationService.ListNotifications 492 + */ 493 + listNotifications: { 494 + methodKind: "unary"; 495 + input: typeof ListNotificationsRequestSchema; 496 + output: typeof ListNotificationsResponseSchema; 497 + }; 498 + /** 499 + * UpdateNotification updates an existing notification channel. 500 + * 501 + * @generated from rpc openstatus.notification.v1.NotificationService.UpdateNotification 502 + */ 503 + updateNotification: { 504 + methodKind: "unary"; 505 + input: typeof UpdateNotificationRequestSchema; 506 + output: typeof UpdateNotificationResponseSchema; 507 + }; 508 + /** 509 + * DeleteNotification removes a notification channel. 510 + * 511 + * @generated from rpc openstatus.notification.v1.NotificationService.DeleteNotification 512 + */ 513 + deleteNotification: { 514 + methodKind: "unary"; 515 + input: typeof DeleteNotificationRequestSchema; 516 + output: typeof DeleteNotificationResponseSchema; 517 + }; 518 + /** 519 + * SendTestNotification sends a test notification to verify configuration. 520 + * 521 + * @generated from rpc openstatus.notification.v1.NotificationService.SendTestNotification 522 + */ 523 + sendTestNotification: { 524 + methodKind: "unary"; 525 + input: typeof SendTestNotificationRequestSchema; 526 + output: typeof SendTestNotificationResponseSchema; 527 + }; 528 + /** 529 + * CheckNotificationLimit checks if the workspace has reached its notification limit. 530 + * 531 + * @generated from rpc openstatus.notification.v1.NotificationService.CheckNotificationLimit 532 + */ 533 + checkNotificationLimit: { 534 + methodKind: "unary"; 535 + input: typeof CheckNotificationLimitRequestSchema; 536 + output: typeof CheckNotificationLimitResponseSchema; 537 + }; 538 + }> = /*@__PURE__*/ 539 + serviceDesc(file_openstatus_notification_v1_service, 0);
+73
src/mod.ts
··· 36 36 import { StatusReportService } from "./gen/openstatus/status_report/v1/service_pb.ts"; 37 37 import { StatusPageService } from "./gen/openstatus/status_page/v1/service_pb.ts"; 38 38 import { MaintenanceService } from "./gen/openstatus/maintenance/v1/service_pb.ts"; 39 + import { NotificationService } from "./gen/openstatus/notification/v1/service_pb.ts"; 39 40 40 41 // Re-export monitor types 41 42 export type { ··· 214 215 UpdateMaintenanceResponse, 215 216 } from "./gen/openstatus/maintenance/v1/service_pb.ts"; 216 217 218 + // Re-export notification types 219 + export type { 220 + Notification, 221 + NotificationSummary, 222 + } from "./gen/openstatus/notification/v1/notification_pb.ts"; 223 + 224 + // Re-export notification provider types and data 225 + export type { 226 + DiscordData, 227 + EmailData, 228 + GoogleChatData, 229 + GrafanaOncallData, 230 + NotificationData, 231 + NtfyData, 232 + OpsgenieData, 233 + PagerDutyData, 234 + SlackData, 235 + SmsData, 236 + TelegramData, 237 + WebhookData, 238 + WebhookHeader, 239 + WhatsappData, 240 + } from "./gen/openstatus/notification/v1/providers_pb.ts"; 241 + 242 + export { 243 + NotificationProvider, 244 + OpsgenieRegion, 245 + } from "./gen/openstatus/notification/v1/providers_pb.ts"; 246 + 247 + // Re-export notification request/response types 248 + export type { 249 + CheckNotificationLimitRequest, 250 + CheckNotificationLimitResponse, 251 + CreateNotificationRequest, 252 + CreateNotificationResponse, 253 + DeleteNotificationRequest, 254 + DeleteNotificationResponse, 255 + GetNotificationRequest, 256 + GetNotificationResponse, 257 + ListNotificationsRequest, 258 + ListNotificationsResponse, 259 + SendTestNotificationRequest, 260 + SendTestNotificationResponse, 261 + UpdateNotificationRequest, 262 + UpdateNotificationResponse, 263 + } from "./gen/openstatus/notification/v1/service_pb.ts"; 264 + 217 265 /** 218 266 * Default OpenStatus API URL. 219 267 */ ··· 338 386 MaintenanceService: Client<typeof MaintenanceService>; 339 387 }; 340 388 }; 389 + /** 390 + * Notification service namespace (v1). 391 + */ 392 + notification: { 393 + v1: { 394 + /** 395 + * NotificationService provides CRUD operations for notification channels. 396 + * 397 + * Methods: 398 + * - `createNotification` - Create a new notification channel 399 + * - `getNotification` - Get a notification channel by ID 400 + * - `listNotifications` - List all notification channels 401 + * - `updateNotification` - Update a notification channel 402 + * - `deleteNotification` - Delete a notification channel 403 + * - `sendTestNotification` - Send a test notification 404 + * - `checkNotificationLimit` - Check notification limits 405 + */ 406 + NotificationService: Client<typeof NotificationService>; 407 + }; 408 + }; 341 409 } 342 410 343 411 /** ··· 388 456 maintenance: { 389 457 v1: { 390 458 MaintenanceService: createClient(MaintenanceService, transport), 459 + }, 460 + }, 461 + notification: { 462 + v1: { 463 + NotificationService: createClient(NotificationService, transport), 391 464 }, 392 465 }, 393 466 };