Files
pcli/model/types.go
T
Steve Cliff 22d5848e1a feat: Add openspec-sync-specs and openspec-verify-change skills
- Introduced `openspec-sync-specs` skill to sync delta specs to main specs, allowing intelligent merging of requirements.
- Added `openspec-verify-change` skill to verify implementation against change artifacts, ensuring completeness, correctness, and coherence before archiving.

docs: Create CLAUDE.md for project guidance

- Added CLAUDE.md to provide an overview of the PCLI project, including build, test commands, architecture, and resource addition guidelines.

chore: Add new change and design documents for project filter in status command

- Created `.openspec.yaml`, `design.md`, `proposal.md`, and `tasks.md` for the `add-project-filter-to-status` change.
- Updated specs for CLI commands and status command to include project filtering functionality.

feat: Expand board included parsing in API client

- Added parsing for `labels`, `cardLabels`, and `cardMemberships` in the `GetBoard` response.
- Updated `ListCardsByBoard` to enrich card output with label names, enhancing usability in kanban sync workflows.
2026-02-18 21:27:02 +00:00

189 lines
5.8 KiB
Go

package model
import (
"encoding/json"
"fmt"
)
type Project struct {
ID string `json:"id"`
OwnerProjectManagerID *string `json:"ownerProjectManagerId"`
BackgroundImageID *string `json:"backgroundImageId"`
Name string `json:"name"`
Description *string `json:"description"`
BackgroundType *string `json:"backgroundType"`
BackgroundGradient *string `json:"backgroundGradient"`
IsHidden bool `json:"isHidden"`
CreatedAt *string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt"`
}
type Board struct {
ID string `json:"id"`
ProjectID string `json:"projectId"`
Position float64 `json:"position"`
Name string `json:"name"`
DefaultView string `json:"defaultView"`
DefaultCardType string `json:"defaultCardType"`
LimitCardTypesToDefaultOne bool `json:"limitCardTypesToDefaultOne"`
AlwaysDisplayCardCreator bool `json:"alwaysDisplayCardCreator"`
ExpandTaskListsByDefault bool `json:"expandTaskListsByDefault"`
CreatedAt *string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt"`
Lists []List `json:"lists,omitempty"`
Cards []Card `json:"cards,omitempty"`
Labels []Label `json:"labels,omitempty"`
CardLabels []CardLabel `json:"cardLabels,omitempty"`
CardMemberships []CardMembership `json:"cardMemberships,omitempty"`
}
type List struct {
ID string `json:"id"`
BoardID string `json:"boardId"`
Type string `json:"type"`
Position *float64 `json:"position"`
Name *string `json:"name"`
Color *string `json:"color"`
CreatedAt *string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt"`
}
type Stopwatch struct {
StartedAt string `json:"startedAt"`
Total float64 `json:"total"`
}
type Card struct {
ID string `json:"id"`
BoardID string `json:"boardId"`
ListID string `json:"listId"`
CreatorUserID *string `json:"creatorUserId"`
PrevListID *string `json:"prevListId"`
CoverAttachmentID *string `json:"coverAttachmentId"`
Type string `json:"type"`
Position *float64 `json:"position"`
Name string `json:"name"`
Description *string `json:"description"`
DueDate *string `json:"dueDate"`
IsDueCompleted *bool `json:"isDueCompleted"`
Stopwatch *Stopwatch `json:"stopwatch"`
CommentsTotal int `json:"commentsTotal"`
IsClosed bool `json:"isClosed"`
ListChangedAt *string `json:"listChangedAt"`
CreatedAt *string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt"`
}
type CardDetail struct {
Card
TaskLists []TaskList `json:"taskLists,omitempty"`
Tasks []Task `json:"tasks,omitempty"`
}
type CardWithList struct {
Card
ListName string `json:"listName"`
Labels []string `json:"labels"`
}
type Comment struct {
ID string `json:"id"`
CardID string `json:"cardId"`
UserID *string `json:"userId"`
Text string `json:"text"`
CreatedAt *string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt"`
}
type TaskList struct {
ID string `json:"id"`
CardID string `json:"cardId"`
Position float64 `json:"position"`
Name string `json:"name"`
ShowOnFrontOfCard bool `json:"showOnFrontOfCard"`
HideCompletedTasks bool `json:"hideCompletedTasks"`
CreatedAt *string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt"`
}
type Task struct {
ID string `json:"id"`
TaskListID string `json:"taskListId"`
LinkedCardID *string `json:"linkedCardId"`
AssigneeUserID *string `json:"assigneeUserId"`
Position float64 `json:"position"`
Name string `json:"name"`
IsCompleted bool `json:"isCompleted"`
CreatedAt *string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt"`
}
type Label struct {
ID string `json:"id"`
BoardID string `json:"boardId"`
Position float64 `json:"position"`
Name *string `json:"name"`
Color string `json:"color"`
CreatedAt *string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt"`
}
type Action struct {
ID string `json:"id"`
BoardID *string `json:"boardId"`
CardID string `json:"cardId"`
UserID *string `json:"userId"`
Type string `json:"type"`
Data json.RawMessage `json:"data"`
CreatedAt *string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt"`
}
type CardLabel struct {
ID string `json:"id"`
CardID string `json:"cardId"`
LabelID string `json:"labelId"`
CreatedAt *string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt"`
}
type CardMembership struct {
ID string `json:"id"`
CardID string `json:"cardId"`
UserID string `json:"userId"`
CreatedAt *string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt"`
}
type Envelope struct {
Data any `json:"data"`
Error *string `json:"error"`
}
type StatusSummary struct {
TotalBoards int `json:"totalBoards"`
Boards []BoardSummary `json:"boards"`
}
type BoardSummary struct {
ID string `json:"id"`
Name string `json:"name"`
Lists []ListSummary `json:"lists"`
}
type ListSummary struct {
ID string `json:"id"`
Name string `json:"name"`
OpenCards int `json:"openCards"`
ClosedCards int `json:"closedCards"`
}
type APIError struct {
StatusCode int
Message string
}
func (e *APIError) Error() string {
return fmt.Sprintf("API error (status %d): %s", e.StatusCode, e.Message)
}