Documentation
¶
Index ¶
- func AddJSONFlags(cmd *cobra.Command, flags *JSONFlags)
- func FetchSpaceStatuses(client *api.Client, spaceID string) ([]string, error)
- func FetchSpaceTags(client *api.Client, spaceID string) ([]string, error)
- func FormatRecentTaskOption(t RecentTask) string
- func IsAuthError(err error) bool
- func IsSilentError(err error) bool
- func LocationSummary(tasks []RecentTask) []string
- func MatchStatus(target string, available []string) (string, error)
- func NeedsAuth(f *Factory) func(cmd *cobra.Command, args []string) error
- func ValidateStatus(client *api.Client, spaceID, status string, w io.Writer) (string, error)
- func ValidateTags(client *api.Client, spaceID string, tags []string, w io.Writer) []string
- type AuthError
- type Factory
- type JSONFlags
- type RecentTask
- type SilentError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddJSONFlags ¶
AddJSONFlags adds --json, --jq, and --template flags to a command.
func FetchSpaceStatuses ¶ added in v0.9.0
FetchSpaceStatuses fetches the available status names for a ClickUp space.
func FetchSpaceTags ¶ added in v0.10.0
FetchSpaceTags fetches the available tag names for a ClickUp space.
func FormatRecentTaskOption ¶ added in v0.5.0
func FormatRecentTaskOption(t RecentTask) string
FormatRecentTaskOption formats a RecentTask for display in a selection prompt.
func IsAuthError ¶
IsAuthError checks if the error is an AuthError.
func IsSilentError ¶
IsSilentError checks if the error is a SilentError.
func LocationSummary ¶ added in v0.5.0
func LocationSummary(tasks []RecentTask) []string
LocationSummary returns a deduplicated summary of locations from recent tasks, e.g. "Folder > List" pairs. Useful for suggesting where to search.
func MatchStatus ¶ added in v0.9.0
MatchStatus finds the best matching status from available statuses using a tiered strategy: 1. Exact match (case-insensitive) 2. Contains match (case-insensitive) 3. Fuzzy match using normalized fold ranking
func NeedsAuth ¶
NeedsAuth returns a pre-run function that validates authentication before command execution.
func ValidateStatus ¶ added in v0.9.0
ValidateStatus validates a status string against the available statuses for a space. If the status fuzzy-matches, it returns the matched value and prints a warning to w. If no match, it returns an error with available statuses. If validation cannot be performed (e.g. network error), the original status is returned unchanged.
func ValidateTags ¶ added in v0.10.0
ValidateTags validates tag names against the available tags for a space. Unknown tags are warned about and filtered out. Only valid tags are returned. If validation cannot be performed (e.g. network error), all tags are returned unchanged.
Types ¶
type AuthError ¶
type AuthError struct {
Message string
}
AuthError indicates an authentication failure.
type Factory ¶
Factory provides lazy-initialized dependencies to commands.
func NewFactory ¶
NewFactory creates a new Factory with the given IOStreams.
func (*Factory) ApiClient ¶
ApiClient returns an authenticated API client (cached after first call).
func (*Factory) GitContext ¶
func (f *Factory) GitContext() (*gitpkg.RepoContext, error)
GitContext returns the detected git context (cached after first call).
type JSONFlags ¶
JSONFlags holds the --json, --jq, and --template flags.
func (*JSONFlags) OutputJSON ¶
OutputJSON writes data as JSON, optionally filtered by jq or formatted by a template.
type RecentTask ¶ added in v0.5.0
type RecentTask struct {
ID string `json:"id"`
CustomID string `json:"custom_id,omitempty"`
Name string `json:"name"`
Status string `json:"status"`
ListName string `json:"list_name"`
FolderName string `json:"folder_name"`
}
RecentTask represents a recently updated task with location context.
func FetchRecentTasks ¶ added in v0.5.0
func FetchRecentTasks(f *Factory, limit int) ([]RecentTask, error)
FetchRecentTasks fetches the current user's recently updated tasks. Uses 2 API calls: one for user identity, one for filtered tasks. Returns up to `limit` tasks ordered by most recently updated.
func FetchRecentTeamTasks ¶ added in v0.5.0
func FetchRecentTeamTasks(f *Factory, limit int) ([]RecentTask, error)
FetchRecentTeamTasks fetches recently updated tasks for the whole team (no assignee filter). Uses 1 API call.
type SilentError ¶
type SilentError struct {
Err error
}
SilentError is an error that should not be printed (the command already handled output).
func (*SilentError) Error ¶
func (e *SilentError) Error() string
func (*SilentError) Unwrap ¶
func (e *SilentError) Unwrap() error