watchfor 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli.js +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/schema.d.ts +262 -51
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -52,5 +52,5 @@ npx watchfor report --period 30d
|
|
|
52
52
|
## Links
|
|
53
53
|
|
|
54
54
|
- API docs: https://watchfor.io/docs/api
|
|
55
|
-
- MCP server for AI agents (
|
|
55
|
+
- MCP server for AI agents (40 tools): https://watchfor.io/docs/api/mcp
|
|
56
56
|
- Create an API key: dashboard → Settings → API keys (`read` or `read+write` scope)
|
package/dist/cli.js
CHANGED
|
@@ -50,7 +50,7 @@ async function main() {
|
|
|
50
50
|
const s = await wf.summary();
|
|
51
51
|
const m = s.monitors;
|
|
52
52
|
const i = s.incidents;
|
|
53
|
-
console.log(`monitors: ${m.total} total · ${m.up} up · ${m.down} down · ${m.paused} paused · health ${m.health_score}%`);
|
|
53
|
+
console.log(`monitors: ${m.total} total · ${m.up} up · ${m.degraded ?? 0} degraded · ${m.down} down · ${m.paused} paused · health ${m.health_score}%`);
|
|
54
54
|
console.log(`incidents: ${i.firing} firing (${i.firing_critical} critical) · ${i.acknowledged} acknowledged · ${i.started_24h} started in 24h`);
|
|
55
55
|
return 0;
|
|
56
56
|
}
|
package/dist/client.d.ts
CHANGED
package/dist/schema.d.ts
CHANGED
|
@@ -187,7 +187,7 @@ export interface paths {
|
|
|
187
187
|
path?: never;
|
|
188
188
|
cookie?: never;
|
|
189
189
|
};
|
|
190
|
-
/** Uptime
|
|
190
|
+
/** Uptime (confirmed critical incidents only), check success and response-time stats (maintenance excluded) */
|
|
191
191
|
get: operations["getMonitorUptime"];
|
|
192
192
|
put?: never;
|
|
193
193
|
post?: never;
|
|
@@ -243,7 +243,7 @@ export interface paths {
|
|
|
243
243
|
get: operations["getAlertRule"];
|
|
244
244
|
put?: never;
|
|
245
245
|
post?: never;
|
|
246
|
-
/** Delete an alert rule (system rules →
|
|
246
|
+
/** Delete an alert rule (system rules → 403) */
|
|
247
247
|
delete: operations["deleteAlertRule"];
|
|
248
248
|
options?: never;
|
|
249
249
|
head?: never;
|
|
@@ -657,6 +657,40 @@ export interface paths {
|
|
|
657
657
|
patch?: never;
|
|
658
658
|
trace?: never;
|
|
659
659
|
};
|
|
660
|
+
"/reports/schedules": {
|
|
661
|
+
parameters: {
|
|
662
|
+
query?: never;
|
|
663
|
+
header?: never;
|
|
664
|
+
path?: never;
|
|
665
|
+
cookie?: never;
|
|
666
|
+
};
|
|
667
|
+
/** The organization's two report-email cadences (weekly + monthly) with their recipients and enabled state */
|
|
668
|
+
get: operations["listReportSchedules"];
|
|
669
|
+
put?: never;
|
|
670
|
+
post?: never;
|
|
671
|
+
delete?: never;
|
|
672
|
+
options?: never;
|
|
673
|
+
head?: never;
|
|
674
|
+
patch?: never;
|
|
675
|
+
trace?: never;
|
|
676
|
+
};
|
|
677
|
+
"/reports/schedules/{frequency}": {
|
|
678
|
+
parameters: {
|
|
679
|
+
query?: never;
|
|
680
|
+
header?: never;
|
|
681
|
+
path?: never;
|
|
682
|
+
cookie?: never;
|
|
683
|
+
};
|
|
684
|
+
get?: never;
|
|
685
|
+
put?: never;
|
|
686
|
+
post?: never;
|
|
687
|
+
delete?: never;
|
|
688
|
+
options?: never;
|
|
689
|
+
head?: never;
|
|
690
|
+
/** Enable/disable the weekly or monthly report email and/or set its recipients (up to 5). Enabling needs at least one recipient; clearing the list disables the cadence; adding the first recipient to an empty, disabled cadence enables it automatically. */
|
|
691
|
+
patch: operations["updateReportSchedule"];
|
|
692
|
+
trace?: never;
|
|
693
|
+
};
|
|
660
694
|
}
|
|
661
695
|
export type webhooks = Record<string, never>;
|
|
662
696
|
export interface components {
|
|
@@ -688,8 +722,11 @@ export interface components {
|
|
|
688
722
|
target?: string;
|
|
689
723
|
description?: string | null;
|
|
690
724
|
interval_seconds?: number;
|
|
691
|
-
/**
|
|
692
|
-
|
|
725
|
+
/**
|
|
726
|
+
* @description Effective status. down = a confirmed critical incident is open (firing or acknowledged); degraded = a failed check not yet confirmed, or an open warning incident; unknown = no check data yet. paused always wins.
|
|
727
|
+
* @enum {string}
|
|
728
|
+
*/
|
|
729
|
+
status?: "up" | "degraded" | "down" | "paused" | "unknown";
|
|
693
730
|
active?: boolean;
|
|
694
731
|
/** @enum {string} */
|
|
695
732
|
scheduling_strategy?: "roundrobin" | "random" | "parallel";
|
|
@@ -704,17 +741,19 @@ export interface components {
|
|
|
704
741
|
};
|
|
705
742
|
MonitorCreate: {
|
|
706
743
|
name: string;
|
|
744
|
+
/** @description http, api, dns, tcp, ssl, udp, icmp, mtr, smtp, ftp, sftp, websocket, rdap, blacklist, ntp, email_policy, sitemap, favicon, cdn, breach, brotli, cms, browser, heartbeat, mcp */
|
|
707
745
|
type: string;
|
|
708
746
|
target: string;
|
|
709
|
-
/** @description Seconds */
|
|
747
|
+
/** @description Seconds; validated against the plan's per-type minimum */
|
|
710
748
|
interval: number;
|
|
711
|
-
/** @description Location ids from GET /locations; required except for heartbeat */
|
|
749
|
+
/** @description Location ids from GET /locations; at least one is required except for heartbeat (which takes none) */
|
|
712
750
|
locations?: string[];
|
|
713
751
|
/**
|
|
714
752
|
* @default roundrobin
|
|
715
753
|
* @enum {string}
|
|
716
754
|
*/
|
|
717
755
|
schedulingStrategy: "roundrobin" | "random" | "parallel";
|
|
756
|
+
/** @description Lowercase alphanumeric with hyphens or colons, e.g. prod, team:web */
|
|
718
757
|
tags?: string[];
|
|
719
758
|
description?: string;
|
|
720
759
|
config?: Record<string, never>;
|
|
@@ -726,7 +765,8 @@ export interface components {
|
|
|
726
765
|
target?: string;
|
|
727
766
|
description?: string;
|
|
728
767
|
interval?: number;
|
|
729
|
-
|
|
768
|
+
/** @enum {string} */
|
|
769
|
+
schedulingStrategy?: "roundrobin" | "random" | "parallel";
|
|
730
770
|
locations?: string[];
|
|
731
771
|
tags?: string[];
|
|
732
772
|
config?: Record<string, never>;
|
|
@@ -738,7 +778,12 @@ export interface components {
|
|
|
738
778
|
monitor_id?: string;
|
|
739
779
|
/** @enum {string} */
|
|
740
780
|
period?: "1h" | "24h" | "7d" | "30d" | "90d";
|
|
781
|
+
/** @description Incident-based uptime: 100 − share of the period inside confirmed critical incidents; scheduled maintenance is neutral and the window is clamped to the monitor's creation time. Failed checks that never became a confirmed incident do not reduce it. null only before the monitor existed. */
|
|
741
782
|
uptime_percent?: number | null;
|
|
783
|
+
/** @description Milliseconds inside confirmed critical incidents this period, maintenance excluded */
|
|
784
|
+
downtime_ms?: number;
|
|
785
|
+
/** @description Successful ÷ total checks over the period (maintenance excluded); null when the period has no checks */
|
|
786
|
+
check_success_percent?: number | null;
|
|
742
787
|
total_checks?: number;
|
|
743
788
|
successful_checks?: number;
|
|
744
789
|
failed_checks?: number;
|
|
@@ -746,6 +791,7 @@ export interface components {
|
|
|
746
791
|
min_response_time_ms?: number | null;
|
|
747
792
|
max_response_time_ms?: number | null;
|
|
748
793
|
last_failure_at?: string | null;
|
|
794
|
+
/** @description Incident-based headline uptime for the last 24 hours */
|
|
749
795
|
uptime_24h?: number | null;
|
|
750
796
|
uptime_7d?: number | null;
|
|
751
797
|
uptime_30d?: number | null;
|
|
@@ -780,7 +826,7 @@ export interface components {
|
|
|
780
826
|
operator?: string;
|
|
781
827
|
value?: string;
|
|
782
828
|
/** @enum {string} */
|
|
783
|
-
severity?: "critical" | "warning"
|
|
829
|
+
severity?: "critical" | "warning";
|
|
784
830
|
failure_threshold?: number;
|
|
785
831
|
min_failed_probes?: number;
|
|
786
832
|
duration_window_seconds?: number;
|
|
@@ -804,7 +850,7 @@ export interface components {
|
|
|
804
850
|
* @default critical
|
|
805
851
|
* @enum {string}
|
|
806
852
|
*/
|
|
807
|
-
severity: "critical" | "warning"
|
|
853
|
+
severity: "critical" | "warning";
|
|
808
854
|
/** @default 1 */
|
|
809
855
|
failureThreshold: number;
|
|
810
856
|
/** @default 1 */
|
|
@@ -836,7 +882,15 @@ export interface components {
|
|
|
836
882
|
status?: "firing" | "acknowledged" | "resolved";
|
|
837
883
|
/** @enum {string} */
|
|
838
884
|
severity?: "warning" | "critical";
|
|
885
|
+
/** @description Human-readable explanation of what failed, derived from the rule that fired (e.g. 'Received an unexpected HTTP status code (expected: 2xx, 3xx)'); the raw engine message only when no rule snapshot exists */
|
|
839
886
|
message?: string;
|
|
887
|
+
/** @description Fire-time alert-rule snapshot — frozen when the incident opened, so later edits to the rule do not rewrite history. null only for old incidents without a snapshot. */
|
|
888
|
+
rule?: {
|
|
889
|
+
name?: string;
|
|
890
|
+
metric?: string;
|
|
891
|
+
operator?: string;
|
|
892
|
+
value?: string;
|
|
893
|
+
} | null;
|
|
840
894
|
monitor?: {
|
|
841
895
|
/** Format: uuid */
|
|
842
896
|
id?: string;
|
|
@@ -846,6 +900,8 @@ export interface components {
|
|
|
846
900
|
started_at?: string;
|
|
847
901
|
acknowledged_at?: string | null;
|
|
848
902
|
resolved_at?: string | null;
|
|
903
|
+
/** @description started_at → resolved_at in seconds; null while open */
|
|
904
|
+
duration_seconds?: number | null;
|
|
849
905
|
};
|
|
850
906
|
MaintenanceWindow: {
|
|
851
907
|
/** Format: uuid */
|
|
@@ -869,39 +925,59 @@ export interface components {
|
|
|
869
925
|
/** Format: date-time */
|
|
870
926
|
created_at?: string;
|
|
871
927
|
};
|
|
928
|
+
/** @description At least one of monitorIds / monitorTags is required. Status-page publishing (statusPageIds, autoPublish) is dashboard-only — sending either field returns 400 invalid_request. */
|
|
872
929
|
MaintenanceWindowCreate: {
|
|
873
930
|
name: string;
|
|
874
931
|
/** Format: date-time */
|
|
875
932
|
startsAt: string;
|
|
933
|
+
/** @description 5 minutes to 30 days */
|
|
876
934
|
durationMinutes: number;
|
|
935
|
+
/** @description Ids outside your organization are dropped, not rejected */
|
|
877
936
|
monitorIds?: string[];
|
|
937
|
+
/** @description Tag targeting also covers monitors that get the tag later; unions with monitorIds */
|
|
878
938
|
monitorTags?: string[];
|
|
879
939
|
description?: string;
|
|
880
|
-
/**
|
|
940
|
+
/**
|
|
941
|
+
* @description IANA name used to interpret recurring start times
|
|
942
|
+
* @default UTC
|
|
943
|
+
*/
|
|
881
944
|
timezone: string;
|
|
882
945
|
/**
|
|
883
946
|
* @default once
|
|
884
947
|
* @enum {string}
|
|
885
948
|
*/
|
|
886
949
|
recurrence: "once" | "daily" | "weekly" | "monthly";
|
|
887
|
-
/**
|
|
950
|
+
/**
|
|
951
|
+
* Format: date-time
|
|
952
|
+
* @description Must be after startsAt
|
|
953
|
+
*/
|
|
888
954
|
recurrenceUntil?: string;
|
|
889
955
|
/** @default true */
|
|
890
956
|
suppressAlerts: boolean;
|
|
891
|
-
/**
|
|
957
|
+
/**
|
|
958
|
+
* @description Show the Maintenance badge on covered monitors while active
|
|
959
|
+
* @default true
|
|
960
|
+
*/
|
|
961
|
+
markMaintenance: boolean;
|
|
962
|
+
/**
|
|
963
|
+
* @description Exclude the window's time from uptime/SLA
|
|
964
|
+
* @default true
|
|
965
|
+
*/
|
|
892
966
|
excludeFromSla: boolean;
|
|
893
967
|
};
|
|
968
|
+
/** @description Partial update. timezone and recurrence cannot be changed after creation — delete and recreate the window instead. */
|
|
894
969
|
MaintenanceWindowUpdate: {
|
|
895
970
|
name?: string;
|
|
971
|
+
description?: string | null;
|
|
896
972
|
/** Format: date-time */
|
|
897
973
|
startsAt?: string;
|
|
898
974
|
durationMinutes?: number;
|
|
899
975
|
monitorIds?: string[];
|
|
900
976
|
monitorTags?: string[];
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
/** @
|
|
904
|
-
|
|
977
|
+
suppressAlerts?: boolean;
|
|
978
|
+
excludeFromSla?: boolean;
|
|
979
|
+
/** @description false disables the window without deleting it (no further occurrences activate) */
|
|
980
|
+
enabled?: boolean;
|
|
905
981
|
};
|
|
906
982
|
AlertRuleUpdate: {
|
|
907
983
|
name?: string;
|
|
@@ -909,7 +985,7 @@ export interface components {
|
|
|
909
985
|
operator?: string;
|
|
910
986
|
value?: string;
|
|
911
987
|
/** @enum {string} */
|
|
912
|
-
severity?: "critical" | "warning"
|
|
988
|
+
severity?: "critical" | "warning";
|
|
913
989
|
failureThreshold?: number;
|
|
914
990
|
minFailedProbes?: number;
|
|
915
991
|
/** @description Seconds */
|
|
@@ -931,68 +1007,76 @@ export interface components {
|
|
|
931
1007
|
name?: string;
|
|
932
1008
|
contactIds?: string[];
|
|
933
1009
|
};
|
|
1010
|
+
/** @description Password protection, logo upload and custom subdomains are dashboard-only. */
|
|
934
1011
|
StatusPageCreate: {
|
|
1012
|
+
/** @description Lowercase letters, numbers and dashes; globally unique across WatchFor (409 when taken) */
|
|
935
1013
|
slug: string;
|
|
936
1014
|
name: string;
|
|
937
1015
|
description?: string;
|
|
938
1016
|
/** @default true */
|
|
939
1017
|
isPublic: boolean;
|
|
940
|
-
|
|
941
|
-
|
|
1018
|
+
/**
|
|
1019
|
+
* @description Confirmed incidents on component monitors appear on the page automatically
|
|
1020
|
+
* @default true
|
|
1021
|
+
*/
|
|
942
1022
|
autoPublishIncidents: boolean;
|
|
943
1023
|
/** @default false */
|
|
944
1024
|
dimUntrackedDays: boolean;
|
|
945
|
-
logoPath?: string;
|
|
946
|
-
/**
|
|
947
|
-
* @default left
|
|
948
|
-
* @enum {string}
|
|
949
|
-
*/
|
|
950
|
-
logoPosition: "left" | "center" | "right";
|
|
951
1025
|
/**
|
|
952
1026
|
* @default auto
|
|
953
1027
|
* @enum {string}
|
|
954
1028
|
*/
|
|
955
1029
|
theme: "light" | "dark" | "auto";
|
|
1030
|
+
/**
|
|
1031
|
+
* @description Components in display order (position = array index); monitor ids outside your organization are dropped, not rejected
|
|
1032
|
+
* @default []
|
|
1033
|
+
*/
|
|
1034
|
+
components: {
|
|
1035
|
+
name: string;
|
|
1036
|
+
description?: string;
|
|
1037
|
+
/** @default [] */
|
|
1038
|
+
monitorIds: string[];
|
|
1039
|
+
/** @default [] */
|
|
1040
|
+
monitorTags: string[];
|
|
1041
|
+
}[];
|
|
956
1042
|
};
|
|
1043
|
+
/** @description Partial update. Component editing, password protection and logo upload are dashboard-only. A slug change re-checks uniqueness (409) and the old URL stops serving immediately. */
|
|
957
1044
|
StatusPageUpdate: {
|
|
958
1045
|
slug?: string;
|
|
959
1046
|
name?: string;
|
|
960
1047
|
description?: string | null;
|
|
961
1048
|
isPublic?: boolean;
|
|
962
|
-
password?: string | null;
|
|
963
1049
|
autoPublishIncidents?: boolean;
|
|
964
1050
|
dimUntrackedDays?: boolean;
|
|
965
|
-
logoPath?: string | null;
|
|
966
|
-
/** @enum {string} */
|
|
967
|
-
logoPosition?: "left" | "center" | "right";
|
|
968
1051
|
/** @enum {string} */
|
|
969
1052
|
theme?: "light" | "dark" | "auto";
|
|
970
1053
|
};
|
|
1054
|
+
/** @description Manual incident notice on the page (type is always incident; maintenance notices come from maintenance windows). */
|
|
971
1055
|
AnnouncementCreate: {
|
|
972
1056
|
title: string;
|
|
1057
|
+
/** @description Becomes the first timeline entry */
|
|
973
1058
|
body: string;
|
|
974
1059
|
/**
|
|
975
|
-
* @default
|
|
1060
|
+
* @default investigating
|
|
976
1061
|
* @enum {string}
|
|
977
1062
|
*/
|
|
978
|
-
|
|
1063
|
+
status: "investigating" | "identified" | "monitoring" | "resolved";
|
|
979
1064
|
/**
|
|
980
1065
|
* @default minor
|
|
981
1066
|
* @enum {string}
|
|
982
1067
|
*/
|
|
983
1068
|
severity: "minor" | "major" | "critical";
|
|
984
|
-
|
|
985
|
-
|
|
1069
|
+
/**
|
|
1070
|
+
* @description Component ids of this page; any other id returns 400
|
|
1071
|
+
* @default []
|
|
1072
|
+
*/
|
|
1073
|
+
affectedComponentIds: string[];
|
|
986
1074
|
};
|
|
1075
|
+
/** @description PATCH = post an update: appends an entry to the public timeline and moves the announcement to `status`; resolved closes it and sets resolved_at. Title and severity edits are dashboard-only. */
|
|
987
1076
|
AnnouncementUpdate: {
|
|
988
|
-
|
|
989
|
-
body?: string;
|
|
990
|
-
/** @enum {string} */
|
|
991
|
-
type?: "incident" | "maintenance";
|
|
1077
|
+
body: string;
|
|
992
1078
|
/** @enum {string} */
|
|
993
|
-
|
|
994
|
-
affectedComponentIds?: string[];
|
|
995
|
-
affectedMonitorIds?: string[];
|
|
1079
|
+
status: "investigating" | "identified" | "monitoring" | "resolved";
|
|
996
1080
|
};
|
|
997
1081
|
Contact: {
|
|
998
1082
|
/** Format: uuid */
|
|
@@ -1186,10 +1270,24 @@ export interface components {
|
|
|
1186
1270
|
Summary: {
|
|
1187
1271
|
/** @constant */
|
|
1188
1272
|
object?: "summary";
|
|
1189
|
-
/** @description
|
|
1190
|
-
monitors?:
|
|
1191
|
-
|
|
1192
|
-
|
|
1273
|
+
/** @description Effective-status counts — same rule as the dashboard: an open critical incident flips a stale up/unknown to down; an open warning incident or an unconfirmed failed check counts as degraded; paused always wins. health_score is 0-100 (share of active, non-paused monitors that are up). */
|
|
1274
|
+
monitors?: {
|
|
1275
|
+
total?: number;
|
|
1276
|
+
up?: number;
|
|
1277
|
+
degraded?: number;
|
|
1278
|
+
down?: number;
|
|
1279
|
+
paused?: number;
|
|
1280
|
+
unknown?: number;
|
|
1281
|
+
health_score?: number;
|
|
1282
|
+
};
|
|
1283
|
+
/** @description Open incident counts (firing, split by severity, and acknowledged) plus incidents started in the last 24h */
|
|
1284
|
+
incidents?: {
|
|
1285
|
+
firing?: number;
|
|
1286
|
+
firing_critical?: number;
|
|
1287
|
+
firing_warning?: number;
|
|
1288
|
+
acknowledged?: number;
|
|
1289
|
+
started_24h?: number;
|
|
1290
|
+
};
|
|
1193
1291
|
open_maintenance_windows?: number;
|
|
1194
1292
|
};
|
|
1195
1293
|
IncidentStats: {
|
|
@@ -1208,7 +1306,17 @@ export interface components {
|
|
|
1208
1306
|
counts?: Record<string, never>[];
|
|
1209
1307
|
top_unstable_monitors?: Record<string, never>[];
|
|
1210
1308
|
};
|
|
1211
|
-
/** @description
|
|
1309
|
+
/** @description Scheduled report-email cadence (weekly or monthly). Every organization has exactly these two; recipients are capped at 5. suppressed_recipients lists addresses that unsubscribed themselves — kept on the list but skipped at send time. */
|
|
1310
|
+
ReportSchedule: {
|
|
1311
|
+
/** @constant */
|
|
1312
|
+
object?: "report_schedule";
|
|
1313
|
+
/** @enum {string} */
|
|
1314
|
+
frequency?: "weekly" | "monthly";
|
|
1315
|
+
enabled?: boolean;
|
|
1316
|
+
recipients?: string[];
|
|
1317
|
+
suppressed_recipients?: string[];
|
|
1318
|
+
};
|
|
1319
|
+
/** @description Org report for a period, always compared with the equal-length previous period. Compared values carry {current, previous, delta}; previous/delta are null with no baseline. Depth follows the plan: basic omits the type-aware sections (listed in gatedSections), withholds insights beyond a cap (gatedInsightCount) and truncates the monitors table. Field names are camelCase (the dashboard's report document), unlike the rest of the API. */
|
|
1212
1320
|
Report: {
|
|
1213
1321
|
/** @constant */
|
|
1214
1322
|
object?: "report";
|
|
@@ -1226,7 +1334,7 @@ export interface components {
|
|
|
1226
1334
|
depth?: "basic" | "advanced";
|
|
1227
1335
|
typesPresent?: string[];
|
|
1228
1336
|
};
|
|
1229
|
-
/** @description uptimePct/incidents/criticalIncidents/downtimeMs as compared values; mttrMs/mtbfMs nullable; longestIncident; totalChecks; monitorsCovered */
|
|
1337
|
+
/** @description uptimePct (incident-based: confirmed critical incidents only, maintenance neutral, weighted by observed time) / checkSuccessPct (successful ÷ total checks) / incidents / criticalIncidents / downtimeMs as compared values; mttrMs/mttaMs/mtbfMs nullable; longestIncident; totalChecks; monitorsCovered */
|
|
1230
1338
|
summary?: Record<string, never>;
|
|
1231
1339
|
/** @description Fleet avg/min/max ms + slow-check count over latency-style monitor types */
|
|
1232
1340
|
responseTime?: Record<string, never> | null;
|
|
@@ -1235,23 +1343,36 @@ export interface components {
|
|
|
1235
1343
|
monitorId?: string;
|
|
1236
1344
|
name?: string;
|
|
1237
1345
|
type?: string;
|
|
1346
|
+
/** @description Incident-based, same formula as the monitor's Uptime card */
|
|
1238
1347
|
uptimePct?: Record<string, never>;
|
|
1348
|
+
downtimeMs?: number;
|
|
1349
|
+
checkSuccessPct?: number;
|
|
1239
1350
|
avgMs?: number;
|
|
1240
1351
|
p95Ms?: number;
|
|
1241
1352
|
incidents?: number;
|
|
1242
1353
|
hadMaintenance?: boolean;
|
|
1243
1354
|
}[];
|
|
1244
1355
|
totalMonitors?: number;
|
|
1245
|
-
/** @description Type-aware sections keyed ssl/domains/cwv/heartbeat/blacklist/mcp — only
|
|
1356
|
+
/** @description Type-aware sections keyed locations/ssl/domains/cwv/heartbeat/blacklist/mcp — only the keys the org's monitors produce (locations needs latency-style monitors), advanced depth only */
|
|
1246
1357
|
sections?: Record<string, never>;
|
|
1247
|
-
/** @description Sections that exist but are locked by the plan */
|
|
1248
|
-
|
|
1358
|
+
/** @description Sections that exist for this org's monitors but are locked by the plan (empty on advanced depth) */
|
|
1359
|
+
gatedSections?: (
|
|
1360
|
+
| "locations"
|
|
1361
|
+
| "ssl"
|
|
1362
|
+
| "domains"
|
|
1363
|
+
| "cwv"
|
|
1364
|
+
| "heartbeat"
|
|
1365
|
+
| "blacklist"
|
|
1366
|
+
| "mcp"
|
|
1367
|
+
)[];
|
|
1249
1368
|
/** @description Plain-language findings, most severe first, tone good|warning|critical|neutral */
|
|
1250
1369
|
insights?: {
|
|
1251
1370
|
tone?: string;
|
|
1252
1371
|
text?: string;
|
|
1253
1372
|
monitorId?: string;
|
|
1254
1373
|
}[];
|
|
1374
|
+
/** @description Insights withheld beyond the plan's cap (0 on advanced depth) */
|
|
1375
|
+
gatedInsightCount?: number;
|
|
1255
1376
|
};
|
|
1256
1377
|
OncallSchedule: {
|
|
1257
1378
|
id?: number;
|
|
@@ -1355,6 +1476,12 @@ export interface components {
|
|
|
1355
1476
|
data: components["schemas"]["ActivityEvent"][];
|
|
1356
1477
|
has_more: boolean;
|
|
1357
1478
|
};
|
|
1479
|
+
ReportScheduleList: {
|
|
1480
|
+
/** @constant */
|
|
1481
|
+
object: "list";
|
|
1482
|
+
data: components["schemas"]["ReportSchedule"][];
|
|
1483
|
+
has_more: boolean;
|
|
1484
|
+
};
|
|
1358
1485
|
};
|
|
1359
1486
|
responses: never;
|
|
1360
1487
|
parameters: never;
|
|
@@ -1471,7 +1598,8 @@ export interface operations {
|
|
|
1471
1598
|
limit?: number;
|
|
1472
1599
|
cursor?: string;
|
|
1473
1600
|
type?: string;
|
|
1474
|
-
status
|
|
1601
|
+
/** @description Effective status: down = confirmed critical incident open; degraded = failed check not yet confirmed, or an open warning incident */
|
|
1602
|
+
status?: "up" | "degraded" | "down" | "paused" | "unknown";
|
|
1475
1603
|
tag?: string;
|
|
1476
1604
|
/** @description Case-insensitive substring search over name and target */
|
|
1477
1605
|
q?: string;
|
|
@@ -1822,6 +1950,8 @@ export interface operations {
|
|
|
1822
1950
|
query?: {
|
|
1823
1951
|
hours?: number;
|
|
1824
1952
|
limit?: number;
|
|
1953
|
+
/** @description true = only passing checks, false = only failed checks (one-call failure forensics); omit for all. The per-location breakdown ignores this filter. */
|
|
1954
|
+
success?: boolean;
|
|
1825
1955
|
};
|
|
1826
1956
|
header?: never;
|
|
1827
1957
|
path: {
|
|
@@ -3081,7 +3211,7 @@ export interface operations {
|
|
|
3081
3211
|
};
|
|
3082
3212
|
cookie?: never;
|
|
3083
3213
|
};
|
|
3084
|
-
requestBody
|
|
3214
|
+
requestBody: {
|
|
3085
3215
|
content: {
|
|
3086
3216
|
"application/json": components["schemas"]["AnnouncementUpdate"];
|
|
3087
3217
|
};
|
|
@@ -3312,6 +3442,20 @@ export interface operations {
|
|
|
3312
3442
|
from?: string;
|
|
3313
3443
|
/** @description Custom period end (ISO 8601 or Unix epoch) */
|
|
3314
3444
|
to?: string;
|
|
3445
|
+
/** @description Comma-separated monitor IDs to scope the report to (advanced-reports plans). Combined with `tags` as a union. */
|
|
3446
|
+
monitor_ids?: string;
|
|
3447
|
+
/** @description Comma-separated monitor tags to scope the report to (advanced-reports plans) */
|
|
3448
|
+
tags?: string;
|
|
3449
|
+
/** @description Comma-separated subset of type-aware sections to generate: locations,ssl,domains,cwv,heartbeat,blacklist,mcp (advanced-reports plans; omit for all) */
|
|
3450
|
+
sections?: string;
|
|
3451
|
+
/** @description Set false to drop the response-time block */
|
|
3452
|
+
response_time?: boolean;
|
|
3453
|
+
/** @description Set false to drop the per-monitor table */
|
|
3454
|
+
monitors_table?: boolean;
|
|
3455
|
+
/** @description Set false to drop the insights block */
|
|
3456
|
+
insights?: boolean;
|
|
3457
|
+
/** @description Comma-separated subset of acknowledged, resolved, open (or `all`). Filters incident aggregates (counts, MTTR/MTTA, downtime, per-monitor column) to incidents in any selected state; uptime stays check-based (advanced-reports plans) */
|
|
3458
|
+
incident_status?: string;
|
|
3315
3459
|
};
|
|
3316
3460
|
header?: never;
|
|
3317
3461
|
path?: never;
|
|
@@ -3339,4 +3483,71 @@ export interface operations {
|
|
|
3339
3483
|
};
|
|
3340
3484
|
};
|
|
3341
3485
|
};
|
|
3486
|
+
listReportSchedules: {
|
|
3487
|
+
parameters: {
|
|
3488
|
+
query?: never;
|
|
3489
|
+
header?: never;
|
|
3490
|
+
path?: never;
|
|
3491
|
+
cookie?: never;
|
|
3492
|
+
};
|
|
3493
|
+
requestBody?: never;
|
|
3494
|
+
responses: {
|
|
3495
|
+
/** @description Both cadences, weekly first */
|
|
3496
|
+
200: {
|
|
3497
|
+
headers: {
|
|
3498
|
+
[name: string]: unknown;
|
|
3499
|
+
};
|
|
3500
|
+
content: {
|
|
3501
|
+
"application/json": components["schemas"]["ReportScheduleList"];
|
|
3502
|
+
};
|
|
3503
|
+
};
|
|
3504
|
+
/** @description Error */
|
|
3505
|
+
default: {
|
|
3506
|
+
headers: {
|
|
3507
|
+
[name: string]: unknown;
|
|
3508
|
+
};
|
|
3509
|
+
content: {
|
|
3510
|
+
"application/json": components["schemas"]["Error"];
|
|
3511
|
+
};
|
|
3512
|
+
};
|
|
3513
|
+
};
|
|
3514
|
+
};
|
|
3515
|
+
updateReportSchedule: {
|
|
3516
|
+
parameters: {
|
|
3517
|
+
query?: never;
|
|
3518
|
+
header?: never;
|
|
3519
|
+
path: {
|
|
3520
|
+
frequency: "weekly" | "monthly";
|
|
3521
|
+
};
|
|
3522
|
+
cookie?: never;
|
|
3523
|
+
};
|
|
3524
|
+
requestBody: {
|
|
3525
|
+
content: {
|
|
3526
|
+
"application/json": {
|
|
3527
|
+
enabled?: boolean;
|
|
3528
|
+
recipients?: string[];
|
|
3529
|
+
};
|
|
3530
|
+
};
|
|
3531
|
+
};
|
|
3532
|
+
responses: {
|
|
3533
|
+
/** @description OK */
|
|
3534
|
+
200: {
|
|
3535
|
+
headers: {
|
|
3536
|
+
[name: string]: unknown;
|
|
3537
|
+
};
|
|
3538
|
+
content: {
|
|
3539
|
+
"application/json": components["schemas"]["ReportSchedule"];
|
|
3540
|
+
};
|
|
3541
|
+
};
|
|
3542
|
+
/** @description Error */
|
|
3543
|
+
default: {
|
|
3544
|
+
headers: {
|
|
3545
|
+
[name: string]: unknown;
|
|
3546
|
+
};
|
|
3547
|
+
content: {
|
|
3548
|
+
"application/json": components["schemas"]["Error"];
|
|
3549
|
+
};
|
|
3550
|
+
};
|
|
3551
|
+
};
|
|
3552
|
+
};
|
|
3342
3553
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "watchfor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Official TypeScript SDK + CLI for WatchFor \u2014 uptime & infrastructure monitoring (monitors, alert rules, incidents, maintenance windows) over the REST API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"watchfor",
|
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "tsc -p tsconfig.json && cp src/schema.d.ts dist/schema.d.ts",
|
|
42
42
|
"prepublishOnly": "npm run build",
|
|
43
|
-
"regen-types": "openapi-typescript https://watchfor.io/openapi.json -o src/schema.d.ts"
|
|
43
|
+
"regen-types": "openapi-typescript ${SPEC:-https://watchfor.io/openapi.json} -o src/schema.d.ts",
|
|
44
|
+
"regen-types:local": "node scripts/dump-spec.mjs > /tmp/watchfor-openapi.json && openapi-typescript /tmp/watchfor-openapi.json -o src/schema.d.ts"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
47
|
"@types/node": "^22.0.0",
|