Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
591 changes: 591 additions & 0 deletions .surface

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions internal/commands/cards.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ func NewCardsCmd() *cobra.Command {
newCardsColumnCmd(&project, &cardTable),
newCardsStepsCmd(&project),
newCardsStepCmd(&project),
newRecordableTrashCmd("card"),
newRecordableArchiveCmd("card"),
newRecordableRestoreCmd("card"),
)

return cmd
Expand Down
18 changes: 9 additions & 9 deletions internal/commands/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ func CommandCategories() []CommandCategory {
Name: "Core Commands",
Commands: []CommandInfo{
{Name: "projects", Category: "core", Description: "Manage projects", Actions: []string{"list", "show", "create", "update", "delete"}},
{Name: "todos", Category: "core", Description: "Manage to-dos", Actions: []string{"list", "show", "create", "complete", "uncomplete", "position"}},
{Name: "todolists", Category: "core", Description: "Manage to-do lists", Actions: []string{"list", "show", "create", "update"}},
{Name: "todos", Category: "core", Description: "Manage to-dos", Actions: []string{"list", "show", "create", "complete", "uncomplete", "position", "trash", "archive", "restore"}},
{Name: "todolists", Category: "core", Description: "Manage to-do lists", Actions: []string{"list", "show", "create", "update", "trash", "archive", "restore"}},
{Name: "todosets", Category: "core", Description: "View to-do set containers", Actions: []string{"show"}},
{Name: "todolistgroups", Category: "core", Description: "Manage to-do list groups", Actions: []string{"list", "show", "create", "update", "position"}},
{Name: "messages", Category: "core", Description: "Manage messages", Actions: []string{"list", "show", "create", "update", "pin", "unpin"}},
{Name: "messages", Category: "core", Description: "Manage messages", Actions: []string{"list", "show", "create", "update", "pin", "unpin", "trash", "archive", "restore"}},
{Name: "campfire", Category: "core", Description: "Chat in Campfire rooms", Actions: []string{"list", "messages", "post", "line", "delete"}},
{Name: "cards", Category: "core", Description: "Manage Kanban cards", Actions: []string{"list", "show", "create", "update", "move", "columns", "steps"}},
{Name: "cards", Category: "core", Description: "Manage Kanban cards", Actions: []string{"list", "show", "create", "update", "move", "columns", "steps", "trash", "archive", "restore"}},
},
},
{
Expand All @@ -60,10 +60,10 @@ func CommandCategories() []CommandCategory {
{
Name: "Files & Docs",
Commands: []CommandInfo{
{Name: "files", Category: "files", Description: "Manage files, documents, and folders", Actions: []string{"list", "show", "create", "update"}},
{Name: "uploads", Category: "files", Description: "List and manage uploads", Actions: []string{"list", "show"}},
{Name: "vaults", Category: "files", Description: "Manage folders (vaults)", Actions: []string{"list", "show", "create"}},
{Name: "docs", Category: "files", Description: "Manage documents", Actions: []string{"list", "show", "create", "update"}},
{Name: "files", Category: "files", Description: "Manage files, documents, and folders", Actions: []string{"list", "show", "download", "update", "trash", "archive", "restore"}},
{Name: "uploads", Category: "files", Description: "List and manage uploads", Actions: []string{"list", "show", "download", "update", "trash", "archive", "restore"}},
{Name: "vaults", Category: "files", Description: "Manage folders (vaults)", Actions: []string{"list", "show", "download", "update", "trash", "archive", "restore"}},
{Name: "docs", Category: "files", Description: "Manage documents", Actions: []string{"list", "show", "download", "update", "trash", "archive", "restore"}},
},
},
{
Expand Down Expand Up @@ -92,7 +92,7 @@ func CommandCategories() []CommandCategory {
{Name: "messagetypes", Category: "communication", Description: "Manage message categories", Actions: []string{"list", "show", "create", "update", "delete"}},
{Name: "forwards", Category: "communication", Description: "Manage email forwards (inbox)", Actions: []string{"list", "show", "inbox", "replies", "reply"}},
{Name: "subscriptions", Category: "communication", Description: "Manage notification subscriptions", Actions: []string{"show", "subscribe", "unsubscribe", "add", "remove"}},
{Name: "comments", Category: "communication", Description: "Manage comments", Actions: []string{"create", "list", "show", "update"}},
{Name: "comments", Category: "communication", Description: "Manage comments", Actions: []string{"create", "list", "show", "update", "trash", "archive", "restore"}},
{Name: "boost", Category: "communication", Description: "Manage boosts (reactions)", Actions: []string{"list", "show", "create", "delete"}},
},
},
Expand Down
3 changes: 3 additions & 0 deletions internal/commands/comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ func NewCommentsCmd() *cobra.Command {
newCommentsShowCmd(),
newCommentsCreateCmd(),
newCommentsUpdateCmd(),
newRecordableTrashCmd("comment"),
newRecordableArchiveCmd("comment"),
newRecordableRestoreCmd("comment"),
)

return cmd
Expand Down
3 changes: 3 additions & 0 deletions internal/commands/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ Each project has a root folder containing documents, uploads, and subfolders.`,
newFilesShowCmd(&project),
newFilesUpdateCmd(&project),
newFilesDownloadCmd(&project),
newRecordableTrashCmd("file"),
newRecordableArchiveCmd("file"),
newRecordableRestoreCmd("file"),
)

return cmd
Expand Down
3 changes: 3 additions & 0 deletions internal/commands/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ func NewMessagesCmd() *cobra.Command {
newMessagesUpdateCmd(),
newMessagesPinCmd(),
newMessagesUnpinCmd(),
newRecordableTrashCmd("message"),
newRecordableArchiveCmd("message"),
newRecordableRestoreCmd("message"),
)

return cmd
Expand Down
51 changes: 51 additions & 0 deletions internal/commands/recordings.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,57 @@ You can pass either an ID or a Basecamp URL:
return cmd
}

// newRecordableTrashCmd creates a trash subcommand for a recordable entity.
func newRecordableTrashCmd(noun string) *cobra.Command {
return &cobra.Command{
Use: "trash <id|url>",
Short: fmt.Sprintf("Move a %s to trash", noun),
Long: fmt.Sprintf(`Move a %s to the trash.

You can pass either an ID or a Basecamp URL:
basecamp %ss trash 789`, noun, noun),
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
app := appctx.FromContext(cmd.Context())
return runRecordingsStatus(cmd, app, args[0], "trashed")
},
}
}

// newRecordableArchiveCmd creates an archive subcommand for a recordable entity.
func newRecordableArchiveCmd(noun string) *cobra.Command {
return &cobra.Command{
Use: "archive <id|url>",
Short: fmt.Sprintf("Archive a %s", noun),
Long: fmt.Sprintf(`Archive a %s to remove it from active view.

You can pass either an ID or a Basecamp URL:
basecamp %ss archive 789`, noun, noun),
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
app := appctx.FromContext(cmd.Context())
return runRecordingsStatus(cmd, app, args[0], "archived")
},
}
}

// newRecordableRestoreCmd creates a restore subcommand for a recordable entity.
func newRecordableRestoreCmd(noun string) *cobra.Command {
return &cobra.Command{
Use: "restore <id|url>",
Short: fmt.Sprintf("Restore a %s", noun),
Long: fmt.Sprintf(`Restore a %s from trash or archive to active status.

You can pass either an ID or a Basecamp URL:
basecamp %ss restore 789`, noun, noun),
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
app := appctx.FromContext(cmd.Context())
return runRecordingsStatus(cmd, app, args[0], "active")
},
}
}

// recordingDisplayName maps SDK recording type names to human-friendly display names.
func recordingDisplayName(sdkType string) string {
switch sdkType {
Expand Down
3 changes: 3 additions & 0 deletions internal/commands/todolists.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ to disambiguate when needed.`,
newTodolistsShowCmd(&project),
newTodolistsCreateCmd(&project, &todosetID),
newTodolistsUpdateCmd(&project),
newRecordableTrashCmd("todolist"),
newRecordableArchiveCmd("todolist"),
newRecordableRestoreCmd("todolist"),
)

return cmd
Expand Down
3 changes: 3 additions & 0 deletions internal/commands/todos.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ func NewTodosCmd() *cobra.Command {
newTodosUncompleteCmd(),
newTodosSweepCmd(),
newTodosPositionCmd(),
newRecordableTrashCmd("todo"),
newRecordableArchiveCmd("todo"),
newRecordableRestoreCmd("todo"),
)

return cmd
Expand Down
Loading