wokku-cli 0.8.0 → 0.10.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: cce452abf4b37774f8aef5230edb8e3a1b88150ed88f69f9409474db937af0e6
4
- data.tar.gz: a4b224d6cbcfa18aa08b5cf427c2dcab36c0ba5b5cb161647ce94f5abc043cc9
3
+ metadata.gz: cfbd0663d45d51e3a5dabedad854c58f432f7c85a8ad5cc9ea8216530148d140
4
+ data.tar.gz: 76cbf9f44acd070052c4fe9bcc864ecd09e159553f9f37f28c7f08618de0c1d3
5
5
  SHA512:
6
- metadata.gz: 69815ec5eb9d7869c7214190df8423632c94ad0e0f2a953ed09f0d9b5936aea0b0c431cc4ea5c3b7f3dd2d46f8263ea43d4ded955239f1794c3cf4a91eed924a
7
- data.tar.gz: b43e5e78b17056f2ca1e82cf9e6cf60dd1d8977478654260201f5bd043d7685ed9117b28029712e2d2f61fe82cffa6468590d356315c92cf7ab70783c98622db
6
+ metadata.gz: 2b2ae0d32869a272fc5c7d8a3e52a62a54d50db38494d52d16a785aadda94714687969ead7f5874c61597c1f7baf44fe95c3cdf4ab313e00128383292db8c625
7
+ data.tar.gz: 59290e05932336abaefee7d004f29e35d4e5eababef8284d03e8f3508811b0e035c81bd3646f8badd2ca5c2204fa92b74c54c249ce3851171896ce85e1743911
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.0 — 2026-11-01
4
+
5
+ - `previews:settings APP [--on|--off] [--database empty|snapshot|shared]` — set up PR previews.
6
+ - `github:repos [OWNER/REPO]` — repos the Wokku GitHub App can see, or a repo's branches, to pick for `github:connect`.
7
+ - `vitals:rotate-token APP` — issue a new web-vitals ingest token.
8
+
9
+ ## 0.9.0 — 2026-11-01
10
+
11
+ - `transfers`, `transfers:accept ID`, `transfers:decline ID`, `transfers:cancel ID` — finish an app transfer without the dashboard.
12
+ - `teams:members:role TEAM_ID MEMBERSHIP_ID viewer|member|admin` — change a member's role.
13
+ - `notifications:test ID` — send a sample message to a notification channel.
14
+ - `databases:resize DB --cpu --memory --disk` and `databases:retry DB`.
15
+ - `billing:invoices` — list invoices; unpaid ones print a link to pay in the dashboard.
16
+
3
17
  ## 0.8.0 — 2026-10-23
4
18
 
5
19
  - `incidents [--all] [--app APP]`, `incidents:info ID` — what is down now and recent outages.
@@ -48,3 +48,34 @@ register "apps:transfer", "Initiate an app transfer to another user (they accept
48
48
  email = data.is_a?(Hash) ? data["recipient_email"] : recipient
49
49
  Wokku::Output.status "Transfer requested. #{email} will receive an email."
50
50
  end
51
+
52
+ register "transfers", "List app transfers waiting on you or on someone else (usage: wokku transfers)" do
53
+ data = api(:get, "/app_transfers")
54
+ data = {} unless data.is_a?(Hash)
55
+ incoming = Array(data["incoming"])
56
+ outgoing = Array(data["outgoing"])
57
+ if incoming.empty? && outgoing.empty?
58
+ Wokku::Output.status "no pending transfers"
59
+ next
60
+ end
61
+ incoming.each { |t| Wokku::Output.status "#{t['id']} incoming #{t['app_name']} from #{t['from_email']} expires #{t['expires_at']}" }
62
+ outgoing.each { |t| Wokku::Output.status "#{t['id']} outgoing #{t['app_name']} to #{t['to_email']} expires #{t['expires_at']}" }
63
+ end
64
+
65
+ register "transfers:accept", "Accept an app transferred to you (usage: wokku transfers:accept TRANSFER_ID)" do
66
+ id = ARGV.shift || abort("Usage: wokku transfers:accept TRANSFER_ID (find it with `wokku transfers`)")
67
+ data = api(:post, "/app_transfers/#{id}/accept")
68
+ Wokku::Output.status "#{data.is_a?(Hash) ? data['app_name'] : 'The app'} is now yours."
69
+ end
70
+
71
+ register "transfers:decline", "Decline an app transferred to you (usage: wokku transfers:decline TRANSFER_ID)" do
72
+ id = ARGV.shift || abort("Usage: wokku transfers:decline TRANSFER_ID (find it with `wokku transfers`)")
73
+ api(:post, "/app_transfers/#{id}/decline")
74
+ Wokku::Output.status "Transfer declined."
75
+ end
76
+
77
+ register "transfers:cancel", "Cancel a transfer you started (usage: wokku transfers:cancel TRANSFER_ID)" do
78
+ id = ARGV.shift || abort("Usage: wokku transfers:cancel TRANSFER_ID (find it with `wokku transfers`)")
79
+ api(:delete, "/app_transfers/#{id}")
80
+ Wokku::Output.status "Transfer cancelled."
81
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # --- Billing (plan; checkout/portal stay in the dashboard) ---
3
+ # --- Billing (plan + invoices; paying stays in the dashboard) ---
4
4
 
5
5
  register "billing:plan", "Show your current Wokku plan + limits (usage: wokku billing:plan)" do
6
6
  data = api(:get, "/billing/current_plan")
@@ -13,3 +13,17 @@ end
13
13
  register "billing:usage", "Retired — usage is now per resource (see billing:plan)" do
14
14
  abort "billing:usage is retired — usage is now per resource; see wokku billing:plan or the dashboard"
15
15
  end
16
+
17
+ register "billing:invoices", "List your invoices; pay unpaid ones in the dashboard (usage: wokku billing:invoices)" do
18
+ data = api(:get, "/billing/invoices")
19
+ rows = data.is_a?(Array) ? data : []
20
+ if rows.empty?
21
+ Wokku::Output.status "no invoices"
22
+ next
23
+ end
24
+ rows.each do |i|
25
+ line = "#{i['reference']} #{i['period']} Rp#{i['amount_idr'].to_i.to_s.reverse.scan(/\d{1,3}/).join('.').reverse} #{i['status']}"
26
+ line += " pay: #{i['pay_url']}" if i["pay_url"]
27
+ Wokku::Output.status line
28
+ end
29
+ end
@@ -91,3 +91,24 @@ register "databases:import", "Import a dump — overwrites the database (usage:
91
91
  data = api_upload(:post, "/databases/#{db}/import", file)
92
92
  Wokku::Output.status(data.is_a?(Hash) && data["message"] ? data["message"] : "Imported.")
93
93
  end
94
+
95
+ register "databases:resize", "Resize a dedicated database; disk only grows (usage: wokku databases:resize DB --cpu 0.5 --memory 1024 --disk 10)" do
96
+ id = ARGV.shift || abort("Usage: wokku databases:resize DB --cpu CPU --memory MB --disk GB")
97
+ body = {}
98
+ while arg = ARGV.shift
99
+ case arg
100
+ when "--cpu" then body[:cpu] = ARGV.shift
101
+ when "--memory" then body[:memory_mb] = ARGV.shift.to_i
102
+ when "--disk" then body[:disk_gb] = ARGV.shift.to_i
103
+ end
104
+ end
105
+ abort "Pass --cpu, --memory and --disk (see `wokku databases:info #{id}` for the current size)" unless body.size == 3
106
+ data = api(:patch, "/databases/#{id}/resize", body)
107
+ Wokku::Output.status((data.is_a?(Hash) && data["message"]) || "Resizing.")
108
+ end
109
+
110
+ register "databases:retry", "Retry provisioning a database stuck in error (usage: wokku databases:retry DB)" do
111
+ id = ARGV.shift || abort("Usage: wokku databases:retry DB")
112
+ data = api(:post, "/databases/#{id}/retry")
113
+ Wokku::Output.status((data.is_a?(Hash) && data["message"]) || "Retrying.")
114
+ end
@@ -23,3 +23,17 @@ register "github:disconnect", "Disconnect the GitHub repo from an app (usage: wo
23
23
  message = data.is_a?(Hash) ? data["message"] : nil
24
24
  Wokku::Output.status(message || "Disconnected.")
25
25
  end
26
+
27
+ register "github:repos", "List repos the Wokku GitHub App can see, or one repo's branches (usage: wokku github:repos [OWNER/REPO])" do
28
+ repo = ARGV.shift
29
+ if repo
30
+ data = api(:get, "/github/repos?repo=#{URI.encode_www_form_component(repo)}")
31
+ branches = data.is_a?(Hash) ? Array(data["branches"]) : []
32
+ branches.empty? ? Wokku::Output.status("no branches") : branches.each { |b| Wokku::Output.status b }
33
+ else
34
+ rows = api(:get, "/github/repos")
35
+ rows = [] unless rows.is_a?(Array)
36
+ next Wokku::Output.status("no repos — install the Wokku GitHub App on more repositories") if rows.empty?
37
+ rows.each { |r| Wokku::Output.status "#{r['full_name']} #{r['private'] ? 'private' : 'public'} #{r['default_branch']}" }
38
+ end
39
+ end
@@ -47,3 +47,9 @@ register "notifications:remove", "Remove a notification (usage: wokku notificati
47
47
  message = data.is_a?(Hash) ? data["message"] : nil
48
48
  Wokku::Output.status(message || "Notification removed.")
49
49
  end
50
+
51
+ register "notifications:test", "Send a test message to a notification channel (usage: wokku notifications:test NOTIFICATION_ID)" do
52
+ id = ARGV.shift || abort("Usage: wokku notifications:test NOTIFICATION_ID")
53
+ data = api(:post, "/notifications/#{id}/test")
54
+ Wokku::Output.status((data.is_a?(Hash) && data["message"]) || "Test notification queued.")
55
+ end
@@ -24,3 +24,19 @@ register "previews:destroy", "Queue cleanup of a PR preview (usage: wokku previe
24
24
  message = data.is_a?(Hash) ? data["message"] : nil
25
25
  Wokku::Output.status(message || "Preview destroy queued.")
26
26
  end
27
+
28
+ register "previews:settings", "Turn PR previews on/off and pick their database (usage: wokku previews:settings APP [--on|--off] [--database empty|snapshot|shared])" do
29
+ id = ARGV.shift || abort("Usage: wokku previews:settings APP [--on|--off] [--database empty|snapshot|shared]")
30
+ body = {}
31
+ while arg = ARGV.shift
32
+ case arg
33
+ when "--on" then body[:preview_enabled] = true
34
+ when "--off" then body[:preview_enabled] = false
35
+ when "--database" then body[:database_strategy] = ARGV.shift || abort("--database needs empty, snapshot or shared")
36
+ end
37
+ end
38
+ abort "Pass --on, --off and/or --database" if body.empty?
39
+ data = api(:patch, "/apps/#{id}/preview_settings", body)
40
+ data = {} unless data.is_a?(Hash)
41
+ Wokku::Output.status "previews: #{data['preview_enabled'] ? 'on' : 'off'}, database: #{data['database_strategy']}"
42
+ end
@@ -57,3 +57,11 @@ register "teams:members:remove", "Remove a member from a team (usage: wokku team
57
57
  api(:delete, "/teams/#{team_id}/members/#{membership_id}")
58
58
  Wokku::Output.status "Member removed."
59
59
  end
60
+
61
+ register "teams:members:role", "Change a member's role (usage: wokku teams:members:role TEAM_ID MEMBERSHIP_ID viewer|member|admin)" do
62
+ team_id = ARGV.shift || abort("Usage: wokku teams:members:role TEAM_ID MEMBERSHIP_ID viewer|member|admin")
63
+ membership_id = ARGV.shift || abort("Missing MEMBERSHIP_ID. Get it from `wokku teams:members TEAM_ID`.")
64
+ role = ARGV.shift || abort("Missing role: viewer, member or admin")
65
+ data = api(:patch, "/teams/#{team_id}/members/#{membership_id}", { role: role })
66
+ Wokku::Output.status "#{data.is_a?(Hash) ? data['email'] : 'Member'} is now #{data.is_a?(Hash) ? data['role'] : role}."
67
+ end
@@ -21,3 +21,10 @@ register "vitals", "Show p75 per Core Web Vital (usage: wokku vitals APP)" do
21
21
  end
22
22
  end
23
23
  end
24
+
25
+ register "vitals:rotate-token", "Issue a new web-vitals ingest token; the old one stops working (usage: wokku vitals:rotate-token APP)" do
26
+ id = ARGV.shift || abort("Usage: wokku vitals:rotate-token APP")
27
+ data = api(:post, "/apps/#{id}/vitals/rotate_token")
28
+ token = data.is_a?(Hash) ? data["vitals_ingest_token"] : nil
29
+ Wokku::Output.status(token ? "New token: #{token} (update the vitals snippet on your site)" : "Token rotated.")
30
+ end
data/lib/wokku/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Wokku
3
- VERSION = "0.8.0"
3
+ VERSION = "0.10.0"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wokku-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Dwicahyo