watchfor 0.15.0 → 0.17.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 CHANGED
@@ -36,6 +36,12 @@ await wf.alertRules.create(monitor.id!, {
36
36
  // uptime, SLA, reports and the status page (include() undoes it).
37
37
  await wf.incidents.exclude(19351, { reason: "Probe-side DNS hiccup" });
38
38
 
39
+ // Post-mortem: creates the draft on first use; only the sections you name change.
40
+ await wf.incidents.updatePostmortem(19351, {
41
+ sections: { summary: "Checkout returned 502 for 14 minutes." },
42
+ add_action_items: [{ title: "Validate upstreams in CI" }],
43
+ });
44
+
39
45
  // Irreversible: wipe a monitor's checks and incidents; uptime restarts "since reset".
40
46
  await wf.monitors.reset(monitor.id!);
41
47
 
@@ -138,12 +144,20 @@ belongs to; choose one with `organization` — the SDK sends it as the
138
144
  `X-WatchFor-Organization` header on every request:
139
145
 
140
146
  ```ts
147
+ const wf = new WatchFor({ apiKey: oauthAccessToken });
148
+ const { data } = await wf.organizations.list();
149
+ // [{ id, name, slug, role: "owner", plan: "Pro", is_default: true, is_current: true }, …]
150
+
141
151
  const acme = new WatchFor({ apiKey: oauthAccessToken, organization: "<organization-id>" });
142
152
  await acme.me(); // { organization: { id, name, slug }, scope }
143
153
  const other = acme.withOrganization("<another-organization-id>"); // new client, same token
144
154
  await other.monitors.list();
145
155
  ```
146
156
 
157
+ - `organizations.list()` returns the ids to use: every organization of the
158
+ token's user with their `role`, `is_default` (used without `organization`)
159
+ and `is_current` (what this client acts on). With an API key it returns just
160
+ the key's own organization (`role: null`).
147
161
  - Without `organization`, an OAuth token acts on the user's oldest owned
148
162
  organization (else their oldest membership).
149
163
  - The user must be a member of that organization (otherwise `403
@@ -174,6 +188,7 @@ npx watchfor monitors example.com
174
188
  npx watchfor checks <monitor-id> --failed # add --cursor <next_cursor> for older pages
175
189
  npx watchfor report --period 30d
176
190
  npx watchfor me # which organization + scope
191
+ npx watchfor organizations # ids for --organization
177
192
 
178
193
  # OAuth token: pick the organization per call or via the environment
179
194
  export WATCHFOR_API_KEY=<oauth-access-token>
@@ -184,5 +199,5 @@ WATCHFOR_ORGANIZATION=<organization-id> npx watchfor summary
184
199
  ## Links
185
200
 
186
201
  - API docs: https://watchfor.io/docs/api
187
- - MCP server for AI agents (59 tools): https://watchfor.io/docs/api/mcp
202
+ - MCP server for AI agents (61 tools): https://watchfor.io/docs/api/mcp
188
203
  - Create an API key: dashboard → Settings → API keys (`read` or `read+write` scope)
package/dist/cli.js CHANGED
@@ -8,6 +8,7 @@ import { WatchFor, WatchForError } from "./client.js";
8
8
  * watchfor incidents --status firing
9
9
  * watchfor monitors [search]
10
10
  * watchfor checks <monitor-id> --failed
11
+ * watchfor organizations (ids for --organization)
11
12
  * watchfor --organization <org-id> monitors (OAuth tokens)
12
13
  */
13
14
  const HELP = `watchfor — WatchFor monitoring CLI (https://watchfor.io)
@@ -17,6 +18,7 @@ Usage:
17
18
 
18
19
  Commands:
19
20
  watchfor me Which organization and scope the credential acts with
21
+ watchfor organizations Organizations the credential can act on (ids for --organization)
20
22
  watchfor summary Org snapshot: what's up/down right now
21
23
  watchfor incidents [--status s] List incidents (firing|acknowledged|resolved)
22
24
  watchfor monitors [query] List monitors (optional name/target search)
@@ -93,6 +95,22 @@ async function main() {
93
95
  console.log(`organization: ${org ? `${org.name} (${org.id})` : "none"} · scope ${me.scope ?? "?"}`);
94
96
  return 0;
95
97
  }
98
+ case "organizations":
99
+ case "orgs": {
100
+ const res = await wf.organizations.list();
101
+ for (const o of res.data) {
102
+ const marks = [
103
+ o.is_current ? "current" : "",
104
+ o.is_default ? "default" : "",
105
+ ]
106
+ .filter(Boolean)
107
+ .join(", ");
108
+ console.log(`${o.id} ${String(o.role ?? "api key").padEnd(7)} ${String(o.plan).padEnd(10)} ${o.name}${marks ? ` (${marks})` : ""}`);
109
+ }
110
+ if (res.data.length === 0)
111
+ console.log("(no organizations)");
112
+ return 0;
113
+ }
96
114
  case "summary": {
97
115
  const s = await wf.summary();
98
116
  const m = s.monitors;
package/dist/client.d.ts CHANGED
@@ -37,6 +37,10 @@ export type ScriptVersionSummary = components["schemas"]["ScriptVersionSummary"]
37
37
  export type Variable = components["schemas"]["Variable"];
38
38
  export type VariableDeleted = components["schemas"]["VariableDeleted"];
39
39
  export type Incident = components["schemas"]["Incident"];
40
+ /** An incident's post-mortem (plan feature). */
41
+ export type Postmortem = components["schemas"]["Postmortem"];
42
+ /** `incidents.updatePostmortem()` body — omitted fields are kept. */
43
+ export type PostmortemUpdate = components["schemas"]["PostmortemUpdate"];
40
44
  export type AlertRule = components["schemas"]["AlertRule"];
41
45
  export type Contact = components["schemas"]["Contact"];
42
46
  export type ContactGroup = components["schemas"]["ContactGroup"];
@@ -77,6 +81,13 @@ export type Plan = components["schemas"]["Plan"];
77
81
  export type Summary = components["schemas"]["Summary"];
78
82
  /** The credential's identity: scope + the organization it acts on. */
79
83
  export type Me = components["schemas"]["Me"];
84
+ /**
85
+ * An organization the credential can act on (`organizations.list()`):
86
+ * `role` is the token user's membership role (null for an API key),
87
+ * `is_default` marks the one used without `organization`, `is_current` the one
88
+ * the request acted on.
89
+ */
90
+ export type Organization = components["schemas"]["Organization"];
80
91
  /** `batch()` results, in request order: `{ status, body }` per operation. */
81
92
  export type BatchResult = components["schemas"]["BatchResult"];
82
93
  /** One operation of a `batch()` call — a relative /api/v1 path. */
@@ -229,6 +240,15 @@ export declare class WatchFor {
229
240
  locations(): Promise<List<Record<string, unknown>>>;
230
241
  /** Every monitor type with its exact alert metrics + config fields. */
231
242
  monitorTypes(): Promise<List<Record<string, unknown>>>;
243
+ readonly organizations: {
244
+ /**
245
+ * The organizations this credential can act on — the ids
246
+ * `organization` / `withOrganization()` accept. An OAuth token lists
247
+ * every organization of its user; an API key only its own. Works
248
+ * whatever `organization` is set to (a foreign id is still 403).
249
+ */
250
+ list: () => Promise<List<Organization>>;
251
+ };
232
252
  readonly monitors: {
233
253
  list: (q?: {
234
254
  q?: string;
@@ -385,6 +405,14 @@ export declare class WatchFor {
385
405
  * it (marking again returns the same one); delete that window to
386
406
  * undo. */
387
407
  markMaintenance: (id: number, idempotencyKey?: string) => Promise<MaintenanceMarking>;
408
+ /** The incident's post-mortem. 404 when it has none yet —
409
+ * `updatePostmortem` creates it. */
410
+ getPostmortem: (id: number) => Promise<Postmortem>;
411
+ /** Create the post-mortem draft on first use, then apply only what is
412
+ * given: `sections` replaces just the sections named; `add_timeline`
413
+ * and `add_action_items` append (repeats skipped). Publishing and
414
+ * deleting stay in the dashboard. */
415
+ updatePostmortem: (id: number, body: PostmortemUpdate) => Promise<Postmortem>;
388
416
  };
389
417
  readonly statusPages: {
390
418
  list: (q?: {
package/dist/client.js CHANGED
@@ -180,6 +180,16 @@ export class WatchFor {
180
180
  monitorTypes() {
181
181
  return this.request("GET", "/meta/monitor-types");
182
182
  }
183
+ // ── Organizations ─────────────────────────────────────────────
184
+ organizations = {
185
+ /**
186
+ * The organizations this credential can act on — the ids
187
+ * `organization` / `withOrganization()` accept. An OAuth token lists
188
+ * every organization of its user; an API key only its own. Works
189
+ * whatever `organization` is set to (a foreign id is still 403).
190
+ */
191
+ list: () => this.request("GET", "/organizations"),
192
+ };
183
193
  // ── Monitors ──────────────────────────────────────────────────
184
194
  monitors = {
185
195
  list: (q) => this.request("GET", "/monitors", { query: q }),
@@ -308,6 +318,14 @@ export class WatchFor {
308
318
  markMaintenance: (id, idempotencyKey) => this.request("POST", `/incidents/${id}/mark-maintenance`, {
309
319
  idempotencyKey,
310
320
  }),
321
+ /** The incident's post-mortem. 404 when it has none yet —
322
+ * `updatePostmortem` creates it. */
323
+ getPostmortem: (id) => this.request("GET", `/incidents/${id}/postmortem`),
324
+ /** Create the post-mortem draft on first use, then apply only what is
325
+ * given: `sections` replaces just the sections named; `add_timeline`
326
+ * and `add_action_items` append (repeats skipped). Publishing and
327
+ * deleting stay in the dashboard. */
328
+ updatePostmortem: (id, body) => this.request("PATCH", `/incidents/${id}/postmortem`, { body }),
311
329
  };
312
330
  // ── Status pages, on-call, channels ──────────────────────────
313
331
  statusPages = {
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { type ActivityEvent, type AlertingState, type AlertRule, type Announcement, type AnnouncementCreate, type AnnouncementUpdate, type ApiErrorBody, type BatchOperation, type BatchResult, type BulkResult, 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 IntegrityBaselineAcceptPending, type List, type MaintenanceMarking, type MaintenanceWindow, type Me, type Monitor, type MonitorDetail, type MonitorReset, type Notification, ORGANIZATION_HEADER, type Plan, type PlaywrightRun, type PlaywrightRunSummary, type PlaywrightTestRun, type PlaywrightTestRunAccepted, type PlaywrightTestRunRequest, type ReportFilters, type ResponseTimeBucket, type ScriptVersion, type ScriptVersionSummary, type StatusPage, type StatusPageComponentCreate, type StatusPageCreate, type StatusPageUpdate, type Summary, type Uptime, type Variable, type VariableDeleted, WatchFor, WatchForError, type WatchForGrade, type WatchForOptions, } from "./client.js";
1
+ export { type ActivityEvent, type AlertingState, type AlertRule, type Announcement, type AnnouncementCreate, type AnnouncementUpdate, type ApiErrorBody, type BatchOperation, type BatchResult, type BulkResult, 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 IntegrityBaselineAcceptPending, type List, type MaintenanceMarking, type MaintenanceWindow, type Me, type Monitor, type MonitorDetail, type MonitorReset, type Notification, ORGANIZATION_HEADER, type Organization, type Plan, type PlaywrightRun, type PlaywrightRunSummary, type PlaywrightTestRun, type PlaywrightTestRunAccepted, type PlaywrightTestRunRequest, type Postmortem, type PostmortemUpdate, type ReportFilters, type ResponseTimeBucket, type ScriptVersion, type ScriptVersionSummary, type StatusPage, type StatusPageComponentCreate, type StatusPageCreate, type StatusPageUpdate, type Summary, type Uptime, type Variable, type VariableDeleted, WatchFor, WatchForError, type WatchForGrade, type WatchForOptions, } from "./client.js";
package/dist/schema.d.ts CHANGED
@@ -227,6 +227,26 @@ export interface paths {
227
227
  patch?: never;
228
228
  trace?: never;
229
229
  };
230
+ "/organizations": {
231
+ parameters: {
232
+ query?: never;
233
+ header?: never;
234
+ path?: never;
235
+ cookie?: never;
236
+ };
237
+ /**
238
+ * List the organizations this credential can act on
239
+ * @description OAuth token: every organization the token's user belongs to (oldest membership first, up to 500), with their role in each — send an id as X-WatchFor-Organization to act on it. `is_default` marks the organization used without the header, `is_current` the one this request acted on. API key: exactly its own organization (role null). AI Agent token: only the organization it was issued for. Works without the header and is not plan-gated, so a client can always discover the ids; a header naming an organization the user doesn't belong to is still 403. Not paginated (has_more is always false).
240
+ */
241
+ get: operations["listOrganizations"];
242
+ put?: never;
243
+ post?: never;
244
+ delete?: never;
245
+ options?: never;
246
+ head?: never;
247
+ patch?: never;
248
+ trace?: never;
249
+ };
230
250
  "/openapi.json": {
231
251
  parameters: {
232
252
  query?: never;
@@ -645,6 +665,30 @@ export interface paths {
645
665
  patch?: never;
646
666
  trace?: never;
647
667
  };
668
+ "/incidents/{id}/postmortem": {
669
+ parameters: {
670
+ query?: never;
671
+ header?: never;
672
+ path?: never;
673
+ cookie?: never;
674
+ };
675
+ /**
676
+ * Get the incident's post-mortem
677
+ * @description Plan feature (post-mortems). 404 when the incident is not in this organization, or when it has no post-mortem yet (the message says so — PATCH creates it).
678
+ */
679
+ get: operations["getIncidentPostmortem"];
680
+ put?: never;
681
+ post?: never;
682
+ delete?: never;
683
+ options?: never;
684
+ head?: never;
685
+ /**
686
+ * Create or update the incident's post-mortem draft
687
+ * @description Creates the post-mortem with the dashboard's template on first use (title from the monitor, severity from the incident), then applies the fields given. Any member may write and complete post-mortems, as in the dashboard; publishing to the status page and deleting stay owner/admin actions in the dashboard. Every change lands in the activity log.
688
+ */
689
+ patch: operations["updateIncidentPostmortem"];
690
+ trace?: never;
691
+ };
648
692
  "/incidents/{id}/mark-maintenance": {
649
693
  parameters: {
650
694
  query?: never;
@@ -1016,7 +1060,7 @@ export interface paths {
1016
1060
  path?: never;
1017
1061
  cookie?: never;
1018
1062
  };
1019
- /** One-call org snapshot: monitor status counts, active incidents, open maintenance */
1063
+ /** One-call org snapshot: monitor status counts, active incidents, open maintenance, expiring certificates and domains */
1020
1064
  get: operations["getOrgSummary"];
1021
1065
  put?: never;
1022
1066
  post?: never;
@@ -1954,7 +1998,12 @@ export interface components {
1954
1998
  timestamp?: string;
1955
1999
  success?: boolean;
1956
2000
  duration_ms?: number;
2001
+ /** @description The probe location's system name */
1957
2002
  location?: string;
2003
+ /** @description The location's display name (city), when it is one of WatchFor's locations */
2004
+ location_name?: string;
2005
+ /** @description ISO 3166-1 alpha-2 country of the location */
2006
+ location_country_code?: string;
1958
2007
  target?: string;
1959
2008
  error?: string | null;
1960
2009
  status_code?: number;
@@ -2391,6 +2440,126 @@ export interface components {
2391
2440
  incident_id: number;
2392
2441
  maintenance_window: components["schemas"]["MaintenanceWindow"];
2393
2442
  };
2443
+ /** @description An incident's post-mortem — the same document the dashboard edits. `sections` is `body` split by its template headings; `timeline` holds only the entries authors added (the incident's automatic events are in GET /incidents/{id}). */
2444
+ Postmortem: {
2445
+ /** Format: uuid */
2446
+ id: string;
2447
+ /** @constant */
2448
+ object: "postmortem";
2449
+ incident_id: number;
2450
+ title?: string | null;
2451
+ /** @enum {string} */
2452
+ status: "draft" | "completed";
2453
+ /** @description Published to the status page (owner/admin, dashboard only). Shown publicly only while also completed and the incident is on a status page. */
2454
+ is_public: boolean;
2455
+ /** @enum {string|null} */
2456
+ severity?: "minor" | "major" | "critical" | null;
2457
+ /** @enum {string|null} */
2458
+ root_cause_category?:
2459
+ | "deploy"
2460
+ | "config_change"
2461
+ | "dependency"
2462
+ | "capacity"
2463
+ | "network"
2464
+ | "hardware"
2465
+ | "security"
2466
+ | "human_error"
2467
+ | "unknown"
2468
+ | "other"
2469
+ | null;
2470
+ /** @description Text under each template heading (markdown-lite); "" when empty. */
2471
+ sections: {
2472
+ summary?: string;
2473
+ impact?: string;
2474
+ root_cause?: string;
2475
+ detection?: string;
2476
+ resolution?: string;
2477
+ what_went_well?: string;
2478
+ what_could_have_gone_better?: string;
2479
+ };
2480
+ /** @description The whole document, markdown-lite (## / ### headings, **bold**, *italic*, `code`, - lists) */
2481
+ body: string;
2482
+ timeline: {
2483
+ /** Format: date-time */
2484
+ at: string;
2485
+ text: string;
2486
+ }[];
2487
+ action_items: {
2488
+ /** Format: uuid */
2489
+ id: string;
2490
+ title: string;
2491
+ /** @enum {string} */
2492
+ status: "open" | "done";
2493
+ assignee?: {
2494
+ id?: string;
2495
+ name?: string;
2496
+ } | null;
2497
+ /** Format: date-time */
2498
+ due_date?: string | null;
2499
+ /** Format: date-time */
2500
+ completed_at?: string | null;
2501
+ }[];
2502
+ /** @description The member who started it; null when an API key did */
2503
+ created_by?: {
2504
+ id?: string;
2505
+ name?: string;
2506
+ } | null;
2507
+ /** Format: date-time */
2508
+ created_at: string;
2509
+ /** Format: date-time */
2510
+ updated_at: string;
2511
+ /** Format: date-time */
2512
+ completed_at?: string | null;
2513
+ };
2514
+ /** @description Omitted fields are kept. `sections` replaces only the sections it names ("" empties one; other sections and custom headings stay as written). `add_timeline` and `add_action_items` append — exact repeats (same time and text / same title, case-insensitive) are skipped, so a retry never duplicates. Publishing and deleting are not available here. */
2515
+ PostmortemUpdate: {
2516
+ title?: string;
2517
+ /**
2518
+ * @description Author-assessed impact, independent of the alert severity
2519
+ * @enum {string|null}
2520
+ */
2521
+ severity?: "minor" | "major" | "critical" | null;
2522
+ /** @enum {string|null} */
2523
+ root_cause_category?:
2524
+ | "deploy"
2525
+ | "config_change"
2526
+ | "dependency"
2527
+ | "capacity"
2528
+ | "network"
2529
+ | "hardware"
2530
+ | "security"
2531
+ | "human_error"
2532
+ | "unknown"
2533
+ | "other"
2534
+ | null;
2535
+ /**
2536
+ * @description completed sets completed_at; draft reopens
2537
+ * @enum {string}
2538
+ */
2539
+ status?: "draft" | "completed";
2540
+ /** @description Markdown-lite text per section. A `## ` line inside a section becomes `### ` so it cannot split the document. The whole document is capped at 50,000 characters. */
2541
+ sections?: {
2542
+ summary?: string;
2543
+ impact?: string;
2544
+ root_cause?: string;
2545
+ detection?: string;
2546
+ resolution?: string;
2547
+ what_went_well?: string;
2548
+ what_could_have_gone_better?: string;
2549
+ };
2550
+ /** @description Timeline entries to add (a post-mortem holds up to 100) */
2551
+ add_timeline?: {
2552
+ /** Format: date-time */
2553
+ at: string;
2554
+ text: string;
2555
+ }[];
2556
+ /** @description Follow-ups to add, open and unassigned (a post-mortem holds up to 50) */
2557
+ add_action_items?: {
2558
+ title: string;
2559
+ /** Format: date-time */
2560
+ due_date?: string | null;
2561
+ }[];
2562
+ };
2394
2563
  MaintenanceWindow: {
2395
2564
  /** Format: uuid */
2396
2565
  id?: string;
@@ -2842,6 +3011,31 @@ export interface components {
2842
3011
  /** @enum {string} */
2843
3012
  scope?: "read" | "write";
2844
3013
  };
3014
+ /** @description An organization the credential can act on. Send its id as X-WatchFor-Organization to act on it with an OAuth token. */
3015
+ Organization: {
3016
+ /** Format: uuid */
3017
+ id: string;
3018
+ /** @constant */
3019
+ object: "organization";
3020
+ name: string;
3021
+ slug: string | null;
3022
+ /**
3023
+ * Format: uri
3024
+ * @description Absolute URL of the organization's logo, or null.
3025
+ */
3026
+ logo: string | null;
3027
+ /**
3028
+ * @description The token user's membership role there (decides what they may change, as in the dashboard). null for an API key, which acts for its organization without being a member.
3029
+ * @enum {string|null}
3030
+ */
3031
+ role: "owner" | "admin" | "member" | null;
3032
+ /** @description Name of the organization's current plan. */
3033
+ plan: string;
3034
+ /** @description The organization requests act on when X-WatchFor-Organization is omitted (OAuth: the user's oldest owned organization, else their oldest membership). Always true for an API key's own organization. */
3035
+ is_default: boolean;
3036
+ /** @description The organization THIS request acted on — the one X-WatchFor-Organization named, else the default. */
3037
+ is_current: boolean;
3038
+ };
2845
3039
  MonitorType: {
2846
3040
  /** @constant */
2847
3041
  object?: "monitor_type";
@@ -2943,6 +3137,32 @@ export interface components {
2943
3137
  /** @description Active monitors whose alerts would reach nobody (no alert rule with a contact group and no notification group) */
2944
3138
  silent_monitors?: number;
2945
3139
  };
3140
+ /** @description Certificate (SSL monitors) and domain (RDAP monitors) expiry in one bulk lookup; null when it can't be read right now */
3141
+ expiring?: {
3142
+ certificates?: components["schemas"]["ExpiryCounts"];
3143
+ domains?: components["schemas"]["ExpiryCounts"];
3144
+ /** @description The ten soonest expiries across both kinds, expired first */
3145
+ soonest?: {
3146
+ /** Format: uuid */
3147
+ monitor_id?: string;
3148
+ name?: string;
3149
+ /** @enum {string} */
3150
+ kind?: "certificate" | "domain";
3151
+ target?: string;
3152
+ /** Format: date-time */
3153
+ expires_at?: string;
3154
+ /** @description Negative once expired */
3155
+ days_left?: number;
3156
+ }[];
3157
+ } | null;
3158
+ };
3159
+ ExpiryCounts: {
3160
+ /** @description Monitors with a known expiry */
3161
+ monitored?: number;
3162
+ expired?: number;
3163
+ within_7_days?: number;
3164
+ /** @description 7 to 29 days left (buckets don't overlap) */
3165
+ within_30_days?: number;
2946
3166
  };
2947
3167
  IncidentStats: {
2948
3168
  /** @constant */
@@ -3128,6 +3348,12 @@ export interface components {
3128
3348
  /** @description Names checks read that no variable defines */
3129
3349
  undefined_refs?: string[];
3130
3350
  };
3351
+ OrganizationList: {
3352
+ /** @constant */
3353
+ object: "list";
3354
+ data: components["schemas"]["Organization"][];
3355
+ has_more: boolean;
3356
+ };
3131
3357
  MonitorTypeList: {
3132
3358
  /** @constant */
3133
3359
  object: "list";
@@ -3151,6 +3377,8 @@ export interface components {
3151
3377
  /** @description Per-location breakdown for the whole window (not paginated) */
3152
3378
  locations?: {
3153
3379
  location?: string;
3380
+ location_name?: string;
3381
+ location_country_code?: string;
3154
3382
  checks?: number;
3155
3383
  success_percent?: number;
3156
3384
  /**
@@ -3431,7 +3659,7 @@ export interface components {
3431
3659
  };
3432
3660
  responses: never;
3433
3661
  parameters: {
3434
- /** @description OAuth tokens only: the id of the organization to act on. The token's user must be a member (otherwise 403 forbidden), and their role there applies — members can read, acknowledge incidents and run diagnostics; creating, changing and deleting needs owner or admin, as in the dashboard. Omitted: the user's oldest owned organization, else their oldest membership. With an API key the header may only repeat the key's own organization id (anything else is 403). */
3662
+ /** @description OAuth tokens only: the id of the organization to act on. The token's user must be a member (otherwise 403 forbidden), and their role there applies — members can read, acknowledge incidents, run diagnostics and write post-mortems; creating, changing and deleting needs owner or admin, as in the dashboard. Omitted: the user's oldest owned organization, else their oldest membership. With an API key the header may only repeat the key's own organization id (anything else is 403). */
3435
3663
  OrganizationHeader: string;
3436
3664
  };
3437
3665
  requestBodies: never;
@@ -3894,6 +4122,35 @@ export interface operations {
3894
4122
  };
3895
4123
  };
3896
4124
  };
4125
+ listOrganizations: {
4126
+ parameters: {
4127
+ query?: never;
4128
+ header?: never;
4129
+ path?: never;
4130
+ cookie?: never;
4131
+ };
4132
+ requestBody?: never;
4133
+ responses: {
4134
+ /** @description OK */
4135
+ 200: {
4136
+ headers: {
4137
+ [name: string]: unknown;
4138
+ };
4139
+ content: {
4140
+ "application/json": components["schemas"]["OrganizationList"];
4141
+ };
4142
+ };
4143
+ /** @description Error */
4144
+ default: {
4145
+ headers: {
4146
+ [name: string]: unknown;
4147
+ };
4148
+ content: {
4149
+ "application/json": components["schemas"]["Error"];
4150
+ };
4151
+ };
4152
+ };
4153
+ };
3897
4154
  getOpenApiSpec: {
3898
4155
  parameters: {
3899
4156
  query?: never;
@@ -4970,6 +5227,83 @@ export interface operations {
4970
5227
  };
4971
5228
  };
4972
5229
  };
5230
+ getIncidentPostmortem: {
5231
+ parameters: {
5232
+ query?: never;
5233
+ header?: never;
5234
+ path: {
5235
+ /** @description Incident id (integer) */
5236
+ id: string;
5237
+ };
5238
+ cookie?: never;
5239
+ };
5240
+ requestBody?: never;
5241
+ responses: {
5242
+ /** @description OK */
5243
+ 200: {
5244
+ headers: {
5245
+ [name: string]: unknown;
5246
+ };
5247
+ content: {
5248
+ "application/json": components["schemas"]["Postmortem"];
5249
+ };
5250
+ };
5251
+ /** @description Error */
5252
+ default: {
5253
+ headers: {
5254
+ [name: string]: unknown;
5255
+ };
5256
+ content: {
5257
+ "application/json": components["schemas"]["Error"];
5258
+ };
5259
+ };
5260
+ };
5261
+ };
5262
+ updateIncidentPostmortem: {
5263
+ parameters: {
5264
+ query?: never;
5265
+ header?: never;
5266
+ path: {
5267
+ /** @description Incident id (integer) */
5268
+ id: string;
5269
+ };
5270
+ cookie?: never;
5271
+ };
5272
+ requestBody?: {
5273
+ content: {
5274
+ "application/json": components["schemas"]["PostmortemUpdate"];
5275
+ };
5276
+ };
5277
+ responses: {
5278
+ /** @description Updated (or unchanged) */
5279
+ 200: {
5280
+ headers: {
5281
+ [name: string]: unknown;
5282
+ };
5283
+ content: {
5284
+ "application/json": components["schemas"]["Postmortem"];
5285
+ };
5286
+ };
5287
+ /** @description Created the draft */
5288
+ 201: {
5289
+ headers: {
5290
+ [name: string]: unknown;
5291
+ };
5292
+ content: {
5293
+ "application/json": components["schemas"]["Postmortem"];
5294
+ };
5295
+ };
5296
+ /** @description Error */
5297
+ default: {
5298
+ headers: {
5299
+ [name: string]: unknown;
5300
+ };
5301
+ content: {
5302
+ "application/json": components["schemas"]["Error"];
5303
+ };
5304
+ };
5305
+ };
5306
+ };
4973
5307
  markIncidentMaintenance: {
4974
5308
  parameters: {
4975
5309
  query?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "watchfor",
3
- "version": "0.15.0",
3
+ "version": "0.17.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",