watchfor 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8a768a7411f989ca33ba64fd4a8ea911931a93b9265421c1e12664b140cf7aed
4
- data.tar.gz: 64381c817f5250cb897219319a6c29d851759f7ce241296e270fc013700207b2
3
+ metadata.gz: 0bbe1b3093561c22831a65a54fe793e3940c44a06b74477890606ed68de080e1
4
+ data.tar.gz: 9f58677f13e0ff368293bae5a040fb18f43f576f40ecff320424592ebabb5232
5
5
  SHA512:
6
- metadata.gz: 1604b16cff061ac83c75dbde6ebbe77c9b513c6bf11654f57cb70bc3b8a0007186bded561c02bc6aa4c2a69d2e06e1747864f63d7f9006039549316e3df36644
7
- data.tar.gz: 4f9e4d9014ba6491f405564bc1224d8377482db9251d0d37cddfe6e8849f5a406c43c3f3c7f80c9f113bca27e44d0fd5ff29c549e2ab805a4fb34f3b82e2c934
6
+ metadata.gz: 9e78697d7e326e57e419aebbbb5c5a38071443cfe2c61c5dd204613a7b92253d0801fb7dc18c91507ae2f8c687f0465821968f74edff781ba1a93bbdd303f1f6
7
+ data.tar.gz: 6ad9649aabcc6d2bc8374d39ea6fecd4e38f03cf44005f644ce6d2767d98b27a99f1b4392ffb755c3ed4df094eee13aa725b015fc7ebbbcb0d4c4142ecab58e6
data/README.md CHANGED
@@ -48,6 +48,7 @@ watchfor summary
48
48
  watchfor monitors
49
49
  watchfor incidents
50
50
  watchfor checks <monitor_id>
51
+ watchfor report --period 30d
51
52
  ```
52
53
 
53
54
  Reference: <https://watchfor.io/openapi.json> · <https://watchfor.io/docs/api>
data/exe/watchfor CHANGED
@@ -32,8 +32,9 @@ begin
32
32
  when "monitor-types" then wf.monitor_types
33
33
  when "incidents" then wf.incidents.list
34
34
  when "checks" then wf.monitors.checks(args.shift)
35
+ when "report" then wf.report(period: args.include?("--period") ? args[args.index("--period") + 1] : nil)
35
36
  else
36
- warn "Usage: watchfor [summary|plan|monitors|locations|monitor-types|incidents|checks <monitor_id>]"
37
+ warn "Usage: watchfor [summary|plan|monitors|locations|monitor-types|incidents|checks <monitor_id>|report [--period 7d|30d]]"
37
38
  exit 2
38
39
  end
39
40
  puts JSON.pretty_generate(result)
@@ -86,6 +86,21 @@ module Watchfor
86
86
  def summary = request("GET", "/summary")
87
87
  def plan = request("GET", "/plan")
88
88
  def incident_stats(period = nil) = request("GET", "/incidents/stats", query: { period: period })
89
+
90
+ # Org report vs the previous period (period: "7d"/"30d", or from/to ISO 8601
91
+ # on advanced-reports plans): uptime, incidents, MTTR/MTBF, response-time
92
+ # trend, per-monitor rows, type-aware sections and plain-language insights.
93
+ def report(period: nil, from: nil, to: nil)
94
+ if from || to
95
+ request("GET", "/reports", query: { from: from, to: to })
96
+ else
97
+ request("GET", "/reports", query: { period: period })
98
+ end
99
+ end
100
+ # The org's two report-email cadences (weekly + monthly); set toggles
101
+ # a cadence and/or replaces its recipients (max 5).
102
+ def report_schedules = request("GET", "/reports/schedules")
103
+ def set_report_schedule(frequency, body) = request("PATCH", "/reports/schedules/#{frequency}", body: body)
89
104
  def locations = request("GET", "/locations")
90
105
  def monitor_types = request("GET", "/meta/monitor-types")
91
106
  def notifications(**query) = request("GET", "/notifications", query: query)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Watchfor
4
- VERSION = "0.1.0"
4
+ VERSION = "0.4.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watchfor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - WatchFor
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-08-28 00:00:00.000000000 Z
11
+ date: 2026-09-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Zero-dependency Ruby client for the WatchFor REST API (monitors, alert
14
14
  rules, incidents, maintenance windows) plus a `watchfor` CLI.