fizzy-cli 0.4.0 → 0.4.1
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 +11 -0
- data/lib/fizzy/cli/cards.rb +10 -5
- data/lib/fizzy/cli/steps.rb +4 -1
- data/lib/fizzy/cli/users.rb +4 -1
- data/lib/fizzy/client.rb +2 -0
- data/lib/fizzy/errors.rb +1 -0
- data/lib/fizzy/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: eb20ca66466e8b1749b5b02f88107fa31ca0a9cb4cffb51cfeca3e712eb6effa
|
|
4
|
+
data.tar.gz: 63b5c87f28cc3b915f77836f2147e8b1f747e6791c4f1918694df9290940ac16
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 99464b430132e9ea62b098fc031112b8a6cebd8cf2ee350693b67cd189c850ee6f7ad7e8cc2ae6b9898e7377b273cf77db3e64bac1de5e406da70e996a843986
|
|
7
|
+
data.tar.gz: ebf5fae49836fa68aac920a8e309dbf8731002d48fcbf8415fbbeabcf3a1e9be8fc586c4b09115a7f0772d064e4ce176fd92321d429d6a1f78c02da7d12b70fb
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
7
7
|
|
|
8
|
+
## [0.4.1] - 2026-02-22
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- Card create and update sent `body` instead of `description`, causing API 400 errors (field silently dropped by Rails strong params)
|
|
12
|
+
- Card create with `--column` now triages via separate API call instead of sending unpermitted `column_id` param
|
|
13
|
+
- HTTP 400 responses now get parsed error messages (like 422) instead of raw JSON dump
|
|
14
|
+
- Cards, steps, and users update commands validate at least one option is provided before sending empty request
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
- `BadRequestError` class for explicit HTTP 400 handling
|
|
18
|
+
|
|
8
19
|
## [0.4.0] - 2026-02-22
|
|
9
20
|
|
|
10
21
|
### Added
|
data/lib/fizzy/cli/cards.rb
CHANGED
|
@@ -55,11 +55,11 @@ module Fizzy
|
|
|
55
55
|
option :body, desc: "Card body (HTML)"
|
|
56
56
|
option :column, desc: "Column ID"
|
|
57
57
|
def create(title)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
resp = client.post("boards/#{require_board!}/cards", body: body)
|
|
58
|
+
payload = { title: title }
|
|
59
|
+
payload[:description] = options[:body] if options[:body]
|
|
60
|
+
resp = client.post("boards/#{require_board!}/cards", body: payload)
|
|
62
61
|
c = resp.body
|
|
62
|
+
client.post("cards/#{c["number"]}/triage", body: { column_id: options[:column] }) if options[:column]
|
|
63
63
|
output_detail(c, pairs: [
|
|
64
64
|
["Number", "##{c["number"]}"],
|
|
65
65
|
["Title", c["title"]],
|
|
@@ -71,7 +71,12 @@ module Fizzy
|
|
|
71
71
|
option :title, desc: "New title"
|
|
72
72
|
option :body, desc: "New body (HTML)"
|
|
73
73
|
def update(number)
|
|
74
|
-
|
|
74
|
+
payload = {}
|
|
75
|
+
payload[:title] = options[:title] if options[:title]
|
|
76
|
+
payload[:description] = options[:body] if options[:body]
|
|
77
|
+
raise Thor::Error, "Nothing to update. Provide --title or --body" if payload.empty?
|
|
78
|
+
|
|
79
|
+
resp = client.put("cards/#{number}", body: payload)
|
|
75
80
|
c = resp.body
|
|
76
81
|
if c
|
|
77
82
|
output_detail(c, pairs: [
|
data/lib/fizzy/cli/steps.rb
CHANGED
|
@@ -34,8 +34,11 @@ module Fizzy
|
|
|
34
34
|
option :description, desc: "New description"
|
|
35
35
|
option :completed, type: :boolean, desc: "Mark completed"
|
|
36
36
|
def update(step_id)
|
|
37
|
+
body = build_body(:description, :completed)
|
|
38
|
+
raise Thor::Error, "Nothing to update. Provide --description or --completed" if body.empty?
|
|
39
|
+
|
|
37
40
|
path = "cards/#{options[:card]}/steps/#{step_id}"
|
|
38
|
-
resp = client.put(path, body:
|
|
41
|
+
resp = client.put(path, body: body)
|
|
39
42
|
s = resp.body
|
|
40
43
|
if s
|
|
41
44
|
output_detail(s, pairs: [
|
data/lib/fizzy/cli/users.rb
CHANGED
|
@@ -31,7 +31,10 @@ module Fizzy
|
|
|
31
31
|
option :name, desc: "New name"
|
|
32
32
|
option :role, desc: "New role"
|
|
33
33
|
def update(user_id)
|
|
34
|
-
|
|
34
|
+
body = build_body(:name, :role)
|
|
35
|
+
raise Thor::Error, "Nothing to update. Provide --name or --role" if body.empty?
|
|
36
|
+
|
|
37
|
+
resp = client.put("users/#{user_id}", body: body)
|
|
35
38
|
u = resp.body
|
|
36
39
|
if u
|
|
37
40
|
output_detail(u, pairs: [
|
data/lib/fizzy/client.rb
CHANGED
|
@@ -88,6 +88,8 @@ module Fizzy
|
|
|
88
88
|
end
|
|
89
89
|
|
|
90
90
|
Response.new(body: parsed_body, headers: response.to_hash, status: status)
|
|
91
|
+
when 400
|
|
92
|
+
raise BadRequestError.new(parse_error(response), status: 400, body: parsed_body)
|
|
91
93
|
when 301, 302
|
|
92
94
|
raise AuthError.new("Redirected to #{response["location"]} — endpoint may require session auth",
|
|
93
95
|
status: status, body: parsed_body)
|
data/lib/fizzy/errors.rb
CHANGED
data/lib/fizzy/version.rb
CHANGED