watchfor 0.10.0 → 0.12.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 +15 -2
- package/dist/cli.js +11 -0
- package/dist/client.d.ts +65 -0
- package/dist/client.js +37 -1
- package/dist/index.d.ts +1 -1
- package/dist/schema.d.ts +730 -22
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# watchfor
|
|
2
2
|
|
|
3
3
|
Official TypeScript SDK + CLI for [WatchFor](https://watchfor.io) —
|
|
4
|
-
uptime & infrastructure monitoring (
|
|
4
|
+
uptime & infrastructure monitoring (27 check types, confirmed alerting,
|
|
5
5
|
status pages, on-call).
|
|
6
6
|
|
|
7
7
|
```bash
|
|
@@ -42,6 +42,11 @@ await wf.monitors.reset(monitor.id!);
|
|
|
42
42
|
// Page integrity: after a deploy, accept what the newest check saw as the new baseline.
|
|
43
43
|
await wf.monitors.acceptBaseline(integrityMonitorId);
|
|
44
44
|
|
|
45
|
+
// Browser checks: try a Playwright script once (nothing saved), then read the result.
|
|
46
|
+
const { id } = await wf.playwright.testRun({ script, target: "https://shop.example.com" });
|
|
47
|
+
const run = await wf.playwright.getTestRun(id); // status: queued | running | done | error
|
|
48
|
+
await wf.variables.put("LOGIN_PASSWORD", { value: process.env.PW!, secret: true });
|
|
49
|
+
|
|
45
50
|
// Older checks: pass next_cursor back as cursor (keep the same hours/success).
|
|
46
51
|
const page = await wf.monitors.checks(monitor.id!, { hours: 24, limit: 100 });
|
|
47
52
|
if (page.next_cursor) {
|
|
@@ -86,6 +91,14 @@ Toolbox. Details: https://watchfor.io/docs/api/diagnostics
|
|
|
86
91
|
- `WatchForError` carries `status`, `code` and `retryAfterSeconds`
|
|
87
92
|
- Pass an idempotency key as the second argument of any `create` call for safe retries
|
|
88
93
|
|
|
94
|
+
## Prometheus metrics (Pro plan and above)
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
const text = await wf.metrics({ tag: "production" }); // Prometheus text format
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Usually you point Prometheus at `https://watchfor.io/api/v1/metrics` directly; this is for scripts and one-off checks. See https://watchfor.io/docs/api/prometheus.
|
|
101
|
+
|
|
89
102
|
## CLI
|
|
90
103
|
|
|
91
104
|
```bash
|
|
@@ -100,5 +113,5 @@ npx watchfor report --period 30d
|
|
|
100
113
|
## Links
|
|
101
114
|
|
|
102
115
|
- API docs: https://watchfor.io/docs/api
|
|
103
|
-
- MCP server for AI agents (
|
|
116
|
+
- MCP server for AI agents (59 tools): https://watchfor.io/docs/api/mcp
|
|
104
117
|
- Create an API key: dashboard → Settings → API keys (`read` or `read+write` scope)
|
package/dist/cli.js
CHANGED
|
@@ -19,6 +19,8 @@ Usage:
|
|
|
19
19
|
Recent probe results for one monitor
|
|
20
20
|
(prints the next_cursor for older pages)
|
|
21
21
|
watchfor report [--period 7d|30d] Org report vs the previous period
|
|
22
|
+
watchfor metrics [--tag t] [--type t]
|
|
23
|
+
Prometheus text format (Pro plan and above)
|
|
22
24
|
watchfor help
|
|
23
25
|
|
|
24
26
|
Environment:
|
|
@@ -55,6 +57,15 @@ async function main() {
|
|
|
55
57
|
console.log(`incidents: ${i.firing} firing (${i.firing_critical} critical) · ${i.acknowledged} acknowledged · ${i.started_24h} started in 24h`);
|
|
56
58
|
return 0;
|
|
57
59
|
}
|
|
60
|
+
case "metrics": {
|
|
61
|
+
const tag = flag(args, "tag");
|
|
62
|
+
const type = flag(args, "type");
|
|
63
|
+
process.stdout.write(await wf.metrics({
|
|
64
|
+
...(tag && tag !== "true" ? { tag } : {}),
|
|
65
|
+
...(type && type !== "true" ? { type } : {}),
|
|
66
|
+
}));
|
|
67
|
+
return 0;
|
|
68
|
+
}
|
|
58
69
|
case "report": {
|
|
59
70
|
const idx = args.indexOf("--period");
|
|
60
71
|
const period = idx !== -1 && (args[idx + 1] === "30d" || args[idx + 1] === "7d")
|
package/dist/client.d.ts
CHANGED
|
@@ -12,6 +12,15 @@ export type MonitorDetail = components["schemas"]["MonitorDetail"];
|
|
|
12
12
|
export type MonitorReset = components["schemas"]["MonitorReset"];
|
|
13
13
|
export type IntegrityBaseline = components["schemas"]["IntegrityBaseline"];
|
|
14
14
|
export type IntegrityBaselineAccept = components["schemas"]["IntegrityBaselineAccept"];
|
|
15
|
+
export type PlaywrightTestRunRequest = components["schemas"]["PlaywrightTestRunRequest"];
|
|
16
|
+
export type PlaywrightTestRunAccepted = components["schemas"]["PlaywrightTestRunAccepted"];
|
|
17
|
+
export type PlaywrightTestRun = components["schemas"]["PlaywrightTestRun"];
|
|
18
|
+
export type PlaywrightRun = components["schemas"]["PlaywrightRun"];
|
|
19
|
+
export type PlaywrightRunSummary = components["schemas"]["PlaywrightRunSummary"];
|
|
20
|
+
export type ScriptVersion = components["schemas"]["ScriptVersion"];
|
|
21
|
+
export type ScriptVersionSummary = components["schemas"]["ScriptVersionSummary"];
|
|
22
|
+
export type Variable = components["schemas"]["Variable"];
|
|
23
|
+
export type VariableDeleted = components["schemas"]["VariableDeleted"];
|
|
15
24
|
export type Incident = components["schemas"]["Incident"];
|
|
16
25
|
export type AlertRule = components["schemas"]["AlertRule"];
|
|
17
26
|
export type Contact = components["schemas"]["Contact"];
|
|
@@ -71,6 +80,18 @@ export declare class WatchFor {
|
|
|
71
80
|
me(): Promise<unknown>;
|
|
72
81
|
/** One-call org snapshot: monitor status counts + active incidents. */
|
|
73
82
|
summary(): Promise<Summary>;
|
|
83
|
+
/**
|
|
84
|
+
* The organization in Prometheus text format (Pro plan and above):
|
|
85
|
+
* status, uptime, response times, expiry, heartbeats, hosts. Cached for
|
|
86
|
+
* 60 s server-side. Filters: tag, type, monitor_id (comma-separated),
|
|
87
|
+
* include_hosts.
|
|
88
|
+
*/
|
|
89
|
+
metrics(query?: {
|
|
90
|
+
tag?: string;
|
|
91
|
+
type?: string;
|
|
92
|
+
monitor_id?: string;
|
|
93
|
+
include_hosts?: boolean;
|
|
94
|
+
}): Promise<string>;
|
|
74
95
|
/** Plan limits and live usage. */
|
|
75
96
|
plan(): Promise<Plan>;
|
|
76
97
|
/** Aggregate incident stats: MTTR, MTBF, most unstable monitors. */
|
|
@@ -136,6 +157,27 @@ export declare class WatchFor {
|
|
|
136
157
|
acceptBaseline: (id: string, body?: {
|
|
137
158
|
pages?: string[];
|
|
138
159
|
}, idempotencyKey?: string) => Promise<IntegrityBaselineAccept>;
|
|
160
|
+
/** Browser checks: runs, newest first (`status` failed | flaky). */
|
|
161
|
+
runs: (id: string, params?: {
|
|
162
|
+
status?: "all" | "failed" | "flaky";
|
|
163
|
+
limit?: number;
|
|
164
|
+
cursor?: string;
|
|
165
|
+
}) => Promise<{
|
|
166
|
+
object: "list";
|
|
167
|
+
data: PlaywrightRunSummary[];
|
|
168
|
+
total?: number;
|
|
169
|
+
has_more: boolean;
|
|
170
|
+
next_cursor: string | null;
|
|
171
|
+
}>;
|
|
172
|
+
/** Browser checks: one run — steps, errors, Web Vitals, screenshot
|
|
173
|
+
* URLs (15 min) and the trace-viewer link. */
|
|
174
|
+
run: (id: string, runId: string) => Promise<PlaywrightRun>;
|
|
175
|
+
/** Browser checks: saved script versions (last 50). */
|
|
176
|
+
scriptVersions: (id: string) => Promise<{
|
|
177
|
+
object: "list";
|
|
178
|
+
data: ScriptVersionSummary[];
|
|
179
|
+
}>;
|
|
180
|
+
scriptVersion: (id: string, version: number) => Promise<ScriptVersion>;
|
|
139
181
|
uptime: (id: string, period?: "1h" | "24h" | "7d" | "30d" | "90d") => Promise<Uptime>;
|
|
140
182
|
/** Recent probe results, newest first. Page with `next_cursor` →
|
|
141
183
|
* `cursor` (keep the same `hours`/`success`); `locations` is the
|
|
@@ -156,6 +198,29 @@ export declare class WatchFor {
|
|
|
156
198
|
update: (monitorId: string, ruleId: string, body: Record<string, unknown>) => Promise<AlertRule>;
|
|
157
199
|
delete: (monitorId: string, ruleId: string) => Promise<Deleted>;
|
|
158
200
|
};
|
|
201
|
+
/**
|
|
202
|
+
* Browser checks (Playwright): run a script once without saving it —
|
|
203
|
+
* `testRun()` returns an id, `getTestRun()` its live progress and result.
|
|
204
|
+
*/
|
|
205
|
+
readonly playwright: {
|
|
206
|
+
testRun: (body: PlaywrightTestRunRequest, idempotencyKey?: string) => Promise<PlaywrightTestRunAccepted>;
|
|
207
|
+
getTestRun: (id: string) => Promise<PlaywrightTestRun>;
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* Org variables and secrets browser checks read as process.env.NAME.
|
|
211
|
+
* Secrets are write-only: `list()` never returns their value.
|
|
212
|
+
*/
|
|
213
|
+
readonly variables: {
|
|
214
|
+
list: () => Promise<{
|
|
215
|
+
object: "list";
|
|
216
|
+
data: Variable[];
|
|
217
|
+
}>;
|
|
218
|
+
put: (name: string, body: {
|
|
219
|
+
value?: string;
|
|
220
|
+
secret?: boolean;
|
|
221
|
+
}) => Promise<Variable>;
|
|
222
|
+
delete: (name: string) => Promise<VariableDeleted>;
|
|
223
|
+
};
|
|
159
224
|
readonly incidents: {
|
|
160
225
|
list: (q?: {
|
|
161
226
|
status?: "firing" | "acknowledged" | "resolved";
|
package/dist/client.js
CHANGED
|
@@ -29,7 +29,7 @@ export class WatchFor {
|
|
|
29
29
|
}
|
|
30
30
|
const headers = {
|
|
31
31
|
Authorization: `Bearer ${this.apiKey}`,
|
|
32
|
-
Accept: "application/json",
|
|
32
|
+
Accept: opts.text ? "text/plain, application/json" : "application/json",
|
|
33
33
|
};
|
|
34
34
|
if (opts.body !== undefined)
|
|
35
35
|
headers["Content-Type"] = "application/json";
|
|
@@ -42,6 +42,8 @@ export class WatchFor {
|
|
|
42
42
|
});
|
|
43
43
|
if (res.status === 204)
|
|
44
44
|
return undefined;
|
|
45
|
+
if (opts.text && res.ok)
|
|
46
|
+
return (await res.text());
|
|
45
47
|
let json = null;
|
|
46
48
|
try {
|
|
47
49
|
json = await res.json();
|
|
@@ -66,6 +68,15 @@ export class WatchFor {
|
|
|
66
68
|
summary() {
|
|
67
69
|
return this.request("GET", "/summary");
|
|
68
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* The organization in Prometheus text format (Pro plan and above):
|
|
73
|
+
* status, uptime, response times, expiry, heartbeats, hosts. Cached for
|
|
74
|
+
* 60 s server-side. Filters: tag, type, monitor_id (comma-separated),
|
|
75
|
+
* include_hosts.
|
|
76
|
+
*/
|
|
77
|
+
metrics(query = {}) {
|
|
78
|
+
return this.request("GET", "/metrics", { query, text: true });
|
|
79
|
+
}
|
|
69
80
|
/** Plan limits and live usage. */
|
|
70
81
|
plan() {
|
|
71
82
|
return this.request("GET", "/plan");
|
|
@@ -141,6 +152,14 @@ export class WatchFor {
|
|
|
141
152
|
body: body ?? {},
|
|
142
153
|
idempotencyKey,
|
|
143
154
|
}),
|
|
155
|
+
/** Browser checks: runs, newest first (`status` failed | flaky). */
|
|
156
|
+
runs: (id, params = {}) => this.request("GET", `/monitors/${id}/runs`, { query: params }),
|
|
157
|
+
/** Browser checks: one run — steps, errors, Web Vitals, screenshot
|
|
158
|
+
* URLs (15 min) and the trace-viewer link. */
|
|
159
|
+
run: (id, runId) => this.request("GET", `/monitors/${id}/runs/${runId}`),
|
|
160
|
+
/** Browser checks: saved script versions (last 50). */
|
|
161
|
+
scriptVersions: (id) => this.request("GET", `/monitors/${id}/script/versions`),
|
|
162
|
+
scriptVersion: (id, version) => this.request("GET", `/monitors/${id}/script/versions/${version}`),
|
|
144
163
|
uptime: (id, period) => this.request("GET", `/monitors/${id}/uptime`, { query: { period } }),
|
|
145
164
|
/** Recent probe results, newest first. Page with `next_cursor` →
|
|
146
165
|
* `cursor` (keep the same `hours`/`success`); `locations` is the
|
|
@@ -163,6 +182,23 @@ export class WatchFor {
|
|
|
163
182
|
delete: (monitorId, ruleId) => this.request("DELETE", `/monitors/${monitorId}/alert-rules/${ruleId}`),
|
|
164
183
|
};
|
|
165
184
|
// ── Incidents ─────────────────────────────────────────────────
|
|
185
|
+
/**
|
|
186
|
+
* Browser checks (Playwright): run a script once without saving it —
|
|
187
|
+
* `testRun()` returns an id, `getTestRun()` its live progress and result.
|
|
188
|
+
*/
|
|
189
|
+
playwright = {
|
|
190
|
+
testRun: (body, idempotencyKey) => this.request("POST", "/playwright/test-runs", { body, idempotencyKey }),
|
|
191
|
+
getTestRun: (id) => this.request("GET", `/playwright/test-runs/${id}`),
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* Org variables and secrets browser checks read as process.env.NAME.
|
|
195
|
+
* Secrets are write-only: `list()` never returns their value.
|
|
196
|
+
*/
|
|
197
|
+
variables = {
|
|
198
|
+
list: () => this.request("GET", "/variables"),
|
|
199
|
+
put: (name, body) => this.request("PUT", `/variables/${encodeURIComponent(name)}`, { body }),
|
|
200
|
+
delete: (name) => this.request("DELETE", `/variables/${encodeURIComponent(name)}`),
|
|
201
|
+
};
|
|
166
202
|
incidents = {
|
|
167
203
|
list: (q) => this.request("GET", "/incidents", { query: q }),
|
|
168
204
|
get: (id) => this.request("GET", `/incidents/${id}`),
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { type ActivityEvent, type AlertRule, type ApiErrorBody, type Check, type CheckList, type CheckNowAck, type Contact, type ContactGroup, type Deleted, type DiagnosticCatalog, type DiagnosticCatalogEntry, type DiagnosticReport, type DiagnosticRun, type DiagnosticSlug, type Incident, type IncidentStats, type IntegrityBaseline, type IntegrityBaselineAccept, type List, type MaintenanceWindow, type Monitor, type MonitorDetail, type MonitorReset, type Notification, type Plan, type StatusPage, type Summary, type Uptime, WatchFor, WatchForError, type WatchForOptions, } from "./client.js";
|
|
1
|
+
export { type ActivityEvent, type AlertRule, type ApiErrorBody, type Check, type CheckList, type CheckNowAck, type Contact, type ContactGroup, type Deleted, type DiagnosticCatalog, type DiagnosticCatalogEntry, type DiagnosticReport, type DiagnosticRun, type DiagnosticSlug, type Incident, type IncidentStats, type IntegrityBaseline, type IntegrityBaselineAccept, type List, type MaintenanceWindow, type Monitor, type MonitorDetail, type MonitorReset, type Notification, type Plan, type PlaywrightRun, type PlaywrightRunSummary, type PlaywrightTestRun, type PlaywrightTestRunAccepted, type PlaywrightTestRunRequest, type ScriptVersion, type ScriptVersionSummary, type StatusPage, type Summary, type Uptime, type Variable, type VariableDeleted, WatchFor, WatchForError, type WatchForOptions, } from "./client.js";
|
package/dist/schema.d.ts
CHANGED
|
@@ -4,6 +4,146 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export interface paths {
|
|
7
|
+
"/playwright/test-runs": {
|
|
8
|
+
parameters: {
|
|
9
|
+
query?: never;
|
|
10
|
+
header?: never;
|
|
11
|
+
path?: never;
|
|
12
|
+
cookie?: never;
|
|
13
|
+
};
|
|
14
|
+
get?: never;
|
|
15
|
+
put?: never;
|
|
16
|
+
/**
|
|
17
|
+
* Run a browser-check script once without saving it (returns 202 + id to poll)
|
|
18
|
+
* @description Validates the script (400 names the line), then runs it in a sandboxed browser on a browser location. Org variables and secrets the script reads are provided exactly as for a saved check. Poll GET /playwright/test-runs/{id}. Counts against the plan's playwrightTestRunsPerHour (429 when spent); an organization can have 3 test runs in flight at once (429 beyond).
|
|
19
|
+
*/
|
|
20
|
+
post: operations["createPlaywrightTestRun"];
|
|
21
|
+
delete?: never;
|
|
22
|
+
options?: never;
|
|
23
|
+
head?: never;
|
|
24
|
+
patch?: never;
|
|
25
|
+
trace?: never;
|
|
26
|
+
};
|
|
27
|
+
"/playwright/test-runs/{id}": {
|
|
28
|
+
parameters: {
|
|
29
|
+
query?: never;
|
|
30
|
+
header?: never;
|
|
31
|
+
path?: never;
|
|
32
|
+
cookie?: never;
|
|
33
|
+
};
|
|
34
|
+
/** A test run's live progress and, when done, its result (kept 1 hour) */
|
|
35
|
+
get: operations["getPlaywrightTestRun"];
|
|
36
|
+
put?: never;
|
|
37
|
+
post?: never;
|
|
38
|
+
delete?: never;
|
|
39
|
+
options?: never;
|
|
40
|
+
head?: never;
|
|
41
|
+
patch?: never;
|
|
42
|
+
trace?: never;
|
|
43
|
+
};
|
|
44
|
+
"/monitors/{id}/runs": {
|
|
45
|
+
parameters: {
|
|
46
|
+
query?: never;
|
|
47
|
+
header?: never;
|
|
48
|
+
path?: never;
|
|
49
|
+
cookie?: never;
|
|
50
|
+
};
|
|
51
|
+
/** A browser check's runs, newest first (404 for other monitor types) */
|
|
52
|
+
get: operations["listMonitorRuns"];
|
|
53
|
+
put?: never;
|
|
54
|
+
post?: never;
|
|
55
|
+
delete?: never;
|
|
56
|
+
options?: never;
|
|
57
|
+
head?: never;
|
|
58
|
+
patch?: never;
|
|
59
|
+
trace?: never;
|
|
60
|
+
};
|
|
61
|
+
"/monitors/{id}/runs/{run_id}": {
|
|
62
|
+
parameters: {
|
|
63
|
+
query?: never;
|
|
64
|
+
header?: never;
|
|
65
|
+
path?: never;
|
|
66
|
+
cookie?: never;
|
|
67
|
+
};
|
|
68
|
+
/** One browser-check run: steps, errors with code frames, Web Vitals, screenshots (presigned 15 min), trace link */
|
|
69
|
+
get: operations["getMonitorRun"];
|
|
70
|
+
put?: never;
|
|
71
|
+
post?: never;
|
|
72
|
+
delete?: never;
|
|
73
|
+
options?: never;
|
|
74
|
+
head?: never;
|
|
75
|
+
patch?: never;
|
|
76
|
+
trace?: never;
|
|
77
|
+
};
|
|
78
|
+
"/monitors/{id}/script/versions": {
|
|
79
|
+
parameters: {
|
|
80
|
+
query?: never;
|
|
81
|
+
header?: never;
|
|
82
|
+
path?: never;
|
|
83
|
+
cookie?: never;
|
|
84
|
+
};
|
|
85
|
+
/** Saved versions of a browser check's script (last 50) */
|
|
86
|
+
get: operations["listScriptVersions"];
|
|
87
|
+
put?: never;
|
|
88
|
+
post?: never;
|
|
89
|
+
delete?: never;
|
|
90
|
+
options?: never;
|
|
91
|
+
head?: never;
|
|
92
|
+
patch?: never;
|
|
93
|
+
trace?: never;
|
|
94
|
+
};
|
|
95
|
+
"/monitors/{id}/script/versions/{version}": {
|
|
96
|
+
parameters: {
|
|
97
|
+
query?: never;
|
|
98
|
+
header?: never;
|
|
99
|
+
path?: never;
|
|
100
|
+
cookie?: never;
|
|
101
|
+
};
|
|
102
|
+
/** One saved version of a browser check's script */
|
|
103
|
+
get: operations["getScriptVersion"];
|
|
104
|
+
put?: never;
|
|
105
|
+
post?: never;
|
|
106
|
+
delete?: never;
|
|
107
|
+
options?: never;
|
|
108
|
+
head?: never;
|
|
109
|
+
patch?: never;
|
|
110
|
+
trace?: never;
|
|
111
|
+
};
|
|
112
|
+
"/variables": {
|
|
113
|
+
parameters: {
|
|
114
|
+
query?: never;
|
|
115
|
+
header?: never;
|
|
116
|
+
path?: never;
|
|
117
|
+
cookie?: never;
|
|
118
|
+
};
|
|
119
|
+
/** Org variables and secrets browser checks read as process.env.NAME (secrets without values) */
|
|
120
|
+
get: operations["listVariables"];
|
|
121
|
+
put?: never;
|
|
122
|
+
post?: never;
|
|
123
|
+
delete?: never;
|
|
124
|
+
options?: never;
|
|
125
|
+
head?: never;
|
|
126
|
+
patch?: never;
|
|
127
|
+
trace?: never;
|
|
128
|
+
};
|
|
129
|
+
"/variables/{name}": {
|
|
130
|
+
parameters: {
|
|
131
|
+
query?: never;
|
|
132
|
+
header?: never;
|
|
133
|
+
path?: never;
|
|
134
|
+
cookie?: never;
|
|
135
|
+
};
|
|
136
|
+
get?: never;
|
|
137
|
+
/** Create or replace a variable or secret; checks that read it are re-synced */
|
|
138
|
+
put: operations["putVariable"];
|
|
139
|
+
post?: never;
|
|
140
|
+
/** Delete a variable; checks that read it get undefined from their next run */
|
|
141
|
+
delete: operations["deleteVariable"];
|
|
142
|
+
options?: never;
|
|
143
|
+
head?: never;
|
|
144
|
+
patch?: never;
|
|
145
|
+
trace?: never;
|
|
146
|
+
};
|
|
7
147
|
"/diagnostics": {
|
|
8
148
|
parameters: {
|
|
9
149
|
query?: never;
|
|
@@ -869,6 +1009,26 @@ export interface paths {
|
|
|
869
1009
|
patch?: never;
|
|
870
1010
|
trace?: never;
|
|
871
1011
|
};
|
|
1012
|
+
"/metrics": {
|
|
1013
|
+
parameters: {
|
|
1014
|
+
query?: never;
|
|
1015
|
+
header?: never;
|
|
1016
|
+
path?: never;
|
|
1017
|
+
cookie?: never;
|
|
1018
|
+
};
|
|
1019
|
+
/**
|
|
1020
|
+
* Prometheus metrics: monitor status, uptime 24h/7d/30d, last check and 24h response times, certificate and domain expiry, heartbeat last ping, hosts, fleet health and open incidents (Pro plan and above)
|
|
1021
|
+
* @description Prometheus text exposition 0.0.4 for `scrape_configs` (`authorization: { credentials: wf_live_… }`). The body is computed at most once a minute per organization and filter and cached for 60 s — scrape every 60s; `watchfor_scrape_generated_timestamp_seconds` shows its age. Own limit: 30 requests a minute per organization, on top of the per-key API limit. Per-object series carry only `monitor_id` / `host_id`; join names with `* on(monitor_id) group_left(name, type) watchfor_monitor_info`. Uptime is incident-based (confirmed critical downtime, maintenance excluded), identical to the dashboard. 403 when the plan does not include it.
|
|
1022
|
+
*/
|
|
1023
|
+
get: operations["getPrometheusMetrics"];
|
|
1024
|
+
put?: never;
|
|
1025
|
+
post?: never;
|
|
1026
|
+
delete?: never;
|
|
1027
|
+
options?: never;
|
|
1028
|
+
head?: never;
|
|
1029
|
+
patch?: never;
|
|
1030
|
+
trace?: never;
|
|
1031
|
+
};
|
|
872
1032
|
"/incidents/stats": {
|
|
873
1033
|
parameters: {
|
|
874
1034
|
query?: never;
|
|
@@ -941,6 +1101,166 @@ export interface paths {
|
|
|
941
1101
|
export type webhooks = Record<string, never>;
|
|
942
1102
|
export interface components {
|
|
943
1103
|
schemas: {
|
|
1104
|
+
PlaywrightTestRunRequest: {
|
|
1105
|
+
/** @description A Playwright Test file (TypeScript or JavaScript). Imports: @playwright/test, otpauth, @faker-js/faker, Node built-ins. Read org variables as process.env.NAME; TARGET_URL is `target`. */
|
|
1106
|
+
script: string;
|
|
1107
|
+
/**
|
|
1108
|
+
* Format: uri
|
|
1109
|
+
* @description The site under test (process.env.TARGET_URL)
|
|
1110
|
+
*/
|
|
1111
|
+
target: string;
|
|
1112
|
+
/**
|
|
1113
|
+
* Format: uuid
|
|
1114
|
+
* @description A browser location (GET /locations, browser: true); omit for the nearest
|
|
1115
|
+
*/
|
|
1116
|
+
location_id?: string;
|
|
1117
|
+
/** @description Per-attempt timeout, capped by the plan (maxPlaywrightTimeoutSeconds); default 60 */
|
|
1118
|
+
timeout_seconds?: number;
|
|
1119
|
+
/**
|
|
1120
|
+
* @description Retry a failed test once inside the run
|
|
1121
|
+
* @default true
|
|
1122
|
+
*/
|
|
1123
|
+
retry: boolean;
|
|
1124
|
+
};
|
|
1125
|
+
PlaywrightTestRunAccepted: {
|
|
1126
|
+
/** @constant */
|
|
1127
|
+
object: "playwright_test_run";
|
|
1128
|
+
/** Format: uuid */
|
|
1129
|
+
id: string;
|
|
1130
|
+
/** @constant */
|
|
1131
|
+
status: "queued";
|
|
1132
|
+
location?: {
|
|
1133
|
+
/** Format: uuid */
|
|
1134
|
+
id?: string;
|
|
1135
|
+
name?: string;
|
|
1136
|
+
};
|
|
1137
|
+
timeout_seconds?: number;
|
|
1138
|
+
/** @description process.env names the script reads that no org variable defines (they are undefined in the run) */
|
|
1139
|
+
missing_variables?: string[];
|
|
1140
|
+
};
|
|
1141
|
+
/** @description One browser-check run. `result` is the stored run result (credentials masked): status, attempts, duration_ms, runtime, tests[].steps[] (title, status, duration_ms, error {message, location, snippet}), failure, navigations (Web Vitals per page), console_errors, page_errors, failed_requests, blocked_requests, artifacts. */
|
|
1142
|
+
PlaywrightRun: {
|
|
1143
|
+
/** @constant */
|
|
1144
|
+
object: "playwright_run";
|
|
1145
|
+
/** Format: uuid */
|
|
1146
|
+
run_id: string;
|
|
1147
|
+
timestamp?: string;
|
|
1148
|
+
location?: string;
|
|
1149
|
+
/** @enum {string} */
|
|
1150
|
+
status:
|
|
1151
|
+
| "passed"
|
|
1152
|
+
| "flaky"
|
|
1153
|
+
| "failed"
|
|
1154
|
+
| "timed_out"
|
|
1155
|
+
| "script_error"
|
|
1156
|
+
| "infra_error";
|
|
1157
|
+
duration_ms?: number;
|
|
1158
|
+
result: {
|
|
1159
|
+
[key: string]: unknown;
|
|
1160
|
+
};
|
|
1161
|
+
/** @description Artefact key → presigned screenshot URL (valid 15 minutes) */
|
|
1162
|
+
screenshot_urls?: {
|
|
1163
|
+
[key: string]: string;
|
|
1164
|
+
};
|
|
1165
|
+
/**
|
|
1166
|
+
* Format: uri
|
|
1167
|
+
* @description The Playwright trace in WatchFor's own trace viewer (opens for a signed-in member; traces never leave our origin). Null when no trace was kept.
|
|
1168
|
+
*/
|
|
1169
|
+
trace_url?: string | null;
|
|
1170
|
+
};
|
|
1171
|
+
PlaywrightRunSummary: {
|
|
1172
|
+
/** @constant */
|
|
1173
|
+
object: "playwright_run";
|
|
1174
|
+
/** Format: uuid */
|
|
1175
|
+
run_id: string;
|
|
1176
|
+
timestamp: string;
|
|
1177
|
+
status: string;
|
|
1178
|
+
duration_ms?: number;
|
|
1179
|
+
attempts?: number;
|
|
1180
|
+
location?: string;
|
|
1181
|
+
failed_step?: string | null;
|
|
1182
|
+
console_errors?: number;
|
|
1183
|
+
failed_requests?: number;
|
|
1184
|
+
/** @enum {string} */
|
|
1185
|
+
artifacts?: "full" | "failure" | "none";
|
|
1186
|
+
has_trace?: boolean;
|
|
1187
|
+
};
|
|
1188
|
+
PlaywrightTestRun: {
|
|
1189
|
+
/** @constant */
|
|
1190
|
+
object: "playwright_test_run";
|
|
1191
|
+
/** Format: uuid */
|
|
1192
|
+
id: string;
|
|
1193
|
+
/** @enum {string} */
|
|
1194
|
+
status: "queued" | "running" | "done" | "error";
|
|
1195
|
+
/** Format: date-time */
|
|
1196
|
+
started_at?: string;
|
|
1197
|
+
/** Format: date-time */
|
|
1198
|
+
finished_at?: string | null;
|
|
1199
|
+
location?: {
|
|
1200
|
+
id?: string;
|
|
1201
|
+
name?: string;
|
|
1202
|
+
} | null;
|
|
1203
|
+
/** @description Streamed progress lines: test_begin, step_begin, step_end (status, duration_ms, error), test_end */
|
|
1204
|
+
events: {
|
|
1205
|
+
[key: string]: unknown;
|
|
1206
|
+
}[];
|
|
1207
|
+
result?: components["schemas"]["PlaywrightRun"] | null;
|
|
1208
|
+
/** @description Why the run could not happen (our side), when status is error */
|
|
1209
|
+
error?: string | null;
|
|
1210
|
+
};
|
|
1211
|
+
ScriptVersionSummary: {
|
|
1212
|
+
/** @constant */
|
|
1213
|
+
object: "script_version";
|
|
1214
|
+
version: number;
|
|
1215
|
+
current?: boolean;
|
|
1216
|
+
saved_by?: string | null;
|
|
1217
|
+
/** Format: date-time */
|
|
1218
|
+
created_at?: string;
|
|
1219
|
+
lines?: number;
|
|
1220
|
+
};
|
|
1221
|
+
ScriptVersion: {
|
|
1222
|
+
/** @constant */
|
|
1223
|
+
object: "script_version";
|
|
1224
|
+
version: number;
|
|
1225
|
+
saved_by?: string | null;
|
|
1226
|
+
/** Format: date-time */
|
|
1227
|
+
created_at?: string;
|
|
1228
|
+
script: string;
|
|
1229
|
+
};
|
|
1230
|
+
Variable: {
|
|
1231
|
+
/** @constant */
|
|
1232
|
+
object: "variable";
|
|
1233
|
+
name: string;
|
|
1234
|
+
secret: boolean;
|
|
1235
|
+
/** @description Null for secrets — a secret's value is never returned */
|
|
1236
|
+
value?: string | null;
|
|
1237
|
+
/** Format: date-time */
|
|
1238
|
+
updated_at?: string;
|
|
1239
|
+
used_by?: {
|
|
1240
|
+
/** Format: uuid */
|
|
1241
|
+
id?: string;
|
|
1242
|
+
name?: string;
|
|
1243
|
+
}[];
|
|
1244
|
+
/** @description Browser checks re-synced by this write */
|
|
1245
|
+
checks_updated?: number;
|
|
1246
|
+
};
|
|
1247
|
+
VariablePut: {
|
|
1248
|
+
/** @description The value. For an existing secret, omit it to keep the stored one. */
|
|
1249
|
+
value?: string;
|
|
1250
|
+
/**
|
|
1251
|
+
* @description Store encrypted and never show again; masked in logs, errors, traces and screenshots
|
|
1252
|
+
* @default false
|
|
1253
|
+
*/
|
|
1254
|
+
secret: boolean;
|
|
1255
|
+
};
|
|
1256
|
+
VariableDeleted: {
|
|
1257
|
+
/** @constant */
|
|
1258
|
+
object: "variable";
|
|
1259
|
+
name: string;
|
|
1260
|
+
/** @constant */
|
|
1261
|
+
deleted: true;
|
|
1262
|
+
checks_updated?: number;
|
|
1263
|
+
};
|
|
944
1264
|
/** @description Error envelope. Status by code: 400 invalid_request (a field path + human message; unknown enum values list the valid ones), 401 unauthorized, 403 forbidden, 404 not_found, 405 method_not_allowed, 409 conflict, 413 payload_too_large (request body over 256 KiB), 429 rate_limited (Retry-After set), 501 not_implemented, 500 internal_error. Every authenticated response — errors included — carries the real X-RateLimit-*\/RateLimit-* remaining count. */
|
|
945
1265
|
Error: {
|
|
946
1266
|
error: {
|
|
@@ -1233,7 +1553,10 @@ export interface components {
|
|
|
1233
1553
|
/** @constant */
|
|
1234
1554
|
object?: "monitor";
|
|
1235
1555
|
name?: string;
|
|
1236
|
-
/**
|
|
1556
|
+
/**
|
|
1557
|
+
* @description Monitor type id; the catalog with target formats and config fields is GET /meta/monitor-types. `playwright` = browser checks (scripted Playwright journeys: login, checkout, search); `browser` = Core Web Vitals (a Lighthouse audit of one page).
|
|
1558
|
+
* @enum {string}
|
|
1559
|
+
*/
|
|
1237
1560
|
type?:
|
|
1238
1561
|
| "tcp"
|
|
1239
1562
|
| "dns"
|
|
@@ -1260,7 +1583,8 @@ export interface components {
|
|
|
1260
1583
|
| "heartbeat"
|
|
1261
1584
|
| "mcp"
|
|
1262
1585
|
| "api"
|
|
1263
|
-
| "integrity"
|
|
1586
|
+
| "integrity"
|
|
1587
|
+
| "playwright";
|
|
1264
1588
|
target?: string;
|
|
1265
1589
|
description?: string | null;
|
|
1266
1590
|
interval_seconds?: number;
|
|
@@ -1397,7 +1721,10 @@ export interface components {
|
|
|
1397
1721
|
};
|
|
1398
1722
|
MonitorCreate: {
|
|
1399
1723
|
name: string;
|
|
1400
|
-
/**
|
|
1724
|
+
/**
|
|
1725
|
+
* @description Monitor type id; the catalog with target formats and config fields is GET /meta/monitor-types. `playwright` = browser checks (scripted Playwright journeys: login, checkout, search); `browser` = Core Web Vitals (a Lighthouse audit of one page).
|
|
1726
|
+
* @enum {string}
|
|
1727
|
+
*/
|
|
1401
1728
|
type:
|
|
1402
1729
|
| "tcp"
|
|
1403
1730
|
| "dns"
|
|
@@ -1424,7 +1751,8 @@ export interface components {
|
|
|
1424
1751
|
| "heartbeat"
|
|
1425
1752
|
| "mcp"
|
|
1426
1753
|
| "api"
|
|
1427
|
-
| "integrity"
|
|
1754
|
+
| "integrity"
|
|
1755
|
+
| "playwright";
|
|
1428
1756
|
/** @description Format per type (see GET /meta/monitor-types). Targets in private, loopback, link-local or cloud-metadata address space (and internal hostnames such as localhost, *.internal) are rejected with 400. */
|
|
1429
1757
|
target: string;
|
|
1430
1758
|
/** @description Seconds; validated against the plan's per-type minimum */
|
|
@@ -1449,7 +1777,7 @@ export interface components {
|
|
|
1449
1777
|
*/
|
|
1450
1778
|
cloneFromMonitorId?: string;
|
|
1451
1779
|
};
|
|
1452
|
-
/** @description Partial update — send only what changes. `config` is MERGED into the stored config (see the property). */
|
|
1780
|
+
/** @description Partial update — send only what changes. `config` is MERGED into the stored config (see the property). An unknown top-level field is a 400 naming it (e.g. `interval_seconds` — the field is `interval`), never silently ignored. */
|
|
1453
1781
|
MonitorUpdate: {
|
|
1454
1782
|
name?: string;
|
|
1455
1783
|
target?: string;
|
|
@@ -2346,7 +2674,10 @@ export interface components {
|
|
|
2346
2674
|
MonitorType: {
|
|
2347
2675
|
/** @constant */
|
|
2348
2676
|
object?: "monitor_type";
|
|
2349
|
-
/**
|
|
2677
|
+
/**
|
|
2678
|
+
* @description Monitor type id; the catalog with target formats and config fields is GET /meta/monitor-types. `playwright` = browser checks (scripted Playwright journeys: login, checkout, search); `browser` = Core Web Vitals (a Lighthouse audit of one page).
|
|
2679
|
+
* @enum {string}
|
|
2680
|
+
*/
|
|
2350
2681
|
type?:
|
|
2351
2682
|
| "tcp"
|
|
2352
2683
|
| "dns"
|
|
@@ -2373,7 +2704,8 @@ export interface components {
|
|
|
2373
2704
|
| "heartbeat"
|
|
2374
2705
|
| "mcp"
|
|
2375
2706
|
| "api"
|
|
2376
|
-
| "integrity"
|
|
2707
|
+
| "integrity"
|
|
2708
|
+
| "playwright";
|
|
2377
2709
|
label?: string;
|
|
2378
2710
|
description?: string;
|
|
2379
2711
|
target_format?: string;
|
|
@@ -2390,6 +2722,8 @@ export interface components {
|
|
|
2390
2722
|
severity?: "critical" | "warning";
|
|
2391
2723
|
}[];
|
|
2392
2724
|
};
|
|
2725
|
+
/** @description Prometheus text exposition format 0.0.4: `# HELP` / `# TYPE` lines and one sample per line. Families: watchfor_organization_info, watchfor_monitors, watchfor_health_score, watchfor_incidents_firing, watchfor_incidents_acknowledged, watchfor_maintenance_windows_active, watchfor_hosts, watchfor_monitor_info, watchfor_monitor_up, watchfor_monitor_state, watchfor_monitor_paused, watchfor_monitor_open_incident_severity, watchfor_monitor_check_interval_seconds, watchfor_monitor_last_check_timestamp_seconds, watchfor_monitor_last_check_success, watchfor_monitor_last_check_duration_seconds, watchfor_monitor_checks_24h, watchfor_monitor_avg_duration_24h_seconds, watchfor_monitor_uptime_ratio, watchfor_ssl_certificate_expiry_timestamp_seconds, watchfor_domain_expiry_timestamp_seconds, watchfor_heartbeat_last_ping_timestamp_seconds, watchfor_host_info, watchfor_host_up, watchfor_host_last_seen_timestamp_seconds, watchfor_scrape_generated_timestamp_seconds, watchfor_scrape_duration_seconds. */
|
|
2726
|
+
PrometheusExposition: string;
|
|
2393
2727
|
Summary: {
|
|
2394
2728
|
/** @constant */
|
|
2395
2729
|
object?: "summary";
|
|
@@ -2597,6 +2931,29 @@ export interface components {
|
|
|
2597
2931
|
active?: boolean;
|
|
2598
2932
|
}[];
|
|
2599
2933
|
};
|
|
2934
|
+
PlaywrightRunSummaryList: {
|
|
2935
|
+
/** @constant */
|
|
2936
|
+
object: "list";
|
|
2937
|
+
data: components["schemas"]["PlaywrightRunSummary"][];
|
|
2938
|
+
has_more: boolean;
|
|
2939
|
+
total?: number;
|
|
2940
|
+
next_cursor?: string | null;
|
|
2941
|
+
};
|
|
2942
|
+
ScriptVersionSummaryList: {
|
|
2943
|
+
/** @constant */
|
|
2944
|
+
object: "list";
|
|
2945
|
+
data: components["schemas"]["ScriptVersionSummary"][];
|
|
2946
|
+
has_more: boolean;
|
|
2947
|
+
};
|
|
2948
|
+
VariableList: {
|
|
2949
|
+
/** @constant */
|
|
2950
|
+
object: "list";
|
|
2951
|
+
data: components["schemas"]["Variable"][];
|
|
2952
|
+
has_more: boolean;
|
|
2953
|
+
secrets_available?: boolean;
|
|
2954
|
+
/** @description Names checks read that no variable defines */
|
|
2955
|
+
undefined_refs?: string[];
|
|
2956
|
+
};
|
|
2600
2957
|
MonitorTypeList: {
|
|
2601
2958
|
/** @constant */
|
|
2602
2959
|
object: "list";
|
|
@@ -2888,22 +3245,26 @@ export interface components {
|
|
|
2888
3245
|
}
|
|
2889
3246
|
export type $defs = Record<string, never>;
|
|
2890
3247
|
export interface operations {
|
|
2891
|
-
|
|
3248
|
+
createPlaywrightTestRun: {
|
|
2892
3249
|
parameters: {
|
|
2893
3250
|
query?: never;
|
|
2894
3251
|
header?: never;
|
|
2895
3252
|
path?: never;
|
|
2896
3253
|
cookie?: never;
|
|
2897
3254
|
};
|
|
2898
|
-
requestBody
|
|
3255
|
+
requestBody: {
|
|
3256
|
+
content: {
|
|
3257
|
+
"application/json": components["schemas"]["PlaywrightTestRunRequest"];
|
|
3258
|
+
};
|
|
3259
|
+
};
|
|
2899
3260
|
responses: {
|
|
2900
|
-
/** @description
|
|
2901
|
-
|
|
3261
|
+
/** @description Queued */
|
|
3262
|
+
202: {
|
|
2902
3263
|
headers: {
|
|
2903
3264
|
[name: string]: unknown;
|
|
2904
3265
|
};
|
|
2905
3266
|
content: {
|
|
2906
|
-
"application/json": components["schemas"]["
|
|
3267
|
+
"application/json": components["schemas"]["PlaywrightTestRunAccepted"];
|
|
2907
3268
|
};
|
|
2908
3269
|
};
|
|
2909
3270
|
/** @description Error */
|
|
@@ -2917,19 +3278,321 @@ export interface operations {
|
|
|
2917
3278
|
};
|
|
2918
3279
|
};
|
|
2919
3280
|
};
|
|
2920
|
-
|
|
3281
|
+
getPlaywrightTestRun: {
|
|
2921
3282
|
parameters: {
|
|
2922
3283
|
query?: never;
|
|
2923
|
-
header?:
|
|
2924
|
-
/** @description Unique key for safe retries (Stripe semantics, 24h window): the same key + body replays the original response instead of re-creating. */
|
|
2925
|
-
"Idempotency-Key"?: string;
|
|
2926
|
-
};
|
|
3284
|
+
header?: never;
|
|
2927
3285
|
path: {
|
|
2928
|
-
/** @description
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
3286
|
+
/** @description Test run id returned by POST /playwright/test-runs */
|
|
3287
|
+
id: string;
|
|
3288
|
+
};
|
|
3289
|
+
cookie?: never;
|
|
3290
|
+
};
|
|
3291
|
+
requestBody?: never;
|
|
3292
|
+
responses: {
|
|
3293
|
+
/** @description OK */
|
|
3294
|
+
200: {
|
|
3295
|
+
headers: {
|
|
3296
|
+
[name: string]: unknown;
|
|
3297
|
+
};
|
|
3298
|
+
content: {
|
|
3299
|
+
"application/json": components["schemas"]["PlaywrightTestRun"];
|
|
3300
|
+
};
|
|
3301
|
+
};
|
|
3302
|
+
/** @description Error */
|
|
3303
|
+
default: {
|
|
3304
|
+
headers: {
|
|
3305
|
+
[name: string]: unknown;
|
|
3306
|
+
};
|
|
3307
|
+
content: {
|
|
3308
|
+
"application/json": components["schemas"]["Error"];
|
|
3309
|
+
};
|
|
3310
|
+
};
|
|
3311
|
+
};
|
|
3312
|
+
};
|
|
3313
|
+
listMonitorRuns: {
|
|
3314
|
+
parameters: {
|
|
3315
|
+
query?: {
|
|
3316
|
+
status?: "all" | "failed" | "flaky";
|
|
3317
|
+
/** @description Page size, 1–100 (default 50). Any other value — 0, negative, non-integer — returns 400. A `sort` query parameter is not supported and returns 400 naming the fixed order. */
|
|
3318
|
+
limit?: number;
|
|
3319
|
+
/** @description Opaque cursor from the previous page's next_cursor */
|
|
3320
|
+
cursor?: string;
|
|
3321
|
+
};
|
|
3322
|
+
header?: never;
|
|
3323
|
+
path: {
|
|
3324
|
+
/** @description Resource id (UUID) */
|
|
3325
|
+
id: string;
|
|
3326
|
+
};
|
|
3327
|
+
cookie?: never;
|
|
3328
|
+
};
|
|
3329
|
+
requestBody?: never;
|
|
3330
|
+
responses: {
|
|
3331
|
+
/** @description OK */
|
|
3332
|
+
200: {
|
|
3333
|
+
headers: {
|
|
3334
|
+
[name: string]: unknown;
|
|
3335
|
+
};
|
|
3336
|
+
content: {
|
|
3337
|
+
"application/json": components["schemas"]["PlaywrightRunSummaryList"];
|
|
3338
|
+
};
|
|
3339
|
+
};
|
|
3340
|
+
/** @description Error */
|
|
3341
|
+
default: {
|
|
3342
|
+
headers: {
|
|
3343
|
+
[name: string]: unknown;
|
|
3344
|
+
};
|
|
3345
|
+
content: {
|
|
3346
|
+
"application/json": components["schemas"]["Error"];
|
|
3347
|
+
};
|
|
3348
|
+
};
|
|
3349
|
+
};
|
|
3350
|
+
};
|
|
3351
|
+
getMonitorRun: {
|
|
3352
|
+
parameters: {
|
|
3353
|
+
query?: never;
|
|
3354
|
+
header?: never;
|
|
3355
|
+
path: {
|
|
3356
|
+
/** @description Resource id (UUID) */
|
|
3357
|
+
id: string;
|
|
3358
|
+
/** @description Run id from GET /monitors/{id}/runs */
|
|
3359
|
+
run_id: string;
|
|
3360
|
+
};
|
|
3361
|
+
cookie?: never;
|
|
3362
|
+
};
|
|
3363
|
+
requestBody?: never;
|
|
3364
|
+
responses: {
|
|
3365
|
+
/** @description OK */
|
|
3366
|
+
200: {
|
|
3367
|
+
headers: {
|
|
3368
|
+
[name: string]: unknown;
|
|
3369
|
+
};
|
|
3370
|
+
content: {
|
|
3371
|
+
"application/json": components["schemas"]["PlaywrightRun"];
|
|
3372
|
+
};
|
|
3373
|
+
};
|
|
3374
|
+
/** @description Error */
|
|
3375
|
+
default: {
|
|
3376
|
+
headers: {
|
|
3377
|
+
[name: string]: unknown;
|
|
3378
|
+
};
|
|
3379
|
+
content: {
|
|
3380
|
+
"application/json": components["schemas"]["Error"];
|
|
3381
|
+
};
|
|
3382
|
+
};
|
|
3383
|
+
};
|
|
3384
|
+
};
|
|
3385
|
+
listScriptVersions: {
|
|
3386
|
+
parameters: {
|
|
3387
|
+
query?: never;
|
|
3388
|
+
header?: never;
|
|
3389
|
+
path: {
|
|
3390
|
+
/** @description Resource id (UUID) */
|
|
3391
|
+
id: string;
|
|
3392
|
+
};
|
|
3393
|
+
cookie?: never;
|
|
3394
|
+
};
|
|
3395
|
+
requestBody?: never;
|
|
3396
|
+
responses: {
|
|
3397
|
+
/** @description OK */
|
|
3398
|
+
200: {
|
|
3399
|
+
headers: {
|
|
3400
|
+
[name: string]: unknown;
|
|
3401
|
+
};
|
|
3402
|
+
content: {
|
|
3403
|
+
"application/json": components["schemas"]["ScriptVersionSummaryList"];
|
|
3404
|
+
};
|
|
3405
|
+
};
|
|
3406
|
+
/** @description Error */
|
|
3407
|
+
default: {
|
|
3408
|
+
headers: {
|
|
3409
|
+
[name: string]: unknown;
|
|
3410
|
+
};
|
|
3411
|
+
content: {
|
|
3412
|
+
"application/json": components["schemas"]["Error"];
|
|
3413
|
+
};
|
|
3414
|
+
};
|
|
3415
|
+
};
|
|
3416
|
+
};
|
|
3417
|
+
getScriptVersion: {
|
|
3418
|
+
parameters: {
|
|
3419
|
+
query?: never;
|
|
3420
|
+
header?: never;
|
|
3421
|
+
path: {
|
|
3422
|
+
/** @description Resource id (UUID) */
|
|
3423
|
+
id: string;
|
|
3424
|
+
version: number;
|
|
3425
|
+
};
|
|
3426
|
+
cookie?: never;
|
|
3427
|
+
};
|
|
3428
|
+
requestBody?: never;
|
|
3429
|
+
responses: {
|
|
3430
|
+
/** @description OK */
|
|
3431
|
+
200: {
|
|
3432
|
+
headers: {
|
|
3433
|
+
[name: string]: unknown;
|
|
3434
|
+
};
|
|
3435
|
+
content: {
|
|
3436
|
+
"application/json": components["schemas"]["ScriptVersion"];
|
|
3437
|
+
};
|
|
3438
|
+
};
|
|
3439
|
+
/** @description Error */
|
|
3440
|
+
default: {
|
|
3441
|
+
headers: {
|
|
3442
|
+
[name: string]: unknown;
|
|
3443
|
+
};
|
|
3444
|
+
content: {
|
|
3445
|
+
"application/json": components["schemas"]["Error"];
|
|
3446
|
+
};
|
|
3447
|
+
};
|
|
3448
|
+
};
|
|
3449
|
+
};
|
|
3450
|
+
listVariables: {
|
|
3451
|
+
parameters: {
|
|
3452
|
+
query?: never;
|
|
3453
|
+
header?: never;
|
|
3454
|
+
path?: never;
|
|
3455
|
+
cookie?: never;
|
|
3456
|
+
};
|
|
3457
|
+
requestBody?: never;
|
|
3458
|
+
responses: {
|
|
3459
|
+
/** @description OK */
|
|
3460
|
+
200: {
|
|
3461
|
+
headers: {
|
|
3462
|
+
[name: string]: unknown;
|
|
3463
|
+
};
|
|
3464
|
+
content: {
|
|
3465
|
+
"application/json": components["schemas"]["VariableList"];
|
|
3466
|
+
};
|
|
3467
|
+
};
|
|
3468
|
+
/** @description Error */
|
|
3469
|
+
default: {
|
|
3470
|
+
headers: {
|
|
3471
|
+
[name: string]: unknown;
|
|
3472
|
+
};
|
|
3473
|
+
content: {
|
|
3474
|
+
"application/json": components["schemas"]["Error"];
|
|
3475
|
+
};
|
|
3476
|
+
};
|
|
3477
|
+
};
|
|
3478
|
+
};
|
|
3479
|
+
putVariable: {
|
|
3480
|
+
parameters: {
|
|
3481
|
+
query?: never;
|
|
3482
|
+
header?: never;
|
|
3483
|
+
path: {
|
|
3484
|
+
name: string;
|
|
3485
|
+
};
|
|
3486
|
+
cookie?: never;
|
|
3487
|
+
};
|
|
3488
|
+
requestBody: {
|
|
3489
|
+
content: {
|
|
3490
|
+
"application/json": components["schemas"]["VariablePut"];
|
|
3491
|
+
};
|
|
3492
|
+
};
|
|
3493
|
+
responses: {
|
|
3494
|
+
/** @description Updated */
|
|
3495
|
+
200: {
|
|
3496
|
+
headers: {
|
|
3497
|
+
[name: string]: unknown;
|
|
3498
|
+
};
|
|
3499
|
+
content: {
|
|
3500
|
+
"application/json": components["schemas"]["Variable"];
|
|
3501
|
+
};
|
|
3502
|
+
};
|
|
3503
|
+
/** @description Created */
|
|
3504
|
+
201: {
|
|
3505
|
+
headers: {
|
|
3506
|
+
[name: string]: unknown;
|
|
3507
|
+
};
|
|
3508
|
+
content: {
|
|
3509
|
+
"application/json": components["schemas"]["Variable"];
|
|
3510
|
+
};
|
|
3511
|
+
};
|
|
3512
|
+
/** @description Error */
|
|
3513
|
+
default: {
|
|
3514
|
+
headers: {
|
|
3515
|
+
[name: string]: unknown;
|
|
3516
|
+
};
|
|
3517
|
+
content: {
|
|
3518
|
+
"application/json": components["schemas"]["Error"];
|
|
3519
|
+
};
|
|
3520
|
+
};
|
|
3521
|
+
};
|
|
3522
|
+
};
|
|
3523
|
+
deleteVariable: {
|
|
3524
|
+
parameters: {
|
|
3525
|
+
query?: never;
|
|
3526
|
+
header?: never;
|
|
3527
|
+
path: {
|
|
3528
|
+
name: string;
|
|
3529
|
+
};
|
|
3530
|
+
cookie?: never;
|
|
3531
|
+
};
|
|
3532
|
+
requestBody?: never;
|
|
3533
|
+
responses: {
|
|
3534
|
+
/** @description OK */
|
|
3535
|
+
200: {
|
|
3536
|
+
headers: {
|
|
3537
|
+
[name: string]: unknown;
|
|
3538
|
+
};
|
|
3539
|
+
content: {
|
|
3540
|
+
"application/json": components["schemas"]["VariableDeleted"];
|
|
3541
|
+
};
|
|
3542
|
+
};
|
|
3543
|
+
/** @description Error */
|
|
3544
|
+
default: {
|
|
3545
|
+
headers: {
|
|
3546
|
+
[name: string]: unknown;
|
|
3547
|
+
};
|
|
3548
|
+
content: {
|
|
3549
|
+
"application/json": components["schemas"]["Error"];
|
|
3550
|
+
};
|
|
3551
|
+
};
|
|
3552
|
+
};
|
|
3553
|
+
};
|
|
3554
|
+
listDiagnostics: {
|
|
3555
|
+
parameters: {
|
|
3556
|
+
query?: never;
|
|
3557
|
+
header?: never;
|
|
3558
|
+
path?: never;
|
|
3559
|
+
cookie?: never;
|
|
3560
|
+
};
|
|
3561
|
+
requestBody?: never;
|
|
3562
|
+
responses: {
|
|
3563
|
+
/** @description OK */
|
|
3564
|
+
200: {
|
|
3565
|
+
headers: {
|
|
3566
|
+
[name: string]: unknown;
|
|
3567
|
+
};
|
|
3568
|
+
content: {
|
|
3569
|
+
"application/json": components["schemas"]["DiagnosticCatalog"];
|
|
3570
|
+
};
|
|
3571
|
+
};
|
|
3572
|
+
/** @description Error */
|
|
3573
|
+
default: {
|
|
3574
|
+
headers: {
|
|
3575
|
+
[name: string]: unknown;
|
|
3576
|
+
};
|
|
3577
|
+
content: {
|
|
3578
|
+
"application/json": components["schemas"]["Error"];
|
|
3579
|
+
};
|
|
3580
|
+
};
|
|
3581
|
+
};
|
|
3582
|
+
};
|
|
3583
|
+
runDiagnostic: {
|
|
3584
|
+
parameters: {
|
|
3585
|
+
query?: never;
|
|
3586
|
+
header?: {
|
|
3587
|
+
/** @description Unique key for safe retries (Stripe semantics, 24h window): the same key + body replays the original response instead of re-creating. */
|
|
3588
|
+
"Idempotency-Key"?: string;
|
|
3589
|
+
};
|
|
3590
|
+
path: {
|
|
3591
|
+
/** @description Which check to run. Short aliases (dns, port-check, api-test, …) are accepted too; the response echoes the canonical slug. */
|
|
3592
|
+
slug:
|
|
3593
|
+
| "smart-audit"
|
|
3594
|
+
| "cwv-check"
|
|
3595
|
+
| "dns-lookup"
|
|
2933
3596
|
| "dns-propagation"
|
|
2934
3597
|
| "whois"
|
|
2935
3598
|
| "ping"
|
|
@@ -5342,6 +6005,51 @@ export interface operations {
|
|
|
5342
6005
|
};
|
|
5343
6006
|
};
|
|
5344
6007
|
};
|
|
6008
|
+
getPrometheusMetrics: {
|
|
6009
|
+
parameters: {
|
|
6010
|
+
query?: {
|
|
6011
|
+
/** @description Only monitors carrying one of these tags (repeat or comma-separate). Organization totals always cover the whole organization. */
|
|
6012
|
+
tag?: string;
|
|
6013
|
+
/** @description Only monitors of these types (repeat or comma-separate) */
|
|
6014
|
+
type?: string;
|
|
6015
|
+
/** @description Only these monitors (repeat or comma-separate) */
|
|
6016
|
+
monitor_id?: string;
|
|
6017
|
+
/** @description false drops the host families */
|
|
6018
|
+
include_hosts?: boolean;
|
|
6019
|
+
};
|
|
6020
|
+
header?: never;
|
|
6021
|
+
path?: never;
|
|
6022
|
+
cookie?: never;
|
|
6023
|
+
};
|
|
6024
|
+
requestBody?: never;
|
|
6025
|
+
responses: {
|
|
6026
|
+
/** @description Prometheus text exposition (format 0.0.4) */
|
|
6027
|
+
200: {
|
|
6028
|
+
headers: {
|
|
6029
|
+
/** @description Unix seconds when this (possibly cached) body was computed */
|
|
6030
|
+
"X-WatchFor-Metrics-Generated"?: number;
|
|
6031
|
+
[name: string]: unknown;
|
|
6032
|
+
};
|
|
6033
|
+
content: {
|
|
6034
|
+
/**
|
|
6035
|
+
* @example # HELP watchfor_monitor_up 1 unless a confirmed critical incident is open on the monitor.
|
|
6036
|
+
* # TYPE watchfor_monitor_up gauge
|
|
6037
|
+
* watchfor_monitor_up{monitor_id="0fe0d9ba-c062-48f5-a9ec-ead9a4076ebd"} 1
|
|
6038
|
+
*/
|
|
6039
|
+
"text/plain": components["schemas"]["PrometheusExposition"];
|
|
6040
|
+
};
|
|
6041
|
+
};
|
|
6042
|
+
/** @description Error */
|
|
6043
|
+
default: {
|
|
6044
|
+
headers: {
|
|
6045
|
+
[name: string]: unknown;
|
|
6046
|
+
};
|
|
6047
|
+
content: {
|
|
6048
|
+
"application/json": components["schemas"]["Error"];
|
|
6049
|
+
};
|
|
6050
|
+
};
|
|
6051
|
+
};
|
|
6052
|
+
};
|
|
5345
6053
|
getIncidentStats: {
|
|
5346
6054
|
parameters: {
|
|
5347
6055
|
query?: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "watchfor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Official TypeScript SDK + CLI for WatchFor — uptime & infrastructure monitoring (monitors, alert rules, incidents, maintenance windows) over the REST API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"watchfor",
|