wokku-cli 0.8.0 → 0.9.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 +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/wokku/commands/apps_lifecycle.rb +31 -0
- data/lib/wokku/commands/billing.rb +15 -1
- data/lib/wokku/commands/databases.rb +21 -0
- data/lib/wokku/commands/notifications.rb +6 -0
- data/lib/wokku/commands/teams.rb +8 -0
- data/lib/wokku/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b3597333cab6700ca27a5956994611fae266fb1d575b34063e4aa3b0ce81f224
|
|
4
|
+
data.tar.gz: ef1d8138fe50d785d24fbbce69cd0121f9840f1d15b440b3bcc0b6cfaf3d9627
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2ac21809795e4cdc1995864fe9e9c3938a4767ff9804b7d9d65445976be5795a379654aa95050443796872044fa526e9f38abeab38e02e5243610f8d67cdab7c
|
|
7
|
+
data.tar.gz: f56048c0cdefd8e318ca8f33f8143d6c0862346b9543d0c5f7704a2ea718b18736acce9361f6933cfb960988acb1b6c40504b8962b9c5a5ae466834c73784250
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.9.0 — 2026-11-01
|
|
4
|
+
|
|
5
|
+
- `transfers`, `transfers:accept ID`, `transfers:decline ID`, `transfers:cancel ID` — finish an app transfer without the dashboard.
|
|
6
|
+
- `teams:members:role TEAM_ID MEMBERSHIP_ID viewer|member|admin` — change a member's role.
|
|
7
|
+
- `notifications:test ID` — send a sample message to a notification channel.
|
|
8
|
+
- `databases:resize DB --cpu --memory --disk` and `databases:retry DB`.
|
|
9
|
+
- `billing:invoices` — list invoices; unpaid ones print a link to pay in the dashboard.
|
|
10
|
+
|
|
3
11
|
## 0.8.0 — 2026-10-23
|
|
4
12
|
|
|
5
13
|
- `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;
|
|
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
|
|
@@ -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
|
data/lib/wokku/commands/teams.rb
CHANGED
|
@@ -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
|
data/lib/wokku/version.rb
CHANGED