fizzy-cli 0.7.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.
- package/docs/API.md +63 -2
- package/package.json +2 -1
- package/.github/workflows/release.yml +0 -29
- package/.github/workflows/tests.yml +0 -24
- package/AGENTS.md +0 -33
- package/CHANGELOG.md +0 -168
- package/Makefile +0 -43
- package/bin/fizzy +0 -0
- package/cmd/account.go +0 -14
- package/cmd/account_list.go +0 -44
- package/cmd/account_list_test.go +0 -118
- package/cmd/board.go +0 -49
- package/cmd/board_create.go +0 -59
- package/cmd/board_create_test.go +0 -141
- package/cmd/board_delete.go +0 -40
- package/cmd/board_delete_test.go +0 -121
- package/cmd/board_list.go +0 -44
- package/cmd/board_list_test.go +0 -115
- package/cmd/board_show.go +0 -40
- package/cmd/board_show_test.go +0 -113
- package/cmd/board_test.go +0 -92
- package/cmd/board_update.go +0 -72
- package/cmd/board_update_test.go +0 -233
- package/cmd/card.go +0 -24
- package/cmd/card_assign.go +0 -55
- package/cmd/card_assign_test.go +0 -130
- package/cmd/card_close.go +0 -46
- package/cmd/card_close_test.go +0 -92
- package/cmd/card_create.go +0 -72
- package/cmd/card_create_test.go +0 -186
- package/cmd/card_delete.go +0 -46
- package/cmd/card_delete_test.go +0 -92
- package/cmd/card_golden.go +0 -46
- package/cmd/card_golden_test.go +0 -92
- package/cmd/card_list.go +0 -53
- package/cmd/card_list_test.go +0 -148
- package/cmd/card_not_now.go +0 -46
- package/cmd/card_not_now_test.go +0 -92
- package/cmd/card_reopen.go +0 -46
- package/cmd/card_reopen_test.go +0 -92
- package/cmd/card_show.go +0 -46
- package/cmd/card_show_test.go +0 -92
- package/cmd/card_tag.go +0 -51
- package/cmd/card_tag_test.go +0 -112
- package/cmd/card_triage.go +0 -46
- package/cmd/card_ungolden.go +0 -46
- package/cmd/card_ungolden_test.go +0 -92
- package/cmd/card_untriage.go +0 -46
- package/cmd/card_untriage_test.go +0 -92
- package/cmd/card_unwatch.go +0 -46
- package/cmd/card_unwatch_test.go +0 -92
- package/cmd/card_update.go +0 -82
- package/cmd/card_update_test.go +0 -149
- package/cmd/card_watch.go +0 -46
- package/cmd/card_watch_test.go +0 -92
- package/cmd/column.go +0 -14
- package/cmd/column_create.go +0 -79
- package/cmd/column_create_test.go +0 -178
- package/cmd/column_delete.go +0 -40
- package/cmd/column_delete_test.go +0 -121
- package/cmd/column_list.go +0 -44
- package/cmd/column_list_test.go +0 -138
- package/cmd/column_show.go +0 -40
- package/cmd/column_show_test.go +0 -111
- package/cmd/column_update.go +0 -67
- package/cmd/column_update_test.go +0 -198
- package/cmd/comment.go +0 -14
- package/cmd/comment_create.go +0 -51
- package/cmd/comment_create_test.go +0 -129
- package/cmd/comment_delete.go +0 -46
- package/cmd/comment_delete_test.go +0 -92
- package/cmd/comment_list.go +0 -51
- package/cmd/comment_list_test.go +0 -132
- package/cmd/comment_show.go +0 -46
- package/cmd/comment_show_test.go +0 -104
- package/cmd/comment_update.go +0 -51
- package/cmd/comment_update_test.go +0 -130
- package/cmd/login.go +0 -81
- package/cmd/login_test.go +0 -98
- package/cmd/notification.go +0 -14
- package/cmd/notification_list.go +0 -69
- package/cmd/notification_list_test.go +0 -288
- package/cmd/notification_read.go +0 -51
- package/cmd/notification_read_all.go +0 -38
- package/cmd/notification_read_all_test.go +0 -75
- package/cmd/notification_read_test.go +0 -138
- package/cmd/notification_unread.go +0 -44
- package/cmd/notification_unread_test.go +0 -99
- package/cmd/reaction.go +0 -13
- package/cmd/reaction_create.go +0 -46
- package/cmd/reaction_create_test.go +0 -113
- package/cmd/reaction_delete.go +0 -46
- package/cmd/reaction_delete_test.go +0 -92
- package/cmd/reaction_list.go +0 -51
- package/cmd/reaction_list_test.go +0 -125
- package/cmd/root.go +0 -38
- package/cmd/step.go +0 -14
- package/cmd/step_create.go +0 -53
- package/cmd/step_create_test.go +0 -171
- package/cmd/step_delete.go +0 -46
- package/cmd/step_delete_test.go +0 -92
- package/cmd/step_update.go +0 -66
- package/cmd/step_update_test.go +0 -190
- package/cmd/tag.go +0 -15
- package/cmd/tag_list.go +0 -47
- package/cmd/tag_list_test.go +0 -109
- package/cmd/use.go +0 -85
- package/cmd/use_test.go +0 -186
- package/go.mod +0 -31
- package/go.sum +0 -53
- package/internal/api/boards.go +0 -93
- package/internal/api/cards.go +0 -288
- package/internal/api/client.go +0 -99
- package/internal/api/columns.go +0 -113
- package/internal/api/comments.go +0 -108
- package/internal/api/identity.go +0 -24
- package/internal/api/notifications.go +0 -89
- package/internal/api/reactions.go +0 -69
- package/internal/api/steps.go +0 -101
- package/internal/api/tags.go +0 -24
- package/internal/api/types.go +0 -190
- package/internal/app/app.go +0 -49
- package/internal/colors/colors.go +0 -32
- package/internal/config/config.go +0 -70
- package/internal/testutil/client.go +0 -26
- package/internal/ui/account_list.go +0 -14
- package/internal/ui/account_selector.go +0 -63
- package/internal/ui/board_list.go +0 -14
- package/internal/ui/board_show.go +0 -17
- package/internal/ui/card_list.go +0 -14
- package/internal/ui/card_show.go +0 -23
- package/internal/ui/column_list.go +0 -28
- package/internal/ui/column_show.go +0 -16
- package/internal/ui/comment_list.go +0 -25
- package/internal/ui/format.go +0 -27
- package/internal/ui/notification_list.go +0 -27
- package/internal/ui/reaction_list.go +0 -14
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// Package ui
|
|
2
|
-
package ui
|
|
3
|
-
|
|
4
|
-
import (
|
|
5
|
-
"fmt"
|
|
6
|
-
|
|
7
|
-
tea "github.com/charmbracelet/bubbletea"
|
|
8
|
-
"github.com/rogeriopvl/fizzy/internal/api"
|
|
9
|
-
)
|
|
10
|
-
|
|
11
|
-
type accountModel struct {
|
|
12
|
-
accounts []api.Account
|
|
13
|
-
cursor int
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
func (m accountModel) Init() tea.Cmd {
|
|
17
|
-
return nil
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
func (m accountModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|
21
|
-
switch msg := msg.(type) {
|
|
22
|
-
case tea.KeyMsg:
|
|
23
|
-
switch msg.String() {
|
|
24
|
-
case "ctrl+c", "q":
|
|
25
|
-
return m, tea.Quit
|
|
26
|
-
case "up", "k":
|
|
27
|
-
if m.cursor > 0 {
|
|
28
|
-
m.cursor--
|
|
29
|
-
}
|
|
30
|
-
case "down", "j":
|
|
31
|
-
if m.cursor < len(m.accounts)-1 {
|
|
32
|
-
m.cursor++
|
|
33
|
-
}
|
|
34
|
-
case "enter":
|
|
35
|
-
return m, tea.Quit
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return m, nil
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
func (m accountModel) View() string {
|
|
42
|
-
s := "Select an account:\n\n"
|
|
43
|
-
for i, account := range m.accounts {
|
|
44
|
-
cursor := " "
|
|
45
|
-
if i == m.cursor {
|
|
46
|
-
cursor = "> "
|
|
47
|
-
}
|
|
48
|
-
s += fmt.Sprintf("%s%s (%s)\n", cursor, account.Name, account.Slug)
|
|
49
|
-
}
|
|
50
|
-
s += "\nUse ↑/↓ or k/j to navigate, Enter to select, q to quit"
|
|
51
|
-
return s
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
func SelectAccount(accounts []api.Account) (api.Account, error) {
|
|
55
|
-
m := accountModel{accounts: accounts, cursor: 0}
|
|
56
|
-
p, err := tea.NewProgram(m).Run()
|
|
57
|
-
if err != nil {
|
|
58
|
-
return api.Account{}, err
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
finalModel := p.(accountModel)
|
|
62
|
-
return finalModel.accounts[finalModel.cursor], nil
|
|
63
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
package ui
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"fmt"
|
|
5
|
-
"io"
|
|
6
|
-
|
|
7
|
-
"github.com/rogeriopvl/fizzy/internal/api"
|
|
8
|
-
)
|
|
9
|
-
|
|
10
|
-
func DisplayBoard(w io.Writer, board *api.Board) error {
|
|
11
|
-
fmt.Fprintf(w, "Board: %s\n", board.Name)
|
|
12
|
-
fmt.Fprintf(w, "ID: %s\n", board.ID)
|
|
13
|
-
fmt.Fprintf(w, "All Access: %v\n", board.AllAccess)
|
|
14
|
-
fmt.Fprintf(w, "Created At: %s\n", FormatTime(board.CreatedAt))
|
|
15
|
-
fmt.Fprintf(w, "Created By: %s\n", board.Creator.Name)
|
|
16
|
-
return nil
|
|
17
|
-
}
|
package/internal/ui/card_list.go
DELETED
package/internal/ui/card_show.go
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
package ui
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"fmt"
|
|
5
|
-
|
|
6
|
-
"github.com/charmbracelet/lipgloss"
|
|
7
|
-
"github.com/rogeriopvl/fizzy/internal/api"
|
|
8
|
-
)
|
|
9
|
-
|
|
10
|
-
func DisplayCard(card *api.Card) error {
|
|
11
|
-
boldStyle := lipgloss.NewStyle().Bold(true)
|
|
12
|
-
dimStyle := lipgloss.NewStyle().Bold(true).Faint(true)
|
|
13
|
-
fmt.Printf("%s\n", boldStyle.Render(fmt.Sprintf("%s (#%d)", card.Title, card.Number)))
|
|
14
|
-
fmt.Println("─────────────────────────────────────")
|
|
15
|
-
fmt.Printf("%s %s\n", dimStyle.Render("Description:"), card.Description)
|
|
16
|
-
fmt.Printf("%s %v\n", dimStyle.Render("Tags:"), card.Tags)
|
|
17
|
-
fmt.Printf("%s %v\n", dimStyle.Render("Golden:"), card.Golden)
|
|
18
|
-
fmt.Printf("%s %s\n", dimStyle.Render("Status:"), card.Status)
|
|
19
|
-
fmt.Printf("%s %s\n", dimStyle.Render("Created:"), card.CreatedAt)
|
|
20
|
-
fmt.Printf("%s %s\n", dimStyle.Render("Last Active:"), card.LastActiveAt)
|
|
21
|
-
fmt.Printf("%s %s\n", dimStyle.Render("URL:"), card.URL)
|
|
22
|
-
return nil
|
|
23
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
package ui
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"fmt"
|
|
5
|
-
|
|
6
|
-
"github.com/charmbracelet/lipgloss"
|
|
7
|
-
"github.com/rogeriopvl/fizzy/internal/api"
|
|
8
|
-
"github.com/rogeriopvl/fizzy/internal/colors"
|
|
9
|
-
)
|
|
10
|
-
|
|
11
|
-
func DisplayColumns(columns []api.Column) error {
|
|
12
|
-
for _, column := range columns {
|
|
13
|
-
colorName := column.Color.Name
|
|
14
|
-
colorDef := colors.ByName(colorName)
|
|
15
|
-
|
|
16
|
-
termColor := lipgloss.Color("7") // default to white
|
|
17
|
-
if colorDef != nil {
|
|
18
|
-
termColor = colorDef.TermColor
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
styledName := lipgloss.NewStyle().
|
|
22
|
-
Foreground(termColor).
|
|
23
|
-
Render(column.Name)
|
|
24
|
-
|
|
25
|
-
fmt.Printf("%s (%s)\n", styledName, DisplayID(column.ID))
|
|
26
|
-
}
|
|
27
|
-
return nil
|
|
28
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
package ui
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"fmt"
|
|
5
|
-
"io"
|
|
6
|
-
|
|
7
|
-
"github.com/rogeriopvl/fizzy/internal/api"
|
|
8
|
-
)
|
|
9
|
-
|
|
10
|
-
func DisplayColumn(w io.Writer, column *api.Column) error {
|
|
11
|
-
fmt.Fprintf(w, "Column: %s\n", column.Name)
|
|
12
|
-
fmt.Fprintf(w, "ID: %s\n", column.ID)
|
|
13
|
-
fmt.Fprintf(w, "Color: %s (%s)\n", column.Color.Name, column.Color.Value)
|
|
14
|
-
fmt.Fprintf(w, "Created At: %s\n", FormatTime(column.CreatedAt))
|
|
15
|
-
return nil
|
|
16
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
package ui
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"fmt"
|
|
5
|
-
|
|
6
|
-
"github.com/rogeriopvl/fizzy/internal/api"
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
func DisplayComments(comments []api.Comment) error {
|
|
10
|
-
for _, comment := range comments {
|
|
11
|
-
fmt.Printf("%s - %s (%s)\n", comment.Creator.Name, comment.Body.PlainText, DisplayID(comment.ID))
|
|
12
|
-
}
|
|
13
|
-
return nil
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
func DisplayComment(comment *api.Comment) error {
|
|
17
|
-
fmt.Printf("Author: %s\n", comment.Creator.Name)
|
|
18
|
-
fmt.Printf("Created: %s\n", comment.CreatedAt)
|
|
19
|
-
if comment.UpdatedAt != comment.CreatedAt {
|
|
20
|
-
fmt.Printf("Updated: %s\n", comment.UpdatedAt)
|
|
21
|
-
}
|
|
22
|
-
fmt.Printf("Card: %s\n", comment.Card.Title)
|
|
23
|
-
fmt.Printf("\n%s\n", comment.Body.PlainText)
|
|
24
|
-
return nil
|
|
25
|
-
}
|
package/internal/ui/format.go
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
package ui
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"github.com/charmbracelet/lipgloss"
|
|
5
|
-
"time"
|
|
6
|
-
)
|
|
7
|
-
|
|
8
|
-
// DisplayMeta returns a formatted metadata string with greyed out styling
|
|
9
|
-
func DisplayMeta(label string, value string) string {
|
|
10
|
-
return lipgloss.NewStyle().
|
|
11
|
-
Foreground(lipgloss.Color("8")). // Grey color
|
|
12
|
-
Render(label + ": " + value)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
func DisplayID(id string) string {
|
|
16
|
-
return DisplayMeta("id", id)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// FormatTime converts an RFC3339 timestamp string to a human-readable format.
|
|
20
|
-
// If parsing fails, returns the original string.
|
|
21
|
-
func FormatTime(timeStr string) string {
|
|
22
|
-
t, err := time.Parse(time.RFC3339, timeStr)
|
|
23
|
-
if err != nil {
|
|
24
|
-
return timeStr
|
|
25
|
-
}
|
|
26
|
-
return t.Format("2006-01-02 15:04:05")
|
|
27
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
package ui
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"fmt"
|
|
5
|
-
|
|
6
|
-
"github.com/rogeriopvl/fizzy/internal/api"
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
func DisplayNotifications(notifications []api.Notification) error {
|
|
10
|
-
for _, notification := range notifications {
|
|
11
|
-
fmt.Printf("%s (%s)\n", notification.Title, DisplayID(notification.ID))
|
|
12
|
-
}
|
|
13
|
-
return nil
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
func DisplayNotification(notification *api.Notification) error {
|
|
17
|
-
status := "read"
|
|
18
|
-
if !notification.Read {
|
|
19
|
-
status = "unread"
|
|
20
|
-
}
|
|
21
|
-
fmt.Printf("%s (%s)\n", notification.Title, DisplayID(notification.ID))
|
|
22
|
-
fmt.Printf("Status: %s\n", status)
|
|
23
|
-
fmt.Printf("Card: %s\n", notification.Card.Title)
|
|
24
|
-
fmt.Printf("From: %s\n", notification.Creator.Name)
|
|
25
|
-
fmt.Printf("Message: %s\n", notification.Body)
|
|
26
|
-
return nil
|
|
27
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
package ui
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"fmt"
|
|
5
|
-
|
|
6
|
-
"github.com/rogeriopvl/fizzy/internal/api"
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
func DisplayReactions(reactions []api.Reaction) error {
|
|
10
|
-
for _, reaction := range reactions {
|
|
11
|
-
fmt.Printf("%s %s (%s)\n", reaction.Content, reaction.Reacter.Name, DisplayID(reaction.ID))
|
|
12
|
-
}
|
|
13
|
-
return nil
|
|
14
|
-
}
|