diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 43d31b6..5dd488e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,7 +5,7 @@ on: - "*" permissions: - id-token: write # Required for OIDC + id-token: write # Required for OIDC contents: read jobs: @@ -32,8 +32,8 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '24' - registry-url: 'https://registry.npmjs.org' + node-version: "24" + registry-url: "https://registry.npmjs.org" - name: Install Deno uses: denoland/setup-deno@v2 with: diff --git a/README.md b/README.md index 8a84dba..3d321e3 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,18 @@ [![npm](https://img.shields.io/npm/v/@openstatus/sdk-node)](https://www.npmjs.com/package/@openstatus/sdk-node) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) -Official Node.js SDK for [OpenStatus](https://openstatus.dev) - the open-source -monitoring platform. +Official Node.js SDK for [OpenStatus](https://openstatus.dev) - The open-source status page with uptime monitoring. ## Features +### Status Page +- **Status Reports** - Manage incident and maintenance reports with update timelines + +### Monitoring - **HTTP Monitoring** - Monitor websites and APIs with customizable assertions - **TCP Monitoring** - Check database connections and other TCP services - **DNS Monitoring** - Verify DNS records and resolution + - **Global Regions** - Monitor from 28 locations worldwide - **Type-safe** - Full TypeScript support with generated types from protobuf @@ -39,11 +43,11 @@ import { openstatus } from "jsr:@openstatus/sdk-node"; ```typescript import { + HTTPMethod, + NumberComparator, openstatus, Periodicity, Region, - HTTPMethod, - NumberComparator, } from "@openstatus/sdk-node"; const headers = { @@ -51,28 +55,29 @@ const headers = { }; // Create a monitor -const { monitor } = await openstatus.monitor.v1.MonitorService.createHTTPMonitor( - { - monitor: { - name: "My API", - url: "https://api.example.com/health", - periodicity: Periodicity.PERIODICITY_1M, - method: HTTPMethod.HTTP_METHOD_GET, - regions: [Region.FLY_AMS, Region.FLY_IAD, Region.FLY_SYD], - active: true, - statusCodeAssertions: [ - { comparator: NumberComparator.EQUAL, target: BigInt(200) }, - ], +const { monitor } = await openstatus.monitor.v1.MonitorService + .createHTTPMonitor( + { + monitor: { + name: "My API", + url: "https://api.example.com/health", + periodicity: Periodicity.PERIODICITY_1M, + method: HTTPMethod.HTTP_METHOD_GET, + regions: [Region.FLY_AMS, Region.FLY_IAD, Region.FLY_SYD], + active: true, + statusCodeAssertions: [ + { comparator: NumberComparator.EQUAL, target: BigInt(200) }, + ], + }, }, - }, - { headers }, -); + { headers }, + ); console.log(`Monitor created: ${monitor?.id}`); // List all monitors -const { httpMonitors, tcpMonitors, dnsMonitors, totalSize } = - await openstatus.monitor.v1.MonitorService.listMonitors({}, { headers }); +const { httpMonitors, tcpMonitors, dnsMonitors, totalSize } = await openstatus + .monitor.v1.MonitorService.listMonitors({}, { headers }); console.log(`Found ${totalSize} monitors`); ``` @@ -107,21 +112,22 @@ await openstatus.monitor.v1.MonitorService.listMonitors({}, { headers }); Create an HTTP/HTTPS monitor. ```typescript -import { Periodicity, Region, HTTPMethod } from "@openstatus/sdk-node"; +import { HTTPMethod, Periodicity, Region } from "@openstatus/sdk-node"; -const { monitor } = await openstatus.monitor.v1.MonitorService.createHTTPMonitor( - { - monitor: { - name: "My Website", - url: "https://example.com", - periodicity: Periodicity.PERIODICITY_1M, - method: HTTPMethod.HTTP_METHOD_GET, - regions: [Region.FLY_AMS, Region.FLY_IAD, Region.FLY_SYD], - active: true, +const { monitor } = await openstatus.monitor.v1.MonitorService + .createHTTPMonitor( + { + monitor: { + name: "My Website", + url: "https://example.com", + periodicity: Periodicity.PERIODICITY_1M, + method: HTTPMethod.HTTP_METHOD_GET, + regions: [Region.FLY_AMS, Region.FLY_IAD, Region.FLY_SYD], + active: true, + }, }, - }, - { headers }, -); + { headers }, + ); ``` #### `updateHTTPMonitor(request, options)` @@ -129,16 +135,17 @@ const { monitor } = await openstatus.monitor.v1.MonitorService.createHTTPMonitor Update an existing HTTP monitor. ```typescript -const { monitor } = await openstatus.monitor.v1.MonitorService.updateHTTPMonitor( - { - id: "mon_123", - monitor: { - name: "Updated Name", - active: false, +const { monitor } = await openstatus.monitor.v1.MonitorService + .updateHTTPMonitor( + { + id: "mon_123", + monitor: { + name: "Updated Name", + active: false, + }, }, - }, - { headers }, -); + { headers }, + ); ``` #### `createTCPMonitor(request, options)` @@ -261,10 +268,11 @@ Get the current status of a monitor across all configured regions. ```typescript import { MonitorStatus, Region } from "@openstatus/sdk-node"; -const { id, regions } = await openstatus.monitor.v1.MonitorService.getMonitorStatus( - { id: "mon_123" }, - { headers }, -); +const { id, regions } = await openstatus.monitor.v1.MonitorService + .getMonitorStatus( + { id: "mon_123" }, + { headers }, + ); // regions is an array of { region, status } // region: Region enum value (e.g., Region.FLY_AMS) @@ -312,88 +320,214 @@ const { status } = await openstatus.health.v1.HealthService.check({}); console.log(ServingStatus[status]); // "SERVING" ``` +### Status Report Service + +Manage incident and maintenance reports with update timelines. + +#### `createStatusReport(request, options)` + +Create a new status report. + +```typescript +import { StatusReportStatus } from "@openstatus/sdk-node"; + +const { statusReport } = await openstatus.statusReport.v1.StatusReportService + .createStatusReport( + { + title: "API Degradation", + status: StatusReportStatus.INVESTIGATING, + message: "We are investigating reports of increased latency.", + date: "2024-01-15T10:30:00", + pageId: "page_123", + pageComponentIds: ["comp_456"], + notify: true, + }, + { headers }, + ); + +console.log(`Status report created: ${statusReport?.id}`); +``` + +#### `getStatusReport(request, options)` + +Get a status report by ID (includes full update timeline). + +```typescript +const { statusReport } = await openstatus.statusReport.v1.StatusReportService + .getStatusReport( + { id: "sr_123" }, + { headers }, + ); + +console.log(`Title: ${statusReport?.title}`); +console.log(`Status: ${StatusReportStatus[statusReport?.status ?? 0]}`); + +// Access update timeline +for (const update of statusReport?.updates ?? []) { + console.log(`${update.date}: ${update.message}`); +} +``` + +#### `listStatusReports(request, options)` + +List all status reports with pagination and optional filtering. + +```typescript +import { StatusReportStatus } from "@openstatus/sdk-node"; + +const { statusReports, totalSize } = await openstatus.statusReport.v1 + .StatusReportService.listStatusReports( + { + limit: 10, + offset: 0, + statuses: [StatusReportStatus.INVESTIGATING, StatusReportStatus.IDENTIFIED], + }, + { headers }, + ); + +console.log(`Found ${totalSize} status reports`); +``` + +#### `updateStatusReport(request, options)` + +Update status report metadata (title, page components). + +```typescript +const { statusReport } = await openstatus.statusReport.v1.StatusReportService + .updateStatusReport( + { + id: "sr_123", + title: "Updated Title", + pageComponentIds: ["comp_456", "comp_789"], + }, + { headers }, + ); +``` + +#### `deleteStatusReport(request, options)` + +Delete a status report and all its updates. + +```typescript +const { success } = await openstatus.statusReport.v1.StatusReportService + .deleteStatusReport( + { id: "sr_123" }, + { headers }, + ); +``` + +#### `addStatusReportUpdate(request, options)` + +Add a new update to an existing status report timeline. + +```typescript +import { StatusReportStatus } from "@openstatus/sdk-node"; + +const { statusReport } = await openstatus.statusReport.v1.StatusReportService + .addStatusReportUpdate( + { + statusReportId: "sr_123", + status: StatusReportStatus.IDENTIFIED, + message: "The issue has been identified as a database connection problem.", + date: "2024-01-15T11:00:00", // optional, defaults to current time + notify: true, + }, + { headers }, + ); +``` + +### Status Report Status + +| Enum Value | Description | +| --------------- | ------------------------------- | +| `UNSPECIFIED` | Default/unspecified status | +| `INVESTIGATING` | Actively investigating the issue | +| `IDENTIFIED` | Root cause has been identified | +| `MONITORING` | Fix deployed, monitoring | +| `RESOLVED` | Issue fully resolved | + ## Monitor Options ### HTTP Monitor -| Option | Type | Required | Description | -| ---------------------- | ------------------ | -------- | -------------------------------------------------------- | -| `name` | string | Yes | Monitor name (max 256 chars) | -| `url` | string | Yes | URL to monitor (max 2048 chars) | -| `periodicity` | Periodicity | Yes | Check interval (see [Periodicity](#periodicity)) | -| `method` | HTTPMethod | No | HTTP method (see [HTTP Methods](#http-methods)) | -| `body` | string | No | Request body | -| `headers` | Headers[] | No | Custom headers (`{ key: string, value: string }[]`) | -| `timeout` | bigint | No | Timeout in ms (default: 45000, max: 120000) | -| `retry` | bigint | No | Retry attempts (default: 3, max: 10) | -| `followRedirects` | boolean | No | Follow redirects (default: true) | -| `regions` | Region[] | No | [Regions](#regions) for checks | -| `active` | boolean | No | Enable monitoring (default: false) | -| `public` | boolean | No | Public visibility (default: false) | -| `degradedAt` | bigint | No | Latency threshold (ms) for degraded status | -| `description` | string | No | Monitor description (max 1024 chars) | -| `statusCodeAssertions` | array | No | [Status code assertions](#status-code-assertions) | -| `bodyAssertions` | array | No | [Body assertions](#body-assertions) | -| `headerAssertions` | array | No | [Header assertions](#header-assertions) | -| `openTelemetry` | OpenTelemetryConfig| No | OpenTelemetry export configuration | +| Option | Type | Required | Description | +| ---------------------- | ------------------- | -------- | --------------------------------------------------- | +| `name` | string | Yes | Monitor name (max 256 chars) | +| `url` | string | Yes | URL to monitor (max 2048 chars) | +| `periodicity` | Periodicity | Yes | Check interval (see [Periodicity](#periodicity)) | +| `method` | HTTPMethod | No | HTTP method (see [HTTP Methods](#http-methods)) | +| `body` | string | No | Request body | +| `headers` | Headers[] | No | Custom headers (`{ key: string, value: string }[]`) | +| `timeout` | bigint | No | Timeout in ms (default: 45000, max: 120000) | +| `retry` | bigint | No | Retry attempts (default: 3, max: 10) | +| `followRedirects` | boolean | No | Follow redirects (default: true) | +| `regions` | Region[] | No | [Regions](#regions) for checks | +| `active` | boolean | No | Enable monitoring (default: false) | +| `public` | boolean | No | Public visibility (default: false) | +| `degradedAt` | bigint | No | Latency threshold (ms) for degraded status | +| `description` | string | No | Monitor description (max 1024 chars) | +| `statusCodeAssertions` | array | No | [Status code assertions](#status-code-assertions) | +| `bodyAssertions` | array | No | [Body assertions](#body-assertions) | +| `headerAssertions` | array | No | [Header assertions](#header-assertions) | +| `openTelemetry` | OpenTelemetryConfig | No | OpenTelemetry export configuration | ### TCP Monitor -| Option | Type | Required | Description | -| --------------- | ------------------ | -------- | ------------------------------------------------ | -| `name` | string | Yes | Monitor name (max 256 chars) | -| `uri` | string | Yes | `host:port` to monitor (max 2048 chars) | -| `periodicity` | Periodicity | Yes | Check interval (see [Periodicity](#periodicity)) | -| `timeout` | bigint | No | Timeout in ms (default: 45000, max: 120000) | -| `retry` | bigint | No | Retry attempts (default: 3, max: 10) | -| `regions` | Region[] | No | [Regions](#regions) for checks | -| `active` | boolean | No | Enable monitoring (default: false) | -| `public` | boolean | No | Public visibility (default: false) | -| `degradedAt` | bigint | No | Latency threshold (ms) for degraded status | -| `description` | string | No | Monitor description (max 1024 chars) | -| `openTelemetry` | OpenTelemetryConfig| No | OpenTelemetry export configuration | +| Option | Type | Required | Description | +| --------------- | ------------------- | -------- | ------------------------------------------------ | +| `name` | string | Yes | Monitor name (max 256 chars) | +| `uri` | string | Yes | `host:port` to monitor (max 2048 chars) | +| `periodicity` | Periodicity | Yes | Check interval (see [Periodicity](#periodicity)) | +| `timeout` | bigint | No | Timeout in ms (default: 45000, max: 120000) | +| `retry` | bigint | No | Retry attempts (default: 3, max: 10) | +| `regions` | Region[] | No | [Regions](#regions) for checks | +| `active` | boolean | No | Enable monitoring (default: false) | +| `public` | boolean | No | Public visibility (default: false) | +| `degradedAt` | bigint | No | Latency threshold (ms) for degraded status | +| `description` | string | No | Monitor description (max 1024 chars) | +| `openTelemetry` | OpenTelemetryConfig | No | OpenTelemetry export configuration | ### DNS Monitor -| Option | Type | Required | Description | -| ------------------ | ------------------ | -------- | -------------------------------------------------- | -| `name` | string | Yes | Monitor name (max 256 chars) | -| `uri` | string | Yes | Domain to resolve (max 2048 chars) | -| `periodicity` | Periodicity | Yes | Check interval (see [Periodicity](#periodicity)) | -| `timeout` | bigint | No | Timeout in ms (default: 45000, max: 120000) | -| `retry` | bigint | No | Retry attempts (default: 3, max: 10) | -| `regions` | Region[] | No | [Regions](#regions) for checks | -| `active` | boolean | No | Enable monitoring (default: false) | -| `public` | boolean | No | Public visibility (default: false) | -| `degradedAt` | bigint | No | Latency threshold (ms) for degraded status | -| `description` | string | No | Monitor description (max 1024 chars) | -| `recordAssertions` | array | No | [DNS record assertions](#dns-record-assertions) | -| `openTelemetry` | OpenTelemetryConfig| No | OpenTelemetry export configuration | +| Option | Type | Required | Description | +| ------------------ | ------------------- | -------- | ------------------------------------------------ | +| `name` | string | Yes | Monitor name (max 256 chars) | +| `uri` | string | Yes | Domain to resolve (max 2048 chars) | +| `periodicity` | Periodicity | Yes | Check interval (see [Periodicity](#periodicity)) | +| `timeout` | bigint | No | Timeout in ms (default: 45000, max: 120000) | +| `retry` | bigint | No | Retry attempts (default: 3, max: 10) | +| `regions` | Region[] | No | [Regions](#regions) for checks | +| `active` | boolean | No | Enable monitoring (default: false) | +| `public` | boolean | No | Public visibility (default: false) | +| `degradedAt` | bigint | No | Latency threshold (ms) for degraded status | +| `description` | string | No | Monitor description (max 1024 chars) | +| `recordAssertions` | array | No | [DNS record assertions](#dns-record-assertions) | +| `openTelemetry` | OpenTelemetryConfig | No | OpenTelemetry export configuration | ### Periodicity -| Enum Value | Description | -| ----------------------- | ------------ | -| `PERIODICITY_30S` | Every 30s | -| `PERIODICITY_1M` | Every 1m | -| `PERIODICITY_5M` | Every 5m | -| `PERIODICITY_10M` | Every 10m | -| `PERIODICITY_30M` | Every 30m | -| `PERIODICITY_1H` | Every 1h | +| Enum Value | Description | +| ----------------- | ----------- | +| `PERIODICITY_30S` | Every 30s | +| `PERIODICITY_1M` | Every 1m | +| `PERIODICITY_5M` | Every 5m | +| `PERIODICITY_10M` | Every 10m | +| `PERIODICITY_30M` | Every 30m | +| `PERIODICITY_1H` | Every 1h | ### HTTP Methods -| Enum Value | Description | -| ------------------------- | ----------- | -| `HTTP_METHOD_GET` | GET | -| `HTTP_METHOD_POST` | POST | -| `HTTP_METHOD_HEAD` | HEAD | -| `HTTP_METHOD_PUT` | PUT | -| `HTTP_METHOD_PATCH` | PATCH | -| `HTTP_METHOD_DELETE` | DELETE | -| `HTTP_METHOD_TRACE` | TRACE | -| `HTTP_METHOD_CONNECT` | CONNECT | -| `HTTP_METHOD_OPTIONS` | OPTIONS | +| Enum Value | Description | +| --------------------- | ----------- | +| `HTTP_METHOD_GET` | GET | +| `HTTP_METHOD_POST` | POST | +| `HTTP_METHOD_HEAD` | HEAD | +| `HTTP_METHOD_PUT` | PUT | +| `HTTP_METHOD_PATCH` | PATCH | +| `HTTP_METHOD_DELETE` | DELETE | +| `HTTP_METHOD_TRACE` | TRACE | +| `HTTP_METHOD_CONNECT` | CONNECT | +| `HTTP_METHOD_OPTIONS` | OPTIONS | ## Assertions @@ -416,14 +550,14 @@ import { NumberComparator } from "@openstatus/sdk-node"; **NumberComparator values:** -| Enum Value | Description | -| ----------------------- | ------------------------ | -| `EQUAL` | Equal to target | -| `NOT_EQUAL` | Not equal to target | -| `GREATER_THAN` | Greater than target | -| `GREATER_THAN_OR_EQUAL` | Greater than or equal | -| `LESS_THAN` | Less than target | -| `LESS_THAN_OR_EQUAL` | Less than or equal | +| Enum Value | Description | +| ----------------------- | --------------------- | +| `EQUAL` | Equal to target | +| `NOT_EQUAL` | Not equal to target | +| `GREATER_THAN` | Greater than target | +| `GREATER_THAN_OR_EQUAL` | Greater than or equal | +| `LESS_THAN` | Less than target | +| `LESS_THAN_OR_EQUAL` | Less than or equal | ### Body Assertions @@ -442,18 +576,18 @@ import { StringComparator } from "@openstatus/sdk-node"; **StringComparator values:** -| Enum Value | Description | -| ----------------------- | ---------------------------- | -| `CONTAINS` | Contains target string | -| `NOT_CONTAINS` | Does not contain target | -| `EQUAL` | Equal to target | -| `NOT_EQUAL` | Not equal to target | -| `EMPTY` | Body is empty | -| `NOT_EMPTY` | Body is not empty | -| `GREATER_THAN` | Lexicographically greater | -| `GREATER_THAN_OR_EQUAL` | Lexicographically >= target | -| `LESS_THAN` | Lexicographically less | -| `LESS_THAN_OR_EQUAL` | Lexicographically <= target | +| Enum Value | Description | +| ----------------------- | --------------------------- | +| `CONTAINS` | Contains target string | +| `NOT_CONTAINS` | Does not contain target | +| `EQUAL` | Equal to target | +| `NOT_EQUAL` | Not equal to target | +| `EMPTY` | Body is empty | +| `NOT_EMPTY` | Body is not empty | +| `GREATER_THAN` | Lexicographically greater | +| `GREATER_THAN_OR_EQUAL` | Lexicographically >= target | +| `LESS_THAN` | Lexicographically less | +| `LESS_THAN_OR_EQUAL` | Lexicographically <= target | ### Header Assertions @@ -482,7 +616,11 @@ import { RecordComparator } from "@openstatus/sdk-node"; { recordAssertions: [ - { record: "A", comparator: RecordComparator.EQUAL, target: "93.184.216.34" }, + { + record: "A", + comparator: RecordComparator.EQUAL, + target: "93.184.216.34", + }, { record: "CNAME", comparator: RecordComparator.CONTAINS, target: "cdn" }, ]; } @@ -501,7 +639,8 @@ import { RecordComparator } from "@openstatus/sdk-node"; ## Regions -Monitor from 28 global locations across multiple providers. Use the `Region` enum: +Monitor from 28 global locations across multiple providers. Use the `Region` +enum: ```typescript import { Region } from "@openstatus/sdk-node"; @@ -546,12 +685,12 @@ regions: [Region.FLY_AMS, Region.FLY_IAD, Region.KOYEB_FRA]; ### Railway Regions -| Enum Value | Location | -| ------------------------ | -------------- | -| `RAILWAY_US_WEST2` | US West | -| `RAILWAY_US_EAST4` | US East | -| `RAILWAY_EUROPE_WEST4` | Europe West | -| `RAILWAY_ASIA_SOUTHEAST1`| Asia Southeast | +| Enum Value | Location | +| ------------------------- | -------------- | +| `RAILWAY_US_WEST2` | US West | +| `RAILWAY_US_EAST4` | US East | +| `RAILWAY_EUROPE_WEST4` | Europe West | +| `RAILWAY_ASIA_SOUTHEAST1` | Asia Southeast | ## Error Handling diff --git a/src/gen/openstatus/status_report/v1/service_pb.ts b/src/gen/openstatus/status_report/v1/service_pb.ts new file mode 100644 index 0000000..487562b --- /dev/null +++ b/src/gen/openstatus/status_report/v1/service_pb.ts @@ -0,0 +1,484 @@ +// @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=ts" +// @generated from file openstatus/status_report/v1/service.proto (package openstatus.status_report.v1, syntax proto3) +/* eslint-disable */ + +import type { + GenFile, + GenMessage, + GenService, +} from "@bufbuild/protobuf/codegenv2"; +import { + fileDesc, + messageDesc, + serviceDesc, +} from "@bufbuild/protobuf/codegenv2"; +import { file_buf_validate_validate } from "../../../buf/validate/validate_pb.ts"; +import type { + StatusReport, + StatusReportStatus, + StatusReportSummary, +} from "./status_report_pb.ts"; +import { file_openstatus_status_report_v1_status_report } from "./status_report_pb.ts"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file openstatus/status_report/v1/service.proto. + */ +export const file_openstatus_status_report_v1_service: GenFile = /*@__PURE__*/ + fileDesc( + "CilvcGVuc3RhdHVzL3N0YXR1c19yZXBvcnQvdjEvc2VydmljZS5wcm90bxIbb3BlbnN0YXR1cy5zdGF0dXNfcmVwb3J0LnYxIqkCChlDcmVhdGVTdGF0dXNSZXBvcnRSZXF1ZXN0EhYKBXRpdGxlGAEgASgJQge6SARyAhABEkkKBnN0YXR1cxgCIAEoDjIvLm9wZW5zdGF0dXMuc3RhdHVzX3JlcG9ydC52MS5TdGF0dXNSZXBvcnRTdGF0dXNCCLpIBYIBAhABEhgKB21lc3NhZ2UYAyABKAlCB7pIBHICEAESOQoEZGF0ZRgEIAEoCUIrukgociYyJF5cZHs0fS1cZHsyfS1cZHsyfVRcZHsyfTpcZHsyfTpcZHsyfRIYCgdwYWdlX2lkGAUgASgJQge6SARyAhABEhoKEnBhZ2VfY29tcG9uZW50X2lkcxgGIAMoCRITCgZub3RpZnkYByABKAhIAIgBAUIJCgdfbm90aWZ5Il4KGkNyZWF0ZVN0YXR1c1JlcG9ydFJlc3BvbnNlEkAKDXN0YXR1c19yZXBvcnQYASABKAsyKS5vcGVuc3RhdHVzLnN0YXR1c19yZXBvcnQudjEuU3RhdHVzUmVwb3J0Ii0KFkdldFN0YXR1c1JlcG9ydFJlcXVlc3QSEwoCaWQYASABKAlCB7pIBHICEAEiWwoXR2V0U3RhdHVzUmVwb3J0UmVzcG9uc2USQAoNc3RhdHVzX3JlcG9ydBgBIAEoCzIpLm9wZW5zdGF0dXMuc3RhdHVzX3JlcG9ydC52MS5TdGF0dXNSZXBvcnQirwEKGExpc3RTdGF0dXNSZXBvcnRzUmVx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N0Gjcub3BlbnN0YXR1cy5zdGF0dXNfcmVwb3J0LnYxLkRlbGV0ZVN0YXR1c1JlcG9ydFJlc3BvbnNlEo4BChVBZGRTdGF0dXNSZXBvcnRVcGRhdGUSOS5vcGVuc3RhdHVzLnN0YXR1c19yZXBvcnQudjEuQWRkU3RhdHVzUmVwb3J0VXBkYXRlUmVxdWVzdBo6Lm9wZW5zdGF0dXMuc3RhdHVzX3JlcG9ydC52MS5BZGRTdGF0dXNSZXBvcnRVcGRhdGVSZXNwb25zZUJeWlxnaXRodWIuY29tL29wZW5zdGF0dXNocS9vcGVuc3RhdHVzL3BhY2thZ2VzL3Byb3RvL29wZW5zdGF0dXMvc3RhdHVzX3JlcG9ydC92MTtzdGF0dXNyZXBvcnR2MWIGcHJvdG8z", + [ + file_buf_validate_validate, + file_openstatus_status_report_v1_status_report, + ], + ); + +/** + * @generated from message openstatus.status_report.v1.CreateStatusReportRequest + */ +export type CreateStatusReportRequest = + & Message<"openstatus.status_report.v1.CreateStatusReportRequest"> + & { + /** + * Title of the status report (required). + * + * @generated from field: string title = 1; + */ + title: string; + + /** + * Initial status (required). + * + * @generated from field: openstatus.status_report.v1.StatusReportStatus status = 2; + */ + status: StatusReportStatus; + + /** + * Initial message describing the incident (required). + * + * @generated from field: string message = 3; + */ + message: string; + + /** + * Date when the event occurred (RFC 3339 format, required). + * + * @generated from field: string date = 4; + */ + date: string; + + /** + * Page ID to associate with this report (required). + * + * @generated from field: string page_id = 5; + */ + pageId: string; + + /** + * Page component IDs to associate with this report (optional). + * + * @generated from field: repeated string page_component_ids = 6; + */ + pageComponentIds: string[]; + + /** + * Whether to notify subscribers about this status report (optional, defaults to false). + * + * @generated from field: optional bool notify = 7; + */ + notify?: boolean; + }; + +/** + * Describes the message openstatus.status_report.v1.CreateStatusReportRequest. + * Use `create(CreateStatusReportRequestSchema)` to create a new message. + */ +export const CreateStatusReportRequestSchema: GenMessage< + CreateStatusReportRequest +> = /*@__PURE__*/ + messageDesc(file_openstatus_status_report_v1_service, 0); + +/** + * @generated from message openstatus.status_report.v1.CreateStatusReportResponse + */ +export type CreateStatusReportResponse = + & Message<"openstatus.status_report.v1.CreateStatusReportResponse"> + & { + /** + * The created status report. + * + * @generated from field: openstatus.status_report.v1.StatusReport status_report = 1; + */ + statusReport?: StatusReport; + }; + +/** + * Describes the message openstatus.status_report.v1.CreateStatusReportResponse. + * Use `create(CreateStatusReportResponseSchema)` to create a new message. + */ +export const CreateStatusReportResponseSchema: GenMessage< + CreateStatusReportResponse +> = /*@__PURE__*/ + messageDesc(file_openstatus_status_report_v1_service, 1); + +/** + * @generated from message openstatus.status_report.v1.GetStatusReportRequest + */ +export type GetStatusReportRequest = + & Message<"openstatus.status_report.v1.GetStatusReportRequest"> + & { + /** + * ID of the status report to retrieve (required). + * + * @generated from field: string id = 1; + */ + id: string; + }; + +/** + * Describes the message openstatus.status_report.v1.GetStatusReportRequest. + * Use `create(GetStatusReportRequestSchema)` to create a new message. + */ +export const GetStatusReportRequestSchema: GenMessage< + GetStatusReportRequest +> = /*@__PURE__*/ + messageDesc(file_openstatus_status_report_v1_service, 2); + +/** + * @generated from message openstatus.status_report.v1.GetStatusReportResponse + */ +export type GetStatusReportResponse = + & Message<"openstatus.status_report.v1.GetStatusReportResponse"> + & { + /** + * The requested status report. + * + * @generated from field: openstatus.status_report.v1.StatusReport status_report = 1; + */ + statusReport?: StatusReport; + }; + +/** + * Describes the message openstatus.status_report.v1.GetStatusReportResponse. + * Use `create(GetStatusReportResponseSchema)` to create a new message. + */ +export const GetStatusReportResponseSchema: GenMessage< + GetStatusReportResponse +> = /*@__PURE__*/ + messageDesc(file_openstatus_status_report_v1_service, 3); + +/** + * @generated from message openstatus.status_report.v1.ListStatusReportsRequest + */ +export type ListStatusReportsRequest = + & Message<"openstatus.status_report.v1.ListStatusReportsRequest"> + & { + /** + * Maximum number of reports to return (1-100, defaults to 50). + * + * @generated from field: optional int32 limit = 1; + */ + limit?: number; + + /** + * Number of reports to skip for pagination (defaults to 0). + * + * @generated from field: optional int32 offset = 2; + */ + offset?: number; + + /** + * Filter by status (optional). If empty, returns all statuses. + * + * @generated from field: repeated openstatus.status_report.v1.StatusReportStatus statuses = 3; + */ + statuses: StatusReportStatus[]; + }; + +/** + * Describes the message openstatus.status_report.v1.ListStatusReportsRequest. + * Use `create(ListStatusReportsRequestSchema)` to create a new message. + */ +export const ListStatusReportsRequestSchema: GenMessage< + ListStatusReportsRequest +> = /*@__PURE__*/ + messageDesc(file_openstatus_status_report_v1_service, 4); + +/** + * @generated from message openstatus.status_report.v1.ListStatusReportsResponse + */ +export type ListStatusReportsResponse = + & Message<"openstatus.status_report.v1.ListStatusReportsResponse"> + & { + /** + * List of status reports (metadata only, use GetStatusReport for full details). + * + * @generated from field: repeated openstatus.status_report.v1.StatusReportSummary status_reports = 1; + */ + statusReports: StatusReportSummary[]; + + /** + * Total number of reports matching the filter. + * + * @generated from field: int32 total_size = 2; + */ + totalSize: number; + }; + +/** + * Describes the message openstatus.status_report.v1.ListStatusReportsResponse. + * Use `create(ListStatusReportsResponseSchema)` to create a new message. + */ +export const ListStatusReportsResponseSchema: GenMessage< + ListStatusReportsResponse +> = /*@__PURE__*/ + messageDesc(file_openstatus_status_report_v1_service, 5); + +/** + * @generated from message openstatus.status_report.v1.UpdateStatusReportRequest + */ +export type UpdateStatusReportRequest = + & Message<"openstatus.status_report.v1.UpdateStatusReportRequest"> + & { + /** + * ID of the status report to update (required). + * + * @generated from field: string id = 1; + */ + id: string; + + /** + * New title for the report (optional). + * + * @generated from field: optional string title = 2; + */ + title?: string; + + /** + * New list of page component IDs (optional, replaces existing list). + * + * @generated from field: repeated string page_component_ids = 3; + */ + pageComponentIds: string[]; + }; + +/** + * Describes the message openstatus.status_report.v1.UpdateStatusReportRequest. + * Use `create(UpdateStatusReportRequestSchema)` to create a new message. + */ +export const UpdateStatusReportRequestSchema: GenMessage< + UpdateStatusReportRequest +> = /*@__PURE__*/ + messageDesc(file_openstatus_status_report_v1_service, 6); + +/** + * @generated from message openstatus.status_report.v1.UpdateStatusReportResponse + */ +export type UpdateStatusReportResponse = + & Message<"openstatus.status_report.v1.UpdateStatusReportResponse"> + & { + /** + * The updated status report. + * + * @generated from field: openstatus.status_report.v1.StatusReport status_report = 1; + */ + statusReport?: StatusReport; + }; + +/** + * Describes the message openstatus.status_report.v1.UpdateStatusReportResponse. + * Use `create(UpdateStatusReportResponseSchema)` to create a new message. + */ +export const UpdateStatusReportResponseSchema: GenMessage< + UpdateStatusReportResponse +> = /*@__PURE__*/ + messageDesc(file_openstatus_status_report_v1_service, 7); + +/** + * @generated from message openstatus.status_report.v1.DeleteStatusReportRequest + */ +export type DeleteStatusReportRequest = + & Message<"openstatus.status_report.v1.DeleteStatusReportRequest"> + & { + /** + * ID of the status report to delete (required). + * + * @generated from field: string id = 1; + */ + id: string; + }; + +/** + * Describes the message openstatus.status_report.v1.DeleteStatusReportRequest. + * Use `create(DeleteStatusReportRequestSchema)` to create a new message. + */ +export const DeleteStatusReportRequestSchema: GenMessage< + DeleteStatusReportRequest +> = /*@__PURE__*/ + messageDesc(file_openstatus_status_report_v1_service, 8); + +/** + * @generated from message openstatus.status_report.v1.DeleteStatusReportResponse + */ +export type DeleteStatusReportResponse = + & Message<"openstatus.status_report.v1.DeleteStatusReportResponse"> + & { + /** + * Whether the deletion was successful. + * + * @generated from field: bool success = 1; + */ + success: boolean; + }; + +/** + * Describes the message openstatus.status_report.v1.DeleteStatusReportResponse. + * Use `create(DeleteStatusReportResponseSchema)` to create a new message. + */ +export const DeleteStatusReportResponseSchema: GenMessage< + DeleteStatusReportResponse +> = /*@__PURE__*/ + messageDesc(file_openstatus_status_report_v1_service, 9); + +/** + * @generated from message openstatus.status_report.v1.AddStatusReportUpdateRequest + */ +export type AddStatusReportUpdateRequest = + & Message<"openstatus.status_report.v1.AddStatusReportUpdateRequest"> + & { + /** + * ID of the status report to update (required). + * + * @generated from field: string status_report_id = 1; + */ + statusReportId: string; + + /** + * New status for the report (required). + * + * @generated from field: openstatus.status_report.v1.StatusReportStatus status = 2; + */ + status: StatusReportStatus; + + /** + * Message describing what changed (required). + * + * @generated from field: string message = 3; + */ + message: string; + + /** + * Optional date for the update (RFC 3339 format). Defaults to current time if not provided. + * + * @generated from field: optional string date = 4; + */ + date?: string; + + /** + * Whether to notify subscribers about this update (optional, defaults to false). + * + * @generated from field: optional bool notify = 5; + */ + notify?: boolean; + }; + +/** + * Describes the message openstatus.status_report.v1.AddStatusReportUpdateRequest. + * Use `create(AddStatusReportUpdateRequestSchema)` to create a new message. + */ +export const AddStatusReportUpdateRequestSchema: GenMessage< + AddStatusReportUpdateRequest +> = /*@__PURE__*/ + messageDesc(file_openstatus_status_report_v1_service, 10); + +/** + * @generated from message openstatus.status_report.v1.AddStatusReportUpdateResponse + */ +export type AddStatusReportUpdateResponse = + & Message<"openstatus.status_report.v1.AddStatusReportUpdateResponse"> + & { + /** + * The updated status report with the new update included. + * + * @generated from field: openstatus.status_report.v1.StatusReport status_report = 1; + */ + statusReport?: StatusReport; + }; + +/** + * Describes the message openstatus.status_report.v1.AddStatusReportUpdateResponse. + * Use `create(AddStatusReportUpdateResponseSchema)` to create a new message. + */ +export const AddStatusReportUpdateResponseSchema: GenMessage< + AddStatusReportUpdateResponse +> = /*@__PURE__*/ + messageDesc(file_openstatus_status_report_v1_service, 11); + +/** + * StatusReportService provides CRUD operations for status reports. + * + * @generated from service openstatus.status_report.v1.StatusReportService + */ +export const StatusReportService: GenService<{ + /** + * CreateStatusReport creates a new status report. + * + * @generated from rpc openstatus.status_report.v1.StatusReportService.CreateStatusReport + */ + createStatusReport: { + methodKind: "unary"; + input: typeof CreateStatusReportRequestSchema; + output: typeof CreateStatusReportResponseSchema; + }; + /** + * GetStatusReport retrieves a specific status report by ID (includes full update timeline). + * + * @generated from rpc openstatus.status_report.v1.StatusReportService.GetStatusReport + */ + getStatusReport: { + methodKind: "unary"; + input: typeof GetStatusReportRequestSchema; + output: typeof GetStatusReportResponseSchema; + }; + /** + * ListStatusReports returns all status reports for the workspace (metadata only). + * + * @generated from rpc openstatus.status_report.v1.StatusReportService.ListStatusReports + */ + listStatusReports: { + methodKind: "unary"; + input: typeof ListStatusReportsRequestSchema; + output: typeof ListStatusReportsResponseSchema; + }; + /** + * UpdateStatusReport updates the metadata of a status report (title, page components). + * + * @generated from rpc openstatus.status_report.v1.StatusReportService.UpdateStatusReport + */ + updateStatusReport: { + methodKind: "unary"; + input: typeof UpdateStatusReportRequestSchema; + output: typeof UpdateStatusReportResponseSchema; + }; + /** + * DeleteStatusReport removes a status report and all its updates. + * + * @generated from rpc openstatus.status_report.v1.StatusReportService.DeleteStatusReport + */ + deleteStatusReport: { + methodKind: "unary"; + input: typeof DeleteStatusReportRequestSchema; + output: typeof DeleteStatusReportResponseSchema; + }; + /** + * AddStatusReportUpdate adds a new update to an existing status report timeline. + * + * @generated from rpc openstatus.status_report.v1.StatusReportService.AddStatusReportUpdate + */ + addStatusReportUpdate: { + methodKind: "unary"; + input: typeof AddStatusReportUpdateRequestSchema; + output: typeof AddStatusReportUpdateResponseSchema; + }; +}> = /*@__PURE__*/ + serviceDesc(file_openstatus_status_report_v1_service, 0); diff --git a/src/gen/openstatus/status_report/v1/status_report_pb.ts b/src/gen/openstatus/status_report/v1/status_report_pb.ts new file mode 100644 index 0000000..ace7638 --- /dev/null +++ b/src/gen/openstatus/status_report/v1/status_report_pb.ts @@ -0,0 +1,238 @@ +// @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=ts" +// @generated from file openstatus/status_report/v1/status_report.proto (package openstatus.status_report.v1, syntax proto3) +/* eslint-disable */ + +import type { + GenEnum, + GenFile, + GenMessage, +} from "@bufbuild/protobuf/codegenv2"; +import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file openstatus/status_report/v1/status_report.proto. + */ +export const file_openstatus_status_report_v1_status_report: + GenFile = /*@__PURE__*/ + fileDesc( + "Ci9vcG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RBVFVTX1JFUE9SVF9TVEFUVVNfTU9OSVRPUklORxADEiEKHVNUQVRVU19SRVBPUlRfU1RBVFVTX1JFU09MVkVEEARCXlpcZ2l0aHViLmNvbS9vcGVuc3RhdHVzaHEvb3BlbnN0YXR1cy9wYWNrYWdlcy9wcm90by9vcGVuc3RhdHVzL3N0YXR1c19yZXBvcnQvdjE7c3RhdHVzcmVwb3J0djFiBnByb3RvMw", + ); + +/** + * StatusReportUpdate represents a single update entry in a status report timeline. + * + * @generated from message openstatus.status_report.v1.StatusReportUpdate + */ +export type StatusReportUpdate = + & Message<"openstatus.status_report.v1.StatusReportUpdate"> + & { + /** + * Unique identifier for the update. + * + * @generated from field: string id = 1; + */ + id: string; + + /** + * Status at the time of this update. + * + * @generated from field: openstatus.status_report.v1.StatusReportStatus status = 2; + */ + status: StatusReportStatus; + + /** + * Timestamp when this update occurred (RFC 3339 format). + * + * @generated from field: string date = 3; + */ + date: string; + + /** + * Message describing the update. + * + * @generated from field: string message = 4; + */ + message: string; + + /** + * Timestamp when the update was created (RFC 3339 format). + * + * @generated from field: string created_at = 5; + */ + createdAt: string; + }; + +/** + * Describes the message openstatus.status_report.v1.StatusReportUpdate. + * Use `create(StatusReportUpdateSchema)` to create a new message. + */ +export const StatusReportUpdateSchema: GenMessage< + StatusReportUpdate +> = /*@__PURE__*/ + messageDesc(file_openstatus_status_report_v1_status_report, 0); + +/** + * StatusReportSummary represents metadata for a status report (used in list responses). + * + * @generated from message openstatus.status_report.v1.StatusReportSummary + */ +export type StatusReportSummary = + & Message<"openstatus.status_report.v1.StatusReportSummary"> + & { + /** + * Unique identifier for the status report. + * + * @generated from field: string id = 1; + */ + id: string; + + /** + * Current status of the report. + * + * @generated from field: openstatus.status_report.v1.StatusReportStatus status = 2; + */ + status: StatusReportStatus; + + /** + * Title of the status report. + * + * @generated from field: string title = 3; + */ + title: string; + + /** + * IDs of affected page components. + * + * @generated from field: repeated string page_component_ids = 4; + */ + pageComponentIds: string[]; + + /** + * Timestamp when the report was created (RFC 3339 format). + * + * @generated from field: string created_at = 5; + */ + createdAt: string; + + /** + * Timestamp when the report was last updated (RFC 3339 format). + * + * @generated from field: string updated_at = 6; + */ + updatedAt: string; + }; + +/** + * Describes the message openstatus.status_report.v1.StatusReportSummary. + * Use `create(StatusReportSummarySchema)` to create a new message. + */ +export const StatusReportSummarySchema: GenMessage< + StatusReportSummary +> = /*@__PURE__*/ + messageDesc(file_openstatus_status_report_v1_status_report, 1); + +/** + * StatusReport represents an incident or maintenance report with full details. + * + * @generated from message openstatus.status_report.v1.StatusReport + */ +export type StatusReport = + & Message<"openstatus.status_report.v1.StatusReport"> + & { + /** + * Unique identifier for the status report. + * + * @generated from field: string id = 1; + */ + id: string; + + /** + * Current status of the report. + * + * @generated from field: openstatus.status_report.v1.StatusReportStatus status = 2; + */ + status: StatusReportStatus; + + /** + * Title of the status report. + * + * @generated from field: string title = 3; + */ + title: string; + + /** + * IDs of affected page components. + * + * @generated from field: repeated string page_component_ids = 4; + */ + pageComponentIds: string[]; + + /** + * Timeline of updates for this report (only included in GetStatusReport). + * + * @generated from field: repeated openstatus.status_report.v1.StatusReportUpdate updates = 5; + */ + updates: StatusReportUpdate[]; + + /** + * Timestamp when the report was created (RFC 3339 format). + * + * @generated from field: string created_at = 6; + */ + createdAt: string; + + /** + * Timestamp when the report was last updated (RFC 3339 format). + * + * @generated from field: string updated_at = 7; + */ + updatedAt: string; + }; + +/** + * Describes the message openstatus.status_report.v1.StatusReport. + * Use `create(StatusReportSchema)` to create a new message. + */ +export const StatusReportSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_openstatus_status_report_v1_status_report, 2); + +/** + * StatusReportStatus represents the current state of a status report. + * + * @generated from enum openstatus.status_report.v1.StatusReportStatus + */ +export enum StatusReportStatus { + /** + * @generated from enum value: STATUS_REPORT_STATUS_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: STATUS_REPORT_STATUS_INVESTIGATING = 1; + */ + INVESTIGATING = 1, + + /** + * @generated from enum value: STATUS_REPORT_STATUS_IDENTIFIED = 2; + */ + IDENTIFIED = 2, + + /** + * @generated from enum value: STATUS_REPORT_STATUS_MONITORING = 3; + */ + MONITORING = 3, + + /** + * @generated from enum value: STATUS_REPORT_STATUS_RESOLVED = 4; + */ + RESOLVED = 4, +} + +/** + * Describes the enum openstatus.status_report.v1.StatusReportStatus. + */ +export const StatusReportStatusSchema: GenEnum< + StatusReportStatus +> = /*@__PURE__*/ + enumDesc(file_openstatus_status_report_v1_status_report, 0); diff --git a/src/mod.ts b/src/mod.ts index 9734c62..018e008 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -33,6 +33,7 @@ import { createClient } from "@connectrpc/connect"; import { createConnectTransport } from "@connectrpc/connect-node"; import { MonitorService } from "./gen/openstatus/monitor/v1/service_pb.ts"; import { HealthService } from "./gen/openstatus/health/v1/health_pb.ts"; +import { StatusReportService } from "./gen/openstatus/status_report/v1/service_pb.ts"; // Re-export monitor types export type { @@ -56,8 +57,8 @@ export type { // Re-export assertion comparator enums export { NumberComparator, - StringComparator, RecordComparator, + StringComparator, } from "./gen/openstatus/monitor/v1/assertions_pb.ts"; // Re-export enums @@ -75,12 +76,6 @@ export type { CreateHTTPMonitorResponse, CreateTCPMonitorRequest, CreateTCPMonitorResponse, - UpdateDNSMonitorRequest, - UpdateDNSMonitorResponse, - UpdateHTTPMonitorRequest, - UpdateHTTPMonitorResponse, - UpdateTCPMonitorRequest, - UpdateTCPMonitorResponse, DeleteMonitorRequest, DeleteMonitorResponse, GetMonitorStatusRequest, @@ -92,6 +87,12 @@ export type { RegionStatus, TriggerMonitorRequest, TriggerMonitorResponse, + UpdateDNSMonitorRequest, + UpdateDNSMonitorResponse, + UpdateHTTPMonitorRequest, + UpdateHTTPMonitorResponse, + UpdateTCPMonitorRequest, + UpdateTCPMonitorResponse, } from "./gen/openstatus/monitor/v1/service_pb.ts"; export { TimeRange } from "./gen/openstatus/monitor/v1/service_pb.ts"; @@ -104,6 +105,31 @@ export type { export { CheckResponse_ServingStatus as ServingStatus } from "./gen/openstatus/health/v1/health_pb.ts"; +// Re-export status report types +export type { + StatusReport, + StatusReportSummary, + StatusReportUpdate, +} from "./gen/openstatus/status_report/v1/status_report_pb.ts"; + +export { StatusReportStatus } from "./gen/openstatus/status_report/v1/status_report_pb.ts"; + +// Re-export status report request/response types +export type { + AddStatusReportUpdateRequest, + AddStatusReportUpdateResponse, + CreateStatusReportRequest, + CreateStatusReportResponse, + DeleteStatusReportRequest, + DeleteStatusReportResponse, + GetStatusReportRequest, + GetStatusReportResponse, + ListStatusReportsRequest, + ListStatusReportsResponse, + UpdateStatusReportRequest, + UpdateStatusReportResponse, +} from "./gen/openstatus/status_report/v1/service_pb.ts"; + /** * Default OpenStatus API URL. */ @@ -161,6 +187,25 @@ export interface OpenStatusClient { HealthService: Client; }; }; + /** + * Status report service namespace (v1). + */ + statusReport: { + v1: { + /** + * StatusReportService provides CRUD operations for status reports. + * + * Methods: + * - `createStatusReport` - Create a new status report + * - `getStatusReport` - Get a status report by ID + * - `listStatusReports` - List all status reports + * - `updateStatusReport` - Update a status report + * - `deleteStatusReport` - Delete a status report + * - `addStatusReportUpdate` - Add an update to a status report + */ + StatusReportService: Client; + }; + }; } /** @@ -198,4 +243,9 @@ export const openstatus: OpenStatusClient = { HealthService: createClient(HealthService, transport), }, }, + statusReport: { + v1: { + StatusReportService: createClient(StatusReportService, transport), + }, + }, };