@openstatus/sdk-node 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +412 -0
- package/esm/gen/buf/validate/validate_pb.d.ts +4766 -0
- package/esm/gen/buf/validate/validate_pb.d.ts.map +1 -0
- package/esm/gen/buf/validate/validate_pb.js +361 -0
- package/esm/gen/openstatus/health/v1/health_pb.d.ts +89 -0
- package/esm/gen/openstatus/health/v1/health_pb.d.ts.map +1 -0
- package/esm/gen/openstatus/health/v1/health_pb.js +54 -0
- package/esm/gen/openstatus/monitor/v1/assertions_pb.d.ts +240 -0
- package/esm/gen/openstatus/monitor/v1/assertions_pb.d.ts.map +1 -0
- package/esm/gen/openstatus/monitor/v1/assertions_pb.js +157 -0
- package/esm/gen/openstatus/monitor/v1/dns_monitor_pb.d.ts +106 -0
- package/esm/gen/openstatus/monitor/v1/dns_monitor_pb.d.ts.map +1 -0
- package/esm/gen/openstatus/monitor/v1/dns_monitor_pb.js +22 -0
- package/esm/gen/openstatus/monitor/v1/http_monitor_pb.d.ts +236 -0
- package/esm/gen/openstatus/monitor/v1/http_monitor_pb.d.ts.map +1 -0
- package/esm/gen/openstatus/monitor/v1/http_monitor_pb.js +82 -0
- package/esm/gen/openstatus/monitor/v1/monitor_pb.d.ts +269 -0
- package/esm/gen/openstatus/monitor/v1/monitor_pb.d.ts.map +1 -0
- package/esm/gen/openstatus/monitor/v1/monitor_pb.js +274 -0
- package/esm/gen/openstatus/monitor/v1/service_pb.d.ts +602 -0
- package/esm/gen/openstatus/monitor/v1/service_pb.d.ts.map +1 -0
- package/esm/gen/openstatus/monitor/v1/service_pb.js +151 -0
- package/esm/gen/openstatus/monitor/v1/tcp_monitor_pb.d.ts +99 -0
- package/esm/gen/openstatus/monitor/v1/tcp_monitor_pb.d.ts.map +1 -0
- package/esm/gen/openstatus/monitor/v1/tcp_monitor_pb.js +20 -0
- package/esm/mod.d.ts +107 -0
- package/esm/mod.d.ts.map +1 -0
- package/esm/mod.js +82 -0
- package/esm/package.json +3 -0
- package/package.json +34 -0
- package/script/gen/buf/validate/validate_pb.d.ts +4766 -0
- package/script/gen/buf/validate/validate_pb.d.ts.map +1 -0
- package/script/gen/buf/validate/validate_pb.js +364 -0
- package/script/gen/openstatus/health/v1/health_pb.d.ts +89 -0
- package/script/gen/openstatus/health/v1/health_pb.d.ts.map +1 -0
- package/script/gen/openstatus/health/v1/health_pb.js +57 -0
- package/script/gen/openstatus/monitor/v1/assertions_pb.d.ts +240 -0
- package/script/gen/openstatus/monitor/v1/assertions_pb.d.ts.map +1 -0
- package/script/gen/openstatus/monitor/v1/assertions_pb.js +160 -0
- package/script/gen/openstatus/monitor/v1/dns_monitor_pb.d.ts +106 -0
- package/script/gen/openstatus/monitor/v1/dns_monitor_pb.d.ts.map +1 -0
- package/script/gen/openstatus/monitor/v1/dns_monitor_pb.js +25 -0
- package/script/gen/openstatus/monitor/v1/http_monitor_pb.d.ts +236 -0
- package/script/gen/openstatus/monitor/v1/http_monitor_pb.d.ts.map +1 -0
- package/script/gen/openstatus/monitor/v1/http_monitor_pb.js +85 -0
- package/script/gen/openstatus/monitor/v1/monitor_pb.d.ts +269 -0
- package/script/gen/openstatus/monitor/v1/monitor_pb.d.ts.map +1 -0
- package/script/gen/openstatus/monitor/v1/monitor_pb.js +277 -0
- package/script/gen/openstatus/monitor/v1/service_pb.d.ts +602 -0
- package/script/gen/openstatus/monitor/v1/service_pb.d.ts.map +1 -0
- package/script/gen/openstatus/monitor/v1/service_pb.js +154 -0
- package/script/gen/openstatus/monitor/v1/tcp_monitor_pb.d.ts +99 -0
- package/script/gen/openstatus/monitor/v1/tcp_monitor_pb.d.ts.map +1 -0
- package/script/gen/openstatus/monitor/v1/tcp_monitor_pb.js +23 -0
- package/script/mod.d.ts +107 -0
- package/script/mod.d.ts.map +1 -0
- package/script/mod.js +91 -0
- package/script/package.json +3 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
// @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=ts"
|
|
2
|
+
// @generated from file openstatus/monitor/v1/service.proto (package openstatus.monitor.v1, syntax proto3)
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
import { enumDesc, fileDesc, messageDesc, serviceDesc, } from "@bufbuild/protobuf/codegenv2";
|
|
5
|
+
import { file_buf_validate_validate } from "../../../buf/validate/validate_pb.js";
|
|
6
|
+
import { file_openstatus_monitor_v1_dns_monitor } from "./dns_monitor_pb.js";
|
|
7
|
+
import { file_openstatus_monitor_v1_http_monitor } from "./http_monitor_pb.js";
|
|
8
|
+
import { file_openstatus_monitor_v1_monitor } from "./monitor_pb.js";
|
|
9
|
+
import { file_openstatus_monitor_v1_tcp_monitor } from "./tcp_monitor_pb.js";
|
|
10
|
+
/**
|
|
11
|
+
* Describes the file openstatus/monitor/v1/service.proto.
|
|
12
|
+
*/
|
|
13
|
+
export const file_openstatus_monitor_v1_service = /*@__PURE__*/ fileDesc("CiNvcGVuc3RhdHVzL21vbml0b3IvdjEvc2VydmljZS5wcm90bxIVb3BlbnN0YXR1cy5tb25pdG9yLnYxIlcKGENyZWF0ZUhUVFBNb25pdG9yUmVxdWVzdBI7Cgdtb25pdG9yGAEgASgLMiIub3BlbnN0YXR1cy5tb25pdG9yLnYxLkhUVFBNb25pdG9yQga6SAPIAQEiUAoZQ3JlYXRlSFRUUE1vbml0b3JSZXNwb25zZRIzCgdtb25pdG9yGAEgASgLMiIub3BlbnN0YXR1cy5tb25pdG9yLnYxLkhUVFBNb25pdG9yIlUKF0NyZWF0ZVRDUE1vbml0b3JSZXF1ZXN0EjoKB21vbml0b3IYASABKAsyIS5vcGVuc3RhdHVzLm1vbml0b3IudjEuVENQTW9uaXRvckIGukgDyAEBIk4KGENyZWF0ZVRDUE1vbml0b3JSZXNwb25zZRIyCgdtb25pdG9yGAEgASgLMiEub3BlbnN0YXR1cy5tb25pdG9yLnYxLlRDUE1vbml0b3IiVQoXQ3J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0TW9uaXRvclN0YXR1c1JlcXVlc3QaLy5vcGVuc3RhdHVzLm1vbml0b3IudjEuR2V0TW9uaXRvclN0YXR1c1Jlc3BvbnNlEnYKEUdldE1vbml0b3JTdW1tYXJ5Ei8ub3BlbnN0YXR1cy5tb25pdG9yLnYxLkdldE1vbml0b3JTdW1tYXJ5UmVxdWVzdBowLm9wZW5zdGF0dXMubW9uaXRvci52MS5HZXRNb25pdG9yU3VtbWFyeVJlc3BvbnNlQlNaUWdpdGh1Yi5jb20vb3BlbnN0YXR1c2hxL29wZW5zdGF0dXMvcGFja2FnZXMvcHJvdG8vb3BlbnN0YXR1cy9tb25pdG9yL3YxO21vbml0b3J2MWIGcHJvdG8z", [
|
|
14
|
+
file_buf_validate_validate,
|
|
15
|
+
file_openstatus_monitor_v1_dns_monitor,
|
|
16
|
+
file_openstatus_monitor_v1_http_monitor,
|
|
17
|
+
file_openstatus_monitor_v1_monitor,
|
|
18
|
+
file_openstatus_monitor_v1_tcp_monitor,
|
|
19
|
+
]);
|
|
20
|
+
/**
|
|
21
|
+
* Describes the message openstatus.monitor.v1.CreateHTTPMonitorRequest.
|
|
22
|
+
* Use `create(CreateHTTPMonitorRequestSchema)` to create a new message.
|
|
23
|
+
*/
|
|
24
|
+
export const CreateHTTPMonitorRequestSchema = /*@__PURE__*/ messageDesc(file_openstatus_monitor_v1_service, 0);
|
|
25
|
+
/**
|
|
26
|
+
* Describes the message openstatus.monitor.v1.CreateHTTPMonitorResponse.
|
|
27
|
+
* Use `create(CreateHTTPMonitorResponseSchema)` to create a new message.
|
|
28
|
+
*/
|
|
29
|
+
export const CreateHTTPMonitorResponseSchema = /*@__PURE__*/ messageDesc(file_openstatus_monitor_v1_service, 1);
|
|
30
|
+
/**
|
|
31
|
+
* Describes the message openstatus.monitor.v1.CreateTCPMonitorRequest.
|
|
32
|
+
* Use `create(CreateTCPMonitorRequestSchema)` to create a new message.
|
|
33
|
+
*/
|
|
34
|
+
export const CreateTCPMonitorRequestSchema = /*@__PURE__*/ messageDesc(file_openstatus_monitor_v1_service, 2);
|
|
35
|
+
/**
|
|
36
|
+
* Describes the message openstatus.monitor.v1.CreateTCPMonitorResponse.
|
|
37
|
+
* Use `create(CreateTCPMonitorResponseSchema)` to create a new message.
|
|
38
|
+
*/
|
|
39
|
+
export const CreateTCPMonitorResponseSchema = /*@__PURE__*/ messageDesc(file_openstatus_monitor_v1_service, 3);
|
|
40
|
+
/**
|
|
41
|
+
* Describes the message openstatus.monitor.v1.CreateDNSMonitorRequest.
|
|
42
|
+
* Use `create(CreateDNSMonitorRequestSchema)` to create a new message.
|
|
43
|
+
*/
|
|
44
|
+
export const CreateDNSMonitorRequestSchema = /*@__PURE__*/ messageDesc(file_openstatus_monitor_v1_service, 4);
|
|
45
|
+
/**
|
|
46
|
+
* Describes the message openstatus.monitor.v1.CreateDNSMonitorResponse.
|
|
47
|
+
* Use `create(CreateDNSMonitorResponseSchema)` to create a new message.
|
|
48
|
+
*/
|
|
49
|
+
export const CreateDNSMonitorResponseSchema = /*@__PURE__*/ messageDesc(file_openstatus_monitor_v1_service, 5);
|
|
50
|
+
/**
|
|
51
|
+
* Describes the message openstatus.monitor.v1.TriggerMonitorRequest.
|
|
52
|
+
* Use `create(TriggerMonitorRequestSchema)` to create a new message.
|
|
53
|
+
*/
|
|
54
|
+
export const TriggerMonitorRequestSchema = /*@__PURE__*/ messageDesc(file_openstatus_monitor_v1_service, 6);
|
|
55
|
+
/**
|
|
56
|
+
* Describes the message openstatus.monitor.v1.TriggerMonitorResponse.
|
|
57
|
+
* Use `create(TriggerMonitorResponseSchema)` to create a new message.
|
|
58
|
+
*/
|
|
59
|
+
export const TriggerMonitorResponseSchema = /*@__PURE__*/ messageDesc(file_openstatus_monitor_v1_service, 7);
|
|
60
|
+
/**
|
|
61
|
+
* Describes the message openstatus.monitor.v1.DeleteMonitorRequest.
|
|
62
|
+
* Use `create(DeleteMonitorRequestSchema)` to create a new message.
|
|
63
|
+
*/
|
|
64
|
+
export const DeleteMonitorRequestSchema = /*@__PURE__*/ messageDesc(file_openstatus_monitor_v1_service, 8);
|
|
65
|
+
/**
|
|
66
|
+
* Describes the message openstatus.monitor.v1.DeleteMonitorResponse.
|
|
67
|
+
* Use `create(DeleteMonitorResponseSchema)` to create a new message.
|
|
68
|
+
*/
|
|
69
|
+
export const DeleteMonitorResponseSchema = /*@__PURE__*/ messageDesc(file_openstatus_monitor_v1_service, 9);
|
|
70
|
+
/**
|
|
71
|
+
* Describes the message openstatus.monitor.v1.ListMonitorsRequest.
|
|
72
|
+
* Use `create(ListMonitorsRequestSchema)` to create a new message.
|
|
73
|
+
*/
|
|
74
|
+
export const ListMonitorsRequestSchema = /*@__PURE__*/ messageDesc(file_openstatus_monitor_v1_service, 10);
|
|
75
|
+
/**
|
|
76
|
+
* Describes the message openstatus.monitor.v1.ListMonitorsResponse.
|
|
77
|
+
* Use `create(ListMonitorsResponseSchema)` to create a new message.
|
|
78
|
+
*/
|
|
79
|
+
export const ListMonitorsResponseSchema = /*@__PURE__*/ messageDesc(file_openstatus_monitor_v1_service, 11);
|
|
80
|
+
/**
|
|
81
|
+
* Describes the message openstatus.monitor.v1.GetMonitorStatusRequest.
|
|
82
|
+
* Use `create(GetMonitorStatusRequestSchema)` to create a new message.
|
|
83
|
+
*/
|
|
84
|
+
export const GetMonitorStatusRequestSchema = /*@__PURE__*/ messageDesc(file_openstatus_monitor_v1_service, 12);
|
|
85
|
+
/**
|
|
86
|
+
* Describes the message openstatus.monitor.v1.RegionStatus.
|
|
87
|
+
* Use `create(RegionStatusSchema)` to create a new message.
|
|
88
|
+
*/
|
|
89
|
+
export const RegionStatusSchema = /*@__PURE__*/ messageDesc(file_openstatus_monitor_v1_service, 13);
|
|
90
|
+
/**
|
|
91
|
+
* Describes the message openstatus.monitor.v1.GetMonitorStatusResponse.
|
|
92
|
+
* Use `create(GetMonitorStatusResponseSchema)` to create a new message.
|
|
93
|
+
*/
|
|
94
|
+
export const GetMonitorStatusResponseSchema = /*@__PURE__*/ messageDesc(file_openstatus_monitor_v1_service, 14);
|
|
95
|
+
/**
|
|
96
|
+
* Describes the message openstatus.monitor.v1.MonitorConfig.
|
|
97
|
+
* Use `create(MonitorConfigSchema)` to create a new message.
|
|
98
|
+
*/
|
|
99
|
+
export const MonitorConfigSchema = /*@__PURE__*/ messageDesc(file_openstatus_monitor_v1_service, 15);
|
|
100
|
+
/**
|
|
101
|
+
* Describes the message openstatus.monitor.v1.GetMonitorSummaryRequest.
|
|
102
|
+
* Use `create(GetMonitorSummaryRequestSchema)` to create a new message.
|
|
103
|
+
*/
|
|
104
|
+
export const GetMonitorSummaryRequestSchema = /*@__PURE__*/ messageDesc(file_openstatus_monitor_v1_service, 16);
|
|
105
|
+
/**
|
|
106
|
+
* Describes the message openstatus.monitor.v1.GetMonitorSummaryResponse.
|
|
107
|
+
* Use `create(GetMonitorSummaryResponseSchema)` to create a new message.
|
|
108
|
+
*/
|
|
109
|
+
export const GetMonitorSummaryResponseSchema = /*@__PURE__*/ messageDesc(file_openstatus_monitor_v1_service, 17);
|
|
110
|
+
/**
|
|
111
|
+
* TimeRange represents the time period for metrics aggregation.
|
|
112
|
+
*
|
|
113
|
+
* @generated from enum openstatus.monitor.v1.TimeRange
|
|
114
|
+
*/
|
|
115
|
+
export var TimeRange;
|
|
116
|
+
(function (TimeRange) {
|
|
117
|
+
/**
|
|
118
|
+
* Unspecified time range.
|
|
119
|
+
*
|
|
120
|
+
* @generated from enum value: TIME_RANGE_UNSPECIFIED = 0;
|
|
121
|
+
*/
|
|
122
|
+
TimeRange[TimeRange["TIME_RANGE_UNSPECIFIED"] = 0] = "TIME_RANGE_UNSPECIFIED";
|
|
123
|
+
/**
|
|
124
|
+
* Last 24 hours.
|
|
125
|
+
*
|
|
126
|
+
* @generated from enum value: TIME_RANGE_1D = 1;
|
|
127
|
+
*/
|
|
128
|
+
TimeRange[TimeRange["TIME_RANGE_1D"] = 1] = "TIME_RANGE_1D";
|
|
129
|
+
/**
|
|
130
|
+
* Last 7 days.
|
|
131
|
+
*
|
|
132
|
+
* @generated from enum value: TIME_RANGE_7D = 2;
|
|
133
|
+
*/
|
|
134
|
+
TimeRange[TimeRange["TIME_RANGE_7D"] = 2] = "TIME_RANGE_7D";
|
|
135
|
+
/**
|
|
136
|
+
* Last 14 days.
|
|
137
|
+
*
|
|
138
|
+
* @generated from enum value: TIME_RANGE_14D = 3;
|
|
139
|
+
*/
|
|
140
|
+
TimeRange[TimeRange["TIME_RANGE_14D"] = 3] = "TIME_RANGE_14D";
|
|
141
|
+
})(TimeRange || (TimeRange = {}));
|
|
142
|
+
/**
|
|
143
|
+
* Describes the enum openstatus.monitor.v1.TimeRange.
|
|
144
|
+
*/
|
|
145
|
+
export const TimeRangeSchema = /*@__PURE__*/ enumDesc(file_openstatus_monitor_v1_service, 0);
|
|
146
|
+
/**
|
|
147
|
+
* MonitorService provides CRUD and operational commands for monitors.
|
|
148
|
+
*
|
|
149
|
+
* @generated from service openstatus.monitor.v1.MonitorService
|
|
150
|
+
*/
|
|
151
|
+
export const MonitorService = /*@__PURE__*/ serviceDesc(file_openstatus_monitor_v1_service, 0);
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
|
|
2
|
+
import type { OpenTelemetryConfig } from "./http_monitor_pb.js";
|
|
3
|
+
import type { MonitorStatus, Periodicity, Region } from "./monitor_pb.js";
|
|
4
|
+
import type { Message } from "@bufbuild/protobuf";
|
|
5
|
+
/**
|
|
6
|
+
* Describes the file openstatus/monitor/v1/tcp_monitor.proto.
|
|
7
|
+
*/
|
|
8
|
+
export declare const file_openstatus_monitor_v1_tcp_monitor: GenFile;
|
|
9
|
+
/**
|
|
10
|
+
* TCPMonitor defines the configuration for a TCP monitor.
|
|
11
|
+
*
|
|
12
|
+
* @generated from message openstatus.monitor.v1.TCPMonitor
|
|
13
|
+
*/
|
|
14
|
+
export type TCPMonitor = Message<"openstatus.monitor.v1.TCPMonitor"> & {
|
|
15
|
+
/**
|
|
16
|
+
* Unique identifier for the monitor (output only for create requests).
|
|
17
|
+
*
|
|
18
|
+
* @generated from field: string id = 1;
|
|
19
|
+
*/
|
|
20
|
+
id: string;
|
|
21
|
+
/**
|
|
22
|
+
* Name of the monitor (required, max 256 characters).
|
|
23
|
+
*
|
|
24
|
+
* @generated from field: string name = 2;
|
|
25
|
+
*/
|
|
26
|
+
name: string;
|
|
27
|
+
/**
|
|
28
|
+
* URI to monitor in format "host:port" (required, max 2048 characters).
|
|
29
|
+
*
|
|
30
|
+
* @generated from field: string uri = 3;
|
|
31
|
+
*/
|
|
32
|
+
uri: string;
|
|
33
|
+
/**
|
|
34
|
+
* Check periodicity (required).
|
|
35
|
+
*
|
|
36
|
+
* @generated from field: openstatus.monitor.v1.Periodicity periodicity = 4;
|
|
37
|
+
*/
|
|
38
|
+
periodicity: Periodicity;
|
|
39
|
+
/**
|
|
40
|
+
* Timeout in milliseconds (0-120000, defaults to 45000).
|
|
41
|
+
*
|
|
42
|
+
* @generated from field: int64 timeout = 5;
|
|
43
|
+
*/
|
|
44
|
+
timeout: bigint;
|
|
45
|
+
/**
|
|
46
|
+
* Latency threshold for degraded status in milliseconds (optional, 0-120000).
|
|
47
|
+
*
|
|
48
|
+
* @generated from field: optional int64 degraded_at = 6;
|
|
49
|
+
*/
|
|
50
|
+
degradedAt?: bigint;
|
|
51
|
+
/**
|
|
52
|
+
* Number of retry attempts (0-10, defaults to 3).
|
|
53
|
+
*
|
|
54
|
+
* @generated from field: int64 retry = 7;
|
|
55
|
+
*/
|
|
56
|
+
retry: bigint;
|
|
57
|
+
/**
|
|
58
|
+
* Description of the monitor (optional).
|
|
59
|
+
*
|
|
60
|
+
* @generated from field: string description = 8;
|
|
61
|
+
*/
|
|
62
|
+
description: string;
|
|
63
|
+
/**
|
|
64
|
+
* Whether the monitor is active (defaults to false).
|
|
65
|
+
*
|
|
66
|
+
* @generated from field: bool active = 9;
|
|
67
|
+
*/
|
|
68
|
+
active: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Whether the monitor is publicly visible (defaults to false).
|
|
71
|
+
*
|
|
72
|
+
* @generated from field: bool public = 10;
|
|
73
|
+
*/
|
|
74
|
+
public: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Geographic regions to run checks from.
|
|
77
|
+
*
|
|
78
|
+
* @generated from field: repeated openstatus.monitor.v1.Region regions = 11;
|
|
79
|
+
*/
|
|
80
|
+
regions: Region[];
|
|
81
|
+
/**
|
|
82
|
+
* OpenTelemetry configuration for exporting metrics.
|
|
83
|
+
*
|
|
84
|
+
* @generated from field: openstatus.monitor.v1.OpenTelemetryConfig open_telemetry = 12;
|
|
85
|
+
*/
|
|
86
|
+
openTelemetry?: OpenTelemetryConfig;
|
|
87
|
+
/**
|
|
88
|
+
* Current operational status of the monitor.
|
|
89
|
+
*
|
|
90
|
+
* @generated from field: openstatus.monitor.v1.MonitorStatus status = 13;
|
|
91
|
+
*/
|
|
92
|
+
status: MonitorStatus;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Describes the message openstatus.monitor.v1.TCPMonitor.
|
|
96
|
+
* Use `create(TCPMonitorSchema)` to create a new message.
|
|
97
|
+
*/
|
|
98
|
+
export declare const TCPMonitorSchema: GenMessage<TCPMonitor>;
|
|
99
|
+
//# sourceMappingURL=tcp_monitor_pb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tcp_monitor_pb.d.ts","sourceRoot":"","sources":["../../../../../src/gen/openstatus/monitor/v1/tcp_monitor_pb.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAGxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE1E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,sCAAsC,EAAE,OAQlD,CAAC;AAEJ;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,kCAAkC,CAAC,GAAG;IACrE;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;;;OAIG;IACH,WAAW,EAAE,WAAW,CAAC;IAEzB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;;OAIG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;;OAIG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB;;;;OAIG;IACH,aAAa,CAAC,EAAE,mBAAmB,CAAC;IAEpC;;;;OAIG;IACH,MAAM,EAAE,aAAa,CAAC;CACvB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,UAAU,CAAC,UAAU,CACI,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=ts"
|
|
2
|
+
// @generated from file openstatus/monitor/v1/tcp_monitor.proto (package openstatus.monitor.v1, syntax proto3)
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2";
|
|
5
|
+
import { file_buf_validate_validate } from "../../../buf/validate/validate_pb.js";
|
|
6
|
+
import { file_openstatus_monitor_v1_http_monitor } from "./http_monitor_pb.js";
|
|
7
|
+
import { file_openstatus_monitor_v1_monitor } from "./monitor_pb.js";
|
|
8
|
+
/**
|
|
9
|
+
* Describes the file openstatus/monitor/v1/tcp_monitor.proto.
|
|
10
|
+
*/
|
|
11
|
+
export const file_openstatus_monitor_v1_tcp_monitor = /*@__PURE__*/ fileDesc("CidvcGVuc3RhdHVzL21vbml0b3IvdjEvdGNwX21vbml0b3IucHJvdG8SFW9wZW5zdGF0dXMubW9uaXRvci52MSL3AwoKVENQTW9uaXRvchIKCgJpZBgBIAEoCRIYCgRuYW1lGAIgASgJQgq6SAdyBRABGIACEhcKA3VyaRgDIAEoCUIKukgHcgUQARiAEBJBCgtwZXJpb2RpY2l0eRgEIAEoDjIiLm9wZW5zdGF0dXMubW9uaXRvci52MS5QZXJpb2RpY2l0eUIIukgFggECIAASHAoHdGltZW91dBgFIAEoA0ILukgIIgYYwKkHKAASJQoLZGVncmFkZWRfYXQYBiABKANCC7pICCIGGMCpBygASACIAQESGAoFcmV0cnkYByABKANCCbpIBiIEGAooABIdCgtkZXNjcmlwdGlvbhgIIAEoCUIIukgFcgMYgAgSDgoGYWN0aXZlGAkgASgIEg4KBnB1YmxpYxgKIAEoCBI/CgdyZWdpb25zGAsgAygOMh0ub3BlbnN0YXR1cy5tb25pdG9yLnYxLlJlZ2lvbkIPukgMkgEJEBwiBYIBAiAAEkIKDm9wZW5fdGVsZW1ldHJ5GAwgASgLMioub3BlbnN0YXR1cy5tb25pdG9yLnYxLk9wZW5UZWxlbWV0cnlDb25maWcSNAoGc3RhdHVzGA0gASgOMiQub3BlbnN0YXR1cy5tb25pdG9yLnYxLk1vbml0b3JTdGF0dXNCDgoMX2RlZ3JhZGVkX2F0QlNaUWdpdGh1Yi5jb20vb3BlbnN0YXR1c2hxL29wZW5zdGF0dXMvcGFja2FnZXMvcHJvdG8vb3BlbnN0YXR1cy9tb25pdG9yL3YxO21vbml0b3J2MWIGcHJvdG8z", [
|
|
12
|
+
file_buf_validate_validate,
|
|
13
|
+
file_openstatus_monitor_v1_http_monitor,
|
|
14
|
+
file_openstatus_monitor_v1_monitor,
|
|
15
|
+
]);
|
|
16
|
+
/**
|
|
17
|
+
* Describes the message openstatus.monitor.v1.TCPMonitor.
|
|
18
|
+
* Use `create(TCPMonitorSchema)` to create a new message.
|
|
19
|
+
*/
|
|
20
|
+
export const TCPMonitorSchema = /*@__PURE__*/ messageDesc(file_openstatus_monitor_v1_tcp_monitor, 0);
|
package/esm/mod.d.ts
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module
|
|
3
|
+
*
|
|
4
|
+
* Official Node.js SDK for OpenStatus - the open-source monitoring platform.
|
|
5
|
+
*
|
|
6
|
+
* @example Basic usage
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import { openstatus } from "@openstatus/node-sdk";
|
|
9
|
+
*
|
|
10
|
+
* const headers = {
|
|
11
|
+
* "x-openstatus-key": `Bearer ${process.env.OPENSTATUS_API_KEY}`,
|
|
12
|
+
* };
|
|
13
|
+
*
|
|
14
|
+
* // List all monitors
|
|
15
|
+
* const { httpMonitors, tcpMonitors, dnsMonitors } =
|
|
16
|
+
* await openstatus.monitor.v1.MonitorService.listMonitors({}, { headers });
|
|
17
|
+
*
|
|
18
|
+
* // Create an HTTP monitor
|
|
19
|
+
* const { monitor } = await openstatus.monitor.v1.MonitorService.createHTTPMonitor({
|
|
20
|
+
* name: "My API",
|
|
21
|
+
* url: "https://api.example.com/health",
|
|
22
|
+
* periodicity: "1m",
|
|
23
|
+
* regions: ["ams", "iad", "syd"],
|
|
24
|
+
* active: true,
|
|
25
|
+
* }, { headers });
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
import type { Client } from "@connectrpc/connect";
|
|
29
|
+
import { MonitorService } from "./gen/openstatus/monitor/v1/service_pb.js";
|
|
30
|
+
import { HealthService } from "./gen/openstatus/health/v1/health_pb.js";
|
|
31
|
+
export type { Headers, HTTPMonitor, OpenTelemetryConfig, } from "./gen/openstatus/monitor/v1/http_monitor_pb.js";
|
|
32
|
+
export type { TCPMonitor } from "./gen/openstatus/monitor/v1/tcp_monitor_pb.js";
|
|
33
|
+
export type { DNSMonitor } from "./gen/openstatus/monitor/v1/dns_monitor_pb.js";
|
|
34
|
+
export type { BodyAssertion, HeaderAssertion, RecordAssertion, StatusCodeAssertion, } from "./gen/openstatus/monitor/v1/assertions_pb.js";
|
|
35
|
+
export { HTTPMethod } from "./gen/openstatus/monitor/v1/http_monitor_pb.js";
|
|
36
|
+
export { Periodicity, Region } from "./gen/openstatus/monitor/v1/monitor_pb.js";
|
|
37
|
+
export { MonitorStatus } from "./gen/openstatus/monitor/v1/monitor_pb.js";
|
|
38
|
+
export type { CreateDNSMonitorRequest, CreateDNSMonitorResponse, CreateHTTPMonitorRequest, CreateHTTPMonitorResponse, CreateTCPMonitorRequest, CreateTCPMonitorResponse, DeleteMonitorRequest, DeleteMonitorResponse, GetMonitorStatusRequest, GetMonitorStatusResponse, GetMonitorSummaryRequest, GetMonitorSummaryResponse, ListMonitorsRequest, ListMonitorsResponse, RegionStatus, TriggerMonitorRequest, TriggerMonitorResponse, } from "./gen/openstatus/monitor/v1/service_pb.js";
|
|
39
|
+
export { TimeRange } from "./gen/openstatus/monitor/v1/service_pb.js";
|
|
40
|
+
export type { CheckRequest, CheckResponse, } from "./gen/openstatus/health/v1/health_pb.js";
|
|
41
|
+
export { CheckResponse_ServingStatus as ServingStatus } from "./gen/openstatus/health/v1/health_pb.js";
|
|
42
|
+
/**
|
|
43
|
+
* OpenStatus API client interface.
|
|
44
|
+
*
|
|
45
|
+
* Provides access to Monitor and Health services.
|
|
46
|
+
*/
|
|
47
|
+
export interface OpenStatusClient {
|
|
48
|
+
/**
|
|
49
|
+
* Monitor service namespace (v1).
|
|
50
|
+
*/
|
|
51
|
+
monitor: {
|
|
52
|
+
v1: {
|
|
53
|
+
/**
|
|
54
|
+
* MonitorService provides CRUD and operational commands for monitors.
|
|
55
|
+
*
|
|
56
|
+
* Methods:
|
|
57
|
+
* - `createHTTPMonitor` - Create a new HTTP monitor
|
|
58
|
+
* - `createTCPMonitor` - Create a new TCP monitor
|
|
59
|
+
* - `createDNSMonitor` - Create a new DNS monitor
|
|
60
|
+
* - `listMonitors` - List all monitors
|
|
61
|
+
* - `triggerMonitor` - Trigger an immediate check
|
|
62
|
+
* - `deleteMonitor` - Delete a monitor
|
|
63
|
+
* - `getMonitorStatus` - Get status of all regions for a monitor
|
|
64
|
+
* - `getMonitorSummary` - Get aggregated metrics for a monitor
|
|
65
|
+
*/
|
|
66
|
+
MonitorService: Client<typeof MonitorService>;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Health service namespace (v1).
|
|
71
|
+
*/
|
|
72
|
+
health: {
|
|
73
|
+
v1: {
|
|
74
|
+
/**
|
|
75
|
+
* HealthService provides health check endpoints.
|
|
76
|
+
*
|
|
77
|
+
* Methods:
|
|
78
|
+
* - `check` - Check API health status
|
|
79
|
+
*/
|
|
80
|
+
HealthService: Client<typeof HealthService>;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* OpenStatus SDK client.
|
|
86
|
+
*
|
|
87
|
+
* Provides access to the OpenStatus API for managing monitors and checking service health.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```typescript
|
|
91
|
+
* import { openstatus } from "@openstatus/node-sdk";
|
|
92
|
+
*
|
|
93
|
+
* // Check API health (no auth required)
|
|
94
|
+
* const { status } = await openstatus.health.v1.HealthService.check({});
|
|
95
|
+
*
|
|
96
|
+
* // Create a monitor (auth required)
|
|
97
|
+
* const headers = { "x-openstatus-key": `Bearer ${process.env.OPENSTATUS_API_KEY}` };
|
|
98
|
+
* const { monitor } = await openstatus.monitor.v1.MonitorService.createHTTPMonitor({
|
|
99
|
+
* name: "My Website",
|
|
100
|
+
* url: "https://example.com",
|
|
101
|
+
* periodicity: "1m",
|
|
102
|
+
* active: true,
|
|
103
|
+
* }, { headers });
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
export declare const openstatus: OpenStatusClient;
|
|
107
|
+
//# sourceMappingURL=mod.d.ts.map
|
package/esm/mod.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAGxE,YAAY,EACV,OAAO,EACP,WAAW,EACX,mBAAmB,GACpB,MAAM,gDAAgD,CAAC;AAExD,YAAY,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAEhF,YAAY,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAGhF,YAAY,EACV,aAAa,EACb,eAAe,EACf,eAAe,EACf,mBAAmB,GACpB,MAAM,8CAA8C,CAAC;AAGtD,OAAO,EAAE,UAAU,EAAE,MAAM,gDAAgD,CAAC;AAE5E,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAEhF,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAG1E,YAAY,EACV,uBAAuB,EACvB,wBAAwB,EACxB,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACxB,wBAAwB,EACxB,yBAAyB,EACzB,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,2CAA2C,CAAC;AAGtE,YAAY,EACV,YAAY,EACZ,aAAa,GACd,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EAAE,2BAA2B,IAAI,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAevG;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,OAAO,EAAE;QACP,EAAE,EAAE;YACF;;;;;;;;;;;;eAYG;YACH,cAAc,EAAE,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC;SAC/C,CAAC;KACH,CAAC;IACF;;OAEG;IACH,MAAM,EAAE;QACN,EAAE,EAAE;YACF;;;;;eAKG;YACH,aAAa,EAAE,MAAM,CAAC,OAAO,aAAa,CAAC,CAAC;SAC7C,CAAC;KACH,CAAC;CACH;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,UAAU,EAAE,gBAWxB,CAAC"}
|
package/esm/mod.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module
|
|
3
|
+
*
|
|
4
|
+
* Official Node.js SDK for OpenStatus - the open-source monitoring platform.
|
|
5
|
+
*
|
|
6
|
+
* @example Basic usage
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import { openstatus } from "@openstatus/node-sdk";
|
|
9
|
+
*
|
|
10
|
+
* const headers = {
|
|
11
|
+
* "x-openstatus-key": `Bearer ${process.env.OPENSTATUS_API_KEY}`,
|
|
12
|
+
* };
|
|
13
|
+
*
|
|
14
|
+
* // List all monitors
|
|
15
|
+
* const { httpMonitors, tcpMonitors, dnsMonitors } =
|
|
16
|
+
* await openstatus.monitor.v1.MonitorService.listMonitors({}, { headers });
|
|
17
|
+
*
|
|
18
|
+
* // Create an HTTP monitor
|
|
19
|
+
* const { monitor } = await openstatus.monitor.v1.MonitorService.createHTTPMonitor({
|
|
20
|
+
* name: "My API",
|
|
21
|
+
* url: "https://api.example.com/health",
|
|
22
|
+
* periodicity: "1m",
|
|
23
|
+
* regions: ["ams", "iad", "syd"],
|
|
24
|
+
* active: true,
|
|
25
|
+
* }, { headers });
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
import { createClient } from "@connectrpc/connect";
|
|
29
|
+
import { createConnectTransport } from "@connectrpc/connect-node";
|
|
30
|
+
import { MonitorService } from "./gen/openstatus/monitor/v1/service_pb.js";
|
|
31
|
+
import { HealthService } from "./gen/openstatus/health/v1/health_pb.js";
|
|
32
|
+
// Re-export enums
|
|
33
|
+
export { HTTPMethod } from "./gen/openstatus/monitor/v1/http_monitor_pb.js";
|
|
34
|
+
export { Periodicity, Region } from "./gen/openstatus/monitor/v1/monitor_pb.js";
|
|
35
|
+
export { MonitorStatus } from "./gen/openstatus/monitor/v1/monitor_pb.js";
|
|
36
|
+
export { TimeRange } from "./gen/openstatus/monitor/v1/service_pb.js";
|
|
37
|
+
export { CheckResponse_ServingStatus as ServingStatus } from "./gen/openstatus/health/v1/health_pb.js";
|
|
38
|
+
/**
|
|
39
|
+
* Default OpenStatus API URL.
|
|
40
|
+
*/
|
|
41
|
+
const DEFAULT_API_URL = "https://api.openstatus.dev/rpc";
|
|
42
|
+
/**
|
|
43
|
+
* Creates a Connect RPC transport configured for the OpenStatus API.
|
|
44
|
+
*/
|
|
45
|
+
const transport = createConnectTransport({
|
|
46
|
+
baseUrl: process.env.OPENSTATUS_API_URL ?? DEFAULT_API_URL,
|
|
47
|
+
httpVersion: "2",
|
|
48
|
+
});
|
|
49
|
+
/**
|
|
50
|
+
* OpenStatus SDK client.
|
|
51
|
+
*
|
|
52
|
+
* Provides access to the OpenStatus API for managing monitors and checking service health.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```typescript
|
|
56
|
+
* import { openstatus } from "@openstatus/node-sdk";
|
|
57
|
+
*
|
|
58
|
+
* // Check API health (no auth required)
|
|
59
|
+
* const { status } = await openstatus.health.v1.HealthService.check({});
|
|
60
|
+
*
|
|
61
|
+
* // Create a monitor (auth required)
|
|
62
|
+
* const headers = { "x-openstatus-key": `Bearer ${process.env.OPENSTATUS_API_KEY}` };
|
|
63
|
+
* const { monitor } = await openstatus.monitor.v1.MonitorService.createHTTPMonitor({
|
|
64
|
+
* name: "My Website",
|
|
65
|
+
* url: "https://example.com",
|
|
66
|
+
* periodicity: "1m",
|
|
67
|
+
* active: true,
|
|
68
|
+
* }, { headers });
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export const openstatus = {
|
|
72
|
+
monitor: {
|
|
73
|
+
v1: {
|
|
74
|
+
MonitorService: createClient(MonitorService, transport),
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
health: {
|
|
78
|
+
v1: {
|
|
79
|
+
HealthService: createClient(HealthService, transport),
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
};
|
package/esm/package.json
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@openstatus/sdk-node",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "SDK for openstatus.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/openstatushq/sdk-node.git"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/openstatushq/sdk-nod/issues"
|
|
12
|
+
},
|
|
13
|
+
"main": "./script/mod.js",
|
|
14
|
+
"module": "./esm/mod.js",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"import": "./esm/mod.js",
|
|
18
|
+
"require": "./script/mod.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"test": "node test_runner.js"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@bufbuild/protobuf": "^2.11.0",
|
|
26
|
+
"@connectrpc/connect": "^2.1.1",
|
|
27
|
+
"@connectrpc/connect-node": "^2.1.1"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/node": "^20.9.0",
|
|
31
|
+
"picocolors": "^1.0.0"
|
|
32
|
+
},
|
|
33
|
+
"_generatedBy": "dnt@dev"
|
|
34
|
+
}
|